Skip to content

enhance desolve output from separable ODEs #17739

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
rwst opened this issue Feb 6, 2015 · 6 comments
Open

enhance desolve output from separable ODEs #17739

rwst opened this issue Feb 6, 2015 · 6 comments

Comments

@rwst
Copy link
Contributor

rwst commented Feb 6, 2015

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.

Upstream: Not yet reported upstream; Will do shortly.

Component: calculus

Issue created by migration from https://trac.sagemath.org/ticket/17739

@rwst rwst added this to the sage-6.5 milestone Feb 6, 2015
@rwst
Copy link
Contributor Author

rwst commented Feb 6, 2015

comment:1

This would yield (doctest):

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)

@rwst
Copy link
Contributor Author

rwst commented Feb 6, 2015

comment:2

Do we resolve this in Sage, Maxima, or both?

@kcrisman
Copy link
Member

kcrisman commented Feb 6, 2015

Upstream: Not yet reported upstream; Will do shortly.

@kcrisman
Copy link
Member

kcrisman commented Feb 6, 2015

comment:3

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!)

@rwst
Copy link
Contributor Author

rwst commented Feb 7, 2015

comment:4

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/

@rwst
Copy link
Contributor Author

rwst commented Feb 9, 2015

comment:5

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.

@mkoeppe mkoeppe removed this from the sage-6.5 milestone Dec 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants