function[P]=logistic(params,t) % This m-file evaluates the logistic function, which is the solution of the % differential equation % % dP/dt = beta*P(M-P), P(0)=P_0. % % Variables: % % t = time % P_0 = initial number of cases % M = carrying capacity for disease % beta = growth rates for small P global ParamsWeightLogistic W = ParamsWeightLogistic; M = W(1)*params(1); beta = W(2)*params(2); P_0 = 494; P = P_0*M ./ ( P_0 + (M-P_0)*exp(-M*beta*t) );