Select Page

# Stiff ODEs

### Introduction

A numerical algorithm providing an efficient and stable way to solve the ODEs and DDEs is used to compute the solution of the dynamical models. Different numerical algorithms can be used to solve the ODE depending on the properties of the ODE system (Adams methods for non stiff ODEs, and Backward Differentiation Formulas methods for stiff ODEs). The right numerical algorithm must be selected in order to get an accurate and stable solution within a reasonable computational time. The stiffness of an ODE systems is one of the main properties that influences the choice of the numerical algorithms. Stiff ODEs can lead to very long computational times if an inappropriate algorithm is used. Stiff ODEs are typical for models that include processes taking place at different time scales. For example models with reaction and diffusion processes are known to be stiff. Reactions can occur at the seconds time scale while diffusion processes can take hours. For such cases a dedicated numerical algorithm for stiff ODEs is available.

A solver for stiff ODEs can be selected in Mlxtran using the keyword odeType. There are two possible choices for odeType:

; ode is considered as stiff
odeType = stiff
; ode is considered as non-stiff (default)
odeType = nonStiff


This command has to be defined in the [LONGITUDINAL] section. When odeType is not specified then the nonStiff ODE solver is used by default.

### Rules and Best Practices

• For the DDEs, the keyword odeType is ineffective.
• For many ODEs the nonStiff solver will provide the best solution. However, it is good practice to always test both solvers to see which one is providing the shorter computational time.
• The absolute and relative tolerance for the numerical resolutions are 1e-6 and 1e-3 respectively for nonStiff ODEs and 1e-9 and 1e-6 respectively for stiff ODEs .