ODE 45 Extra parameter
Show older comments
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 Comments
Torsten
on 23 Aug 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
on 23 Aug 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?
Accepted Answer
More Answers (0)
Categories
Find more on Ordinary Differential Equations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!