Undefined function 'int' for input arguments of type 'double'.

1 Ansicht (letzte 30 Tage)
P.K. Pattnaik
P.K. Pattnaik am 29 Jun. 2022
Bearbeitet: P.K. Pattnaik am 29 Jun. 2022
syms x S1(x) E1(x) I1(x) R1(x) h1 h2 h3 h4 C1 C2 C3 C4
b = 0.001; w = 0.01; g = 0.02; NS = 497; NE = 1; NI = 1; NR = 1;
EQ = [ diff(S1,x) == 0, diff(E1,x) == 0, diff(I1,x) == 0, diff(R1,x) == 0 ];
SN = dsolve(EQ); fS1 = SN.S1; fE1 = SN.E1; fI1 = SN.I1; fR1 = SN.R1;
S(1) = NS; E(1) = NE; I(1) = NI; R(1) = NR;
for m = 2 : 7
for k = 1 : m - 1
S(m) = h1 * ( int( diff(S(m-1)) + b * S(k) * I(m-k) ));
E(m) = h2 * ( int( diff(E(m-1)) - b * S(k) * I(m-k) + w * E(k) ));
I(m) = h3 * ( int( diff(I(m-1)) - w * E(k) + g * I(k) ));
R(m) = h4 * ( int( diff(R(m-1)) + g * I(k) ));
end
end
SA = fS1 + S(1) + S(2) + S(3) + S(4) + S(5) + S(6) + S(7);
hS = subs(SA,h1,-1:0.25:1); figure(1),fplot(hS,[0 5])
  6 Kommentare
Torsten
Torsten am 29 Jun. 2022
And you defined all arrays to be symbolic ?
P.K. Pattnaik
P.K. Pattnaik am 29 Jun. 2022
Bearbeitet: P.K. Pattnaik am 29 Jun. 2022
Yes, code ran successfully.
Thanks but where is the option to Accept your answer?

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by