Specify sensitivity analysis options
The SensitivityAnalysisOptions
property is
an object that holds the sensitivity analysis options in the configuration
set object. Sensitivity analysis is supported only for deterministic
(ODE) simulations.
Note
The SensitivityAnalysisOptions
property controls
the settings related to sensitivity analysis. To enable or disable
sensitivity analysis, use the SensitivityAnalysis
property.
Properties of SensitivityAnalysisOptions
are
summarized in Property Summary.
When sensitivity analysis is enabled, the following command
[t,x,names] = sbiosimulate(modelObj)
returns [t,x,names]
, where
t
is an n-by-1
vector,
where n
is the number of steps taken by the ode
solver and t
defines the time steps of the solver.
x
is an n-by-m
matrix,
where n
is the number of steps taken by the ode
solver and m
is:
Number of species and parameters specified in StatesToLog + (Number of sensitivity outputs * Number of sensitivity input factors)
names
is the list of states logged
and the list of sensitivities of the species specified in StatesToLog
with
respect to the input factors.
For an example of the output, see Examples.
You can add a number of configuration set objects with different SensitivityAnalysisOptions
to
the model object with the addconfigset
method.
Only one configuration set object in the model object can have the Active
property
set to true
at any given time.
Inputs | Specify species and parameter input factors for sensitivity analysis |
Normalization | Specify normalization type for sensitivity analysis |
Outputs | Specify species and parameter outputs for sensitivity analysis |
Applies to | Object: configuration set |
Data type | Object |
Data values | SensitivityAnalysisOptions properties as
summarized in Property Summary. |
Access | Read-only |
This example shows how to set SensitivityAnalysisOptions
.
Import the radio decay model from SimBiology demos.
modelObj = sbmlimport('radiodecay');
Retrieve the configuration settings and the sensitivity
analysis options from modelObj
.
configsetObj = getconfigset(modelObj);
sensitivityObj = get(configsetObj, 'SensitivityAnalysisOptions');
Add a species and a parameter to the Inputs
property.
Use the sbioselect
function to retrieve the species
and parameter objects from the model.
speciesObj = sbioselect(modelObj,'Type', 'species', 'Name', 'z'); parameterObj = sbioselect(modelObj, 'Type', 'parameter', 'Name', 'c'); set(sensitivityObj, 'Inputs', [speciesObj parameterObj]);
Add a species to the Outputs
property
and display.
set(sensitivityObj, 'Outputs', speciesObj); get(sensitivityObj, 'Outputs')
SimBiology Species Array Index: Compartment: Name: InitialAmount: InitialAmountUnits: 1 unnamed z 0 molecule
Enable SensitivityAnalysis
.
set(configsetObj.SolverOptions, 'SensitivityAnalysis', true); get(configsetObj.SolverOptions, 'SensitivityAnalysis') ans = 1
Simulate and return the results to three output variables. See Description for more information.
[t,x,names] = sbiosimulate(modelObj);
Display the names
.
names
names = 'x' 'z' 'd[z]/d[z]_0' 'd[z]/d[Reaction1.c]'
Display state values x
.
x
The display follows the column order shown in names
for
the values in x
. The rows correspond to t
.