ASKSAGE: Sage Q&A Forum - Individual question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Wed, 03 Jul 2013 05:51:36 -0500desolve_system problem with exp()/e^http://ask.sagemath.org/question/10315/desolve_system-problem-with-expe/Hi!
I'm trying to solve ode system:
x'=-2x+2y+e^t,
y'=-2x+3y+3e^t
This is what I tried in Sage:
>reset()
>var('t')
>x = function('x', t)
>y = function('y', t)
>dgl1 = x.diff(t) == -2 * x + 2 * y + exp(t)
>dgl2 = y.diff(t) == -2 * x + 3 * y + 3 * exp(t)
>dgls = [dgl1, dgl2]
>aw = [0, 0, -1]
>S = desolve_system(dgls, [x, y], aw)
But I always get this error:
>Traceback (click to the left of this block for traceback)
>...
>TypeError: ECL says: Maxima asks: Is ?g9271-1 positive, negative, or
zero?
If I remove the exp(t) it works fine, also if I replace the exp(t) with for example 2^t Sage gives me a solution. I already tried using e^t instead of exp(t) and tried some assumptions (assume(x >= 0), assume(t >= 0), etc.). Anyone got an idea what I'm doing wrong? Thanks in advance!Wed, 03 Jul 2013 04:30:22 -0500http://ask.sagemath.org/question/10315/desolve_system-problem-with-expe/Answer by kcrisman for <p>Hi!</p>
<p>I'm trying to solve ode system:
x'=-2x+2y+e^t,
y'=-2x+3y+3e^t</p>
<p>This is what I tried in Sage:</p>
<blockquote>
<p>reset()</p>
<p>var('t')</p>
<p>x = function('x', t)</p>
<p>y = function('y', t)</p>
<p>dgl1 = x.diff(t) == -2 * x + 2 * y + exp(t)</p>
<p>dgl2 = y.diff(t) == -2 * x + 3 * y + 3 * exp(t)</p>
<p>dgls = [dgl1, dgl2]</p>
<p>aw = [0, 0, -1]</p>
<p>S = desolve_system(dgls, [x, y], aw)</p>
</blockquote>
<p>But I always get this error:</p>
<blockquote>
<p>Traceback (click to the left of this block for traceback)</p>
<p>...</p>
<p>TypeError: ECL says: Maxima asks: Is ?g9271-1 positive, negative, or
zero?</p>
</blockquote>
<p>If I remove the exp(t) it works fine, also if I replace the exp(t) with for example 2^t Sage gives me a solution. I already tried using e^t instead of exp(t) and tried some assumptions (assume(x >= 0), assume(t >= 0), etc.). Anyone got an idea what I'm doing wrong? Thanks in advance!</p>
http://ask.sagemath.org/question/10315/desolve_system-problem-with-expe/?answer=15182#post-id-15182The `?g1234` is supposed to be an internal variable that the end user would not see, even in Maxima. See [Trac 9825](http://trac.sagemath.org/sage_trac/ticket/9825).
But I can't reproduce this in Maxima. Sorry this isn't much of an answer. Maybe this will spur someone one to be able to reproduce it; certainly this is an upstream bug, in the sense that it doesn't raise an error.
Maxima 5.29.1 http://maxima.sourceforge.net
using Lisp ECL 12.12.1
Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
The function bug_report() provides bug reporting information.
(%i1) dgl1:'diff('x(t),t,1)=-2*x+2*y+exp(t);
d t
(%o1) -- (x(t)) = 2 y - 2 x + %e
dt
(%i2) dgl2:'diff('y(t),t,1)=-2*x+3*y+3*exp(t);
d t
(%o2) -- (y(t)) = 3 y - 2 x + 3 %e
dt
(%i6) atvalue(x(t),t=0,0);
(%o6) 0
(%i7) atvalue(y(t),t=0,-1);
(%o7) - 1
(%i8) [desolve([dgl1,dgl2],[x(t),y(t)]);](http://)
desolve: can't handle this case.
-- an error. To debug this try: debugmode(true);
Wed, 03 Jul 2013 05:51:36 -0500http://ask.sagemath.org/question/10315/desolve_system-problem-with-expe/?answer=15182#post-id-15182