sbiosimulate - Simulate model object

Syntax

[t,x,names] = sbiosimulate(modelObj)
simDataObj = sbiosimulate(modelObj)
... = sbiosimulate(modelObj, configsetObj)
... = sbiosimulate(modelObj, variantObj)
... = sbiosimulate(modelObj, configsetObj, variantObj)

Arguments

Output Arguments

tAn n-by-1 vector of time points. Shows the simulation time steps.
xAn n-by-m data array. Where n is the number of time samples and m is the number of states logged in the simulation. Each column of x describes the variation in the quantity of a state over time.
namesAn m-by-1 cell array of names.

If the species are in multiple compartments, species names are qualified with the compartment name, in the form, compartmentName.speciesName. For example, nucleus.DNA, cytoplasm.mRNA.

Parameter names are qualified with the reaction name if the parameter is scoped to the reaction's kinetic law, for example, Transcription.k1, denotes that the parameter k1 is scoped to the kinetic law for the reaction, Transcription.

simdataObjsimdataObj is an object that holds time and state data as well as metadata, such as the types and names for the logged states or the configuration set used during simulation. You can access time, data, and names stored in simdataObj through simdataObj properties. See SimData object for more information.

Input Arguments

modelObjModel object to be simulated.
configsetObjSpecify the configuration set object to use in the simulation. For more information about configuration sets see Configset object.
variantObjSpecify the variant object to apply to the model during the simulation. For more information about variant objects see Variant object.

Description

[t,x,names] = sbiosimulate(modelObj) simulates a model object (modelObj) using the active configuration set attached to the model (modelObj) and returns the specified outputs as described in Output Arguments.

simDataObj = sbiosimulate(modelObj) simulates the Simbiology model object (modelObj) and returns the results to a SimData object.

... = sbiosimulate(modelObj, configsetObj) simulates a model object (modelObj) using a configuration set (configset) that overrides the active configuration set attached to the model (modelObj). After the command is executed this override does not exist; the configuration set that is defined as 'active' is reinstated. To get the configuration sets attached to a model, use getconfigset. To attach a new or existing configuration set to a model, use addconfigset. To set the active configuration set of a model, use setactiveconfigset. For more information about configuration sets see Configset object.

... = sbiosimulate(modelObj, variantObj) simulates a model object, (modelObj), using the variant object or array of variant objects (variantObj).

... = sbiosimulate(modelObj, configsetObj, variantObj) simulates a model object, (modelObj), using the configuration set object configsetObj and the variant object or array of variant objects (variantObj).

Property Summary

Configuration set property summary

ActiveIndicate object in use during simulation
CompileOptionsDimensional analysis and unit conversion options
NameSpecify name of object
NotesHTML text describing SimBiology® object
RuntimeOptionsOptions for logged species
SensitivityAnalysisOptionsSpecify sensitivity analysis options
SolverOptionsSpecify model solver options
SolverTypeSelect solver type for simulation
StopTimeSet stop time for simulation
StopTimeTypeSpecify type of stop time for simulation
TimeUnitsShow stop time units for simulation
TypeDisplay top-level SimBiology® object type

Examples

The following examples show you how to change solver settings.

Example 1

Create a SimBiology® model from an SBML file, simulate the model using a solver other than the default solver (default is ode15s), and view the results.

  1. Read the file for theoscillator model.

    modelObj = sbmlimport('oscillator.xml');
  2. Get the active configset.

    configsetObj = getconfigset(modelObj, 'active');
  3. Configure the SolverType to ode45 and set StopTime to 10.

    set(configsetObj, 'SolverType', 'ode23s');
    set(configsetObj, 'StopTime', 10);
  4. Simulate modelObj.

    [t,x]= sbiosimulate(modelObj);
  5. Plot the results of the simulation.

    plot(t, x)

Example 2

Simulate the above example with DimensionalAnalysis off (set to false).

  1. Repeat steps 1 and 2 above, then set dimensional analysis and unit conversion off in the configset object. DimensionalAnalysis and UnitConversion are properties of the CompileOptions object in the configset object.

     set(configsetObj.CompileOptions, 'UnitConversion', false);
     set(configsetObj.CompileOptions, 'DimensionalAnalysis', false);
  2. Simulate modelObj.

    simDataObj = sbiosimulate(modelObj);
  3. Plot the results of the simulation.

    plot(simDataObj.Time, simDataObj.Data);
    legend(simDataObj.DataNames)

See Also

SimBiology object constructor sbiomodel, model object method addconfigset

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS