RELIABILITY: ADVANCED ACTIVE LEARNING ON THE TWO-DIMENSIONAL HAT FUNCTION¶

In this example, it is shown how advanced options of active learning reliability can be set. Three cases are illustrated, each relating to a specific aspect of the framework:

  • Enrichment and convergence criteria
  • Surrogate model options
  • Reliability algorithms options

Package imports¶

In [1]:
from uqpylab import sessions

Start a remote UQCloud session¶

In [2]:
# Start the session
mySession = sessions.cloud()
# (Optional) Get a convenient handle to the command line interface
uq = mySession.cli
# Reset the session
mySession.reset()
Processing .
.
 done!

 uqpylab.sessions :: INFO     :: This is UQ[py]Lab, version 1.00, running on https://uqcloud.ethz.ch. 
                                 UQ[py]Lab is free software, published under the open source BSD 3-clause license.
                                 To request special permissions, please contact:
                                  - Stefano Marelli (marelli@ibk.baug.ethz.ch).
                                 A new session (7ee2d780742446bc92e8588cc4b6e61a) started.
 uqpylab.sessions :: INFO     :: Reset successful.

Set the random seed for reproducibility¶

In [3]:
uq.rng(10,'twister');

COMPUTATIONAL MODEL¶

The two-dimensional hat function is defined as follows:

$$g(x_1, x_2) = 20 - (x_1 - x_2)^2 - 8 (x_1 + x_2 - 4)^3$$

Create a limit state function model based on the hat function using a string, written below in a vectorized operation:

In [4]:
ModelOpts = { 
    'Type': 'Model', 
    'mString': '20 - (X(:,1)-X(:,2)).^2 - 8*(X(:,1)+X(:,2)-4).^3',
    'isVectorized': 1
}

myModel = uq.createModel(ModelOpts)

PROBABILISTIC INPUT MODEL¶

The probabilistic input model consists of two independent and identically-distributed Gaussian random variables:

$$X_i \sim \mathcal{N}(0.25, 1), \quad i = 1, 2$$

Specify the marginals of the two input random variables:

In [5]:
InputOpts = {
    "Marginals": [
        {"Name": "X1",               
         "Type": "Gaussian",
         "Parameters": [0.25, 1]
        },
        {"Name": "X2",
         "Type": "Gaussian",
         "Parameters": [0.25, 1]
        }
    ]
}

Create the INPUT object based on the specified marginals:

In [6]:
myInput = uq.createInput(InputOpts)

STRUCTURAL RELIABILITY¶

Failure event is defined as $g(\mathbf{x}) \leq 0$. The failure probability is then defined as $P_f = P[g(\mathbf{x})\leq 0]$.

Three reliability analyses are performed and in each instance, a specific aspect of the framework is finely tuned.

Select the Reliability module and the active learning method:

In [7]:
ALROptions = {
    "Type": "Reliability",
    "Method": "ALR"
}

Enrichment and convergence options¶

Specify the number of enrichment points per iteration

In [8]:
ALROptions["ALR"] = {"NumOfPoints": 2}

Specify options related to convergence

Here we combine two stopping criteria, i.e., the algorithm will stop only when the two conditions are satisfied

In [9]:
ALROptions["ALR"]["Convergence"] = ["StopBetaBound", "StopBetaStab"]

Specify the convergence threshold for each of the stopping criteria

In [10]:
ALROptions["ALR"]["ConvThres"] =  [[0.01, 0.05]]

Specify the maximum number of enrichment points

In [11]:
ALROptions["ALR"]["MaxAddedED"] = 20

Run the active learning reliability analysis

In [12]:
myALRAnalysis = uq.createAnalysis(ALROptions)
Processing .
.
.
. done!

Print out a report of the results

In [13]:
uq.print(myALRAnalysis)
---------------------------------------------------
Active learning reliability
---------------------------------------------------
Pf               4.3967e-04       
Beta             3.3265           
CoV              0.0229           
ModelEvaluations 16               
PfCI             [4.1990e-04 4.5945e-04]
BetaCI           [3.3142e+00 3.3393e+00]
PfMinus/Plus     [4.3967e-04 4.3967e-04]
---------------------------------------------------


Visualize the results of the analysis

In [14]:
uq.display(myALRAnalysis);