Skip to Main Content Skip to Search
Product Documentation

sbiosimulate - Simulate model object

Syntax

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

Description

[t,x,names] = sbiosimulate(modelObj) simulates modelObj, a SimBiology model object, using the active configuration set associated with modelObj, and returns the simulation results in three outputs, described in Output Arguments.

simDataObj = sbiosimulate(modelObj) returns the simulation results to simDataObj, a SimData object.

... = sbiosimulate(modelObj, configsetObj) uses configsetObj, a configuration set object, thus overriding the active configuration set associated with 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 modelObj, a SimBiology model object, using variantObj, a variant object or an array of variant objects.

... = sbiosimulate(modelObj, doseObj) simulates modelObj, a SimBiology model object, using doseObj, a dose object or an array of dose objects.

... = sbiosimulate(modelObj, configsetObj, variantObj) simulates modelObj, a SimBiology model object, using configsetObj, a configuration set object or [], an empty array; and variantObj, a variant object, array of variant objects, or [], an empty array.

... = sbiosimulate(modelObj, configsetObj, doseObj) simulates modelObj, a SimBiology model object, using configsetObj, a configuration set object or [], an empty array; and doseObj, a dose object, array of dose objects, or [], an empty array.

... = sbiosimulate(modelObj, configsetObj, variantObj, doseObj) simulates modelObj, a SimBiology model object, using configsetObj, a configuration set object or [], an empty array; variantObj, a variant object, array of variant objects, or [], an empty array; and doseObj, a dose object, array of dose objects, or [], an empty array.

Input Arguments

modelObj

SimBiology Model object.

configsetObj

Configset object to use in the simulation. When there are three or more inputs, configsetObj can also be [], an empty array.

    Note   If your model contains events, the Configset object cannot specify 'expltau' or 'impltau' for the SolverType property.

    Note   If your model contains doses, the Configset object cannot specify 'ssa', 'expltau', or 'impltau' for the SolverType property.

    Tip   Set configsetObj to [], an empty array, if you want to specify both a variant and a dose, and use the active configuration set.

variantObj

Variant object or array of variant objects to apply to the model during the simulation. When there are three or more inputs, variantObj can also be [], an empty array.

doseObj

Dose object or array of dose objects to apply to the model during the simulation. For more information about dose objects, see ScheduleDose object and RepeatDose object. When there are three or more inputs, doseObj can also be [], an empty array.

Output Arguments

t

An n-by-1 vector of time points, showing the simulation time steps.

x

An 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.

names

An 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.

simdataObj

SimData object, which 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 by using properties of a SimData object.

Examples

The following examples show 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 then view the results.

  1. Read the file for the oscillator model.

    modelObj = sbmlimport('oscillator.xml');
  2. Get the active configuration set for the model.

    configsetObj = getconfigset(modelObj, 'active');
  3. Set SolverType to ode23t and set StopTime to 10.

    set(configsetObj, 'SolverType', 'ode23t');
    set(configsetObj, 'StopTime', 10);
  4. Simulate the model.

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

    plot(t, x)

Example 2

Simulate the above example without dimensional analysis (DimensionalAnalysis property 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 the model.

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

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

See Also

addconfigset | Configset object | getconfigset | Model object | RepeatDose object | sbioaccelerate | sbiomodel | ScheduleDose object | setactiveconfigset | SimData object | Variant object

  


Free Computational Biology Interactive Kit

See how to analyze, visualize, and model biological data and systems using MathWorks products.

Get free kit

Trials Available

Try the latest computational biology products.

Get trial software
 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS