Opened 6 years ago
Last modified 6 years ago
#17739 new enhancement
enhance desolve output from separable ODEs
Reported by: | rws | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | sage-6.5 |
Component: | calculus | Keywords: | |
Cc: | Merged in: | ||
Authors: | Reviewers: | ||
Report Upstream: | Not yet reported upstream; Will do shortly. | Work issues: | |
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description
At the moment, desolve
behaves like this even with trivial separable ODEs:
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
They could be solved by substituting a variable for y(t)
and calling solve
. Only if there is no solution from solve
the integrated equation should be given.
Change History (5)
comment:1 Changed 6 years ago by
comment:2 Changed 6 years ago by
Do we resolve this in Sage, Maxima, or both?
comment:3 follow-up: ↓ 4 Changed 6 years ago by
- Report Upstream changed from N/A to Not yet reported upstream; Will do shortly.
You should report this upstream, but maybe first to the email list, not as a bug. Surely there must be a reason 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!)
comment:4 in reply to: ↑ 3 Changed 6 years ago by
Replying to kcrisman:
You should report this upstream, but maybe first to the email list, not as a bug. Surely there must be a reason they report the solutions that way ... right?
It appears not, see http://sourceforge.net/p/maxima/mailman/message/33364512/
comment:5 Changed 6 years ago by
So, the inconsistency is in Sage, which removes 'y==' from the results that have it, perhaps to facilitate further usage of the expression.
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()
We could now either remove the snippet, in order to always get an equation, or always try to solve for dvar
and return an equation only when no solution is found.
This would yield (doctest):