tb_1=function(t,y,parms) { # # Definition of model dependent variables S=y[1]; E=y[2]; I=y[3]; L=y[4]; # # ODEs St=lambda-beta*S*(I+delta*L)-mu*S; Et=beta*(1-p)*S*(I+delta*L)+r2*I-(mu+k*(1-r1))*E; It=beta*p*S*(I+delta*L)+k*(1-r1)*E+gamma*L- (mu+d1+phi*(1-r2)+r2)*I; Lt=phi*(1-r2)*I-(mu+d2+gamma)*L; # # ODE derivative vector yt=rep(0,4); yt[1]=St; yt[2]=Et; yt[3]=It; yt[4]=Lt; # # Increment calls to tb_1 ncall <<- ncall+1; # # Return derivative vector as list return(list(c(yt))); }