资源简介
灵敏度分析的代码,包括测试函数、灵敏度分析过程,直接运行
代码片段和文件信息
% Example 1
%
%
% Citation: Cannavo‘ F. Sensitivity analysis for volcanic source modeling quality assessment and model selection Computers & Geosciences Vol. 44 July 2012 Pages 52-59 ISSN 0098-3004 http://dx.doi.org/10.1016/j.cageo.2012.03.008.
clear all
clc
% create a new project
pro = pro_Create();
% add 5 input variables with a pdf uniformely distributed in [0 1]
% pro = pro_AddInput(pro @(N)pdf_Uniform(N [0 1]) ‘param1‘);
% pro = pro_AddInput(pro @(N)pdf_Uniform(N [0 1]) ‘param2‘);
% pro = pro_AddInput(pro @(N)pdf_Uniform(N [0 1]) ‘param3‘);
% pro = pro_AddInput(pro @(N)pdf_Uniform(N [0 1]) ‘param4‘);
% pro = pro_AddInput(pro @(N)pdf_Uniform(N [0 1]) ‘param5‘);
% add to the project 5 input variables named param* distributed in the
% range [0 1] and indicate that the variables will be sampled following a
% Sobol set
pro = pro_AddInput(pro @()pdf_Sobol([0 1]) ‘param1‘);
pro = pro_AddInput(pro @()pdf_Sobol([0 1]) ‘param2‘);
pro = pro_AddInput(pro @()pdf_Sobol([0 1]) ‘param3‘);
pro = pro_AddInput(pro @()pdf_Sobol([0 1]) ‘param4‘);
pro = pro_AddInput(pro @()pdf_Sobol([0 1]) ‘param5‘);
% set the model and name it as ‘model‘ to the project
% the model is well-known as “Sobol function“
pro = pro_SetModel(pro @(x)TestModel(x[0 1 9 9 9]) ‘model‘);
% calculate the real analytical values of sensitivity coefficients for the
% model “Sobol function“ (3.0.1).
[D Si] = SATestModel([0 1 9 9 9]);
% set the number of samples for the quasi-random Monte Carlo simulation
pro.N = 20000;
% initialize the project by calculating the model at the sample points
pro = GSA_Init(pro);
% calculate the total global sensitivity coefficient for the set of 2 variables
% (‘param1 and param5) (see sections 2.3 and 2.4)
% [Stot eStot pro] = GSA_GetTotalSy(pro {‘param1‘ ‘param5‘});
% calculate the global sensitivity coefficient for the set of all the input
% variables and verify that equals 1
[S eS pro] = GSA_GetSy(pro {53124});
% calculate the first order global sensitivity coefficient for the second variable and
% verify that S2 equals the real value Si(2)
[S2 eS2 pro] = GSA_GetSy(pro {2});
% calculate the first order global sensitivity coefficients by using FAST
% algorithm and verify that all coefficients equal the real ones in Si
Sfast = GSA_FAST_GetSi(pro);
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 2395 2018-05-10 23:51 example1.m
文件 1739 2018-05-10 23:37 example2.m
文件 4404 2018-05-10 23:39 example_MultiOut_MultiSI.m
文件 1273 2018-05-10 23:40 fnc_FAST_getFreqs.m
文件 1353 2018-05-10 23:40 fnc_FAST_getInputs.m
文件 858 2018-05-10 23:41 fnc_GetComplementaryInputs.m
文件 622 2018-05-10 23:41 fnc_GetIndex.m
文件 815 2018-05-10 23:41 fnc_GetInputs.m
文件 5658 2018-05-10 23:41 fnc_getSobolSequence.m
文件 785 2018-05-10 23:42 fnc_getSobolSetMatlab.m
文件 1960 2018-05-10 23:42 fnc_SampleInputs.m
文件 1282 2018-05-10 23:42 fnc_SelectInput.m
文件 2819 2018-05-10 23:43 GSA_FAST_GetSi.m
文件 3672 2018-05-10 23:43 GSA_FAST_GetSi_MultiOut.m
文件 5379 2018-05-10 23:43 GSA_GetSy.m
文件 6530 2018-05-10 23:44 GSA_GetSy_MultiOut_MultiSI.m
文件 2158 2018-05-10 23:44 GSA_GetTotalSy.m
文件 2289 2018-05-10 23:44 GSA_GetTotalSy_MultiOut_MultiSI.m
文件 2121 2018-05-10 23:45 GSA_Init.m
文件 2730 2018-05-10 23:45 GSA_Init_MultiOut_MultiSI.m
文件 976 2018-05-10 23:45 pdf_LogNormal.m
文件 817 2018-05-10 23:45 pdf_Normal.m
文件 587 2018-05-10 23:45 pdf_Sobol.m
文件 970 2018-05-10 23:46 pdf_Uniform.m
文件 718 2018-05-10 23:36 pro_AddInput.m
文件 720 2018-05-11 00:03 pro_AddInput2.m
文件 1218 2018-05-10 23:47 pro_Create.m
文件 737 2018-05-10 23:47 pro_SetModel.m
文件 332 2018-05-10 23:47 SATestModel.m
文件 241 2018-05-10 23:47 TestModel.m
文件 127 2018-05-10 23:47 TestModel2.m
............此处省略0个文件信息
评论
共有 条评论