ODE 45 Extra parameter
Mostrar comentarios más antiguos
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 comentarios
Torsten
el 23 de Ag. de 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
el 23 de Ag. de 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?
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Ordinary Differential Equations en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
