Right, we need to be careful about infinite solutions. solve() currently doesn't handle them, but it one day will.
I think the solution is to just have it return a Set object. Sets are pretty advanced by now so that they can represent things like log(x) + n*pi*I or asin(x) + 2*n*pi, for n integer. If there is just one inverse, it can just return a singleton set. For now, solve() will just have to pick one element or something until we make it capable of returning Set objects itself. As for multiargument functions, we can model it against fdiff, which also handles multiple arguments. We might also think of other ways that we could let users extend solve via API. For example, something like the LambertW is the inverse of x*exp(x). Obviously we could set the inverse of LambertW and make solve(LambertW(x) - y, x) work, but how could we make solve(x*exp(x) - y, x) work, without modifying the solve code (yes, I know this already works, but I mean imagine for a function like LambertW that isn't implemented already). Aaron Meurer On Sat, Aug 25, 2012 at 3:30 AM, Joachim Durchholz <j...@durchholz.org> wrote: > Am 25.08.2012 11:14, schrieb G B: > >> 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? > > > I agree that short-term solutions for the atan2 case are possible. > However, there's still the question how to define the concept of the inverse > for a multi-parameter function. > I don't know whether it's a pressing problem for solve() as it is today. I'm > pretty sure it's going to be relevant some time in the future, so whatever > we do now, we should at least have spend a few thoughts on the > multi-parameter case, even if it's only to reach the conclusion "we have no > clear path laid out for that". > > > -- > You received this message because you are subscribed to the Google Groups > "sympy" group. > To post to this group, send email to sympy@googlegroups.com. > To unsubscribe from this group, send email to > sympy+unsubscr...@googlegroups.com. > 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 sympy@googlegroups.com. To unsubscribe from this group, send email to sympy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sympy?hl=en.