Products & Services Solutions Academia Support User Community Company

Learn more about SimBiology   

Storing and Applying Alternate Model Values Using Variants

What Are Variants?

Variants allow you to apply alternate values to model components to represent values for the components. The alternate values apply only during a simulation and do not otherwise alter the model's values. Some examples for use of variants are:

Simulating using a variant does not alter the model component values permanently. The values specified in the variant temporarily apply during simulation. You can store values for:

Using one or more variants associated with a model allows you to evaluate model behavior during simulation, with different values for the various model components without having to search and replace these values, or having to create additional models with these values. If you determine that the values in a variant accurately define your model, you can permanently replace the values in your model with the values stored in the variant object.

Using Variants

Creating and Using Variants at the Command Line

  1. Create the variant and add it to the model using the addvariant method.

  2. (Optional) Set the Active property to true if you always want the variant to be applied before simulating the model.

  3. Enter the variant object as an argument to sbiosimulate. This applies the variant only for the current simulation and supersedes any active variant objects on the model.

    If you followed step 2, simply calling sbiosimulate on the model object apples the variant.

For more information, see the following sources of information in the SimBiology Reference:

For information about...See...
Variant object methods and propertiesVariant object
Example of creating and adding a variantaddvariant
Appending contents to variantsaddcontent
Replacing model values permanently with values from a variantcommit

Creating and Using Variants in the SimBiology Desktop

For information about creating variants in the SimBiology desktop and applying them during a simulation, see the following:

Applying Multiple Variants in a Model

When multiple variants are used during a simulation, and there are duplicate specifications for a property's value, the last occurrence for the property value in the array of variants is used during simulation. You can find out which variant is applied last by looking at the indices of the variant objects stored on the model (at the command line) or the last variant created.

If you specify variants as arguments to sbiosimulate, this applies the variants for the current simulation in the order that they are specified, and supersedes any active variant objects on the model.

Similarly, in the variant contents (Content property), if there are duplicate specifications for a property's value, the last occurrence for the property in the contents is used during simulation.

If you permanently replace values in a model with values from multiple variants using the Commit button in the desktop, the value committed in the model is the last occurrence of the value in the variants.

  


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-2010- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS