Opened 11 years ago

Closed 8 weeks ago

#9825 closed defect (fixed)

desolve_system unable to interpret ilt and Maxima's temporary variables

Reported by: rhinton Owned by: burcin
Priority: major Milestone: sage-9.3
Component: calculus Keywords: calculus, maxima, symbolics
Cc: robert.marik Merged in:
Authors: Emmanuel Charpentier Reviewers: Karl-Dieter Crisman
Report Upstream: Fixed upstream, in a later stable release. Work issues:
Branch: 74d88f4 (Commits, GitHub, GitLab) Commit: 74d88f4c23873e83dad685dc1dbc4530f38bfb52
Dependencies: Stopgaps:

Status badges

Description

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 

Change History (22)

comment:1 follow-up: Changed 10 years ago by kcrisman

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.

comment:2 in reply to: ↑ 1 Changed 10 years ago by kcrisman

Replying to kcrisman:

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

Meaning this thread.

comment:3 Changed 9 years ago by kcrisman

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

comment:4 Changed 8 years ago by kcrisman

comment:5 Changed 8 years ago by kcrisman

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

Last edited 8 years ago by kcrisman (previous) (diff)

comment:6 Changed 8 years ago by jdemeyer

  • Milestone changed from sage-5.11 to sage-5.12

comment:7 Changed 7 years ago by vbraun_spam

  • Milestone changed from sage-6.1 to sage-6.2

comment:8 Changed 7 years ago by vbraun_spam

  • Milestone changed from sage-6.2 to sage-6.3

comment:9 Changed 7 years ago by rws

  • Report Upstream changed from N/A to Reported upstream. No feedback yet.

comment:10 Changed 7 years ago by kcrisman

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.

comment:11 Changed 7 years ago by rws

I took your repeated mail to the list as report.

comment:12 Changed 7 years ago by kcrisman

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.

comment:13 Changed 7 years ago by vbraun_spam

  • Milestone changed from sage-6.3 to sage-6.4

comment:14 Changed 7 years ago by kcrisman

  • Report Upstream changed from Reported upstream. No feedback yet. to Fixed upstream, in a later stable release.

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

comment:15 follow-up: Changed 6 years ago by rws

  • Summary changed from desolve_system unable to interpret Maxima's temporary variables to desolve_system unable to interpret ilt and Maxima's temporary variables

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.

comment:16 in reply to: ↑ 15 Changed 6 years ago by nbruin

Replying to rws:

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.

comment:17 Changed 2 months ago by charpent

  • Milestone changed from sage-6.4 to sage-duplicate/invalid/wontfix
  • Status changed from new to needs_review

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,

comment:18 Changed 2 months ago by kcrisman

  • Status changed from needs_review to needs_work

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

comment:19 Changed 2 months ago by charpent

  • Branch set to u/charpent/desolve_system_unable_to_interpret_ilt_and_maxima_s_temporary_variables

comment:20 Changed 2 months ago by charpent

  • Commit set to 74d88f4c23873e83dad685dc1dbc4530f38bfb52
  • Milestone changed from sage-duplicate/invalid/wontfix to sage-9.3
  • Status changed from needs_work to needs_review

Doctest added.

HTH,


New commits:

74d88f4Document the fix of #9825

comment:21 Changed 2 months ago by kcrisman

  • Authors set to Emmanuel Charpentier
  • Reviewers set to Karl-Dieter Crisman
  • Status changed from needs_review to positive_review

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.

comment:22 Changed 8 weeks ago by vbraun

  • Branch changed from u/charpent/desolve_system_unable_to_interpret_ilt_and_maxima_s_temporary_variables to 74d88f4c23873e83dad685dc1dbc4530f38bfb52
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.