# Summary

Read the results of a centered parameter study from Dakota's HDF5-format output file and plot them using the Python packages h5py and matplotlib.

# Description

Dakota was used to perform a centered parameter study of the cantilever problem. In a centered parameter study, Dakota steps each variable one at a time while holding the others fixed at their initial values. The results of each step (variable values and responses) were written to Dakota's HDF5-format results file. The Jupyter Notebook included with the example demonstrates how to use the Python `h5py` package to access the results and the `matplotlib` package to then plot them.

# Dakota Keywords

HDF5 output is not enabled in Dakota by default. To turn it on, add `results_output hdf5` to the `environment` section of the Dakota input. Additional keywords tailor the specific data written and the name of the file, as described in the [Reference Manual](https://dakota.sandia.gov//sites/default/files/docs/6.13/html-ref/environment-results_output-hdf5.html). Layout of the data in the output file [is also described there](https://dakota.sandia.gov//sites/default/files/docs/6.13/html-ref/hdf5_output.html).

# How to run the example

Use Jupyter Notebook or Jupyterlab to open `plot_centered.ipynb`. The notebook uses `dakota_results.h5`, which can be re-generated by running the Dakota input `dakota_centered.in`:

    $ dakota -i dakota_centered.in -o dakota_cal.out

On gitlab, `plot_centered.ipynb` can be viewed read-only. Another way to view the file read-only is by opening `plot_centered.html` in a web browser.

# Requirements

[Jupyter notebook or JupyterLab](https://jupyter.org/) is needed to run the notebook interactively. The Python packages `h5py` and `matplotlib` are also required. All these dependencies can be satisfied by installing the [Anaconda](https://www.anaconda.com/) Python distribution.

# Contents

* `dakota_centered.in`: Dakota input for centered parameter study
* `dakota_results.h5`: HDF5-format results output file
* `plot_centered.ipynb`: Jupyter notebook, demonstrating how to read and plot results
* `plot_centered.html`: Read-only version of the notebook

