ODE 45 Extra parameter
Afficher commentaires plus anciens
Hello
I hope you're well.
I am currently trying to plot with ODE45. This is a linear growth model.
My formula is (r*p*(1-p/N)) - ((200/2)*(1+sin(2*pi*t)/12))
ODE45 works fine when solving with just the first part of the formula
sol = ode45(@(t,p) (r*p*(1-p/N)) , tspan, p0);
however I am not sure how to implement the extra bit of code. I tried the following
sol = ode45(@(t,p) (r*p*(1-p/N)) - ((200/2)*(1+sin(2*pi*t)/12)), tspan,p0);
But dont think this is correct.
I'm not sure how to implement this extra bit. Would appreciate any help.
Thanks.
Kind regards,
3 commentaires
Torsten
le 23 Août 2022
If your ODE is
dp/dt = r*p*(1-p/N) - 200/2*(1+sin(2*pi*t)/12)
with p(0) = p0, your settings are correct.
Steven Lord
le 23 Août 2022
Is there something in particular that leads you to doubt the answer you receive when you run your code? If so can you show us your code and explain your doubt in more detail?
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Ordinary Differential Equations dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
