This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

StopTime

Simulation time criteria to stop simulation

Description

StopTime is a property of a Configset object. This property sets the maximum simulation time criteria to stop a simulation. Time units are specified by the TimeUnits property of the Configset object.

A simulation stops when it meets any of the criteria specified by StopTime, MaximumNumberOfLogs, or MaximumWallClock. However, if you specify the OutputTimes property of the SolverOptions property of the Configset object, then StopTime and MaximumNumberOfLogs are ignored. Instead, the last value in OutputTimes is used as the StopTime criteria, and the length of OutputTimes is used as the MaximumNumberOfLogs criteria.

Characteristics

Applies toObject: Configset
Data typedouble
Data valuesNonnegative scalar. Default is 10.
AccessRead/write

Examples

Set Simulation Time Criteria to Stop Simulation

  1. Create a model object named cell and save it in a variable named modelObj. Retrieve the configuration set from modelObj and save it in a variable named configsetObj.

    modelObj  = sbiomodel('cell');
    configsetObj = getconfigset(modelObj);
  2. Configure the simulation stop criteria by setting the StopTime property to 20 seconds. Leave the MaximumNumberOfLogsand MaximumWallClock properties at their default values of Inf.

    set(configsetObj, 'StopTime', 20)
    get(configsetObj)
    
                            Active: 1
                    CompileOptions: [1x1 SimBiology.CompileOptions]
                              Name: 'default'
                             Notes: ''
                    RuntimeOptions: [1x1 SimBiology.RuntimeOptions]
        SensitivityAnalysisOptions: [1x1 SimBiology.SensitivityAnalysisOptions]
                     SolverOptions: [1x1 SimBiology.ODESolverOptions]
                        SolverType: 'ode15s'
                          StopTime: 20
               MaximumNumberOfLogs: Inf
                  MaximumWallClock: Inf
                         TimeUnits: 'second'
                              Type: 'configset'

    When you simulate modelObj, the simulation stops when the simulation time reaches 20 seconds.