1

I'm fairly new to Matlab and programming in general, and this error message has defeated me . The simplified code is the following:

Lpi = .05;
Dpi = .01;
LpD = [.1, 06];
LpI = [.9, 14];
DpR = [.4, 06];
DpI = [.6, 08];
IpH = [01, 30];

syms H(t) L(t) D(t) R(t) I(t)

HtL =@(t) H(t) * (Lpi*L(t) + Dpi*D(t));
LtD =@(t) LpD(1)*HtL(t-LpD(2));
LtI =@(t) LpI(1)*HtL(t-LpI(2));
DtR =@(t) DpR(1)*LtD(t-DpR(2));
DtI =@(t) DpI(1)*LtD(t-DpI(2));
ItH =@(t) IpH(1)*(LtI(t-IpH(2))+DtI(t-IpH(2)));

odea = diff(H, t) == ItH(t) - HtL(t);
odeb = diff(L, t) == HtL(t) - LtD(t) - LtI(t);
odec = diff(D, t) == LtD(t) - DtR(t) - DtI(t);
oded = diff(R, t) == DtR(t);
odee = diff(I, t) == LtI(t) + DtI(t) - ItH(t);

odes = [odea;odeb;odec;oded;odee];

S = dsolve(odes);

If there are any doubts about the purpose or operation, I can try to explain them below.

Once the differential equations are declared, it is my understanding that they indeed are differential equations, as Matlab's workspace shows them to be of the form:

val(t) =

diff(H(t), t) == (24*H(t - 44)*(D(t - 44)/100 + L(t - 44)/20))/25 - H(t)*(D(t)/100 + L(t)/20)

(this is the case of odea, I don't include the rest as they are similar but longer)

The problem pops up when I call dsolve, as it displays the following error:

Error using mupadengine/feval_internal (line 172)
Expecting an ODE in the specified variable.

Error in dsolve>mupadDsolve (line 328)
T = feval_internal(symengine,'symobj::dsolve',sys,x,options);

Error in dsolve (line 183)
sol = mupadDsolve(args, options);

Error in main (line 50)
S = dsolve(odes);

I am very confused by this error, as it is, as I understand, textbook usage of the function dsolve (according to MathWorks' "Solve a System of Differential Equations" page).

Thank you in advance for any help.

  • 1
    It's expecting an ODE but you're giving it a DDE, a delay-differential equation. – David Apr 16 '20 at 07:00
  • And even in the ODE case, `dsolve` will only give a useful result if a symbolic solution does actually exist (including the use of "special" functions, "named" solutions to some normalized linear ODE). For most ODE systems, this is not the case. – Lutz Lehmann Apr 16 '20 at 07:08

0 Answers0