Hello, I'm currently working on an SIR model and plotting them. However, my y-axis shows up as a range from 0 to 1, instead of 0 to the population I am using. I've tried to play around with the y-axis, but it drastically changes my plots. How do I render the y-axis from 0 to the population I am testing without effecting how it is plotted?
My code is shown below:
N = 59170000; I = 67466; R = 40592; S = N - I - R; s = S/N; i = I/N; r = R/N;props = [s i r];[t,x] = ode45('sir', [0 365], props);plot(t,x,'LineWidth',2);xlim([0 365]);xticks(0:20:365);legend('S','I','R','Location','best');
This is my SIR function:
function dx = sir(t, x) dx = [0; 0; 0]; r0 = 2.28; gamma = 1/18; beta = r0*gamma; dx(1) = -beta * x(1) * x(2); dx(2) = beta * x(1) * x(2) - gamma * x(2); dx(3) = gamma * x(2);end
Best Answer