How do I plot the phase space for a system of 3 ODEs

6 次查看(过去 30 天)
I am new to matlab and need to plot a phase space for a system of three ODEs. My ODEs are Udot = aU(1-U/Q) - bUS, Sdot = -cS + dSU - jSO, and Odot = -kO + lOS. I have values for the parameters: a=180, b=60, c=120, d=30, j=120, k=30, l=15, Q=60, and want to plot the 3D phase space of this system of ODEs. Thank You.

回答(1 个)

Ameer Hamza
Ameer Hamza 2020-4-19
编辑:Ameer Hamza 2020-4-21
try this
a=180;
b=60;
c=120;
d=30;
j=120;
k=30;
l=15;
Q=60;
% Udot = aU(1-U/Q) - bUS
% Sdot = -cS + dSU - jSO
% Odot = -kO + lOS
dudt = @(u,s,o) a.*u.*(1-u/Q) - b.*u.*s;
dsdt = @(u,s,o) -c.*s + d.*s.*u - j.*s.*o;
dodt = @(u,s,o) -k.*o + l.*o.*s;
u = 0:0.1:1;
s = 0:2:20;
o = 0:3:30;
[U,S,O] = meshgrid(u,s,o);
dU = dudt(U,S,O);
dS = dsdt(U,S,O);
dO = dodt(U,S,O);
quiver3(U,S,O,dU,dS,dO);
axis tight

类别

Help CenterFile Exchange 中查找有关 Ordinary Differential Equations 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by