diff --git a/docs/arduino/img/equation-1-2.png b/docs/arduino/img/equation-1-2.png
new file mode 100644
index 00000000..4734aac2
Binary files /dev/null and b/docs/arduino/img/equation-1-2.png differ
diff --git a/docs/arduino/img/equation-3.png b/docs/arduino/img/equation-3.png
new file mode 100644
index 00000000..f0b62dc3
Binary files /dev/null and b/docs/arduino/img/equation-3.png differ
diff --git a/docs/arduino/img/equation-4.png b/docs/arduino/img/equation-4.png
new file mode 100644
index 00000000..db5dd592
Binary files /dev/null and b/docs/arduino/img/equation-4.png differ
diff --git a/docs/arduino/usecase.md b/docs/arduino/usecase.md
index 223ed441..3c31f067 100644
--- a/docs/arduino/usecase.md
+++ b/docs/arduino/usecase.md
@@ -1,280 +1,74 @@
# From constitutive parameter calibration to site response analysis
-**Pedro Arduino - University of Washington**
-A collection of educational notebooks to introduce model parameter calibration and site response analysis using OpenSees in DesignSafe-CI. The example makes use of the following DesignSafe resources:
+## A collection of educational notebooks to introduce model parameter calibration and site response analysis using OpenSees in DesignSafe-CI.
-[Simulation on DS - OpenSees](https://www.designsafe-ci.org/rw/workspace/#!/OpenSees::Simulation){target=_blank}
-[Jupyter notebooks on DS Juypterhub](https://www.designsafe-ci.org/rw/workspace/#!/Jupyter::Analysis){target=_blank}
+**Pedro Arduino - University of Washington**
+**Sang-Ri Yi - SimCenter, UC Berkeley**
+**Aakash Bangalore Satish - SimCenter, UC Berkeley**
-## Background
-### Citation and Licensing
+*key Words: quoFEM, OpenSees, Tapis, Python*
-* Please cite [Chen, L. et al. (2021)](https://peer.berkeley.edu/sites/default/files/2021_chen_final.pdf){target=_blank} to acknowledge the use of resources from this use case.
-
-* Please cite [Rathje et al. (2017)](https://doi.org/10.1061/(ASCE)NH.1527-6996.0000246){target=_blank} to acknowledge the use of DesignSafe resources.
-
-* This software is distributed under the [GNU General Public License](https://www.gnu.org/licenses/gpl-3.0.html){target=_blank}.
-
-## Description
-Site response analysis for liquefiable soils is fundamental in the estimation of demands on civil infrastructure including buildings and lifelines. Current state of the art in numerical methods in geotechnical engineering require the use of advance constitutive models and fully couple nonlinear finite element (FEM) tools. Advanced constitutive models require calibration of material parameters based on experimental tests. These parameters include uncertainties that in turn propagate to uncertenties in the estimation of demands. The products included in this use-case provide simple examples showing how to achieve site response analysis including parameter identification and uncertainty quantification using SimCenter tools and the DesignSafe cyber infrastructure.
-
-
- -
-Fig.1 - Site response problem
- -This document presents a suite of Jupyter Notebooks published in DesignSafe that navigate the process of constitutive model parameter calibration and site response analysis for a simple liquefaction case. They also introduce methods useful when using DesignSafe infrastructure in TACC. All notebooks leverage existing SimCenter backend functionality (e.g. Dakota, OpenSees, etc) implemented in quoFEM and run locally and in TACC through DesignSafe. Three notebooks are included for this purpose: - -1. **Site response workflow notebook**: This notebook introduces typical steps used in geotechnical numerical analysis workflows taking advantage of Jupyter and DesignSafe. - -2. **Parameter calibration notebook**: This notebook is customized for the PM4Sand model and presents the estimation of its main parameters that best fit experimental data as well as their uncertainty. - -3. **Propagation of parameter undertainty in site response analysis notebook**: This notebook introduces methods to propagate material parameter uncertainties in site reponse analysis. +## Resources -This first version of this use-case page includes details on the site response workflow notebook. The parameter calibration and propagation of uncertainties notebooks will be updated in a second version. +The example makes use of the following DesignSafe resources: +[DesignSafe - Jupyter notebooks on DS Juypterhub](https://www.designsafe-ci.org/rw/workspace/#!/Jupyter::Analysis)- -
-Fig.2 - OpenSees numerical simulation workflow
+| Site Response | Notebook | +| :-------: | :---------: | +| FreeField Response | [![Open In DesignSafe](https://raw.githubusercontent.com/geoelements/LearnMPM/main/DesignSafe-Badge.svg)](https://jupyter.designsafe-ci.org/hub/user-redirect/lab/tree/CommunityData/Jupyter%20Notebooks%20for%20Civil%20Engineering%20Courses/University_of_Washington/freeFieldJupyterPM4Sand/freeFieldJupyterPM4Sand_Community.ipynb) | -The soil profile shown in Figure 3 includes a 5.0m loose sand underlain by a 1.0 m dense soil.The loose sand is modeled using the PM4Sand constitutive model for liquefiable soils available in OpenSees. The dense sand is considered linear elastic. The groundwter table is assumed at 2.0 m making the lower 3.0 m of the loose sand susceptible to liquefaction. The soil profile is subject to a dynamic excitation at its base. The site response of interest includes (i) the surface acceleration, (ii) profiles of lateral displacement, horizontal acceleration, maximum shear strain, and cyclic stress ratio and (iii) stress strain and pore pressure plots for a point in the middle of the soil profile. The opensees model definition, analysis steps, and recorders are contained in the [N10_T3.tcl](FreeField-JupyterNB/N10_T3.tcl) file, and the input signal is in [velocity.input](FreeField-JupyterNB/velocity.input). The model can be run using OpenSees in any OS framework. + quoFEM | Notebook | +| :-------: | :---------: | +| Sensitivity analysis | [![Open In DesignSafe](https://raw.githubusercontent.com/geoelements/LearnMPM/main/DesignSafe-Badge.svg)](https://jupyter.designsafe-ci.org/hub/user-redirect/lab/tree/CommunityData/Jupyter%20Notebooks%20for%20Civil%20Engineering%20Courses/University_of_Washington/quoFEM_Example1/GlobalSensitivity/quoFEM-Sensitivity.ipynb)| +| Bayessian calibration | [![Open In DesignSafe](https://raw.githubusercontent.com/geoelements/LearnMPM/main/DesignSafe-Badge.svg)](https://jupyter.designsafe-ci.org/hub/user-redirect/lab/tree/CommunityData/Jupyter%20Notebooks%20for%20Civil%20Engineering%20Courses/University_of_Washington/quoFEM_Example1/BayesianCalibration/quoFEM-Bayesian.ipynb)| +| Forward propagation | [![Open In DesignSafe](https://raw.githubusercontent.com/geoelements/LearnMPM/main/DesignSafe-Badge.svg)](https://jupyter.designsafe-ci.org/hub/user-redirect/lab/tree/CommunityData/Jupyter%20Notebooks%20for%20Civil%20Engineering%20Courses/University_of_Washington/quoFEM_Example1/ForwardPropagation/quoFEM-Propagation.ipynb)| --
-Fig.3 - N10_T3 soil profile with liquefiable layer
- -The notebook, and required scripts, are available in the [DesignSafe/community](https://www.designsafe-ci.org/data/browser/public/designsafe.storage.community/Jupyter%20Notebooks%20for%20Civil%20Engineering%20Courses/University_of_Washington/freeFieldJupyterPM4Sand){target=_blank} folder and can be executed without any modification. -Users are invited to try this notebook and use any parts of it. -The notebook can be broken down into four main components: -- - -
-Fig.4 - Surface acceleratio and response spectrum
- - -Plot profiles -``` python -from plotProfile import plot_profile -plot_profile() -``` +## Description -- -
-Fig.5 - Profiles of max displacement, PHA, Max shear strain and cyclic stress ratio
+Seismic site response refers to the way the ground responds to seismic waves during an earthquake. This response can vary based on the soil and rock properties of the site, as well as the characteristics of the earthquake itself. -Plot excess pore water pressure -``` python -from plotPorepressure import plot_porepressure -plot_porepressure() -``` +Site response analysis for liquefiable soils is fundamental in the estimation of demands on civil infrastructure including buildings and lifelines. For this purpose, current state of the art in numerical methods in geotechnical engineering require the use of advance constitutive models and fully couple nonlinear finite element (FEM) tools. Advanced constitutive models require calibration of material parameters based on experimental tests. These parameters include uncertainties that in turn propagate to uncertenties in the estimation of demands. The products included in this use-case provide simple examples showing how to achieve site response analysis including parameter identification and uncertainty quantification using SimCenter tools and the DesignSafe cyber infrastructure.- - +
-Fig.6 - stress strain and pore pressure in the middle of liquefiable layer
- +Fig.1 - Site response problem
-#### Generate report +## Implementation -Generating a summary report is a convenient way to present results from lengthy simulations prcesses. In jupyter this can be done invoking any posprocessor available in the docker container image. Among them rst2pdf is commonly distributed with python. For the site response notebook a simple ShortReport.rst file is included that collects the results and plots generated in a simple pdf file. The python code shown below, exemplifies this process and include: -1. Running rst2pdf on [ShortReport.rst](FreeField-JupyterNB/ShortReport.rst) -2. Posting the resulting pdf file in the jupyter notebook. For this it is convenient to define the PDF function shown below that specifies the format of the file in the screen. +This use-case introduces a suite of Jupyter Notebooks published in DesignSafe that navigate the process of constitutive model parameter calibration and site response analysis for a simple liquefaction case. They also introduce methods useful when using DesignSafe infrastructure in TACC. All notebooks leverage existing SimCenter backend functionality (e.g. Dakota, OpenSees, etc) implemented in quoFEM and run locally and in TACC through DesignSafe. The following two pages address these aspects, including: -Run rst2pdf, assign to pdf_fn, and call PDF show function -``` python -import sys -!{sys.executable} -m pip install rst2pdf -os.system('rst2pdf ShortReport.rst ShortReport.pdf') +1. [**Site response workflow notebook**](./usecase_siteResponse.md): This notebook introduces typical steps used a seismic site response analysis workflow taking advantage of Jupyter, OpenSees, and DesignSafe-CI. -pdf_fn = jobinfo.archivePath.replace(user, '/user/' + user + '/files/MyData') -pdf_fn += '/' -pdf_fn += cur_dir.split('/')[-1] -pdf_fn += '/ShortReport.pdf' -print pdf_fn +2. [**quoFEM Notebooks**](./usecase_quoFEM.md): These notebooks provide an introduction to uncertainty quantification (UQ) methods using *quoFEM* to address sensitivity, Bayesian calibration, and forward propagation specifically in the context of seismic site response. Three different analysis are discussed including: -PDF(pdf_fn , (750,600)) -``` + a. **Global sensitivity analysis** This notebook provides insight into which model parameters are critical for estimating triggering of liquefaction. -PDF function -``` python -class PDF(object): - def __init__(self, pdf, size=(200,200)): - self.pdf = pdf - self.size = size + b. **Parameter calibration notebook**: This notebook is customized for the PM4Sand model and presents the estimation of its main parameters that best fit experimental data as well as their uncertainty. - def _repr_html_(self): - return ''.format(self.pdf, self.size) + c. **Propagation of parameter undertainty in site response analysis notebook**: This notebook introduces methods to propagate material parameter uncertainties in site reponse analysis. - def _repr_latex_(self): - return r'\includegraphics[width=1.0\textwidth]{{{0}}}'.format(self.pdf) -``` -#### Create Interactive Plots +## Citation and Licensing -Finally, jupyter notebooks offer flexibility to invoke GUI widgets that can help present results in a dynamic and interactive manner. The python scripts shown below create interactive plots for pore water pressure and soil profile lateral displacements. The horizontal bars allow users interrogate each plot for results at any particular time. Complete pyhon scripts are included in the [interactiveplot.py](FreeField-JupyterNB/interactiveplot.py) available in community. +* Please cite [Aakash B. Satish et al. (2022)](https://doi.org/10.1007/978-3-031-11898-2_152){target=_blank} to acknowledge the use of resources from this use case.- -
-Fig.7 - Pore pressure interactive plot
+* Please cite [Chen, L. et al. (2021)](https://peer.berkeley.edu/sites/default/files/2021_chen_final.pdf){target=_blank} to acknowledge the use of resources from this use case. -#### Displacement +* Please cite [Rathje et al. (2017)](https://doi.org/10.1061/(ASCE)NH.1527-6996.0000246){target=_blank} to acknowledge the use of DesignSafe resources. -``` python -createDispplot() -``` +* This software is distributed under the [GNU General Public License](https://www.gnu.org/licenses/gpl-3.0.html){target=_blank}. -- -
-Fig.8 - Displacement proficle interactive plot
diff --git a/docs/arduino/usecase_matlab.md b/docs/arduino/usecase_matlab.md index be7dfeea..29e9659c 100644 --- a/docs/arduino/usecase_matlab.md +++ b/docs/arduino/usecase_matlab.md @@ -1,43 +1,40 @@ -# Launching a Matlab script from a Jupyter notebook +# Launching a Matlab script in Jupyter -**Pedro Arduino - University of Washington** +## Launching a Matlab Script from DesignSafe Jupyter Hub using a dedicated Tapis app -This document presents a Jupyter Notebook published in DesignSafe that navigate the process of launching a matlab script from jupyter using a DesignSafe matlab Tapis app. It also exemplifies how to combine matlab and python events in a single notebook. The example makes use of the following DesignSafe resources: +**Pedro Arduino - University of Washington** -[Jupyter notebooks on DS Juypterhub](https://www.designsafe-ci.org/rw/workspace/#!/Jupyter::Analysis){target=_blank}- +
Fig.1 - Schematic of Matlab workflow
- -The notebook, and required scripts, are available in the Community Data folder and can be executed without any modification. -Users are invited to try this notebook and use any parts of it. -[matlabBatch-VM.ipynb](https://jupyter.designsafe-ci.org/user/name/lab/workspaces/auto-J/tree/CommunityData/Jupyter%20Notebooks%20for%20Civil%20Engineering%20Courses/University_of_Washington/MatlabBatch/matlabBatch-VM.ipynb) - +## Implementation The notebook can be broken down into three main components: @@ -128,10 +125,9 @@ job_description["notifications"] = [ ] ``` - #### Run Matlab script -Submitting a job using DesignSafe HPC resources requires the use of agave job.submit(); and passing the job_description array as argument. Checking the status of a job can be done using jobs.getStatus(). The python code shown below exemplifies these commands. In the notebook a simple python function is included in *DS_GenFunctions.py* that encapsulates the GetStatus process. When submitting a job, agave copies all the files present in the input folder to a temporary location that is used during execution. After completion agave copies all the results to an archived folder. +Submitting a job using DesignSafe HPC resources requires the use of agave/tapis job.submit(); and passing the job_description array as argument. Checking the status of a job can be done using jobs.getStatus(). The python code shown below exemplifies these commands. In the notebook a simple python function is included in *DS_GenFunctions.py* that encapsulates the GetStatus process. When submitting a job, agave/tapis copies all the files present in the input folder to a temporary location that is used during execution. After completion agave/tapis copies all the results to an archived folder. ```python import time @@ -149,7 +145,7 @@ while status != "FINISHED": ### Postprocess Results using Python -With JupyterHub, post-processing can be efficiently carried out using Python, R, or Julia through DesignSafe. Independent of scripting language, postprocessing requires identification of the location of the archived files. This is done interrogating a particular agave job and evaluating the correct folder location. The python code lines shown below exemplifly the steps required for this purpose. +With JupyterHub, post-processing can be efficiently carried out using Python, R, or Julia through DesignSafe. Independent of scripting language, postprocessing requires identification of the location of the archived files. This is done interrogating a particular agave/tapis job and evaluating the correct folder location. The python code lines shown below exemplifly the steps required for this purpose. #### Identify job, archived location and user @@ -213,7 +209,7 @@ for ii in range(3): ```- +
Fig.2 - Displacement, velocity and acceleration time history for selected motion
@@ -245,7 +241,7 @@ axs2[0].grid(True) ```- +
Fig.3 - Response spectra
@@ -285,5 +281,10 @@ class PDF(object): return r'\includegraphics[width=1.0\textwidth]{{{0}}}'.format(self.pdf) ``` +## Citation and Licensing + +* Please cite [Rathje et al. (2017)](https://doi.org/10.1061/(ASCE)NH.1527-6996.0000246){target=_blank} to acknowledge the use of DesignSafe resources. + +* This software is distributed under the [GNU General Public License](https://www.gnu.org/licenses/gpl-3.0.html){target=_blank}. diff --git a/docs/arduino/usecase_quoFEM.md b/docs/arduino/usecase_quoFEM.md index 0a914d68..6c324c5f 100644 --- a/docs/arduino/usecase_quoFEM.md +++ b/docs/arduino/usecase_quoFEM.md @@ -1,27 +1,32 @@ # Sensitivity Analysis, Bayesian Calibration and Forward Propagation of Uncertainties Using quoFEM + + + + **Pedro Arduino - University of Washington**
-* Please cite [Sang-Ri Yi et al. (2022)](https://doi.org/10.1007/978-3-031-30125-4_6) to acknowledge the use of resources from this use case.
+| Step | Notebook |
+| :-------: | :---------: |
+| Sensitivity analysis | [![Open In DesignSafe](https://raw.githubusercontent.com/geoelements/LearnMPM/main/DesignSafe-Badge.svg)](https://jupyter.designsafe-ci.org/hub/user-redirect/lab/tree/CommunityData/Jupyter%20Notebooks%20for%20Civil%20Engineering%20Courses/University_of_Washington/quoFEM_Example1/GlobalSensitivity/quoFEM-Sensitivity.ipynb)|
+| Bayessian calibration | [![Open In DesignSafe](https://raw.githubusercontent.com/geoelements/LearnMPM/main/DesignSafe-Badge.svg)](https://jupyter.designsafe-ci.org/hub/user-redirect/lab/tree/CommunityData/Jupyter%20Notebooks%20for%20Civil%20Engineering%20Courses/University_of_Washington/quoFEM_Example1/BayesianCalibration/quoFEM-Bayesian.ipynb)|
+| Forward propagation | [![Open In DesignSafe](https://raw.githubusercontent.com/geoelements/LearnMPM/main/DesignSafe-Badge.svg)](https://jupyter.designsafe-ci.org/hub/user-redirect/lab/tree/CommunityData/Jupyter%20Notebooks%20for%20Civil%20Engineering%20Courses/University_of_Washington/quoFEM_Example1/ForwardPropagation/quoFEM-Propagation.ipynb)|
-* Please cite [Rathje et al. (2017)](https://doi.org/10.1061/(ASCE)NH.1527-6996.0000246) to acknowledge the use of DesignSafe resources.
+
- +
Fig.1 - Probabilistic calibration of soil model (step 2) with sensitivity analysis (step 1) and prediction of uncertainty in estimation of lateral sperading (step 3)
+## Implementation -## Uncertainty Quantification Using quoFEM +### Uncertainty Quantification Using quoFEM Accurate quantification of uncertainty requires well-established workflows that incorporate sophisticated UQ techniques with advanced simulation models and frameworks. The SimCenter quoFEM tool streamlines this process by offering comprehensive workflows in a single tool, which can be accessed locally or remotely through a web browser using the DCV client on DesignSafe. Furthermore, users can utilize the Jupyter Hub environment on DesignSafe to manage the same, or additional, runs via Python scripts, defining job variables and submitting jobs through the Tapis system. This allows for seamless collaboration and efficient job management, resulting in faster and more effective UQ analysis. @@ -49,7 +55,7 @@ In this context, the notebooks included in this use-case complement input genera To connect SimCenter applications and Jupyter notebooks in DesignSafe, it's essential to ensure that all required tools are accessible from both frameworks. The SimCenter's vision is well-aligned with this concept and offers all of the necessary functionality through backend applications installed in DesignSafe that can be accessed via Tapis apps. This is schematically shown in Fig 2. Additionally, all SimCenter workflows are stored in JSON files that represent all steps in a workflow. This file is readily accesible using a JSON parser.- +
Fig.2 - Running quoFEM analysis using remote computing resources at DesignSafe
@@ -62,7 +68,7 @@ In order to facilitate the discussion of each notebook, it is helpful to first i 3. Run Tapis job 4. Post-process results -Instructions for (1) setting up and (2) running Tapis jobs can be found [here](https://jupyter.designsafe-ci.org/user/name/lab/workspaces/auto-J/tree/CommunityData/Jupyter%20Notebooks%20for%20Civil%20Engineering%20Courses/University_of_Washington/freeFieldJupyterPM4Sand/freeFieldJupyterPM4Sand_Community.ipynb). These steps are generally applicable for launching any Tapis app from a Jupyter notebook in DesignSafe. The most significant step in this process is determining the appropriate Tapis app to utilize. To perform uncertainty quantification within SimCenter backend applications, the following Tapis app is used: +Instructions for (1) setting up and (2) running Tapis jobs can be found [here](https://jupyter.designsafe-ci.org/hub/user-redirect/lab/tree/CommunityData/Jupyter%20Notebooks%20for%20Civil%20Engineering%20Courses/University_of_Washington/freeFieldJupyterPM4Sand/freeFieldJupyterPM4Sand_Community.ipynb). These steps are generally applicable for launching any Tapis app from a Jupyter notebook in DesignSafe. The most significant step in this process is determining the appropriate Tapis app to utilize. To perform uncertainty quantification within SimCenter backend applications, the following Tapis app is used: ``` python #Select tapis-app @@ -74,12 +80,12 @@ storage_id = 'designsafe.storage.default' app = ag.apps.get(appId=app_id) ``` -Post-processing of results is specific to the problem being solved and can be achieved using Python to access output data stored in archived files. For this purpose it is important to identify the location of data files. This is explained [here](https://jupyter.designsafe-ci.org/user/name/lab/workspaces/auto-J/tree/CommunityData/Jupyter%20Notebooks%20for%20Civil%20Engineering%20Courses/University_of_Washington/freeFieldJupyterPM4Sand/freeFieldJupyterPM4Sand_Community.ipynb). +Post-processing of results is specific to the problem being solved and can be achieved using Python to access output data stored in archived files. For this purpose it is important to identify the location of data files. This is explained [here](https://jupyter.designsafe-ci.org/hub/user-redirect/lab/tree/CommunityData/Jupyter%20Notebooks%20for%20Civil%20Engineering%20Courses/University_of_Washington/freeFieldJupyterPM4Sand/freeFieldJupyterPM4Sand_Community.ipynb). Displaying a quoFEM job workflow is useful for understanding the data and steps followed in the workflow. These include: simulation tools, input variables, UQ methods used, and remote directories/folders. An schematic of a typical quoFEM workflow is shown in Fig. 3.- +
Fig.3 - Elements of quoFEM workflow (only relevant elements for launching notebook from JupyterHub)
@@ -97,9 +103,9 @@ IPython.display.JSON(jsonInfo) To modify the workflow, the user can either manually change the workflow files within the tmp.SimCenter folder or regenerate the workflow using quoFEM. Regenerating the workflow using quoFEM is the preferred approach, as the quoFEM desktop is specifically designed to facilitate workflow creation. On the other hand, Jupyter notebooks offer more flexibility in terms of post-processing, generating plots, and manipulating data. -## Step 1 – Global Sensitivity Analysis +### Step 1 – Global Sensitivity Analysis - [quoFEM-Sensitivity.ipynb](https://jupyter.designsafe-ci.org/user/name/lab/workspaces/auto-J/tree/CommunityData/Jupyter%20Notebooks%20for%20Civil%20Engineering%20Courses/University_of_Washington/quoFEM_Example1/GlobalSensitivity/quoFEM-Sensitivity.ipynb). +[![Open In DesignSafe](https://raw.githubusercontent.com/geoelements/LearnMPM/main/DesignSafe-Badge.svg)](https://jupyter.designsafe-ci.org/hub/user-redirect/lab/tree/CommunityData/Jupyter%20Notebooks%20for%20Civil%20Engineering%20Courses/University_of_Washington/quoFEM_Example1/GlobalSensitivity/quoFEM-Sensitivity.ipynb) The PM4Sand constitutive model has 24 parameters. Among them, apparent relative density $D_r$, shear modulus coefficient $G_o$, and contraction rate parameter $h_{po}$, are known to be important for predicting liquefaction responses [2]. Therefore, these three parameters $\theta = \{D_r,G_o,h_{po}\}$ are considered in the UQ analyses and their prior distributions are assumed to be uniform distributions with the ranges shown in Table 1. These prior distributions shall capture a plausible wide range that includes all possible parameter values for the target soils. The experimental data will be used to constrain this wide range to the domain that best describes the behavior exhibited by the specimen during the experiments. @@ -120,17 +126,17 @@ The sensitivity analysis is performed for a simulation model that reproduces the -$$ + + ++ +
+where $\theta_i$ is the parameter of interest (i.e., one of the $\{D_r,G_o,h_{po}\}$ ) , $\boldsymbol{\theta}_{\sim i}$ denotes the other two parameters, $\mathbb{E}_{\boldsymbol{X}}[.]$ and $\operatorname{Var}_{\boldsymbol{X}}[.]$ denote mean and variance of function over $\boldsymbol{X}$, respectively, and the vertical bar denotes ‘conditional on’. The former index, called the main-effect index, quantifies how much of the variance of $Y$ is attributed to the parameter $\theta_i$, while the latter index, called the total-effect index, also considers the joint contributions of $\theta_i$ and other parameters [3].
- +
Fig.4 - Single element FE model used in sensitivity analysis and Bayesian calibration
- +
Fig.5 - (a) simulated cyclic stress-strain curve; (b)stress path during the simulated cyclic direct simple shear test; (c) evolution of pore water pressure ratio during the simulated CyDSS test
The sensitivity analysis is performed using the algorithm in Weirs et al. (2012) through the Dakota engine that interfaces with quoFEM [3]. 2500 simulations were performed using the prior distributions in Table 1. The resulting sensitivity is shown in Fig. 6(a) which indicates that $D_r$ is the dominating parameter for the response $Y$. This is also confirmed by inspecting the scatter plot of Fig. 6(b): $D_r$ (horizontal axis) demonstrates a stronger influence on the output (vertical axis) compared to the influence of the other parameters shown in (c) and (d). Based on this, we can expect that the CyDSS observations will help constrain the uncertainty in $D_r$, while the reduction of uncertainty in $h_{po}$ and $G_o$ will be relatively limited. Additionally, different types of experiments would be needed to better characterize those other parameters.- +
Fig.6 - (a) Sensitivity analysis results for the critical number of cycles given CSR = 0.172; (b)– (d) Individual input-output scatter plots
-## Step 2 – Bayesian Parameter Calibration +### Step 2 – Bayesian Parameter Calibration + +[![Open In DesignSafe](https://raw.githubusercontent.com/geoelements/LearnMPM/main/DesignSafe-Badge.svg)](https://jupyter.designsafe-ci.org/hub/user-redirect/lab/tree/CommunityData/Jupyter%20Notebooks%20for%20Civil%20Engineering%20Courses/University_of_Washington/quoFEM_Example1/BayesianCalibration/quoFEM-Bayesian.ipynb) -[quoFEM-Bayesian.ipynb](https://jupyter.designsafe-ci.org/user/name/lab/workspaces/auto-J/tree/CommunityData/Jupyter%20Notebooks%20for%20Civil%20Engineering%20Courses/University_of_Washington/quoFEM_Example1/BayesianCalibration/quoFEM-Bayesian.ipynb) Consider now the observations of the CyDSS experiment in Table 2, that are publicly available on the DesignSafe data depot [4]. We assume that the observed count of cycles at different CSR values, denoted as $Y_i^m$ $(i = 1,…,6)$, is given by the simulation model predictions and an added Gaussian noise. The latter captures various inaccuracies such as inherent uncertainty in the phenomenon, the imperfection of our simulation model, and measurement error. Given the above assumptions, we can denote the relationship between the data and model prediction, $Y_i(\theta)$, as -$$ + + ++ +
+where noise $\epsilon_i$ is assumed to have zero-mean and unknown variance $\sigma^2_{\epsilon,i}$. Given the six measurement values, we can use a Bayesian approach to evaluate the posterior distribution of the parameters of PM4Sand and the unknown noise variances: -$$ + + +
+ +
+where $p(∙)$ denotes the (joint) probability distribution, and $c$ is the normalization constant that ensures the area under the posterior distribution is one. From Eq. (3), @@ -214,20 +236,20 @@ test experimental data
- +
Fig.7 - Comparison of calibrated model predictions and experimental data
Figure 7 compares the experimental data with the calibrated model predictions of the load-cycle counts, while Fig. 8 shows the calibrated parameter sample from the joint posterior distribution. Figure 8 shows that uncertainty in all variables is reduced by calibrating to the observed data, but the reduction was most apparent in $D_r$. This is in line with our expectations from the earlier sensitivity analysis. The results also highlight a strong dependency between $D_r$ and $h_{po}$, indicating that multiple combinations of $D_r$ and $h_{po}$ produce near-optimal solutions. None of these features are captured by a deterministic estimator that results from a conventional error-minimizing optimization approach (e.g., red diamond marker shown in the same figure). It is also important to recognize that a non-negligible amount of uncertainty remains in the parameter estimates, and this produces substantial uncertainty in the model predictions. The dark blue bounds in Fig. 7 show the level of uncertainty in the estimated number of cycles to liquefaction, but this simulation model was prepared to reproduce the experimental setup. When the calibrated constitutive model is applied in another simulation, the responses can exhibit different scales of uncertainties.- +
Fig.8 - PM4Sand model parameters sampled from the joint posterior distribution
-## Step 3 – Forward Propagation +### Step 3 – Forward Propagation -[quoFEM-Propagation.ipynb](https://jupyter.designsafe-ci.org/user/name/lab/workspaces/auto-J/tree/CommunityData/Jupyter%20Notebooks%20for%20Civil%20Engineering%20Courses/University_of_Washington/quoFEM_Example1/ForwardPropagation/quoFEM-Propagation.ipynb) +[![Open In DesignSafe](https://raw.githubusercontent.com/geoelements/LearnMPM/main/DesignSafe-Badge.svg)](https://jupyter.designsafe-ci.org/hub/user-redirect/lab/tree/CommunityData/Jupyter%20Notebooks%20for%20Civil%20Engineering%20Courses/University_of_Washington/quoFEM_Example1/ForwardPropagation/quoFEM-Propagation.ipynb) A forward propagation analysis is helpful to characterize uncertainties in a simulation model. For this purpose it is good practice to run such an analysis and characterize the effect of uncertainties on application-specific quantities of interest before practically applying these parameter values in a simulation for decision making. @@ -235,7 +257,7 @@ The obtained samples of the soil parameters in Fig. 8 are used to predict the un- +
Fig.9 - Schematic of 1D soil layer with liquefiable soil used in the forward propagation analysis.
@@ -243,14 +265,13 @@ The results of 500 simulations are shown in Fig. 10. The mean and standard devia- +
Fig.10 - Predicted earthquake response of soil column
- -## References +### References 1. McKenna, F., et al.: NHERI-SimCenter/quoFEM: Version 3.0.0. Zenodo (2022). @@ -265,3 +286,13 @@ https://doi.org/10.17603/ds2-eahz-9466. Accessed 28 June 2021. 5. Ching, J., Chen, Y.C.: Transitional Markov chain Monte Carlo method for Bayesian model updating, model class selection, and model averaging. J. Eng. Mech. 133(7), 816–832 (2007). 6. Carlin, J.B., Vehtari, A., Stern, H.S., Rubin, D.B., Gelman, A., Dunson, D.B.: Bayesian Data Analysis, 3rd edn. Taylor & Francis, United Kingdom (2014). + +## Citation and Licensing + +* Please cite [Aakash B. Satish et al. (2022)](https://doi.org/10.1007/978-3-031-11898-2_152) to acknowledge the use of resources from this use case.+ +
+Fig.2 - OpenSees numerical simulation workflow
+ + +The soil profile shown in Figure 3 includes a 5.0m loose sand underlain by a 1.0 m dense soil.The loose sand is modeled using the PM4Sand constitutive model for liquefiable soils available in OpenSees. The dense sand is considered linear elastic. The groundwter table is assumed at 2.0 m making the lower 3.0 m of the loose sand susceptible to liquefaction. The soil profile is subject to a dynamic excitation at its base. The site response of interest includes (i) the surface acceleration, (ii) profiles of lateral displacement, horizontal acceleration, maximum shear strain, and cyclic stress ratio and (iii) stress strain and pore pressure plots for a point in the middle of the soil profile. The opensees model definition, analysis steps, and recorders are contained in the [N10_T3.tcl](FreeField-JupyterNB/N10_T3.tcl) file, and the input signal is in [velocity.input](FreeField-JupyterNB/velocity.input). The model can be run using OpenSees in any OS framework. + ++ +
+Fig.3 - N10_T3 soil profile with liquefiable layer
+ + +## Implementation + +The notebook can be broken down into four main components: + ++ + +
+Fig.4 - Surface acceleratio and response spectrum
+ + +Plot profiles +``` python +from plotProfile import plot_profile +plot_profile() +``` + ++ +
+Fig.5 - Profiles of max displacement, PHA, Max shear strain and cyclic stress ratio
+ +Plot excess pore water pressure +``` python +from plotPorepressure import plot_porepressure +plot_porepressure() +``` + ++ + +
+Fig.6 - stress strain and pore pressure in the middle of liquefiable layer
+ + +#### Generate report + +Generating a summary report is a convenient way to present results from lengthy simulations prcesses. In jupyter this can be done invoking any posprocessor available in the docker container image. Among them rst2pdf is commonly distributed with python. For the site response notebook a simple ShortReport.rst file is included that collects the results and plots generated in a simple pdf file. The python code shown below, exemplifies this process and include: +1. Running rst2pdf on [ShortReport.rst](FreeField-JupyterNB/ShortReport.rst) +2. Posting the resulting pdf file in the jupyter notebook. For this it is convenient to define the PDF function shown below that specifies the format of the file in the screen. + +Run rst2pdf, assign to pdf_fn, and call PDF show function +``` python +import sys +!{sys.executable} -m pip install rst2pdf +os.system('rst2pdf ShortReport.rst ShortReport.pdf') + +pdf_fn = jobinfo.archivePath.replace(user, '/user/' + user + '/files/MyData') +pdf_fn += '/' +pdf_fn += cur_dir.split('/')[-1] +pdf_fn += '/ShortReport.pdf' +print pdf_fn + +PDF(pdf_fn , (750,600)) +``` + +PDF function +``` python +class PDF(object): + def __init__(self, pdf, size=(200,200)): + self.pdf = pdf + self.size = size + + def _repr_html_(self): + return ''.format(self.pdf, self.size) + + def _repr_latex_(self): + return r'\includegraphics[width=1.0\textwidth]{{{0}}}'.format(self.pdf) +``` + +#### Create Interactive Plots + +Finally, jupyter notebooks offer flexibility to invoke GUI widgets that can help present results in a dynamic and interactive manner. The python scripts shown below create interactive plots for pore water pressure and soil profile lateral displacements. The horizontal bars allow users interrogate each plot for results at any particular time. Complete pyhon scripts are included in the [interactiveplot.py](FreeField-JupyterNB/interactiveplot.py) available in community. + +#### Pore water pressure + +``` python +from interactiveplot import createpwpplot, createDispplot +createpwpplot() +``` ++ +
+Fig.7 - Pore pressure interactive plot
+ +#### Displacement + +``` python +createDispplot() +``` + ++ +
+Fig.8 - Displacement proficle interactive plot
+ +## Citation and Licensing + +* Please cite [Chen, L. et al. (2021)](https://peer.berkeley.edu/sites/default/files/2021_chen_final.pdf){target=_blank} to acknowledge the use of resources from this use case. + +* Please cite [Rathje et al. (2017)](https://doi.org/10.1061/(ASCE)NH.1527-6996.0000246){target=_blank} to acknowledge the use of DesignSafe resources. + +* This software is distributed under the [GNU General Public License](https://www.gnu.org/licenses/gpl-3.0.html){target=_blank}. +