Calculating Senstivities with SimBiology GUI and from 'sbiosimuate' - How do I deal with NaNs and Infs
Show older comments
Hi
I am trying to replicate the results of Sensitivity Analysis I get from Simbiology GUI in my script file. The code is written below:
% set the outputs
set(csObj.SensitivityAnalysisOptions, 'Outputs',[s1 s2 s3]);
% set the inputs
set(csObj.SensitivityAnalysisOptions,'Inputs', [k1 k2 k3]);
% Set Normalization
set(csObj.SensitivityAnalysisOptions,'Normalization','Full');
% Enable Sensitivity
set(csObj.SolverOptions, 'SensitivityAnalysis',true);
% accelerate
sbioaccelerate(m);
% Simulate
simDataObj = sbiosimulate(m);
% Get the data
[T, R, snames, ifacs] = getsensmatrix(simDataObj);
The Sensitivity matrix I get ('R') has NaNs and Infs in it, so I convert them to zero and sum across the time axis.
R(isnan(R)) = 0;
R(isinf(R)) = 0;
R = abs(R);
R1 = sum(R,1); % Sum across time
R1 = squeeze(R1); % size of R1 now is states * parameters
And compare the results with the plot obtained from GUI
[Value, Index] = sort(R1(1,:),'descend')
I see that my results are different from those in the GUI, both in terms of values of Sensitivity and order of sensitive parameter.
Can anyone help as to what I am doing wrong here in the normalization of 'R' matrix?
Thanks S N
Accepted Answer
More Answers (0)
Communities
More Answers in the SimBiology Community
Categories
Find more on Perform Sensitivity Analysis in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!