[R] Euler & Runge-Kutta

Franklin Bretschneider bretschr at xs4all.nl
Mon Nov 7 21:52:55 CET 2016

Hello Tom Mosca,


> Can someone help me with R code to perform approximations to second order differential equations and systems of first order differential equations using Euler's method and Runge-Kutta?  I am not a student and this is not for a test or graded assignment.
> Examples (unrelated to each other):
> h = 0.1
> 1.  3(t^2)y'' - 5ty' + 5y = 0
>     y(1) = 0, y'(1) = 2/3
> 2.  Lotka-Volterra
>     x' = x(3-y)
>     y' = y(x-3)

For solving differential equations, the famous "lsoda" solver is best, far better than the simple Euler method, and also better than Runge & Kutta.
Angels, or very nice people, implemented solving methods using the lsoda into R. Download the package "deSolve" and the world of numerical solutions is at your feet.

Succes, Franklin

Franklin Bretschneider
Dept of Biology
Utrecht University
bretschr at xs4all.nl

More information about the R-help mailing list