Ask Your Question
0

Symbolic math problem

asked 2015-01-11 18:18:01 +0100

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 18:36:53 +0100

slelievre gravatar image

updated 2015-01-11 18:38:23 +0100

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 18:44:49 +0100 )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 18:18:01 +0100

Seen: 574 times

Last updated: Jan 11 '15