Global stability of an epidemiology
I want to get the graph of the global stability and the R_0 of the model. Below is the code and the error message please I need help on how to fix the error and obtain a desired result clear; clc; % Define the parameters of the epidemic model alpha1 = 0.0444; alpha3 = 0.2; alpha0 =0.06685; alpha2 = 0.0000548; alpha4 =0.001096; kappa = 10^6; mu = 2.249*10^-5; lambda = 0.0546; omega =0; %(0, 0.9) phi =0.012 ; rho = 0.0031; tua =0.85 ; eta =0.33; a=0.028;
% Define the initial conditions of the epidemic model I0 = 0.01; S0 = 1 ; R0 = 0; E0=0; H0=0.68; % Define the time vector tspan = [0 10]; % Define the differential equations of the epidemic model ode=@(t,y)[alpha0-alpha1*lambda*S-mu*S+alpha2*omega*E+alpha4*R; alpha1*lambda*S -... (alpha2 + mu)*E; alpha2*(1-omega)*E - (alpha3 + phi+ mu)*I; alpha3*I - (alpha4 + mu)*R;... rho*(1-tau )*I+ (a-eta)*H]; % Solve the system of ODEs using the ode45 solver [t,y] = ode45(ode, tspan, [S0, E0, I0, R0, H0]); % Plot the results figure; plot(t, y(:,1), 'r', t, y(:,2), 'b', t, y(:,3), 'g', y(:,4), 'k', y(:,5), 'm'); xlabel('Time'); ylabel('Population'); legend('Susceptible', 'Exposed', 'Infected', 'Recovered', 'Vibro cholera population'); % Calculate the basic reproduction number R0 n = alpha2*alpha0*(1-omega)*kappa*(eta-a)+rho*(1-tau); R0 = kappa*mu*(alpha2+mu)*(alpha3+phi+mu)*(eta-a)/n; % Determine the global stability of the epidemic model if R0 < 1 disp('The epidemic model is globally stable'); else disp('The epidemic model is globally unstable'); end
error Error in ode45 (line 113) [neq, tspan, ntspan, next, t0, tfinal, tdir, y0, f0, odeArgs, odeFcn, ...
Error in glo (line 32) [t,y] = ode45(ode, tspan, [S0, E0, I0, R0, H0]);
1 Kommentar
Akzeptierte Antwort
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!