Add second year

This commit is contained in:
2023-12-07 01:19:12 +00:00
parent 3291e5c79e
commit 3d12031ab8
1168 changed files with 431409 additions and 0 deletions

View File

@ -0,0 +1,14 @@
function dydt = shark_tuna_model(t,x)
% function to model the prey-predator population relations over time of
% sharks & tuna
global k; % mentioning global variable x so that it can be used here
dydt = [0; 0];
% dS/dt = k1 S T - k2 S
dydt(1) = k(1)*x(1)*x(2)-k(2)*x(1);
% dT/dt = k3 T -k4 S T
dydt(2) = k(3)*x(2) - k(4) * x(1) * x(2);
end

View File

@ -0,0 +1,12 @@
clear;
global k;
k = [0.015 0.7 0.5 0.01].';
[t,y] = ode45(@shark_tuna_model, [0 50], [100 100]);
plot(t,y);
title("SHARK-TUNA POPULATION DYNAMICS LIMIT CYCLING");
xlabel("TIME");
ylabel("POPULATION NUMBERS");
legend("SHARKS", "TUNA", "Location", "northwest");