OutputTimes
Specify times to log deterministic simulation output
Description
OutputTimes
is a property of the SolverOptions
property,
which is a property of a Configset
object. This
property specifies the times during a deterministic (ODE) simulation
that data is recorded. Time units are specified by the TimeUnits
property
of the Configset
object. OutputTimes
is
available only for ODE solvers (ode15s
, ode23t
, ode45
,
and sundials
).
If the criteria set in the MaximumWallClock
property
causes a simulation to stop before all time values in OutputTimes
are
reached, then no data is recorded for the latter time values.
The OutputTimes
property can also control
when a simulation stops:
The last value in
OutputTimes
overrides theStopTime
property as criteria for stopping a simulation.The length of
OutputTimes
overrides theMaximumNumberOfLogs
property as criteria for stopping a simulation.
Characteristics
Applies to | Object: SolverOptions |
Data type | double |
Data values | Vector of nonnegative, monotonically increasing values, or [] ,
an empty vector. Default is [] , which results in
data being logged every time the simulation solver takes a step. |
Access | Read/write |
Examples
Specify Times to Log Deterministic Simulation Output
Specify the times during a deterministic (ODE) simulation that data is recorded.
Create a model
object named cell
and save it in a variable named modelObj
.
modelObj = sbiomodel('cell');
Retrieve the configuration set from modelObj
and save it in a variable named configsetObj
.
configsetObj = getconfigset(modelObj);
Specify to log output every second for the first 10
seconds of the simulation. Do this by setting the OutputTimes
property of the SolverOptions
property of ConfigsetObj
.
set(configsetObj.SolverOptions, 'OutputTimes', [1:10]) get(configsetObj.SolverOptions, 'OutputTimes')
ans = 10×1
1
2
3
4
5
6
7
8
9
10
When you simulate modelObj
, output is logged every second for the first 10
seconds of the simulation. Also, the simulation stops after the 10th log.