Skip to content
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

desolve_system unable to interpret ilt and Maxima's temporary variables #9825

Closed
rhinton mannequin opened this issue Aug 27, 2010 · 22 comments
Closed

desolve_system unable to interpret ilt and Maxima's temporary variables #9825

rhinton mannequin opened this issue Aug 27, 2010 · 22 comments

Comments

@rhinton
Copy link
Mannequin

rhinton mannequin commented Aug 27, 2010

desolve_system sometimes generates a Maxima result that includes temporary variables that Sage does not parse correctly.

sage: t = var('t')
sage: x1 = function('x1', t)
sage: x2 = function('x2', t)
sage: de1 = (diff(x1,t) == -3*(x2^2-1))
sage: de2 = (diff(x2,t) == 1)
sage: desolve_system([de1, de2], [x1, x2], ivar=t)
...
TypeError: unable to make sense of Maxima expression 'x1(t)=ilt(-((3*laplace(x2(t)^2,t,?g1543)-x1(0))*?g1543-3)/?g1543^2,?g1543,t)' in Sage 

Upstream: Fixed upstream, in a later stable release.

CC: @robert-marik

Component: calculus

Keywords: maxima, symbolics

Author: Emmanuel Charpentier

Branch/Commit: 74d88f4

Reviewer: Karl-Dieter Crisman

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

@rhinton rhinton mannequin added this to the sage-5.11 milestone Aug 27, 2010
@rhinton rhinton mannequin added c: calculus labels Aug 27, 2010
@rhinton rhinton mannequin assigned burcin Aug 27, 2010
@kcrisman
Copy link
Member

comment:1

On [ this Maxima list thread] we get the original system in Maxima notation - thanks to Stavros Macrackis:

de1: diff(x1(t),t)=-3*(x2(t)^2-1);
de2: diff(x2(t),t)=1;
desolve([de1,de2],[x1(t),x2(t)]);

He also provides a simpler example which does this:

desolve([diff(f(x),x)=f(x^2)],[f(x)]);

The suggestion is that the ilt should be replacing the ?g1234 type variables (which are indeed dummy variables, but native Lisp ones) by Maxima-type ones, so I am putting to reported upstream, developers acknowledge bug. However, my feeling is that we should fix this by parsing these things as well, should they come up again.

@kcrisman
Copy link
Member

comment:2

Replying to @kcrisman:

On [ this Maxima list thread] we get the original system in Maxima notation - thanks to Stavros Macrackis:

Meaning this thread.

@kcrisman
Copy link
Member

comment:3

I've followed up again at this new thread - apparently it never actually made it to their bug tracker?

@kcrisman
Copy link
Member

comment:4

See also this ask.sagemath question.

@kcrisman
Copy link
Member

kcrisman commented Jul 3, 2013

comment:5

And this ask.sagemath question, though here Maxima is actually asking a question about these variables!

@jdemeyer jdemeyer modified the milestones: sage-5.11, sage-5.12 Aug 13, 2013
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.1, sage-6.2 Jan 30, 2014
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.2, sage-6.3 May 6, 2014
@rwst
Copy link

rwst commented Jun 30, 2014

Upstream: Reported upstream. No feedback yet.

@kcrisman
Copy link
Member

comment:10

Did you report it upstream to their bug tracker? I never heard on either of these emails, so I think this is how it will have to be reported.

@rwst
Copy link

rwst commented Jun 30, 2014

comment:11

I took your repeated mail to the list as report.

@kcrisman
Copy link
Member

comment:12

Sadly, that isn't always enough :( Reported upstream here, however, just now. There was internal discussion in the original Maxima thread so I took it that the experts had several possible resolutions.

@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.3, sage-6.4 Aug 10, 2014
@kcrisman
Copy link
Member

kcrisman commented Nov 3, 2014

Changed upstream from Reported upstream. No feedback yet. to Fixed upstream, in a later stable release.

@kcrisman
Copy link
Member

kcrisman commented Nov 3, 2014

comment:14

Upstream seems to have made a change that would do something about this. Anyone want to give it a whirl?

@rwst
Copy link

rwst commented Feb 1, 2015

comment:15

This now returns [x1(t) == ilt(-(3*g3390*laplace(x2(t)^2, t, g3390) - g3390*x1(0) - 3)/g3390^2, g3390, t), x2(t) == t + x2(0)] so it becomes an issue to fix our Maxima interface.

@rwst rwst changed the title desolve_system unable to interpret Maxima's temporary variables desolve_system unable to interpret ilt and Maxima's temporary variables Feb 1, 2015
@nbruin
Copy link
Contributor

nbruin commented Feb 1, 2015

comment:16

Replying to @rwst:

This now returns [x1(t) == ilt(-(3*g3390*laplace(x2(t)^2, t, g3390) - g3390*x1(0) - 3)/g3390^2, g3390, t), x2(t) == t + x2(0)] so it becomes an issue to fix our Maxima interface.

According to the documentation of inverse_laplace this is probably more or less correct. We might want to do something about "ilt" so that it is more closely tied to inverse_laplace, though.

@EmmanuelCharpentier
Copy link
Mannequin

EmmanuelCharpentier mannequin commented Mar 13, 2021

comment:17

This is now fixed (probably due to upstream upgrade) :

sage: x1, x2=function("x1, x2")
sage: de1=x1(t).diff(t)==-3*(x2(t)-1)
sage: de2=x2(t).diff(t)==1
sage: Sol=desolve_system([de1, de2],[x1(t),x2(t)],ivar=t) ; Sol
[x1(t) == -3/2*t^2 - 3*t*x2(0) + 3*t + x1(0), x2(t) == t + x2(0)]

==> invalidation of the bug and review query in order to get this bug closed.

HTH,

@EmmanuelCharpentier EmmanuelCharpentier mannequin removed this from the sage-6.4 milestone Mar 13, 2021
@kcrisman
Copy link
Member

comment:18

I guess as usual doctest needed? Looks like it was a combination of their upstream fix and something we did to parse it right.

@EmmanuelCharpentier
Copy link
Mannequin

EmmanuelCharpentier mannequin commented Mar 14, 2021

@EmmanuelCharpentier
Copy link
Mannequin

EmmanuelCharpentier mannequin commented Mar 14, 2021

Commit: 74d88f4

@EmmanuelCharpentier
Copy link
Mannequin

EmmanuelCharpentier mannequin commented Mar 14, 2021

comment:20

Doctest added.

HTH,


New commits:

74d88f4Document the fix of #9825

@EmmanuelCharpentier EmmanuelCharpentier mannequin added this to the sage-9.3 milestone Mar 14, 2021
@kcrisman
Copy link
Member

Reviewer: Karl-Dieter Crisman

@kcrisman
Copy link
Member

comment:21

Thanks, this is great. Despite patchbot not yet reporting and my own Sage install being too brittle to test, Cell server says it's fine so let's do it.

@kcrisman
Copy link
Member

Author: Emmanuel Charpentier

@vbraun
Copy link
Member

vbraun commented Mar 20, 2021

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

6 participants