フィルターのクリア

How to graph a differential equation

4 ビュー (過去 30 日間)
Krish Desai
Krish Desai 2016 年 2 月 12 日
編集済み: Daniel Baughman 2018 年 2 月 8 日
The equation I am trying to graph: f(y)=r(1−(y/L)y - py^2/(q+y^2)
Where p=1.2, q=1 and L=6.1
function yp=fishfun(t,y)
[t,y]=fishfun(fishfun,[0,1],-1);
plot(t,y)
yp=0.65*(1-(y/6.1))*y-(1.2*y*y)/1+y*y;
odeplot(t,y)

採用された回答

Star Strider
Star Strider 2016 年 2 月 13 日
I believe this is what you want to do:
fishfun = @(t,y) 0.65*(1-(y/6.1))*y-(1.2*y*y)/1+y*y;
[t,y]=ode45(fishfun,[0,1],-1);
figure(1)
plot(t,y)
grid
  1 件のコメント
Daniel Baughman
Daniel Baughman 2018 年 2 月 8 日
編集済み: Daniel Baughman 2018 年 2 月 8 日
I don't understand why I have to use ode45 to plot differential equations. Edit: sorry just seems more complicated than it has to be.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeProgramming についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by