Opened 12 years ago

Closed 21 months ago

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

Reported by: Owned by: Ryan Hinton Burcin Erocal major sage-9.3 calculus calculus, maxima, symbolics Robert Marik Emmanuel Charpentier Karl-Dieter Crisman Fixed upstream, in a later stable release. 74d88f4 74d88f4c23873e83dad685dc1dbc4530f38bfb52

### 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
```

### comment:1 follow-up:  2 Changed 12 years ago by Karl-Dieter Crisman

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 12 years ago by Karl-Dieter Crisman

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

### comment:3 Changed 11 years ago by Karl-Dieter Crisman

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

### comment:5 Changed 9 years ago by Karl-Dieter Crisman

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

Version 0, edited 9 years ago by Karl-Dieter Crisman (next)

### comment:6 Changed 9 years ago by Jeroen Demeyer

Milestone: sage-5.11 → sage-5.12

### comment:7 Changed 9 years ago by For batch modifications

Milestone: sage-6.1 → sage-6.2

### comment:8 Changed 9 years ago by For batch modifications

Milestone: sage-6.2 → sage-6.3

### comment:9 Changed 8 years ago by Ralf Stephan

Report Upstream: N/A → Reported upstream. No feedback yet.

### comment:10 Changed 8 years ago by Karl-Dieter Crisman

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 8 years ago by Ralf Stephan

I took your repeated mail to the list as report.

### comment:12 Changed 8 years ago by Karl-Dieter Crisman

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 8 years ago by For batch modifications

Milestone: sage-6.3 → sage-6.4

### comment:14 Changed 8 years ago by Karl-Dieter Crisman

Report Upstream: Reported upstream. No feedback yet. → 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:  16 Changed 8 years ago by Ralf Stephan

Summary: desolve_system unable to interpret Maxima's temporary variables → 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 8 years ago by Nils Bruin

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 21 months ago by Emmanuel Charpentier

Milestone: sage-6.4 → sage-duplicate/invalid/wontfix new → 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 21 months ago by Karl-Dieter Crisman

Status: needs_review → 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 21 months ago by Emmanuel Charpentier

Branch: → u/charpent/desolve_system_unable_to_interpret_ilt_and_maxima_s_temporary_variables

### comment:20 Changed 21 months ago by Emmanuel Charpentier

Commit: → 74d88f4c23873e83dad685dc1dbc4530f38bfb52 sage-duplicate/invalid/wontfix → sage-9.3 needs_work → needs_review

HTH,

New commits:

 ​74d88f4 `Document the fix of #9825`

### comment:21 Changed 21 months ago by Karl-Dieter Crisman

Authors: → Emmanuel Charpentier → Karl-Dieter Crisman needs_review → 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 21 months ago by Volker Braun

Branch: u/charpent/desolve_system_unable_to_interpret_ilt_and_maxima_s_temporary_variables → 74d88f4c23873e83dad685dc1dbc4530f38bfb52 → fixed positive_review → closed
Note: See TracTickets for help on using tickets.