Simple equation

45 views
Skip to first unread message

Samuel S. Watson

unread,
May 5, 2017, 10:59:42 AM5/5/17
to sympy
The command 

solve((1-x)**10000 - 0.99, x)

doesn't really work, but maybe that's no so bad since `solve` is searching for all complex roots. But even  

from sympy.solvers.solveset import solveset_real
solveset_real
((1-x)**10000 - 0.99, x)

is very slow. Manually raising both sides to the 10000 makes it fine, of course. Should the solver be capable of this type of manipulation? 

Aaron Meurer

unread,
May 8, 2017, 7:52:06 PM5/8/17
to sy...@googlegroups.com
solveset_real is probably just finding all the roots and filtering out
the nonreal ones. It's probably possible to make this work in a way
that doesn't try to expand the 10000 degree polynomial, but it isn't
implemented yet.

The equation can obviously be inverted manually by applying the
operations in "reverse" order (-(w*0.99**(1/10000) - 1)). The w
should be a root of unity of degree 10000. The solver would then need
to recognize that only two values for w give real answers. The
difficulty is how to make this general enough that it applies to more
than just this specific problem.

Actually, even giving all 10000 values of w as RootOf would probably
be fast enough to return a full complex solution set.

Aaron Meurer
> --
> You received this message because you are subscribed to the Google Groups
> "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sympy+un...@googlegroups.com.
> To post to this group, send email to sy...@googlegroups.com.
> Visit this group at https://groups.google.com/group/sympy.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sympy/d73febf0-c938-4b45-9302-8052fc021977%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages