On Sun, May 19, 2013 at 8:58 PM, Julien Rioux <julien.ri...@gmail.com> wrote: > > On Sunday, 19 May 2013 20:31:07 UTC-4, Aaron Meurer wrote: >> >> I'm writing the part of the new tutorial on solve(). I have some >> questions >> >> - What is a good example of an equation that has a solution, but which >> cannot be represented symbolically (as an example of when solve() >> might return no solutions for this reason)? >> > > solve(sin(x)) only returns 0 instead of infinitely many pi-periodic > solutions: >>>> solve(sin(x)) > [0] > > This can be represented symbolically with a parameter but we don't do it > yet. As a result we get this behavior: >>>> solve(sin(x)/x) > [] >>>> solve(sin(Symbol('x', nonzero=True))) > [] > > So solve returns an empty list.
Except I don't think it's that great to advertise what SymPy can not do in the tutorial. Aaron Meurer > >> >> [...] >> >> - The lack of a consistant return type is killing me. It seems the >> type depends not just on whether you are solving one or two equations, >> but also on the *type* of the equations! >> >> In [5]: solve([x - 1, y - 1], [x, y]) >> Out[5]: {x: 1, y: 1} >> >> In [6]: solve([x**2 - 1, y - 1], [x, y]) >> Out[6]: [(-1, 1), (1, 1)] >> >> Is there a reason that we don't set `dict=True` by default, at least >> for systems of equations? >> > > Since I discovered it, I always use dict=True and have never looked back. In > a tutorial I would use dict=True everywhere. > > Cheers, > Julien > > -- > You received this message because you are subscribed to the Google Groups > "sympy" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to sympy+unsubscr...@googlegroups.com. > To post to this group, send email to sympy@googlegroups.com. > Visit this group at http://groups.google.com/group/sympy?hl=en-US. > For more options, visit https://groups.google.com/groups/opt_out. > > -- You received this message because you are subscribed to the Google Groups "sympy" group. To unsubscribe from this group and stop receiving emails from it, send an email to sympy+unsubscr...@googlegroups.com. To post to this group, send email to sympy@googlegroups.com. Visit this group at http://groups.google.com/group/sympy?hl=en-US. For more options, visit https://groups.google.com/groups/opt_out.