First time here? Check out the FAQ!

Ask Your Question
0

Numerical form of the symbolic expression

asked 4 years ago

huhahu gravatar image

updated 4 years ago

Emmanuel Charpentier gravatar image

I have a symbolic expression ( a variable polynomial of n degree)

1/9*sqrt(3)*(2*sqrt(3)*x^2*e^(1/2*sqrt(3)) + 3*x*e^(1/2*sqrt(3)))

If possible, I would like these in numeric form as

1.37262 x+1.58496 x^2

Is there a function which does it?

Preview: (hide)

Comments

Please format your math expressions as such...

Emmanuel Charpentier gravatar imageEmmanuel Charpentier ( 4 years ago )

1 Answer

Sort by » oldest newest most voted
2

answered 4 years ago

Emmanuel Charpentier gravatar image

updated 4 years ago

This one-liner :

sage: sum([u[0].n()*x^u[1]
                 for u in (1/9*sqrt(3)*(2*sqrt(3)*x^2*e^(1/2*sqrt(3)) + 3*x*e^(1/2*sqrt(3)))).coefficients()])
1.58496178349078*x^2 + 1.37261716853050*x

does the trick. Is it useful ?

HTH,

Preview: (hide)
link

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 4 years ago

Seen: 259 times

Last updated: Nov 10 '20