numerical solution of predator-prey model
Afficher commentaires plus anciens
Hello all, I have a 3d predator prey system and i want to solve it numerically in order to analyze it, I am new to Matlab, used it couples of time before and i beg you for help as i am writing my thesis now, below is the code i used but it seems not to work and i have errors i do not understant in order to fix! Please Help!!!
function signal
%initial conditions
x0=1; y0=1; z0=1;
IC=[x0,y0,z0];
t = 0:.1:60;
r=15;
b=0.05433;
beta=0.9;
rho= .7;
delta= .2;
m= .2;
[t,s]= ode45(@RHS, t,IC );
plot(t ,s(:,2),'linewidth',2,'color','b')
grid on;
xlabel('t', 'FontSize', 20);
ylabel('\omega', 'FontSize', 20);
function dsdt= RHS(t,s)
dsdt_1=r*(s(1)+s(2))-b*s(1)*(s(1)+s(2))-beta*s(1)*s(3)/(1+beta*s(1))-s(1)*(1+s(3)*s(2))/(1+s(3));
dsdt_2=s(1)*(1+s(3)*s(2))/(1+s(3))-b*s(2)*(s(1)+s(2))-rho*beta*s(2)*s(3)/(1+beta*s(2));
dsdt_3=delta*s(1)*s(3)/(1+beta*s(1))+rho*delta*s(2)*s(3)/(1+beta*s(2))-m*s(3);
dsdt=[dsdt_1;dsdt_2,dsdt_3];
end
end
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Dates and Time dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!