This example shows how to calculate the local sensitivities of some species in the Lotka-Volterra model using the SimFunctionSensitivity
object.
Load the sample project.
Define the input parameters.
Define the observed species, which are the outputs of simulation.
Create a SimFunctionSensitivity
object. Set the sensitivity output factors to all species (y1
and y2
) specified in the observables
argument and input factors to those in the params
argument (c1
and c2
) by setting the name-value pair argument to 'all'
.
f =
SimFunction
Parameters:
Name Value Type
________________ _____ _____________
{'Reaction1.c1'} 10 {'parameter'}
{'Reaction2.c2'} 0.01 {'parameter'}
Observables:
Name Type
______ ___________
{'y1'} {'species'}
{'y2'} {'species'}
Dosed: None
Sensitivity Input Factors:
Name Type
________________ _____________
{'Reaction1.c1'} {'parameter'}
{'Reaction2.c2'} {'parameter'}
Sensitivity Output Factors:
Name Type
______ ___________
{'y1'} {'species'}
{'y2'} {'species'}
Sensitivity Normalization:
Full
Calculate sensitivities by executing the object with c1
and c2
set to 10 and 0.1, respectively. Set the output times from 1 to 10. t
contains time points, y
contains simulation data, and sensMatrix
is the sensitivity matrix containing sensitivities of y1
and y2
with respect to c1
and c2
.
Retrieve the sensitivity information at time point 5.
sensMatrix2 = 2×2
37.6987 -6.8447
-40.2791 5.8225
The rows of sensMatrix2
represent the output factors (y1
and y2
). The columns represent the input factors (c1
and c2
).
Set the stop time to 15, without specifying the output times. In this case, the output times are the solver time points by default.
Retrieve the calculated sensitivities from the SimData
object sd
.
Plot the sensitivities of species y1
and y2
with respect to c1
.
Plot the sensitivities of species y1
and y2
with respect to c2
.
Alternatively, you can use sbioplot
.
You can also plot the sensitivity matrix using the time integral for the calculated sensitivities of y1
and y2
. The plot indicates y1
and y2
are more sensitive to c1
than c2
.