Ask Your Question

Revision history [back]

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(),(AX+B*u).list()])] desolve_system(diffeqns,X.list(),ics=[0,1,2],ivar=t)

click to hide/show revision 2
None

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(),(AX+B*u).list()])]
desolve_system(diffeqns,X.list(),ics=[0,1,2],ivar=t)

zip(*[diff(X,t).list(),(A*X+B*u).list()])] desolve_system(diffeqns,X.list(),ics=[0,1,2],ivar=t)