%% Analysis using a Hi-sAFe dummy model

%% 1 - INITIALIZE UQLAB
clearvars
rng(1,'twister')
uqlab

%% 2 - SETUP MODEL

ModelOpts.mFile = 'dummyModel_hisafe';
ModelOpts.isVectorized = false;

myUQLinkModel = uq_createModel(ModelOpts);

%% 3 - CREATE INPUTS

InputOpts.Marginals(1).Name = 'NorthOrientation'; 
InputOpts.Marginals(1).Type = 'Uniform';
InputOpts.Marginals(1).Parameters = [0, 180];

InputOpts.Marginals(2).Name = 'Latitude'; 
InputOpts.Marginals(2).Type = 'Uniform';
InputOpts.Marginals(2).Parameters = [0, 90]; 

% Create the INPUT object
myInput = uq_createInput(InputOpts);
uq_print(myInput)

%% 4 - RUN SOBOL

SobolOpts.Type = 'Sensitivity';
SobolOpts.Method = 'Sobol';
SobolOpts.Sobol.SampleSize = 4;
SobolOpts.Sobol.Order = 1;
mySobolAnalysis = uq_createAnalysis(SobolOpts);

uq_print(mySobolAnalysis);



