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

6 ビュー (過去 30 日間)
Jackson Seith
Jackson Seith 2020 年 4 月 19 日
編集済み: Ameer Hamza 2020 年 4 月 21 日
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 Center および File ExchangeOrdinary Differential Equations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by