sbioensemblerun

Multiple stochastic ensemble runs of SimBiology model

Syntax

simdataObj = sbioensemblerun(modelObj, Numruns)
simdataObj = sbioensemblerun(modelObj, Numruns, Interpolation)
simdataObj = sbioensemblerun(modelObj, Numruns, configsetObj)
simdataObj = sbioensemblerun(modelObj, Numruns, configsetObj, Interpolation)
simdataObj = sbioensemblerun(modelObj, Numruns, variantObj)
simdataObj = sbioensemblerun(modelObj, Numruns, variantObj, Interpolation)
simdataObj = sbioensemblerun(modelObj, Numruns, configsetObj, variantObj)
simdataObj = sbioensemblerun(modelObj, Numruns, configsetObj, variantObj, Interpolation)

Arguments

simdataObjAn array of SimData objects containing simulation data generated by sbioensemblerun. All elements of simdataObj contain data for the same states in the same model.
modelObjModel object to be simulated.
Numruns

Integer scalar representing the number of stochastic runs to make.

Interpolation

String variable denoting the interpolation scheme to be used if data should be interpolated to get a consistent time vector. Valid values are 'linear' (linear interpolation), 'zoh' (zero-order hold), or 'off' (no interpolation). Default is 'off'. If interpolation is on, the data is interpolated to match the time vector with the smallest simulation stop time.

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

Description

simdataObj = sbioensemblerun(modelObj, Numruns) performs a stochastic ensemble run of the SimBiology® model object (modelObj), and returns the results in simdataObj, an array of SimData objects. The active configset and the active variants are used during simulation and are saved in the output, SimData object (simdataObj).

sbioensemblerun uses the settings in the active configset on the model object (modelObj) to perform the repeated simulation runs. The SolverType property of the active configset must be set to one of the stochastic solvers: 'ssa', 'expltau', or 'impltau'. sbioensemblerun generates an error if the SolverType property is set to any of the deterministic (ODE) solvers.

simdataObj = sbioensemblerun(modelObj, Numruns, Interpolation) performs a stochastic ensemble run of a model object (modelObj), and interpolates the results of the ensemble run onto a common time vector using the interpolation scheme (Interpolation).

simdataObj = sbioensemblerun(modelObj, Numruns, configsetObj) performs an ensemble run of a model object (modelObj), using the specified configuration set (configsetObj).

simdataObj = sbioensemblerun(modelObj, Numruns, configsetObj, Interpolation) performs an ensemble run of a model object (modelObj), using the specified configuration set (configsetObj), and interpolates the results of the ensemble run onto a common time vector using the interpolation scheme (Interpolation).

simdataObj = sbioensemblerun(modelObj, Numruns, variantObj) performs an ensemble run of a model object (modelObj), using the variant object or array of variant objects (variantObj).

simdataObj = sbioensemblerun(modelObj, Numruns, variantObj, Interpolation) performs an ensemble run of a model object (modelObj), using the variant object or array of variant objects (variantObj), and interpolates the results of the ensemble run onto a common time vector using the interpolation scheme (Interpolation).

simdataObj = sbioensemblerun(modelObj, Numruns, configsetObj, variantObj) performs an ensemble run of a model object (modelObj), using the configuration set (configsetObj), and the variant object or array of variant objects (variantObj). If the configuration set object (configsetObj) is empty, the active configset on the model is used for simulation. If the variant object (variantObj) is empty, then no variant (not even the active variants in the model) is used for the simulation.

simdataObj = sbioensemblerun(modelObj, Numruns, configsetObj, variantObj, Interpolation) performs an ensemble run of a model object (modelObj), using the configuration set (configsetObj), and the variant object or array of variant objects (variantObj), and interpolates the results of the ensemble run onto a common time vector using the interpolation scheme (Interpolation).

Examples

This example shows how to perform an ensemble run and generate a 2-D distribution plot.

  1. The project file, radiodecay.sbproj, contains a model stored in a variable called m1. Load m1 into the MATLAB® workspace.

    sbioloadproject('radiodecay.sbproj','m1');
  2. Change the solver of the active configset to be ssa. Also, adjust the LogDecimation property on the SolverOptions property of the configuration set.

    cs = getconfigset(m1, 'active');
    set(cs, 'SolverType', 'ssa');
    so = get(cs, 'SolverOptions');
    set(so, 'LogDecimation', 10);

      Tip   The LogDecimation property lets you define how often the simulation data is recorded as output. If your model has high concentrations or amounts of species, or a long simulation time (for example, 600s), you can record simulation data less often to manage the amount of data generated. Be aware that by doing so you might miss some transitions if your model is very dynamic. Try setting LogDecimation to 10 or more.

  3. Perform an ensemble of 20 runs with linear interpolation to get a consistent time vector.

    simdata = sbioensemblerun(m1, 20, 'linear');
  4. Create a 2-D distribution plot of the species 'z' at a time = 1.0.

    FH = sbioensembleplot(simdata, 'z', 1.0);
Was this topic helpful?