Updates:
Summary: solve doesn't return conditions where solution might apply (was: multiplication by I breaks solve)

Comment #2 on issue 3161 by [email protected]: solve doesn't return conditions where solution might apply (was: multiplication by I breaks solve)
http://code.google.com/p/sympy/issues/detail?id=3161

`solve(sqrt(z)*I - w, z)` fails, too. But we can solve for `sqrt(z)`:

    >>> solve(sqrt(z)*I - w,sqrt(z))
    [-I*w]

That means that z is the square of that:

    >>> _[0]**2
    -w**2

Substituting into the original equation gives

    >>> (sqrt(z)*I - w).subs(z,_)
    -w + I*sqrt(-w**2)
    >>> ans=_

Evaluating at some values shows...

    >>> [ans.subs(w,i) for i in range(-1,2)]
    [0, 0, -2]

...implying that whether this is an answer or not depends on what w is. Giving w a negative assumptions allows the solution to be found.

    >>> var('w', negative=True)
    w
    >>> solve(sqrt(z)*I - w,z)
    [-w**2]

Returning a solution and the conditions under which it applies is not something that solve does at present.

So it looks like all is as we would expect given the current status of solve. solve returns solutions that are always True -- or those that it couldn't decide on.

I'll just change the Summary.

--
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.

Reply via email to