ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Fri, 16 Apr 2021 17:06:47 +0200Cannot evaluate symbolic expression to a numerical valuehttps://ask.sagemath.org/question/56672/cannot-evaluate-symbolic-expression-to-a-numerical-value/ I'm trying to do this:
```
(sqrt(10*y*(10-y))+sqrt(1000)*acos(sqrt(y/10))-15*sqrt(2*6.673*10^(-11)*50000000000)).roots( ring=RealField(100))
```
Unfortunately I get the error in the title.
Also any other way of solving the above equation numerically would be appreciated. I was able to do it in maxima using `find_root` but was hoping for a better function (one that doesn't require specifying an interval). I couldn't use find_root in sage because it returns the error 'unable to simplify to float approximation' and ofcourse `solve` doesn't return explicit solutions.Dr. BananaFri, 16 Apr 2021 17:06:47 +0200https://ask.sagemath.org/question/56672/Tiny results of find roothttps://ask.sagemath.org/question/54012/tiny-results-of-find-root/ I was finding roots with a simple loop but got two odd results:
g(x) = (x^2)*cos(2*x)
for num in [-10..10,step=.1]:
try:
root=find_root(g,num,num+.1)
print(root)
except:
pass
-8.639379797371932
-7.0685834705770345
-5.497787143782152
-3.9269908169872405
-2.356194490192345
-0.7853981633974483
-7.755114791616843e-09
Are these two actual roots or a numerical error and how would I tell the difference?
7.755077210568017e-09
0.7853981633974483
2.356194490192345
3.9269908169872405
5.497787143782152
7.0685834705770345
8.639379797371932
cybervigilanteFri, 23 Oct 2020 23:21:35 +0200https://ask.sagemath.org/question/54012/