Hi @damarginal
Here are the scripts. It says new users cannot upload, so I will copy paste them here:
The UQLink Script:
fclose all;
clearvars;
clc;
Restart = 0;
%%= 0 is not restart, = 1 is restart
Analysis_Type = 1; % = 1 is model eval, = 2 is SOBOL analysis
Sample_Size = 1000;
%%
%% NAME DIRECTORIES AND VARIABLES, AND DELETE OLD FILES
Current_Folder=pwd;
%%find current dir
files = ls(‘AUTO_EAE_UQLab*.inp’); % (list of files with AUTO_EAE_UQLab*.inp)
for n = 1: size(files, 1)
delete(strtrim(files(n,:)));
end
if isunix
%% Unix
copyfile(strcat(Current_Folder,’/UQInput_Template/AUTO_EAE_UQLab.inp’), Current_Folder, ‘f’)
elseif ispc % Windows
copyfile(strcat(Current_Folder,’\UQInput_Template\AUTO_EAE_UQLab.inp’), Current_Folder, ‘f’)
end
if Restart == 0
%% = 0 is not restart so delete old folders
delete(‘AUTO_EAE_UQLab.zip’)
end
if ispc
Exe_File = ‘AAPU_EAE_UQ_Function_ELM2’;
%%this is the external .exe program
elseif isunix
Exe_File = ‘run_AAPU_EAE_UQ_Function_ELM2_Linux.sh’;
%% this is the external .sh program
end
%/global/software/matlab/R2017a/
Input_File = ‘AUTO_EAE_UQLab.inp’;
Output_File = ‘AUTO_EAE_UQLab.out’;
timer = tic;
%% INITIALIZE UQLAB
if isunix
%%Unix
cd /global/home/hpc4077/UQLab/core
uqlab
cd(Current_Folder);
elseif ispc % Windows
uqlab
end
%%
%%Model type:
Mopts.Type = ‘UQLink’ ;
Mopts.Name = ‘AUTO_EAE_UQLab’;
%%
%%Mandatory options:)
%%Provide the command line, i.e. a sample of the command line that will be)
%%run on the shell
if ispc
%%Windows
Command = strcat([Exe_File, ’ ‘, Input_File]);
elseif isunix
%%Unix
Deliminator = ‘"’;
Executable = [Deliminator fullfile(Current_Folder,Exe_File) Deliminator];
Command = sprintf(’%%s %%s %%s’, Executable, Input_File);
end
Mopts.Command = Command ; % load the file then run the matlab script
%%
%%Provide the template file, i.e. a copy of the original input files)
%%where the inputs of interest are replaced by markers:)
Mopts.Template = strcat(Input_File, ‘.tpl’);
%%
%%Provide the MATLAB file that is used to retrieve the quantity of interest)
%%from the code output file:)
Mopts.Output.FileName = Output_File ;
if isunix
%%Unix
Mopts.Output.Parser = ‘uq_readOutput’ ;
elseif ispc % Windows
Mopts.Output.Parser = ‘uq_readOutput’ ;
end
%%
% Format of the variables written in the Abaqus input file
Mopts.Format = {’%6.5f’};
%%
% Set the display to quiet
ModelOpts.Display = ‘quiet’ ;
%%
% Create the UQLink wrapper:
AUTO_EAE_Model = uq_createModel(Mopts) ;
%% 3 - DEFINE THE PROBABILISTIC MODEL
inputopts.Marginals(1).Name = ‘Pellet_Dia’;
inputopts.Marginals(1).Type = ‘Lognormal’ ; % Lognormal 0.96073 vs Gaussian 0.96070
inputopts.Marginals(1).Moments = [12.210092 0.00328781] ;
inputopts.Marginals(2).Name = ‘Sheath_ID’;
inputopts.Marginals(2).Type = ‘Lognormal’ ; % Lognormal 0.976272368 vs Gaussian 0.976253242
inputopts.Marginals(2).Moments = [12.299666 0.003665] ;
inputopts.Marginals(3).Name = ‘Dish_Dpth’;
inputopts.Marginals(3).Type = ‘Lognormal’ ; % Lognormal 0.913672446 vs Gaussian 0.895779768
inputopts.Marginals(3).Moments = [0.2098888889 0.0146364505] ;
inputopts.Marginals(4).Name = ‘Land_Width’;
inputopts.Marginals(4).Type = ‘Lognormal’ ; % Lognormal 0.967042334 vs Gaussian 0.959241921
inputopts.Marginals(4).Moments = [0.8235563 0.0324305] ;
inputopts.Marginals(5).Name = ‘Pelt_Density’;
inputopts.Marginals(5).Type = ‘Gaussian’ ; % Lognormal 0.992068054 vs Gaussian 0.992175757
inputopts.Marginals(5).Moments = [10.6256873 0.0198114] ;
inputopts.Marginals(6).Name = ‘Stac_Lengt’;
inputopts.Marginals(6).Type = ‘Gaussian’ ; % BASED ON ASSUMPTION OF GAUSSIAN, MEAN CENTERED BETWEEN MANUFACTURER MAX AND MIN TOLERANCE
inputopts.Marginals(6).Moments = [481.42500 0.261666667] ;
inputopts.Marginals(7).Name = ‘Sheat_Lengt’;
inputopts.Marginals(7).Type = ‘Gaussian’ ; % BASED ON ASSUMPTION OF GAUSSIAN, MEAN CENTERED BETWEEN MANUFACTURER MAX AND MIN TOLERANCE
inputopts.Marginals(7).Moments = [486.1300 0.016666667] ;
inputopts.Marginals(8).Name = ‘Weld_Disp_A’;
inputopts.Marginals(8).Type = ‘Gaussian’ ; % Lognormal 0.965769662 vs Gaussian 0.9706230 vs Weibull 0.977885841
inputopts.Marginals(8).Moments = [0.035528 0.000677] ;
inputopts.Marginals(9).Name = ‘Weld_Disp_B’;
inputopts.Marginals(9).Type = ‘Gaussian’ ; % Lognormal 0.965769662 vs Gaussian 0.9706230 vs Weibull 0.977885841
inputopts.Marginals(9).Moments = [0.035528 0.000677] ;
inputopts.Marginals(10).Name = ‘Sheat_Thick’;
inputopts.Marginals(10).Type = ‘Lognormal’ ; % Lognormal 0.973156331 vs Gaussian 0.972522273
inputopts.Marginals(10).Moments = [0.4008627 0.0018982] ;
inputopts.Marginals(11).Name = ‘He_Fract’;
inputopts.Marginals(11).Type = ‘Lognormal’ ; % Lognormal 0.976818174 vs Gaussian 0.973329443
inputopts.Marginals(11).Moments = [0.852541 0.024087] ;
inputopts.Marginals(12).Name = ‘Sheat_Rough’;
inputopts.Marginals(12).Type = ‘Gaussian’ ; % BASED ON ASSUMPTION OF GAUSSIAN, MEAN CENTERED BETWEEN PATENT LITERATURE CONTROL LIMIT OF 0.5 AND 0.3 AND 3 STDEV BETWEEN LIMITS AND MEAN
inputopts.Marginals(12).Moments = [0.4 0.0333] ;
inputopts.Marginals(13).Name = ‘Pell_Rough’;
inputopts.Marginals(13).Type = ‘Gaussian’ ; % BASED ON ASSUMPTION OF GAUSSIAN, MEAN AND STDEV DERIVED FROM LITERATURE
inputopts.Marginals(13).Moments = [0.776666667 0.130000000] ;
inputopts.Marginals(14).Name = ‘Pelt_Grain_Sz’;
inputopts.Marginals(14).Type = ‘Lognormal’ ; % Lognormal 0.968824216 vs Gaussian 0.952122186
inputopts.Marginals(14).Moments = [8.2256354 1.2219068] ;
inputopts.Marginals(15).Name = ‘Chamf_Dept’;
%% radial chamfer
inputopts.Marginals(15).Type = ‘Gaussian’ ;
%% BASED ON ASSUMPTION OF GAUSSIAN, and mean and std
inputopts.Marginals(15).Moments = [0.825 0.1] ;
inputopts.Marginals(15).Bounds = [0, 1.00];
%%Arbitary Limit decided by me)
inputopts.Marginals(16).Name = ‘Chamf_Leng’; % axial chamfer
inputopts.Marginals(16).Type = ‘Gaussian’ ;
%%BASED ON ASSUMPTION OF GAUSSIAN, and mean and std
inputopts.Marginals(16).Moments = [0.183 0.1] ;
inputopts.Marginals(16).Bounds = [0, 0.36]; % if greater than 0.36 the ELESTRES runs keep failing
inputopts.Marginals(17).Name = ‘Shth_Yld_Strss’;
inputopts.Marginals(17).Type = ‘Gaussian’ ; % Lognormal 0.996343578 vs Gaussian 0.99757754
inputopts.Marginals(17).Moments = [485.2622625 25.48472693] ;
inputopts.Marginals(18).Name = ‘Zone’;
inputopts.Marginals(18).Type = ‘Gaussian’ ; % Gaussian 0.95317
inputopts.Marginals(18).Moments = [5.1619 2.7480] ;
inputopts.Marginals(18).Bounds = [1, 12];
inputopts.Marginals(19).Name = ‘Bundle_Start_Spot’;
inputopts.Marginals(19).Type = ‘Uniform’ ;
inputopts.Marginals(19).Moments = [((8+1)/2) ((8-1)/(2*sqrt(3)))] ; % for Zone 6 … RSQ = 0.87
inputopts.Marginals(19).Bounds = [1, 8];
% Create the INPUT object
myInput = uq_createInput(inputopts);
uq_print(myInput)
%% 4 - VARIOUS APPLICATIONS
if Analysis_Type == 1; % = 1 is model eval,
%% 4.1 Estimation of the response PDF using Monte Carlo simulation
% Compute an experimental design (ED) of size 250 using Latin Hypercube Sampling:
X = uq_getSample(Sample_Size,‘LHS’) ;
%%
% Evaluate the Abaqus model (truss tip deflection) on the ED:
Y = uq_evalModel(AUTO_EAE_Model, X);
save(strcat(‘run_sample_size_’,num2str(Sample_Size)));
elseif Analysis_Type == 2; % = 2 is SOBOL analysis
SobolOpts.Type = ‘Sensitivity’;
SobolOpts.Method = ‘Sobol’;
SobolOpts.Sobol.Order = 1;
SobolOpts.Sobol.SampleSize = Sample_Size;
SobolAnalysis = uq_createAnalysis(SobolOpts);
uq_print(SobolAnalysis)
SobolResults = SobolAnalysis.Results;
save(strcat(‘SOBOL_sample_size_’,num2str(Sample_Size)));
elseif Analysis_Type == 3; % = 2 is PCE Sobol analysis
PCEOpts.Type = ‘Metamodel’;
PCEOpts.MetaType = ‘PCE’;
PCEOpts.FullModel = AUTO_EAE_Model;
PCEOpts.Degree = 7;
PCEOpts.ExpDesign.NSamples = 20000;
myPCE = uq_createModel(PCEOpts);
SobolOpts.Type = ‘Sensitivity’;
SobolOpts.Method = ‘Sobol’;
SobolOpts.Sobol.Order = 1;
SobolOpts.Sobol.SampleSize = 100000;
mySobolAnalysisPCE = uq_createAnalysis(SobolOpts);
uq_print(mySobolAnalysisPCE)
mySobolResultsPCE = mySobolAnalysisPCE.Results;
save(strcat(‘PCE_SOBOL_sample_size_’,num2str(SobolOpts.Sobol.SampleSize)));
end
time = toc(timer)
The Parser Script is simple:
function Y = uq_readOutput(outputfile)
%%Read t h e s i n g l e l i n e o f t h e f i l e , wh ich c o r r e s p o n d s t o t h e)
%%s o u g h t m idspan beam d e f l e c t i o n)
Y = dlmread(outputfile) ;
end
FYI, wherever there is a % sign, I put %% instead, because it was inadvertently triggering some math symbolism.
Thanks!