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.Mon, 18 Feb 2013 14:59:38 +0100Evaluate expression with unknownshttps://ask.sagemath.org/question/9816/evaluate-expression-with-unknowns/I'm trying to evaluate an integral that comes out with a crazy long result. I'm not going to paste it here because it really is quite long, which is essentially the problem. The result actually only has a few instances of unknowns in it, 90% of it's length comes from un-evaluated constants (like 2^(1/7), log(11.5), stuff like that). So it sort of looks like:
f(x) = (x* 2* pi* log(5)* 6^1.5) / (3^4*pi^2+x)
except it spans 10 lines.
If I could get sage to just express all of that stuff as a solid number, then the resulting expression wouldn't be so prohibitively long (I think it would actually evaluate out to something similar to the example I gave, number*x/(number+x) ). But numerical_approx() won't take anything with unknowns in it, so I can't just plug that expression into n().
How does one evaluate the knowns in an expression that contains unknowns?
Thank you ahead of time for your help!adamhgMon, 18 Feb 2013 14:59:38 +0100https://ask.sagemath.org/question/9816/How do I evaluate symbolic expressions numerically in notebook()https://ask.sagemath.org/question/8589/how-do-i-evaluate-symbolic-expressions-numerically-in-notebook/I have solved an equation using this statement
s1 = solve(eq,ss)
The result is
ss = **rhs**
By setting all other variables in the right-hand side of the equation, I can retrieve a value using, among other things,
print **rhs**
or
N(**rhs**),
but when I try
N(ss)
I get the error message "cannot evaluate symbolic expression numerically". How can I evaluate the left-hand side as if it were the right-hand side?
khentiamentiuTue, 10 Jan 2012 19:52:18 +0100https://ask.sagemath.org/question/8589/