Engineers-Excel.com

Coupled ODE Solver: How it works

Description| How it works| Planetary Motion



This app solves the ODE system using the 4th order Runge Kutta method. To allow the user to specify the equations in terms of Y1, Y2, etc, the initial variables are copied to the cells Y1, Y2, etc in the hidden column Y.

A macro is used to run the calculations. Unlike the first and second order ODE solvers, we cannot use Data Tables here as the functions specified by the user can involve many variables (Data Tables can handle only 2 variables at best).

The fourth order Runge-Kutta equations are:


Yi+1 = Yi + 1/6 [K1 + 2K2 + 2K3+ K4]

where,

K1 = h f [ti, Yi]
K2 = h f [ti+h/2, Yi+ K1/2]
K3 = h f [ti+h/2, Yi+ K2/2]
K4 = h f [ti+h, Yi+ K3]

The derivatives are evaluated by substituting the t and Y values into the cells containing the initial conditions and for this reason, these cells should not have formulae in them. If required, the tool can also be modified to handle a larger number of equations.