I am plotting the logistic growth model using ode45,But I am confused because I am getting oscillation while I should get a constant line so do you think there is another routine could I use it or I need to change something to get the right plot??
조회 수: 23(최근 30일)
Matt Tearle 2014년 10월 22일
The oscillation you're seeing is a standard numerical artifact that comes from using an explicit RK method. (Look at the scale of the oscillation -- it's small.) The solution to the ODE settles very quickly to equilibrium, which causes stability issues for a numerical solver (it's very easy to overshoot the solution, then have to come back, overshoot again, etc., which is the behavior you're seeing).
Check the doc for ode45 to see the other solvers that are available. A stiff solver such as ode23s will give you better behavior (as far as the oscillation is concerned, at least).