Sage: Ticket #17739: enhance desolve output from separable ODEs
https://trac.sagemath.org/ticket/17739
<p>
At the moment, <code>desolve</code> behaves like this even with trivial separable ODEs:
</p>
<pre class="wiki">sage: t = var('t')
sage: y=function('y')(t)
sage: desolve(diff(y,t)-y^2,y)
-1/y(t) == _C + t
sage: desolve(diff(y,t)-y^2+y,y)
log(y(t) - 1) - log(y(t)) == _C + t
sage: desolve(diff(y,t)-y^2-1,y)
arctan(y(t)) == _C + t
</pre><p>
They could be solved by substituting a variable for <code>y(t)</code> and calling <code>solve</code>. Only if there is no solution from <code>solve</code> the integrated equation should be given.
</p>
en-usSagehttps://trac.sagemath.org/chrome/site/logo_sagemath_trac.png
https://trac.sagemath.org/ticket/17739
Trac 1.1.6rwsFri, 06 Feb 2015 09:20:00 GMT
https://trac.sagemath.org/ticket/17739#comment:1
https://trac.sagemath.org/ticket/17739#comment:1
<p>
This would yield (doctest):
</p>
<pre class="wiki">sage: t = var('t')
sage: y=function('y')(t)
sage: desolve(diff(y,t)-y^2,y)
-1/(_C + t)
sage: desolve(diff(y,t)-y^2+y,y)
-1/(e^(_C + t) - 1)
sage: desolve(diff(y,t)-y^2-1,y)
tan(_C + t)
</pre>
TicketrwsFri, 06 Feb 2015 09:22:31 GMT
https://trac.sagemath.org/ticket/17739#comment:2
https://trac.sagemath.org/ticket/17739#comment:2
<p>
Do we resolve this in Sage, Maxima, or both?
</p>
TicketkcrismanFri, 06 Feb 2015 15:55:14 GMTupstream changed
https://trac.sagemath.org/ticket/17739#comment:3
https://trac.sagemath.org/ticket/17739#comment:3
<ul>
<li><strong>upstream</strong>
changed from <em>N/A</em> to <em>Not yet reported upstream; Will do shortly.</em>
</li>
</ul>
<p>
You should report this upstream, but maybe first to the email list, not as a bug. Surely there must be a <em>reason</em> they report the solutions that way ... right? (For instance, maybe this is "more correct" than something with solve that might lose a solution or something. Though it's hard to see how that could happen in your first example!)
</p>
TicketrwsSat, 07 Feb 2015 13:46:11 GMT
https://trac.sagemath.org/ticket/17739#comment:4
https://trac.sagemath.org/ticket/17739#comment:4
<p>
Replying to <a class="ticket" href="https://trac.sagemath.org/ticket/17739#comment:3" title="Comment 3">kcrisman</a>:
</p>
<blockquote class="citation">
<p>
You should report this upstream, but maybe first to the email list, not as a bug. Surely there must be a <em>reason</em> they report the solutions that way ... right?
</p>
</blockquote>
<p>
It appears not, see <a class="ext-link" href="http://sourceforge.net/p/maxima/mailman/message/33364512/"><span class="icon"></span>http://sourceforge.net/p/maxima/mailman/message/33364512/</a>
</p>
TicketrwsMon, 09 Feb 2015 17:18:08 GMT
https://trac.sagemath.org/ticket/17739#comment:5
https://trac.sagemath.org/ticket/17739#comment:5
<p>
So, the inconsistency is in Sage, which removes 'y==' from the results that have it, perhaps to facilitate further usage of the expression.
</p>
<pre class="wiki"> if is_SymbolicEquation(soln) and soln.lhs() == dvar:
# Remark: Here we do not check that the right hand side does not depend on dvar.
# This probably will not hapen for soutions obtained via ode2, anyway.
soln = soln.rhs()
</pre><p>
We could now either remove the snippet, in order to always get an equation, or always try to solve for <code>dvar</code> and return an equation only when no solution is found.
</p>
Ticket