From a6ca90ed6e7028e011e838747216008d4a0462d2 Mon Sep 17 00:00:00 2001 From: monabraeunig <138789374+monabraeunig@users.noreply.github.com> Date: Thu, 10 Oct 2024 10:21:33 +0200 Subject: [PATCH 1/3] Update README.md --- clients/README.md | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/clients/README.md b/clients/README.md index f8a379e5..bbc80ace 100644 --- a/clients/README.md +++ b/clients/README.md @@ -563,3 +563,50 @@ which indeed returns `Ev = 2.9948`, i.e., close to 3 as expected. The script the [Full example sources here.](https://github.com/UM-Bridge/umbridge/blob/main/clients/matlab/sgmkClient.m) +## UQLab client + +UQLab is a general purpose Uncertainty Quantification framework based on Matlab. It is made of open-source scientific modules which are smoothly connected to perform uncertainty quantification through Monte Carlo simulation, sensitivity analysis, reliability analysis (computation of rare event probabilities), surrogate models (polynomial chaos expansions, Kriging, etc.), Bayesian inversion/calibration and many more. + +UQLab fully supports UM-Bridge models. After registering at `https://www.uqlab.com/`, downloading and installing UQLab as indicated on the UQLab website, you can start UQLab using + +``` +uqlab +``` + +To run an UM-Bridge model, install Docker Desktop and start a docker model, e.g., the [Euler-Bernoulli beam model](https://um-bridge-benchmarks.readthedocs.io/en/docs/forward-benchmarks/muq-beam-propagation.html), using the terminal command + +``` +>> docker run -it -p 4243:4243 linusseelinger/benchmark-muq-beam-propagation:latest +``` + +Add UM-Bridge to your Matlab path and create an UM-Bridge model as in the section ["Matlab client"](https://um-bridge-benchmarks.readthedocs.io/en/docs/umbridge/clients.html#matlab-client) above: + +```matlab +addpath(fullfile('\YOUR\FULL\PATH\TO\UMBRIDGE\INSTALLATION', 'matlab')) % modify with the correct path +model = HTTPModel('http://localhost:4243', 'forward'); +``` + +The following lines create the corresponding UQLab model object: + +```matlab +ModelOpts.mHandle = @(X) model.evaluate(X); +EulerBernoulliBeamModel = uq_createModel(ModelOpts); +``` + +Additional parameters can also be passed to the model, see the [UQLab User Manual: The Model Module](https://uqftp.ethz.ch/uqlab_doc_pdf/2.1.0/UserManual_Model.pdf), Section 2.1.4. + +The model can now be evaluated for one or more sets of input parameters. For example, the three-dimensional Euler-Bernoulli beam model with parameter space [1.00 ,1.05]^3 can be evaluated at two parameter sets as follows: + +```matlab +X = [1.00, 1.00, 1.01; ... + 1.04, 1.01, 1.05]; +Y = uq_evalModel(EulerBernoulliBeamModel, X); +``` + +Each row of `X` and `Y` correspond to one set of input parameters. +In general, let `N` denote the number of sample sets, and let `N_in` and `N_out` denote the input and output dimension of the model, respectively. +Then `X` has dimension `N x N_in`, and `Y` has dimension `N x N_out`. + +The UQLab model object can be used further for all types of UQ analyses, as explained in detail in the [UQLab documentation](https://www.uqlab.com/documentation). + +[Full example sources here.](https://github.com/UM-Bridge/umbridge/blob/main/clients/matlab/uqlabClient.m) From ddba1dd9b2861915c15a97f952f71700b211aca1 Mon Sep 17 00:00:00 2001 From: monabraeunig <138789374+monabraeunig@users.noreply.github.com> Date: Thu, 10 Oct 2024 10:56:48 +0200 Subject: [PATCH 2/3] Create uqlabClient.m Added the UQLab client example --- clients/matlab/uqlabClient.m | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 clients/matlab/uqlabClient.m diff --git a/clients/matlab/uqlabClient.m b/clients/matlab/uqlabClient.m new file mode 100644 index 00000000..022ace78 --- /dev/null +++ b/clients/matlab/uqlabClient.m @@ -0,0 +1,20 @@ +%% Using the UQLab client together with UM-Bridge + +addpath(fullfile('\YOUR\FULL\PATH\TO\UMBRIDGE\INSTALLATION', 'matlab')) % modify with the correct path +model = HTTPModel('http://localhost:4243', 'forward'); + +% The following lines create the corresponding UQLab model object: +ModelOpts.mHandle = @(X) model.evaluate(X); +EulerBernoulliBeamModel = uq_createModel(ModelOpts); + +% Additional parameters can also be passed to the model, see the UQLab User +% Manual: The Model Module, Section 2.1.4 +% (https://uqftp.ethz.ch/uqlab_doc_pdf/2.1.0/UserManual_Model.pdf). + +% The model can now be evaluated for one or more sets of input parameters. +% For example, the three-dimensional Euler-Bernoulli beam model with +% parameter space [1.00 ,1.05]^3 can be evaluated at two parameter sets as +% follows: +X = [1.00, 1.00, 1.01; ... + 1.04, 1.01, 1.05]; +Y = uq_evalModel(EulerBernoulliBeamModel, X); From d963c27c118bcae700fdca72f703814ebd05335d Mon Sep 17 00:00:00 2001 From: monabraeunig <138789374+monabraeunig@users.noreply.github.com> Date: Thu, 10 Oct 2024 12:45:26 +0200 Subject: [PATCH 3/3] Update README.md --- clients/README.md | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/clients/README.md b/clients/README.md index bbc80ace..db15f8b8 100644 --- a/clients/README.md +++ b/clients/README.md @@ -567,19 +567,13 @@ which indeed returns `Ev = 2.9948`, i.e., close to 3 as expected. The script the UQLab is a general purpose Uncertainty Quantification framework based on Matlab. It is made of open-source scientific modules which are smoothly connected to perform uncertainty quantification through Monte Carlo simulation, sensitivity analysis, reliability analysis (computation of rare event probabilities), surrogate models (polynomial chaos expansions, Kriging, etc.), Bayesian inversion/calibration and many more. -UQLab fully supports UM-Bridge models. After registering at `https://www.uqlab.com/`, downloading and installing UQLab as indicated on the UQLab website, you can start UQLab using +UQLab fully supports UM-Bridge models. After registering at [UQLab](https://www.uqlab.com/), downloading and installing UQLab as indicated on the UQLab website, you can start UQLab using ``` uqlab ``` -To run an UM-Bridge model, install Docker Desktop and start a docker model, e.g., the [Euler-Bernoulli beam model](https://um-bridge-benchmarks.readthedocs.io/en/docs/forward-benchmarks/muq-beam-propagation.html), using the terminal command - -``` ->> docker run -it -p 4243:4243 linusseelinger/benchmark-muq-beam-propagation:latest -``` - -Add UM-Bridge to your Matlab path and create an UM-Bridge model as in the section ["Matlab client"](https://um-bridge-benchmarks.readthedocs.io/en/docs/umbridge/clients.html#matlab-client) above: +Add UM-Bridge to your Matlab path and create an UM-Bridge model as in the section [Matlab client](https://um-bridge-benchmarks.readthedocs.io/en/docs/umbridge/clients.html#matlab-client) above: ```matlab addpath(fullfile('\YOUR\FULL\PATH\TO\UMBRIDGE\INSTALLATION', 'matlab')) % modify with the correct path @@ -609,4 +603,4 @@ Then `X` has dimension `N x N_in`, and `Y` has dimension `N x N_out`. The UQLab model object can be used further for all types of UQ analyses, as explained in detail in the [UQLab documentation](https://www.uqlab.com/documentation). -[Full example sources here.](https://github.com/UM-Bridge/umbridge/blob/main/clients/matlab/uqlabClient.m) +[Full example sources here.](https://github.com/UM-Bridge/umbridge/blob/UQLab/clients/matlab/uqlabClient.m)