Ask Your Question
0

Symbolic math problem

asked 2015-01-11 11:18:01 -0600

this post is marked as community wiki

This post is a wiki. Anyone with karma >750 is welcome to improve it.

I need find in sage numberic value of expression like

s=cos(99.9500000000000*pi + 199.900000000000*pi*real_part(sgn(sin(49.9750000000000*pi))))*e^(-199.900000000000*pi*imag_part(sgn(sin(49.9750000000000*pi)))) + 1

but s.n() gives error "TypeError: cannot evaluate symbolic expression numerically". How to resolve this problem?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2015-01-11 11:36:53 -0600

updated 2015-01-11 11:38:23 -0600

Use RDF.pi() instead of pi.

sage: pi = RDF.pi()
sage: s = cos(99.9500000000000*pi + 199.900000000000*pi*real_part(sgn(sin(49.9750000000000*pi))))*e^(-199.900000000000*pi*imag_part(sgn(sin(49.9750000000000*pi)))) + 1
sage: s
1.98768834059514
edit flag offensive delete link more

Comments

Thanks. Now it works

gmind gravatar imagegmind ( 2015-01-11 11:44:49 -0600 )edit

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: 2015-01-11 11:18:01 -0600

Seen: 57 times

Last updated: Jan 11 '15