Error using dsolve in system of first order differential equation
Hi I am trying to solve a system of ODEs using matlab but am getting errorrs. Here is my code.
a and b are constants
syms S(t) I(t) R(t) a b
eqns = [diff(S,t)== -a*S*I, diff(I,t)==a*S*I-b*I,diff(R,t)==b*I];
ans = dsolve(eqns)
Warning: Unable to find explicit solution.
> In dsolve (line 201)
then I tried this
ans = dsolve(eqns,’Implicit’,true)
and got the following
Error using char
Conversion to char from logical is not possible.
Error in dsolve>mupadDsolve (line 286)
if isvarname(char(args{end}))
Error in dsolve (line 194)
sol = mupadDsolve(args, options);Hi I am trying to solve a system of ODEs using matlab but am getting errorrs. Here is my code.
a and b are constants
syms S(t) I(t) R(t) a b
eqns = [diff(S,t)== -a*S*I, diff(I,t)==a*S*I-b*I,diff(R,t)==b*I];
ans = dsolve(eqns)
Warning: Unable to find explicit solution.
> In dsolve (line 201)
then I tried this
ans = dsolve(eqns,’Implicit’,true)
and got the following
Error using char
Conversion to char from logical is not possible.
Error in dsolve>mupadDsolve (line 286)
if isvarname(char(args{end}))
Error in dsolve (line 194)
sol = mupadDsolve(args, options); Hi I am trying to solve a system of ODEs using matlab but am getting errorrs. Here is my code.
a and b are constants
syms S(t) I(t) R(t) a b
eqns = [diff(S,t)== -a*S*I, diff(I,t)==a*S*I-b*I,diff(R,t)==b*I];
ans = dsolve(eqns)
Warning: Unable to find explicit solution.
> In dsolve (line 201)
then I tried this
ans = dsolve(eqns,’Implicit’,true)
and got the following
Error using char
Conversion to char from logical is not possible.
Error in dsolve>mupadDsolve (line 286)
if isvarname(char(args{end}))
Error in dsolve (line 194)
sol = mupadDsolve(args, options); system of ode MATLAB Answers — New Questions