SENSITIVITY ANALYSIS: DEPENDENT INPUT VARIABLES¶
In this example, the Kucherenko and ANCOVA sensitivity indices are computed and compared for the <https://www.sfu.ca/~ssurjano/shortcol short column function> with correlated input parameters.
Package imports¶
from uqpylab import sessions
Start a remote UQCloud session¶
# 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 (1f52785b95f645d0a8e9246e4ee21980) started.
uqpylab.sessions :: INFO :: Reset successful.
Set the random seed for reproducibility¶
uq.rng(101,'twister');
2 - COMPUTATIONAL MODEL¶
The short-column function is an analytical 3-dimensional function that models the limit state of a short steel column with a rectangular cross-section, subjected to a bending moment and an axial force. The short column function |uq_shortcol| is supplied with UQpyLab.
Create a MODEL object from the function file:
ModelOpts = {
'Type': 'Model',
'ModelFun': 'shortcol.model',
}
myModel = uq.createModel(ModelOpts)
3 - PROBABILISTIC INPUT MODEL¶
The probabilistic input model consists of three random variables with the following marginals:
Variable | Description | Distribution | Mean | Std. deviation |
---|---|---|---|---|
Y | Yield stress | Lognormal | 5 MPa | 0.5 MPa |
M | Bending moment | Gaussian | 2000 N.mm | 400 N.mm |
P | Axial force | Gaussian | 500 N | 100 N |
Define the marginal distributions of the input model:
InputOpts = {
'Marginals': [
{
'Name': 'Y', # yield stress
'Type': 'Lognormal',
'Moments': [5, 0.5] # (MPa)
},
{
'Name': 'M', # bending moment
'Type': 'Gaussian',
'Moments': [2000, 400] # (N.mm)
},
{
'Name': 'P', # axial force
'Type': 'Gaussian',
'Moments': [500, 100] # (N)
}]
}
The parameters $P$ and $M$ are assumed to be correlated under Gaussian copula with a rank correlation of 0.72.
Define the Gaussian copula and its parameters:
InputOpts['Copula'] = {
'Type': 'Gaussian',
'RankCorr': [[1, 0, 0], [0, 1, 0.72], [0, 0.72, 1]]
}
Create an INPUT object based on the specified marginals and copula:
myInput = uq.createInput(InputOpts)
Show the correlated input:
uq.display(myInput);
KucherenkoOpts = {
'Type': 'Sensitivity',
'Method': 'Kucherenko'
}
Specify the sample size for the analysis:
KucherenkoOpts['Kucherenko'] = {'SampleSize': 5e4}
Note that the resulting cost depends on the estimator. The default estimator is the Modified estimator with a total computational cost of $(2M+2) \times N$, where $M$ is the input dimension and $N$ is the sample size.
Therefore, the total cost for the current setup is $(2 \cdot 3 + 2) \times 5 \cdot 10^4 = 4 \times 10^5$ evaluations of the full computational model.
Run the Kucherenko analysis:
myKucherenkoAnalysis = uq.createAnalysis(KucherenkoOpts)
Processing .
done! uqpylab.sessions :: INFO :: Received intermediate compute request, function: shortcol.model.
uqpylab.sessions :: INFO :: Carrying out local computation...
uqpylab.sessions :: INFO :: Local computation complete.
uqpylab.sessions :: INFO :: Starting transmission of intermediate compute results ((100000,))...
uqpylab.sessions :: INFO :: Intermediate compute results sent.
uqpylab.sessions :: INFO :: Received intermediate compute request, function: shortcol.model.
uqpylab.sessions :: INFO :: Carrying out local computation...
uqpylab.sessions :: INFO :: Local computation complete.
uqpylab.sessions :: INFO :: Starting transmission of intermediate compute results ((100000,))...
uqpylab.sessions :: INFO :: Intermediate compute results sent.
uqpylab.sessions :: INFO :: Received intermediate compute request, function: shortcol.model.
uqpylab.sessions :: INFO :: Carrying out local computation...
uqpylab.sessions :: INFO :: Local computation complete.
uqpylab.sessions :: INFO :: Starting transmission of intermediate compute results ((100000,))...
uqpylab.sessions :: INFO :: Intermediate compute results sent.
uqpylab.sessions :: INFO :: Received intermediate compute request, function: shortcol.model.
uqpylab.sessions :: INFO :: Carrying out local computation...
uqpylab.sessions :: INFO :: Local computation complete.
uqpylab.sessions :: INFO :: Starting transmission of intermediate compute results ((100000,))...
uqpylab.sessions :: INFO :: Intermediate compute results sent.
4.2 ANCOVA indices¶
Select the sensitivity tool in UQLab and the ANCOVA analysis method:
ANCOVAOpts = {
'Type': 'Sensitivity',
'Method': 'ANCOVA'
}
Specify the sample size for the analysis (the sample will be used to construct a PCE model):
ANCOVAOpts['ANCOVA'] = {'SampleSize': 150}
Run the ANCOVA sensitivity analysis:
myANCOVAAnalysis = uq.createAnalysis(ANCOVAOpts)
uqpylab.sessions :: INFO :: Received intermediate compute request, function: shortcol.model.
uqpylab.sessions :: INFO :: Carrying out local computation...
uqpylab.sessions :: INFO :: Local computation complete.
uqpylab.sessions :: INFO :: Starting transmission of intermediate compute results ((150,))...
uqpylab.sessions :: INFO :: Intermediate compute results sent.
5 - RESULTS¶
Print out a report on the Kucherenko analysis:
uq.print(myKucherenkoAnalysis)
-------------------------------------------------- Total Kucherenko indices for output component 1 -------------------------------------------------- Y M P 0.248495 0.030790 0.211492 -------------------------------------------------- -------------------------------------------------- First Order Kucherenko indices for output component 1 -------------------------------------------------- Y M P 0.221721 0.551340 0.720783 -------------------------------------------------- Total cost (model evaluations): 400000
Display a graphical representation of the analysis:
uq.display(myKucherenkoAnalysis);
Print out a report on the ANCOVA analysis:
uq.print(myANCOVAAnalysis)
-------------------------------------------------- ANCOVA indices for output component 1 -------------------------------------------------- Indices Y M P S 0.220 0.190 0.564 S^U 0.220 0.065 0.439 S^I 0.001 0.000 0.001 S^C -0.001 0.124 0.124 -------------------------------------------------- Total cost (model evaluations): 150
Display a graphical representation of the analysis:
uq.display(myANCOVAAnalysis);
Terminate the remote UQCloud session¶
mySession.quit()
uqpylab.sessions :: INFO :: Session 1f52785b95f645d0a8e9246e4ee21980 terminated.
True