--
Olivier
--
You received this message because you are subscribed to the Google Groups "sympy" group.
To view this discussion on the web visit https://groups.google.com/d/msg/sympy/-/Kg9vhQMHIZQJ.
To post to this group, send email to sy...@googlegroups.com.
To unsubscribe from this group, send email to sympy+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/sympy?hl=en.
Thank you very much it indeed works with "mpmath" in lambdify. However my final goal would be to actually use numpy to evaluate that value (as a function of n and d) in another program that has no dependency on sympy nor mpmath.
Do you think there is a way to make sympy refactor the expression so that the naive numpy translation would be more stable, especially for the range of d and n is such that the solution has an imaginary part close to or exactly zero?
I will try to further investigate.
--
Olivier
--
You received this message because you are subscribed to the Google Groups "sympy" group.
To view this discussion on the web visit https://groups.google.com/d/msg/sympy/-/yQddw56BoSwJ.
On 10 January 2012 12:56, Olivier Grisel <olivier...@gmail.com> wrote:Thank you very much it indeed works with "mpmath" in lambdify. However my final goal would be to actually use numpy to evaluate that value (as a function of n and d) in another program that has no dependency on sympy nor mpmath.
Do you think there is a way to make sympy refactor the expression so that the naive numpy translation would be more stable, especially for the range of d and n is such that the solution has an imaginary part close to or exactly zero?
I don't think it can be done automatically by sympy. But there are many functions that rewrite expressions. I know too little about them to tell but maybe some of them will help. Hopefully someone on the group will know a better way to do it.
>>> sp.expand(sol, complex=True)
=> RuntimeError: maximum recursion depth exceeded while calling a Python objectApparently wolframlapha is able to find a something interesting in terms of phase:
sp.expand(sol, complex=True)"""