ErrorTolerance
Specify explicit or implicit tau error tolerance
Description
The ErrorTolerance
property specifies the
error tolerance for the explicit tau and implicit tau stochastic solvers.
It is a property of the SolverOptions
object. SolverOptions
is
a property of the configset
object. The explicit
and implicit tau solvers automatically chooses a time interval (tau
)
such that the relative change in the propensity function for each
reaction is less than the user-specified error tolerance.
A propensity function describes the probability that the reaction will occur in the next smallest time interval, given the conditions and constraints.
If the error tolerance is too large, there may not be a solution
to the problem and that could lead to an error. If the error tolerance
is small, the solver will take more steps than when the error tolerance
is large leading to longer simulation times. The error tolerance should
be adjusted depending upon the problem, but a good value for the error
tolerance is between 1 %
to 5 %
.
Characteristics
Applies to | Object: SolverOptions |
Data type | double |
Data values | >0, <1. The default is 3e-2 . |
Access | Read/write |
Examples
This example shows how to change ErrorTolerance
settings.
Retrieve the
configset
object from themodelObj
and change theSolverType
toexpltau
.modelObj = sbiomodel('cell'); configsetObj = getconfigset(modelObj); set(configsetObj, 'SolverType', 'expltau')
Change the
ErrorTolerance
to1e-8
.set(configsetObj.SolverOptions, 'ErrorTolerance', 5.0e-2); get(configsetObj.SolverOptions, 'ErrorTolerance') ans = 5.000000e-002