I agree it probably is cleaner to have the functions responsible for their own 
inverses, and also agree that it will require some thought to handle the 
ambiguities.  In particular the cases where the ambiguities don't lead to a 
finite solution set (inverting asin, for example?).  I know some CASes will 
return solutions with an additional parameter to handle that case.

In the specific case of atan2, I think there's a short term solution in the 
sense that atan2(y,x) can be seen as a form of atan(y/x).  Perhaps, at least 
temporarily, it can be treated as nested operations for the sake of inversion 
which saves us the headache of dealing separately with the 3 cases Joachim 
enumerates?



On Aug 25, 2012, at 1:57 AM, Joachim Durchholz <[email protected]> wrote:

> Am 25.08.2012 06:56, schrieb Aaron Meurer:
>> I think this is doable.  We just need to extend the algorithm to
>> handle inverses of multi-argument functions.
>> 
>> By the way, we also should think of an API to let functions define
>> their own inverses which would be recognized by solve().  That would
>> be better than the dict that lives in solvers.py, line 2123.
> 
> Sounds like the approach to go.
> 
> The inversion API looks nontrivial to me:
> 
> 1) I don't know how solve() deals with ambiguous inverses like sqrt(x) or 
> complex logarithm. However, if we provide an inversion API, it should include 
> information about the kind of ambiguity involved.
> 
> 2) For multi-argument functions, there are multiple kinds of inverses.
> z = atan2 (x, y) could be inverted for x, y, or (x,y).
> I'm not sure how this should be dealt with, mostly because I know far too 
> little about solve(). I guess it depends on what kinds of inverses solve() 
> ever needs, and whether it can deal with equation systems or just single 
> equations, and what kinds of tasks the algorithms inside solve() are suited 
> for.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "sympy" 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?hl=en.
> 

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" 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?hl=en.

Reply via email to