Status: New
Owner: ----
Labels: Type-Defect Priority-Medium
New issue 2656 by [email protected]: Solve exp(x*log(x) - 1, x)
http://code.google.com/p/sympy/issues/detail?id=2656
Hi, I am trying to solve a function containing both exp, log, erfc, and
they may be embedded into each other....But sympy cannot handle this, as
shown below:
from sympy import solve, exp, log, pi
from sympy.mpmath import *
from sympy import Symbol
x=Symbol('x')
sigma = 4
mu = 1.5
solve(x * ((1.0 / sqrt(2 * pi) * x * sigma) * exp(-0.5 * (log(x) -
mu)**2 / sigma**2)) + 0.5 * erfc((mu - log(x)) / (sigma * sqrt(2))) -
1, x)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/work/local/python-2.7.1/lib/python2.7/site-packages/sympy/mpmath/functions/functions.py",
line 287, in log
return ctx.ln(x)
File "/home/work/local/python-2.7.1/lib/python2.7/site-packages/sympy/mpmath/ctx_mp_python.py",
line 984, in f
x = ctx.convert(x)
File "/home/work/local/python-2.7.1/lib/python2.7/site-packages/sympy/mpmath/ctx_mp_python.py",
line 662, in convert
return ctx._convert_fallback(x, strings)
File "/home/work/local/python-2.7.1/lib/python2.7/site-packages/sympy/mpmath/ctx_mp.py",
line 556, in _convert_fallback
raise TypeError("cannot create mpf from " + repr(x))
TypeError: cannot create mpf from x
But sqrt, log, exp, itself is OK, as shown as below:
solve((1.0 / sqrt(2 * pi) * x * sigma) - 1,
x) [0.626657068657750]
SO, How can I solve a function containint expressions like sqrt(log(x) - 1)
or exp((log(x) - mu)**2 - 3)???
Thanks
--
You received this message because you are subscribed to the Google Groups
"sympy-issues" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sympy-issues?hl=en.