function ydot=RHSinfct2(t,y) % RHSabalone2 % % define the RHS of the model equations. % variables are % y(1): S, susceptible, uninfected individuals [number] % y(2): I, infected individuals [number] % y(3): D, dead animals from the infected population [number] % y(4): P, infectious particles close % to the susceptible population [number] % y(5): S2, susceptible, uninfected individuals [number/m^2] % in the second population % array indexes of variables nVar=5; iS=1;iI=2;iD=3;iP=4;iS2=5; global PAR % most rates are 1/day ydot=zeros(nVar,1); D=y(iS2)-y(iS);if D < 0; D=0; end K=(1 - (y(iS)+y(iI))/PAR.Carry);if K < 0; K=0;end K2=(1 - y(iS2)/PAR.Carry2);if K2 < 0; K2=0;end % time changes of susceptable animals ydot(iS)= - PAR.IPinfect * PAR.depth * y(iP) * y(iS)... - PAR.Iinfect * y(iI) * y(iS) ... - PAR.Dinfect * y(iD) * y(iS) ... - PAR.Bmort * y(iS) ... + PAR.ReproS * K * y(iS) ... + PAR.ReproI * K * y(iI) ... + PAR.Imm * y(iS2) + PAR.Diff * D; % time changes of susceptable animals in 2nd population ydot(iS2)= PAR.Repro2 *K2 * y(iS2) ... - PAR.Imm * y(iS2) - PAR.Diff * D; % time changes of infected animals ydot(iI)= PAR.IPinfect * y(iP) * y(iS)... + PAR.Iinfect * y(iI) * y(iS)... + PAR.Dinfect * y(iD) * y(iS)... - PAR.Imort * y(iI); % time changes of dead infected animals ydot(iD)= PAR.Imort * y(iI) - PAR.DeadDecay * y(iD); % time changes of infectious particles ydot(iP)= PAR.Irelease * y(iI) + PAR.Drelease * y(iD) ... - PAR.IPremove * y(iP);