Solving System of Differential Equations
1 view (last 30 days)
Show older comments
syms I so s(t) as(t) mo m(t) am(t) im(t) img(t) po p(t) kcp t a(t) ao am(t) kca kona koffa konm koffm kong koffg ksig g(t) go
eqn1 = diff(s) == (-kona*s*a)+koffa*as;
eqn2 = diff(m) == -konm*m*a+koffm*a*m-konm*I*m+koffm*im; eqn3 = diff(g) == -kong*im*g+koffg*img; eqn4 = diff(img) == kong*im*g-koffg*img; eqn5 = diff(p) == ksig*img-kcp;
I= 1; so=1; mo=1;go=1; po=1; kcp=1; ao=1; kca=1; kona=1; koffa=1; konm=1; koffm=1; kong=1; koffg=1; ksig=1; eqn6= so==s+as; eqn7= mo==m+am+im+img; eqn8= go==g+img; eqn9= po==p+kcp*t; eqn10= a==(a-am-as)/((kca*t)+1);
S = dsolve(eqn5, eqn2, eqn3, eqn4,eqn5,eqn6,eqn7,eqn8,eqn9,eqn10)
Error using mupadengine/feval (line 163)
Invalid equation or initial condition.
Error in dsolve>mupadDsolve (line 336)
T = feval(symengine,'symobj::dsolve',sys,x,options);
Error in dsolve (line 193)
sol = mupadDsolve(args, options);
I am trying to solve a system of differential equations, but I get these errors which I'm not sure how to fix. Thanks for the help!
2 Comments
Walter Roberson
on 2 Dec 2016
dsolve(eqn5, eqn2, eqn3, eqn4,eqn5,eqn6,eqn7,eqn8,eqn9,eqn10)
repeats eqn5 and does not mention eqn1
Pablo Estuardo
on 21 Feb 2020
same probleme here..
syms u(t) v(t) f taux tauy Hm rho R u0 v0
du = diff(u);
dv = diff(v);
DE = [du - f*v == taux/(Hm*rho) - R*u; dv + f*u == tauy/(Hm*rho) - R*v]
Soln = dsolve(DE, u(0)==u0, v(0)==v0)
Error using mupadengine/feval (line 163)
The equations are invalid.
Error in dsolve>mupadDsolve (line 336)
T = feval(symengine,'symobj::dsolve',sys,x,options);
Error in dsolve (line 193)
sol = mupadDsolve(args, options);
Answers (1)
Walter Roberson
on 2 Dec 2016
eqn10 is of the form
a(t) == -(am(t) - a(t) + as(t))/(t + 1)
Even if you simplify to
a(t) = -(am(t) + as(t))/t
you have the problem that this is not a differential equation and is not an initial condition.
You eqn6, eqn7, eqn8, and eqn9 are of the form
constant == sum of functions of t
Those are not initial conditions or differential equations either.
If the line
a(t) == -(am(t) - a(t) + as(t))/(t + 1)
exists for the purpose of defining a(t) for use in the other equations, then instead of presenting it as a condition or equation, you have to substitute it into the other equations (preferably after reducing it to -(am(t) + as(t))/t )
0 Comments
See Also
Categories
Find more on Calculus in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!