On Thursday, 7 May 2015 21:04:36 UTC+1, Douglas Davis wrote: > > Is there a way to convert a symbolic result from using rational > expressions and constants to the corresponding expression using reals? > > For example if I have a result of > > -15/28*2^(2/3)*a*hh^2+32/pi*b^3 > > I need to convert it to > > -0.85039*a*hh^2 + 10.186*b^3 > > Anything I try I gives "cannot evaluate symbolic expression numerically" > > I need both types of solutions for grading homework. Many expressions are > more complicated and I change upstream values frequently so converting each > term by hand is not practical.i >
for symbolic polynomials you can use .coefficients() to extract coefficients, then you can conert them by using .n()... This is far from ideal, but still automatic. What you could also do is substiture numbers for each variable, and then use .n(); this way you can compute a table of numerical values... > I have been looking for a solution for some time. Thank you. > > -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To post to this group, send email to sage-support@googlegroups.com. Visit this group at http://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/d/optout.