Comment by tmonteil for You should be able to just check if it has no...
The `Symbolic Ring` is quite unpredictible, so that you may lose some opportunities, for example: sage: expr = integral(exp(-cos(x)), x, 0, 1) sage: expr integrate(e^(-cos(x)), x, 0, 1) sage:...
View ArticleComment by petropolis for You should be able to just check if it has no...
I woul prefer your method to the try/except method. I will wait to see if someone can make it watertight.
View ArticleAnswer by Eviatar Bach for Context: I want to evaluate a symbolic expression...
You should be able to just check if it has no variables. def is_numerically_evaluable(expr): return not expr.variables() Then: sage: is_numerically_evaluable(sin(1)) True sage:...
View ArticleAnswer by tmonteil for Context: I want to evaluate a symbolic expression...
Python (therefore Sage) offers a try/except system to handle exceptions, see [this page](http://docs.python.org/2/tutorial/errors.html) for more details. In your case, you can write something like:...
View ArticleHow to check if a symbolic expression is numerically evaluable?
Context: I want to evaluate a symbolic expression numerically; however sometimes this expression still depends on some symbolic parameters not yet assigned a value. Question: What is the best way to...
View Article