I am linking a third party software to UQLabs using UQLink. The third party software is called Hi-sAFe which is used to simulate interactions between trees and crops for agriculture. This thid-party software simulates the growing of trees and crops over several years, I am currently similulating over 30 years so it takes a long time to run one interation of any kind of sensitivity analysis. I am running this on a HPC.
I have manged to succesfully get the link set up between the two softwares and get the output values from the simulation. However, I am struggling with performing any kind of sensitivity analysis.
I have attempted both Morris and Sobol’s methods as of now to see if it is working on a small scale. I would eventually like to use both to do a larger analysis with several input parameters using Morris, set the values which are least sensitive, and then run a Sobol method on the most sensitive. As of now, since it takes so long to run one iteration of Hi-sAFe, I just want to see if the sensitivity analysis is working although it will not necessarily get the correct values. Thus, I am doing very few iterations.
I will only discuss here the issues I have with Sobol. My inputs are set as:
InputOpts.Marginals(1).Name = 'Latitude';
InputOpts.Marginals(1).Type = 'Uniform';
InputOpts.Marginals(1).Parameters = [0, 90];
InputOpts.Marginals(2).Name = 'NorthOrientation';
InputOpts.Marginals(2).Type = 'Uniform';
InputOpts.Marginals(2).Parameters = [0, 180];
% Create the INPUT object
myInput = uq_createInput(InputOpts);
I have set up the Sobol analysis as below:
SobolOpts.Type = 'Sensitivity';
SobolOpts.Method = 'Sobol';
SobolOpts.Sobol.SampleSize = 10;
SobolOpts.Sobol.Order = 1;
mySobolAnalysis = uq_createAnalysis(SobolOpts);
% Print results in terminal
uq_print(mySobolAnalysis);
As I said, I am doing it with very few iterations for now, even though I know the results will not be significant. For this analysis it ran a total of 12 realisations. However, I have tried running more realisations, up to 50, and it still gives the same error, so I think there is something else going on.
When I run this analysis, I get the following error:
Error using uq_sobol_indices
Unable to perform assignment because the size of the left side is 1-by-2 and
the size of the right side is 1-by-0.
Error in uq_sensitivity (line 87)
results = uq_sobol_indices(CurrentAnalysis);
Error in uq_analysis/run (line 84)
this.Results = eval([this.Type '(this)']);
Error in uq_runAnalysis (line 29)
[varargout{1:nargout}] = current_analysis.run(current_analysis, varargin{:});
Error in uq_initialize_uq_sensitivity (line 889)
uq_runAnalysis(current_analysis);
Error in uq_core_module/run_initialization_script (line 208)
initHandle(obj);
Error in uq_core_analysis/add_module (line 96)
success = this.run_initialization_script(obj);
Error in uq_createAnalysis (line 83)
eval(str);
Error in UQLink_v3Capsis_HPC_MC (line 166)
mySobolAnalysis = uq_createAnalysis(SobolOpts);
As I stated, I have tried more iterations by changing SobolOpts.Sobol.SampleSize
. I thought there may be an issue with my output parser, however I have double checked it and it is giving outputs as row vectors for each realisation. For this case I had a 12 x 3837 array. Is this maybe too much data to process?
I have been stuck with this for a while and am by no means an expert in this field so any new ideas or thoughts are more than welcome!