This repository is for the demonstration of UQpy at the FrontUQ 2024 conference. Last updated September 20, 2024.
This repository is written entirely in Python.
We recommend you set up a new Python environment and
install the packages in requirements.txt
, then run validate_setup.py
to confirm UM-Bridge
and UQpy are properly installed.
The script validate_setup.py
runs the XFoil model twice, once with UM-Bridge and once with UQpy, and prints the results.
This repository builds data-driven surrogate models using UQpy.
We recommend you use the Jupyter notebook (.ipynb
) version of each of the following scripts.
For convenience, we also provide identical Python scripts (.py
) versions of each demo in the python_demos
folder.
We build and fit a Gaussian Process Regression (GPR) to data computed by XFoil in train_gpr
.
We construct a Polynomial Chaos Expansion (PCE)
using XFoil data and show how to estimate Sobol indices using PCE coefficients in train_pce
.
Future versions of this repository will include deterministic and Bayesian neural networks when the upcoming Scientific Machine Learning module is released as a part of UQpy.
Additional scripts are provided to compute Monte Carlo statistics on the output of the XFoil model.
The model is provided for us and computed using the package XFoil. The details of XFoil are not important to us, we treat this model as a black box. The aerodynamic model takes in 5 inputs with distributions given by the table below.
Parameter Name | Aleatory Distribution | Epistemic Interval |
---|---|---|
1. Angle of Attack | N(0, 0.1) | [-0.3, 0.3] |
2. Reynolds Number | N(500,000, 2,500) | [493,500, 507,500] |
3. Upper Surface Trip Location | N(0.3, 0.015) | [0.225, 0.345] |
4. Lower Surface Trip Location | N(0.7, 0.021) | [0.637, 0.763] |
5. Flap Deflection | N(0, 0.08) | [-0.24, 0.24] |
The model returns the following 4 outputs:
- Lift (CL)
- Total Resistance (CD)
- Resistance due to Pressure (CDp)
- Torque (CM)
The model is defined via a docker container provided by FrontUQ.
The docker container can be found at linusseelinger/xfoil_arm64
.
To run the docker container (docker run
), detach it from the terminal session (-d
),
and specify port 4242 (-p 4242
), run
docker run -d -p 4242 --name xfoil linusseelinger/xfoil_arm64
Sometimes the port specification doesn't work, in which case you can view the port with either of the two following lines:
docker port xfoil
docker ps
With the docker container running, the following lines of python will run the model.
Make sure the port number after localhost:
matches the port number returned by docker port xfoil
.
import umbridge
model = umbridge.HTTPModel("http://localhost:4242", "forward")
inputs = [[0.0, 500_000, 0.3, 0.7, 0.0]]
print(model(inputs))
For each of the surrogates, the training and testing data are computed within each demo.
We include datasets of precomputed XFoil model runs in the data
folder generated by the data/generate_data.py
script.
These datasets are useful to compute Monte Carlo estimates of output distributions.
Connor Krill
Shields Uncertainty Research Group
Department of Civil and Systems Engineering
Johns Hopkins University
Baltimore, Maryland