odeset

Specify ordinary differential equation options.

Syntax

options = odeset('option1', value1, 'option2', value2)

Inputs

optionN
The name of option N to set.
valueN
The value to set for option N.

Outputs

options
A struct containing the options.
The available options are as follows:
  • RelTol: The relative tolerance on the integrations
  • Abstol: The absolute tolerance on the integrations
  • Jacobian: The analytical Jacobian function (only for ode15s, ode15i)

Examples

Set options to control the relative and absolute tolerances:
options = odeset('RelTol', 1.0e-3, 'AbsTol', 1.0e-6)
options = struct [
AbsTol: 1e-06
RelTol: 0.001
]
Set options to specify the analytical Jacobian function name:
options = odeset('Jacobian', @JacFunc)
options = struct [
Jacobian: JacFunc
]

Comments

The default value for RelTol is 1.0e-3. It is a scalar.

The default value for AbsTol is 1.0e-6. It can be specified as either a scalar that applies to every equation in the system, or as a vector with one element for each equation.