Reliabaility analysis with PCE:How to call the Matlab model and defined the implicit performance function

Hi, everybody. I am new to UQlab and trying to find a solution to my problem. I want to use the PCE module to call a FEM model (Matlab file) for reliability analysis. As I know, if there is no need to call other models, this reliability analysis is very easy to solve. As shown in Example,
" ModelOpts.mFile = ‘uq_SimplySupportedBeam’; (defined the implicit performance function)
ModelOpts.isVectorized = true;
myModel = uq_createModel(ModelOpts);"
However, take a truss structure as an example (uq_truss_model, provided by UQLAB), I want to use the PCE module to call this model and defined the limit state function (g(x) =Vmax-|v1(x)|) for reliability analysis.

Can someone please help me with this?
Best regards,
QZ

1 Like

Hi @Qiang_Zhang, welcome to UQWorld! :slight_smile:

To learn how to define a model in UQLab, have a look at this example and the UQLab model manual, specifically sections 2.2 and 2.1.1.

Do you want to define a uq_model for your FEM code or for the limit state function?

  • for the FEM model:
    Since your FEM model is written in Matlab, it should be quite straightforward to create a uq_model from it: Depending on the implementation of your model, you might need to create a wrapper function, e.g. Y = function my_FEM_model(X, P) that takes as arguments the input samples (where the model is to be evaluated) and possibly some parameters. Inside the wrapper, you evaluate your FEM model and finally return the quantity of interest in Y. This is actually quite analogous to the implementation of the Ishigami model using an m-file (have a look at uq_ishigami.m and this example).
  • for the limit state function:
    Similar to above, you need to create a wrapper function that takes as argument the input samples and computes the corresponding values of the limit state function (using the FEM model and the definition of the limit state function). Then you can create a model from this m-file as in the UQLab model manual, section 2.1.1.

One question, you mentioned that you want to use the PCE module, why is that? Do you need to compute a surrogate model before doing the reliability analysis?

I hope this helps! Let us know whether it works out!


(Just for completeness: For more complicated models using third-party software, UQLab has the UQLink module, but it sounds like this not needed in your case.)

2 Likes

Hi @Qiang_Zhang,

By the way, if your main goal is to conduct a reliability analysis using a metamodel, to complement @nluethen’s suggestion above, you might also want to consider using the metamodel-based method for reliability analysis in UQLab. The metamodel used is not, strictly speaking, a PCE but may still suit your purpose. You do need to define a computational model in UQLab first per answer above.

Have a look at Section 1.6 and the corresponding usage section of the Reliability analysis user manual. There is also an example here (have a look at Section 4.5).

Hi! Thank you very much. But this example is very sample. I want to call the finite element model (uq_truss_model) and define the limit state function for reliability analysis. Can you give me an example? The above response to Dr. Nora’s example. @nluethen
Thank you very much.
Best wishes,
QZ

Dear Qiang_Zhang

If you want to use a third party code such as a finite element code, you should use the UQLink module of UQLab (see manual here). It allows you to link easily your external code with UQLab.
The UQLink module comes with several examples including one with Abaqus and one with OpenSees. With these examples, you should be able to solve your own problem.
Best regards
Bruno

Hi @Qiang_Zhang,

In response to your earlier questions:
The purpose of UQLab is to analyze computational models. (Almost) everything in UQLab is based on models. Therefore, the first step is usually to construct the computational model in UQLab (and the corresponding probabilistic input). Here is an example how to do that: https://www.uqlab.com/model-parameters For your case, the implementation using an m-file is probably the most relevant. If you already have an m-file that implements the computational model in a way compatible with UQLab (i.e., a function that takes as arguments row-wise input and optionally some parameters, and returns the corresponding QOI), in your case uq_truss_response.m, the implementation is really analogous to the one of the Ishigami function in the example I linked above. This m-file is what I called “wrapper function” in my earlier post.

Once you have your computational model, you can e.g. construct a metamodel using PCE as in https://www.uqlab.com/pce-calculation-strategies.

Or, if you want to perform reliability analysis, you need to define another UQLab model object that represents the limit state function. For this, you have to implement a Matlab function (an m-file) which for a given input evaluates the limit state function (using the definition of the limit state function, and evaluating your computational model). Then you can create a uq_model from the m-file using the same procedure as described above.

I hope this helps, good luck!

1 Like

Thank you very much. I‘m using this method for reliability analysis. But, when it comes to evaluate the full model on the current experimental design(uq_evalModel(myModel,X_ED)), program error “Experimental design dimension error : size(X,1) = 50 ,size(Y,1) = 1”. I’m very puzzled, it should be calculable normally. And I can’t figure out why. @nluethen
Can you help me? This is my model. (function,PCE model) Truss.m (1.8 KB) uq_Example_PCE_XujunTruss.m (6.4 KB)
Thank you very much.uq_XujunTruss.m (809 Bytes)


Hi…@nluethen
I think I already know where my problem is… but, I still need your help.
The problem is my limit state function. I wrote to him in this form before:
“V = 0.11+Truss(X(:,1),X(:,2),X(:,3),X(:,4),X(:,5),X(:,6),X(:,7),X(:,8),X(:,9),X(:,10));”
but you know, X(:,1)…X(:,10) is a multi-data sample, 0.11 is a constant value. So, "program error “Experimental design dimension error : size(X,1) = 50 ,size(Y,1) = 1”.! And I change in this form,
V = repmat(0.11,1,50)’+Truss(X(:,1),X(:,2),X(:,3),X(:,4),X(:,5),X(:,6),X(:,7),X(:,8),X(:,9),X(:,10).
Calculations can proceed normally, however, but cannot run the loop. can you tell me how to define this constant value to calculate the loop?
Thank you very much!

Best Regards,
QZ

A post was split to a new topic: Calculate Skewness and Kurtosis of a Limit State Function with PCE

Great that you were able to figure it out! What dimension does the output of the Truss-function have? UQLab assumes that the data points in the experimental design matrix X are arranged in rows, i.e. each row is one data point. Correspondingly, it expects the output to be a column vector. Is this fulfilled for your function Truss(...)? Also, you should probably not assume that you always have 50 design points, but infer the number of design points from the X-matrix.

Regarding your comment:

It is not clear to me which part of your code is not working. Can you evaluate the limit state function, and is the output correct? Which loop is not working?


For completeness, even though I think it is not necessary here, there is also the option of switching off the vectorization (so that UQLab will evaluate your model one row of X at a time) using
modelopts.isVectorized = false;
(See UQLab model manual)
This is useful e.g. in the case that your Truss-function is not able to handle vectorized input.