How do i get a direction field plot?

Hello, I need to plot a direction field for this differential equation
dP/dt=0.0015*P*(1-(P/6000))
how would I do it?
Thank you for helping.

 採用された回答

Sam Chak
Sam Chak 2022 年 4 月 20 日
編集済み: Sam Chak 2022 年 4 月 20 日

2 投票

Because there are two equilibrium points and , I think it should look like this.
[T, P] = meshgrid(0:6e3/14:6e3, 0:6e3/14:6e3);
S = 0.0015*P.*(1 - (P/6000));
L = sqrt(1 + S.^2);
U = 1./L;
V = S./L;
quiver(T, P, U, V, 0.5)
axis square
xlabel('t')
ylabel('P(t)')

3 件のコメント

Tuân Nguyen
Tuân Nguyen 2022 年 4 月 20 日
thank you so much, appreciate it!
Tuân Nguyen
Tuân Nguyen 2022 年 4 月 20 日
As the code that you replied me with, I wonder how can I extend the interval of P(t) to 8000?
thank you!
Sam Chak
Sam Chak 2022 年 4 月 20 日
In this line, you can change the range of P.
[T, P] = meshgrid(0:(6000-0)/14:6000, 0:(8000-0)/14:8000);
Here is the syntax:
x_start:h:x_end
where h is the spacing between the points.
(8000-0)/14
will generate 15 points between 0 to 8000 in P

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeProgramming についてさらに検索

質問済み:

2022 年 4 月 20 日

コメント済み:

2022 年 4 月 20 日

Community Treasure Hunt

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

Start Hunting!

Translated by