- #1
- 1,591
- 3
I'd like to learn how to use Runge-Kutta to solve IDEs. My understanding is that this technique can be used for the following:
[tex]\frac{dy}{dt}=F(t,y)+\int_0^t G[t,s,y(s)]ds[/tex]
So I start with the following simple version:
[tex]\frac{dy}{dt}=ay-by^2+K\int_0^t y(s)ds[/tex]
This is a good start because this equation can be differentiated to yield:
[tex]y(y^{''})=(y^{'})^{2}-by^{'}y^{2}+Ky^3[/tex]
with:
[tex]y^{'}(0)=ay(0)-b[y(0)]^2[/tex]
And so I can numerically solve the resulting ODE to get a precise answer that I can check against the Runge-Kutta version. Well, my results aren't "close" enough. I've included two plots: The first plot is the Runge-Kutta (dark line) against the ODE solution. The second plot gives the absolute difference between the two. The third plot is the back-substitution of the numerical results of the ODE back into the IDE. As you can see, the values are no more than [itex]10^{-5}[/itex] which is close.
However, the difference between the ODE results and Runge-Kutta of the IDE is the same type even with smaller increments of t and different values of a and b and K.
Perhaps I'm implementing Runge-Kutta incorrectly. Can anyone give me suggestions?
Thanks,
Salty
[tex]\frac{dy}{dt}=F(t,y)+\int_0^t G[t,s,y(s)]ds[/tex]
So I start with the following simple version:
[tex]\frac{dy}{dt}=ay-by^2+K\int_0^t y(s)ds[/tex]
This is a good start because this equation can be differentiated to yield:
[tex]y(y^{''})=(y^{'})^{2}-by^{'}y^{2}+Ky^3[/tex]
with:
[tex]y^{'}(0)=ay(0)-b[y(0)]^2[/tex]
And so I can numerically solve the resulting ODE to get a precise answer that I can check against the Runge-Kutta version. Well, my results aren't "close" enough. I've included two plots: The first plot is the Runge-Kutta (dark line) against the ODE solution. The second plot gives the absolute difference between the two. The third plot is the back-substitution of the numerical results of the ODE back into the IDE. As you can see, the values are no more than [itex]10^{-5}[/itex] which is close.
However, the difference between the ODE results and Runge-Kutta of the IDE is the same type even with smaller increments of t and different values of a and b and K.
Perhaps I'm implementing Runge-Kutta incorrectly. Can anyone give me suggestions?
Thanks,
Salty
Attachments
Last edited: