| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → SimBiology |
| Contents | Index |
| Learn more about SimBiology |
| On this page… |
|---|
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:
Store and apply parameter values for yeast and mouse models using two separate variants.
Store parameter estimates from different experimental conditions in several variants and apply them to a model.
Store component values for mutant strains and apply the values to a model representing the wild-type.
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:
Species InitialAmount
Parameter Value
Compartment Capacity
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.
Create the variant and add it to the model using the addvariant method.
(Optional) Set the Active property to true if you always want the variant to be applied before simulating the model.
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 properties | Variant object |
| Example of creating and adding a variant | addvariant |
| Appending contents to variants | addcontent |
| Replacing model values permanently with values from a variant | commit |
For information about creating variants in the SimBiology desktop and applying them during a simulation, see the following:
The context-sensitive help (SimBiology Desktop Help) in the SimBiology desktop for procedures. To access this help:
In the SimBiology desktop, from the Project Explorer, select Variants.
The desktop opens the Variants pane. The SimBiology Desktop Help updates to show you how to work with variants.
If the context-sensitive help is not open, select Help > SimBiology Desktop Help.
Desktop Example — Applying Changes to Parameter Value Using a Variant
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.
![]() | Desktop Example — Changing Species Amounts Using an Event | Desktop Example — Applying Changes to Parameter Value Using a Variant | ![]() |

See how to analyze, visualize, and model biological data and systems using MathWorks products.
Get free kit| © 1984-2010- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |