How to graph a differential equation
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Krish Desai
le 12 Fév 2016
Modifié(e) : Daniel Baughman
le 8 Fév 2018
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)
0 commentaires
Réponse acceptée
Star Strider
le 13 Fév 2016
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 commentaire
Daniel Baughman
le 8 Fév 2018
Modifié(e) : Daniel Baughman
le 8 Fév 2018
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.
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Numerical Integration and Differential Equations dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!