At the moment I'm using the following code to get the t=infinity values against B.*1000./gamma
B = 0:0.01:1;
gamma = 0.1;
sigma = 0:0.01:1;
t_inf_values = zeros(size(B));
for i = 1:numel(B)
beta = B(i);
fprintf('beta = %f\n', beta)
f = @(t,x) [-beta.*x(1)*x(2) + sigma.*x(3); beta.*x(1)*x(2)-gamma.*x(2); gamma.*x(2)-sigma.*x(3)];
[t,xa] = ode45(f, [0 1000], [950 50 0]);
t_inf_values(i) = xa(end,3);
t_inf_values1(i) = xa(end,2);
end
plot((B.*1000./gamma), t_inf_values, 'g')
hold on
plot((B.*1000./gamma), t_inf_values1, 'r')
hold off
Now I need to vary sigma and plot sigma against the infinity values of B.*1000./gamma.
Best Answer