
Direction field and phase potrait
5 ビュー (過去 30 日間)
古いコメントを表示
Hello, I need to draw a direction field and sketch phase potrait for this differential equation:
dL/dA = (-0.5L+0.0001AL)/2A(1-0.0001A)-0.01AL
How would I do it?
thank you for helping!
0 件のコメント
採用された回答
Sam Chak
2022 年 4 月 25 日
編集済み: Sam Chak
2022 年 4 月 25 日
Hi @Tuân Nguyen
You can basically plot the direction field like this:
[A, L] = meshgrid(0.1:10/14:10.1, -5:10/14:5);
M = (- 0.5*L + 0.0001*A.*L)./(2*A.*(1 - 0.0001*A) - 0.01*A.*L);
N = sqrt(1 + M.^2);
U = 1./N;
V = M./N;
quiver(A, L, U, V, 0.5)
axis square
hold on
% differential equation
f = @(A, L) (- 0.5*L + 0.0001*A*L)/(2*A*(1 - 0.0001*A) - 0.01*A*L);
tspan = 0.1:0.01:10.1; % simulation time
init = 4; % initial condition L(0.1) = 4
[A, L] = ode45(f, tspan, init);
plot(A, L, 'r', 'linewidth', 1.5)
hold off
Result:

For more info, please visit the documentation:
4 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Ordinary Differential Equations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!