ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Tue, 18 Jan 2011 20:54:09 +0100differential equation problems.https://ask.sagemath.org/question/7884/differential-equation-problems/I am trying to get the differential equation examples to work:
x = var('x')
y = function('y',x)
desolve(diff(y,x) + y - 1, y)
or
t = var('t')
x = function('x',t)
DE = diff(x, t) + x - 1
desolve(DE, [x,t])
Both return errors. What am I doing wrong?
Tue, 18 Jan 2011 17:24:58 +0100https://ask.sagemath.org/question/7884/differential-equation-problems/Comment by Shashank for <p>I am trying to get the differential equation examples to work:</p>
<p>x = var('x')
y = function('y',x)
desolve(diff(y,x) + y - 1, y)</p>
<p>or</p>
<p>t = var('t')
x = function('x',t)
DE = diff(x, t) + x - 1
desolve(DE, [x,t])</p>
<p>Both return errors. What am I doing wrong?</p>
https://ask.sagemath.org/question/7884/differential-equation-problems/?comment=22266#post-id-22266Surprising! I copy pasted both the equations and they work fine for me. Tue, 18 Jan 2011 19:11:41 +0100https://ask.sagemath.org/question/7884/differential-equation-problems/?comment=22266#post-id-22266Answer by DSM for <p>I am trying to get the differential equation examples to work:</p>
<p>x = var('x')
y = function('y',x)
desolve(diff(y,x) + y - 1, y)</p>
<p>or</p>
<p>t = var('t')
x = function('x',t)
DE = diff(x, t) + x - 1
desolve(DE, [x,t])</p>
<p>Both return errors. What am I doing wrong?</p>
https://ask.sagemath.org/question/7884/differential-equation-problems/?answer=11992#post-id-11992You may not be doing anything wrong. I got two different kinds of errors:
<pre><code>TypeError: Error executing code in Maxima
CODE:
sage99 : ('y(x))+(diff('y(x), x, 1))+(-1)$
Maxima ERROR:
sage99 : ('y(x))+(diff('y(x), x, 1))+(-1)$
stdin:7094:Incorrect syntax: Too many )'s
(%i87)
stdin:7145:Incorrect syntax: Premature termination of input at $.
(%i88)
</code></pre>
and
<pre><code>sage: desolve(diff(y,x) + y - 1, y)
sage103
</code></pre>
before getting the right answer:
<pre><code>sage: desolve(diff(y,x) + y - 1, y)
(c + e^x)*e^(-x)
</code></pre>
Then I did it from a restart and everything worked the first time, and I can't reproduce the errors anymore. Looks like the maxima interface can get itself into a state, whether because of something I'd done previously or not. But this definitely shouldn't happen: were these the same kinds of errors you saw?Tue, 18 Jan 2011 19:14:14 +0100https://ask.sagemath.org/question/7884/differential-equation-problems/?answer=11992#post-id-11992Answer by mhfrey for <p>I am trying to get the differential equation examples to work:</p>
<p>x = var('x')
y = function('y',x)
desolve(diff(y,x) + y - 1, y)</p>
<p>or</p>
<p>t = var('t')
x = function('x',t)
DE = diff(x, t) + x - 1
desolve(DE, [x,t])</p>
<p>Both return errors. What am I doing wrong?</p>
https://ask.sagemath.org/question/7884/differential-equation-problems/?answer=11993#post-id-11993I had to restart and it is working now for both examples. Unfortunately I did not capture the error information. If I see it again I will capture the information and post it.
Thank you for your help.Tue, 18 Jan 2011 20:54:09 +0100https://ask.sagemath.org/question/7884/differential-equation-problems/?answer=11993#post-id-11993