Comment #6 on issue 3722 by [email protected]: solve can try split equation into real and imaginary parts
http://code.google.com/p/sympy/issues/detail?id=3722

The remaining problems can be solved with a little extra work from the user, adding an auxiliary equation:

solve([re(x) - 1, im(x) - 2, -x + re(x) + im(x)], x, re(x), im(x))
{re(x): 1, x: 3, im(x): 2}

And in this case, replace arg with its definition and x with its real and imaginary parts:

eqs=[abs(x) - 2, arg(x) - pi]
eqs=[i.subs(x, re(x)+I*im(x)).replace(arg, lambda w: atan(im(x)/re(x))) for i in eqs]
eqs.append(Eq(x, re(x)+I*im(x)))
solve(eqs, x, re(x), im(x), dict=True)
x - re(x) - I*im(x)
[{re(x): -2, x: -2, im(x): 0}, {re(x): 2, x: 2, im(x): 0}]

To make this automatic, I guess one would have to see if there are re and im terms containing a symbol of interest. If so, replace all instances of that symbol with re(sym) + im(sym)*I and add the auxiliary equation (re(sym) + im(sym) - sym) and add re(sym) and im(sym) as entities to be solve for.


--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--
You received this message because you are subscribed to the Google Groups 
"sympy-issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sympy-issues.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to