This page will look better in a graphical browser that supports web standards, but is accessible to any browser or internet device.

Served by Samwise.

# JSim ODE Solver Tuning Guide

The default set of parameters associated with the ODE solvers are usually sufficient for most ODE problems, but occassionally need to be "tweaked". When a solver fails or gives a poor result, it is usually caused by (1) too large a step size, (2) too large relative and absolute tolerances in the solutions, (3) too few steps for calculation, or (4) problem being too stiff. Many of these problems can be fixed by changing the ODE solver parameters, or by using a more complex solver, or by doing both. The ODE solvers are listed in order of increasing complexity.

## Euler: forward one-step

Decrease model step (t.delta) where t stands for the independent variable (e.g. t.delta, x.delta, etc.) and/or increase nstep. The actual step size is (t.delta/nstep) for the solver. Error is first order (proportional to actual step size).

## RK2: 2nd order Runge-Kutta, also known as modified trapezoidal method

Decrease model step (t.delta) where t stands for the independent variable (e.g. t.delta, x.delta, etc.) and/or increase nstep. The actual step size is (t.delta/nstep) for the solver. Error is second order (proportional to actual step size squared).

## RK4: 4th order Runge-Kutta

Decrease model step (t.delta) where t stands for the independent variable (e.g. t.delta, x.delta, etc.) and/or increase nstep. The actual step size is (t.delta/nstep) for the solver.

## KM: Runge-Kutta Merson with adaptive stepsize

Decrease minstep (must be smaller than t.delta) and/or decrease tol.

## Fehlberg: Runge-Kutta-Fehlberg (RKF45)

Decrease minstep (must be smaller than t.delta) and/or decrease tol.

## CVode

Decrease reltol and/or abstol; increase maxsteps; checking the box marked "stiff" invokes a BDF (backward differentiation formula, otherwise Adams-Moulton methods are used.)

## Dopri5: Dorman Prince 5th order with variable stepsize (explicit Runge-Kutta Method)

Decrease reltol and abstol. Most of the other parameters are already set to reasonable values and changing them will probably not improve the solution.

## Radau: Implicit Runge-Kutta method with variable order (5,9,13) with step size control

Decrease reltol and abstol. Most of the other parameters are already set to reasonable values and changing them will probably not improve the solution.