Allowable error tolerance relative to state value during a simulation
RelativeTolerance
is a property of the SolverOptions
object,
which is a property of a Configset
object. It is
available for the ode solvers (ode15s
, ode23t
, ode45
,
and sundials
).
The RelativeTolerance
property specifies
the allowable error tolerance relative to the state vector at each
simulation step. The state vector contains values for all the state
variables, for example, amounts for all the species.
If you set the RelativeTolerance
at 1e-2
,
you are specifying that an error of 1% relative to each state value
is acceptable at each simulation step.
For details, see Selecting Absolute Tolerance and Relative Tolerance for Simulation.
Applies to | Object: SolverOptions |
Data type | double |
Data values | Positive scalar that is <1 . Default is 1e-3 . |
Access | Read/write |
This example shows how to change AbsoluteTolerance
.
Retrieve the configset
object from
the modelObj
.
modelObj = sbiomodel('cell');
configsetObj = getconfigset(modelObj)
Change the AbsoluteTolerance
to 1e-8
.
set(configsetObj.SolverOptions, 'RelativeTolerance', 1.0e-6); get(configsetObj.SolverOptions, 'RelativeTolerance') ans = 1.0000e-006