ODE 45 Extra parameter
显示 更早的评论
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 个评论
Torsten
2022-8-23
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
2022-8-23
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?
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Ordinary Differential Equations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
