Skip to content

Latest commit

 

History

History
114 lines (95 loc) · 4.07 KB

File metadata and controls

114 lines (95 loc) · 4.07 KB

UQToolkit Helpful Tips

Table of contents

  1. Helpful weblinks
  2. Installing UQTk on Anvil
  3. Run UQTk

1. Helpful weblinks

2. Installing UQTk on Anvil

module load cmake
module load anaconda/4.4.0
module load expat
module load netlib-lapack/3.8.0-tb3ivhl
mkdir build
git clone git@github.com:sandialabs/UQTk.git
cd UQTk/config/
cp config-gcc-Python.sh config-gcc-Python_PyUQTk_OFF.sh
vi config-gcc-Python_PyUQTk_OFF.sh
  • Modifcations for config-gcc-Python_PyUQTk_OFF.sh:
    • PyUQTk=OFF
    • UQTK_SRC_DIR=../UQTk # replace UQTk-SNL with UQTk
cd ../../build
../UQTk/config/config-gcc-Python_PyUQTk_OFF.sh
make -j 8
ctest
make install
vi ~/.bash_prfile
  • Edit your .bash_profile to add the following two lines:
PATH=$PATH:/home/userid/UQTk-install/bin
export UQTK_INS=/home/userid/UQTk-install

3. Running UQTk

  • Use the UQTk toolkit for performing developing surrogate models, sensitivity analysis, and calibration.
  • UQTk script - UQTk/examples/iuq/workflow.x.
  • Input files required:
    • ytrain.dat - nrow=0.8*nsamples, ncols= 365*num_QoIs; Model evaluations at training samples
    • ptrain.dat - nrow=0.8*nsamples, ncols=num of parameters for calibration
    • yval.dat - nrow=0.2*nsamples, ncols= 365*num_QoIs; Model evaluations at validation samples
    • pval.dat - nrow=0.2*nsamples, ncols=num of parameters for calibration
    • prange.dat : d x 2 Parameter physical ranges
    • pnames.txt : d x 1 List of parameter names
    • outnames.txt : L x 1 List of output names
    • Note - 365 is used in my examples since I am calibrating daily values. Replace 365 with 12 if calibrating monthly values.
    • Note - Scripts for generating ytrain.dat are included in this repo. Use the shell script to run the scripts and generate ytrain.dat, yval.dat, ptrain.dat, and pval.dat)

3.1 UQTk steps in workflow.x:

  • File location: UQTk/examples/iuq/workflow.x

  • Step 1a: Prepare ensemble of model simulations.

  • Step 1b: Build surrogates for each output given ensemble of simulations. Output:

    • results.pk
  • Step 1c: Sample plotting examples, relying on results.pk. Main outputs:

    • sens_main.eps
    • sens_total.eps
  • Step 1d: Reads results.pk to generate surrogate multiindex and coefficient text files, as well as estimated surrogate error file that will be used for inference. Outputs:

    • surr_errors.dat
    • pccfp.X_all.dat
    • mindexp.X_all.dat
  • Step 2a: Prepare observational/experimental data for inference. Outputs:

    • xdata_all.txt:
      • nrows= 365*num_QoIs, ncols=2
      • first column is day number and second column contains QoI number e.g., 0, 1, 2 for three QoIs.
    • ydata_all.txt:
      • nrows= 365*num_QoIs, ncols=1
      • Data values
    • dataerr_all.dat:
      • nrows= 365*num_QoIs, ncols=1
      • Standard deviation measure of the data. Often using surrogate error as a placeholder
    • ind_calib.dat :
      • nrows= 365*num_QoIs, ncols=1
      • Masking array of 0's and 1's to indicate which data points are to be used for inference (1 for data point to be used for calibration)
      • This file can be generated by awk ‘$2==0{print 1}; $2!=0{print 0}’ xdata_all.txt > ind_calib.dat. i.e., use all data points for first QoIs and none for the other two.
  • Step 2b: Select observational/experimental data and run inference (preparing and running calibration).

    • fixindnom.dat - this file should contain ids of parameters that should be fixed at the nominal values. All other parameters are calibrated. So for example, if there are total of 18 parameters but we want to calibrate only five of them (5, 12,13, 15, 16 (counting from 0)). Then fixindnom.dat should look like:
0 0.0
1 0.0
2 0.0
3 0.0
4 0.0
6 0.0
7 0.0
8 0.0
9 0.0
10 0.0
11 0.0
14 0.0
17 0.0
  • Step 2c: Sample plotting, relying on outputs of model inference. Main outputs:
    • fit_shade.eps
    • pdf_tri.eps