setactiveconfigset (model)

Set active configuration set for model object

Syntax

configsetObj = setactiveconfigset(modelObj, 'NameValue')
configsetObj2 = setactiveconfigset(modelObj, configsetObj1)

Description

configsetObj = setactiveconfigset(modelObj, 'NameValue') sets the configuration set NameValue to be the active configuration set for the model modelObj and returns to configsetObj.

configsetObj2 = setactiveconfigset(modelObj, configsetObj1) sets the configset configsetObj1 to be the active configset for modelObj and returns to configsetObj2. Any change in one of these two configset objects configsetObj1 and configsetObj2 is reflected in the other. To copy over a configset object from one model object to another, use the copyobj method.

The active configuration set contains the settings that are be used during a simulation. A default configuration set is attached to any new model.

Examples

  1. Create a model object by importing the oscillator.xml file, and add a Configset object to the model.

    modelObj  = sbmlimport('oscillator');
    configsetObj = addconfigset(modelObj, 'myset');
  2. Configure the simulation stop criteria by setting the StopTime, MaximumNumberOfLogs, and MaximumWallClock properties of the Configset object. Set the stop criteria to a simulation time of 3000 seconds, 50 logs, or a wall clock time of 10 seconds, whichever comes first.

    set(configsetObj, 'StopTime', 3000, 'MaximumNumberOfLogs', 50,...
        'MaximumWallClock', 10)
    get(configsetObj)
    
                            Active: 0
                    CompileOptions: [1x1 SimBiology.CompileOptions]
                              Name: 'myset'
                             Notes: ''
                    RuntimeOptions: [1x1 SimBiology.RuntimeOptions]
        SensitivityAnalysisOptions: [1x1 SimBiology.SensitivityAnalysisOptions]
                     SolverOptions: [1x1 SimBiology.ODESolverOptions]
                        SolverType: 'ode15s'
                          StopTime: 3000
               MaximumNumberOfLogs: 50
                  MaximumWallClock: 10
                         TimeUnits: 'second'
                              Type: 'configset'
  3. Set the new Configset object to be active, simulate the model using the new Configset object, and plot the result.

     setactiveconfigset(modelObj, configsetObj);
    [t,x] = sbiosimulate(modelObj);
    plot (t,x)
Was this topic helpful?