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.Sat, 09 Mar 2019 21:08:25 +0100TypeError: cannot solve differential equationhttps://ask.sagemath.org/question/45730/typeerror-cannot-solve-differential-equation/I am trying to use sagemath to solve a system of ordinary differential equation. However, I failed and got an TypeError (This returns the following error: TypeError: Computation failed since Maxima requested additional constraints; using the 'assume' command before evaluation may help).
Here is my code for it. Could anyone help me with this? Thank you.
A=Matrix([[5/3, -4/3], [4/3, -5/3]])
B=Matrix([[2],[1]])
C=Matrix([-1,2])
D=Matrix([0])
t = var('t')
X=symb_mat(2,1,'X',t);
diffeqns = [eql == eqr \
for (eql,eqr) in zip(*[diff(X,t).list(),(A*X+B*u).list()])]
desolve_system(diffeqns,X.list(),ics=[0,1,2],ivar=t)Sat, 09 Mar 2019 01:47:49 +0100https://ask.sagemath.org/question/45730/typeerror-cannot-solve-differential-equation/Comment by Emmanuel Charpentier for <p>I am trying to use sagemath to solve a system of ordinary differential equation. However, I failed and got an TypeError (This returns the following error: TypeError: Computation failed since Maxima requested additional constraints; using the 'assume' command before evaluation may help).
Here is my code for it. Could anyone help me with this? Thank you. </p>
<pre><code>A=Matrix([[5/3, -4/3], [4/3, -5/3]])
B=Matrix([[2],[1]])
C=Matrix([-1,2])
D=Matrix([0])
t = var('t')
X=symb_mat(2,1,'X',t);
diffeqns = [eql == eqr \
for (eql,eqr) in zip(*[diff(X,t).list(),(A*X+B*u).list()])]
desolve_system(diffeqns,X.list(),ics=[0,1,2],ivar=t)
</code></pre>
https://ask.sagemath.org/question/45730/typeerror-cannot-solve-differential-equation/?comment=45737#post-id-45737Would you mind typing your code in a way that makes it readable ?Sat, 09 Mar 2019 12:48:24 +0100https://ask.sagemath.org/question/45730/typeerror-cannot-solve-differential-equation/?comment=45737#post-id-45737Comment by Emmanuel Charpentier for <p>I am trying to use sagemath to solve a system of ordinary differential equation. However, I failed and got an TypeError (This returns the following error: TypeError: Computation failed since Maxima requested additional constraints; using the 'assume' command before evaluation may help).
Here is my code for it. Could anyone help me with this? Thank you. </p>
<pre><code>A=Matrix([[5/3, -4/3], [4/3, -5/3]])
B=Matrix([[2],[1]])
C=Matrix([-1,2])
D=Matrix([0])
t = var('t')
X=symb_mat(2,1,'X',t);
diffeqns = [eql == eqr \
for (eql,eqr) in zip(*[diff(X,t).list(),(A*X+B*u).list()])]
desolve_system(diffeqns,X.list(),ics=[0,1,2],ivar=t)
</code></pre>
https://ask.sagemath.org/question/45730/typeerror-cannot-solve-differential-equation/?comment=45738#post-id-45738Also, what is your `symb_mat` function ? I'm running *H. sapiens sapiens L.* v 1.0, without divinatory processor nor telepathic interface...Sat, 09 Mar 2019 12:56:00 +0100https://ask.sagemath.org/question/45730/typeerror-cannot-solve-differential-equation/?comment=45738#post-id-45738Comment by Emmanuel Charpentier for <p>I am trying to use sagemath to solve a system of ordinary differential equation. However, I failed and got an TypeError (This returns the following error: TypeError: Computation failed since Maxima requested additional constraints; using the 'assume' command before evaluation may help).
Here is my code for it. Could anyone help me with this? Thank you. </p>
<pre><code>A=Matrix([[5/3, -4/3], [4/3, -5/3]])
B=Matrix([[2],[1]])
C=Matrix([-1,2])
D=Matrix([0])
t = var('t')
X=symb_mat(2,1,'X',t);
diffeqns = [eql == eqr \
for (eql,eqr) in zip(*[diff(X,t).list(),(A*X+B*u).list()])]
desolve_system(diffeqns,X.list(),ics=[0,1,2],ivar=t)
</code></pre>
https://ask.sagemath.org/question/45730/typeerror-cannot-solve-differential-equation/?comment=45742#post-id-45742Thnks, `calc314` : now one can read the code. But that still doesn't tell us what `sumb_mat` is supposed to do...
I also see something called `u` used in the penultimate line, without a clue about what it could be.Sat, 09 Mar 2019 21:08:25 +0100https://ask.sagemath.org/question/45730/typeerror-cannot-solve-differential-equation/?comment=45742#post-id-45742