フィルターのクリア

How can I plot the graph of three non-linear coupled ODE's vs. time in xy-plane in MATLAB. I want to use x-axis for time while y axis for x(1),x(2),x(3) thanks

1 回表示 (過去 30 日間)
My ODE's are:
k_1*x(2)-k1*x(1)-k3*x(1)*x(2)+k_3*x(3);
k1*x(1)-(k_1+k2)*x(2)-k3*x(1)*x(2)+(k4+k_3)*x(3);
k3*x(1)*x(2)-(k4+k_3)*x(3)
where parameter values are as given below
k1 = 1.5;
k_1 = 0.5;
k2 = 1;
k3 = 2;
k_3 = 1;
k4 = 3;

採用された回答

Walter Roberson
Walter Roberson 2021 年 12 月 8 日
tspan = [0 10];
x0 = [0 0.1 0.2];
[t, x] = ode45(@odefun, tspan, x0);
plot(t, x);
legend({'x(1)', 'x(2)', 'x(3)'}, 'location', 'best');
function dk = odefun(t, x)
k1 = 1.5;
k_1 = 0.5;
k2 = 1;
k3 = 2;
k_3 = 1;
k4 = 3;
dk = [k_1*x(2)-k1*x(1)-k3*x(1)*x(2)+k_3*x(3);
k1*x(1)-(k_1+k2)*x(2)-k3*x(1)*x(2)+(k4+k_3)*x(3);
k3*x(1)*x(2)-(k4+k_3)*x(3) ];
end
  2 件のコメント
Akhtar Jan
Akhtar Jan 2021 年 12 月 8 日
thank u sir ...how it can be run in my machine?
Akhtar Jan
Akhtar Jan 2021 年 12 月 8 日
thank u sir i have run it .....you are gr8

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

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