Error: maximum recursion limit of 500 reached while trying to plot models.

1 view (last 30 days)
I am trying to plot a SIER model. The first few time I ran my script I was able to have a figure created with the four models (SIER) in figure 1.
However, now I am getting this error message.
Error in odearguments (line 90)
f0 = feval(ode,t0,y0,args{:}); % ODE15I sets args{1} to yp0.
Caused by:
Maximum recursion limit of 500 reached.
Here is my script that I am running:
S_i = 5;
I_i = 10^-6;
R_i = 0;
E_i = 5;
initial_values = [S_i,I_i,R_i,E_i];
% Use odr45 function to solve differential equations
figure(1)
[t,x] = ode45('sir_2', [0 80], initial_values,[]);
% Plot models
plot(t,x);
hold on
% Create labels
legend("s","i","r","e");
title("SIR model");
ylabel("Population");
xlabel("Time");
  4 Comments

Sign in to comment.

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!