Perform a Parameter Scan

This example shows how to perform a parameter scan by simulating a model multiple times, each time varying the value of a parameter.

In the model described in Model of the Yeast Heterotrimeric G Protein Cycle, the rate of G protein inactivation (kGd) is much lower in the mutant strain versus the wild-type strain (kGd = 0.004 versus kGd = 0.11), which explains higher levels of activated G protein (Ga) in the mutant strain. For a detailed look at how varying the level of kGd affects the level of Ga, perform a parameter scan over five values of kGd.

Load the gprotein.sbproj project, which includes the variable m1, a model object.

sbioloadproject gprotein

The m1 model object appears in the MATLAB® Workspace.

View the variants in the m1 model.

SimBiology Variant - mutant (inactive)

ContentIndex:    Type:       Name:         Property:       Value:
1                parameter   kGd           Value           0.004

This model contains one variant named mutant that holds the content for the kGd parameter. This variant is inactive.

Assign the variant to a variable, variantObj, so you can use it to perform the scan.

variantObj = m1.Variants(1);

Create a vector of five evenly spaced values for kGd ranging from 0.001 to 0.15.

kGdValues = linspace(1e-3,0.15,5)
kGdValues =

    0.0010    0.0382    0.0755    0.1127    0.1500

Initialize a variable, scanData, which you will later use to hold an array of SimData objects to store the results of the parameter scan .

scanData = [];

Loop over the five kGd values, assigning each to the mutant variant, and specifying the mutant variant to modify the value of kGd when simulating the m1 model. Store the results of the five simulations in an array of SimData objects.

for kGd = kGdValues
    % Set the value (4th column) of the kGd variant (1st row)
    variantObj.Content{1}{4} = kGd;
    % Simulate the m1 model using the kGd variant
    simDataObj = sbiosimulate(m1,variantObj);
    % Store the results in an array of SimData objects
    scanData = [scanData;simDataObj];

The scanData array now contains five SimData objects, with each object containing the data from one simulation in the parameter scan.

More About

Was this topic helpful?