Cantilever Beam (Uncertainty Quantification)

From COSSAN Wiki
Jump to: navigation, search

This page shows how to perform Uncertainty Quantification of the Cantilever Beam with COSSAN-X.

Problem Definition in COSSAN-X

Define a Project

In the first step a new project named 'Cantilever_beam' is created: This can be done by pressing the 'new' icon, or from the menu File->New->Project.

Create-project.png


After the project has been created, the project name 'Cantilever_beam' appears in the workspace. All the subfolders are empty

250

Input

Parameters


In the next step, the constant input parameters, i.e. the length L and the width b are specified. Clicking with the right button at the folder 'parameter' and selecting 'Add parameter' the following wizard appear on the screen (see also Parameter (wizard)):


Parameter.png

After pressing finish, a Parameter object is created and it properties can edited (see also Parameter (editor)):


Parameter-length.png

The same procedure is repeated to define the parameter b. Then, the length L and the width b are specified as parameters with COSSAN-X.


Parameter-end.png

To save a created parameter, simply click the 'ctrl' and the 's' key simultaneously.

Random Variables

In the next step, a probability distribution is associated to each uncertain quantity, i.e. the height h, the tip load P, the density \rho and the Young's modulus E.

To define new random variables, right click on the sub-folder "Random Variables" and select "Add Random Variable". Then, the following input mask will pop up, which allows you to define the name and a description of the uncertain quantity:


Create rv.png

After pressing "Finish"  the editor for Random Variable appears, where the distribution type can be selected from a list. In the following, the "Normal" distribution has been selected for the variable height h, and the mean of 0.24 and standard deviation of 0.01 have been inserted.


Rv h.png

After all parameters of the distribution have been specified, the preview of the PDF and CDF of the random variable is shown. (It is necessary to save the data of the Random Variable by either pressing "Ctrl s" or pressing the save icon).

This procedure is repeated for all uncertain parameters. For instance, the follow figure shows the definition of the Young's Module:


Eeditor.png


Then an overview over all defined random variables are shown in the bottom part of the central window of the GUI:


RVsummary.png

Random Variable Set

Next, at least one or more Random Variable Sets need to be specified. Random Variable sets allow users to define correlations between Random Variable. Please note that it is NOT necessary to define a Random Variable Set for the random variables that are independent or uncorrelated. In this simple case, one single set "rvset1" suffices.

To create a random variable set, right click on the sub-folder "Random Variable Sets" and select "Add Random Variables Set" (see also Random Variables Set (wizard). Then the following wizard pops up, where the name of the set can be modified:


RVSet.png


After pressing Finish, the editor for Random Variable Set will open, as shown below. In this case all four random variables are inserted into the set. The GUI supports "drag and drop". Hence, the list is filled by simply drag all icons in the workspace to the window in the right.


Create rv set1.png


Without pressing at the button "Correlations", all random variable in the set are assumed to be uncorrelated. In this case, the uncertainty in the tip load P and the height are obviously independent. However, the elasticity module E for wood is strongly correlated with the density. In this case, a correlation coefficient of 0.8 has been selected. Note that zero correlations can be left blank.


Rvset1 corr.png


This completes the input in the sub-folder "Random Variable Sets".

Functions

Functions of constant parameters and of random variables are very powerful and useful for many cases. In this simple case, however, the response quantitiy could be computed without using any function. Hence, the sub-folder could be left empty.


Since the response (i.e. tip displacement w) is analytically known, it may also be defined as a function. However, for demonstration, only the moment of inertia will be computed by using functions while w will be computed independently by a matlab script.


In the following, a function for the moment of inertia I=bh^3/12 will be created.

Analogously to create parameters and random variables, each function is created by right clicking the sub-folder "Function".


Add function.png


The pop up window allows to create a new function where the name and description can be edited. We use the name "I" and the description "moment of inertia".


Create function I.png


After pressing finish, the editor for Function is open. Note that all previously defined names can be used within the function. Each name must be enclosed by <& &> as demonstrated below.

The function definition is:

 <&b&>.*<&h&>.^3/12 

as shown in the following picture.


Function I.png

Evaluator

An evaluator is used in a definition of a model. If a model could be seen as a black box that returns output values given the input values, an evaluator is actually the content of such a black box. Thus, an evaluator is a low-level definition of the functional relation between the inputs and outputs of a model.

See also Category:Evaluators

Matlab script

A Matlab script (also called MIO "Matlab Input Output") is used to calculate the quantity of interest. The new Matlab script is created using the wizard. To create a new Matlab script the following path must be followed:

Evaluators => Matlab Files => Right click => Add Matlab Script
MioWizard.png

Then the Matlab script editor will appear. First at all it is necessary to define the Input factors required to compute the beam displacement. In this examples all the defined inputs are required. Hence, pressing the plus button in Input windows of the Matlab script it is possible to add all the required inputs. Then, it is necessary to define a name of the computed quantity. The displacement is identified by the letter w.

MioEditorMetadata.png

In order to edit the script, please select the tab script from the Matlab script editor (indicated by the red arrow in the above picture). The displacement of the Beam is calculated by means of the following Matlab script:

Toutput(n).w=(Tinput(n).rho*9.81*Tinput(n).b*Tinput(n).h*Tinput(n).L^4)/(8*Tinput(n).E*Tinput(n).I) + ...
(Tinput(n).P*Tinput(n).L^3)/(3*Tinput(n).E*Tinput(n).I); 

The above script can be copy and paste inside the for loop as shown in the figure at the right:

MioEditorScript.png


In this example Matlab structures are used to interact with the Engine. For more information about the Matlab script please refer to the following page: Mio (editor)

Performance Function

The Performance function is used to define the domain of definition of the model into two sets, the safe set and the failure set. For more information see Performance function definition.

Model

To investigate the effect of uncertainties in the input to the response, it is necessary to define a model. As shown in the following three options are available. The first option "Physical Model" allows to generate independent samples by various methods to assess the variability (scatter) of the response. The second option "Optimization Models" is selected in case the response should be optimized in same sense. The third option "Probabilistic Models" is dedicated to reliability analysis. The "(0)" at end of the three options, indicate that none of the options have been established.
Model2.png

Physical Model

In a first step the most basic option "Physical Model" is selected by moving the mouse pointer to "Physical Model" and clicking the right mouse button and selecting "Add Physical Model":


Select physical.png

A wizard pops up showing default names which can be modified. In the following the default values are accepted by pressing the 'Finish' button.


Name physical.png

Then, the editor appears, in which Evaluators and the Random Variable Sets can be added. The error message in red at the top indicate that the input is at the present state insufficient to perform an simulation analysis.


Define physical.png

Clicking at the '+' of the evaluator (top left , the following window pops up, showing the available options. In this example, only the option "DisplacementBeam" is available and selected by pressing 'OK'.


Specify Evaluator.png

Then the input and output associated with the evaluator are shown at the right in the windows 'Inputs' and 'Outputs' as shown in the following:


IO evaluator.png

Saving the object, the error message on the top disapper and the Model is ready to be analyzed. However, it is necessary to add also the Random Variable set in order to consider correlation between the random variable. 

In case the random variable set is not specified, the random variables required to evaluate the model are added automatically to an uncorrelated Random Variable set named "uncorrelated_rvs". 

Next, all required Random Variable Sets need to be specified. Pressing at the '+' button of the Random Variable Sets, the available sets are shown:


Specify RVSet.png

After Pressing the 'OK' button, all required data is specified. Note that the warnings in red have now disappeared.


Completed physical.png


Uncertainty Quantification Analysis

After saving the data, the simulation is ready to start.
Different simulations can be started by pressing at the small white triangle within a green circle at top right.
Start analysis.png

Run the Analysis


The next window allows to choose among different analysis types such as: 'Design of Experiments', 'Sensitivity Analysis', 'Uncertainty Quantification'  and 'Userdefined Analysis'. In this tutorial 'Uncertainty Quantification' is selected.


Type of analysis.png

After pressing 'Next' the following page appears and the method simulation is selected:


UQbeam.png

After pressing 'Next' in the above window, various options for simulation are provided. The well known Monte Carlo sampling procedure is selected. At the right, the number of independent samples can be declared. It is possible to split the computation into several batches which might be processed by different computers using parallel computing.

Bulbgraph.png It is recommended to keep the number of sample per simulation smaller than 10000
The computational performance degradate with the increase of the batch size


In this simple example with little computational effort, only a single batch is used. Choosing a zero maximum runtime, means that no limit for the runtime is given.


Simulation method.png

Pressing Next it is possible to specify the Grid Settings (i.e. how to perform the analysis). In this example the analysis will be performed on the local machine and it is not necessary to change the default values in the mask. 


GridSetting.png

The actual computations starts after pressing the 'Finish' button. Then, the the following window appears.


Running MCSimulation.png

When completed, a message of successful completion is provided:


Successful completion.png

Show the Results

All results are accessible in the section "Analysis". The results are stored in sub-folders according to the performed analysis. In the present case only Uncertainty Quantification has been performed. This can be recognized by the value '(1)' in the folder 'Uncertainty Quantification'

ResultTypes.png

For more information about the structure of the results (outputs), please refer to the following page Category:Outputs.

Uncertainty Quantification

Expanding the folder 'Results' of the Uncertainty Quantification shows the following sub folders and all the involved variables defined in the input. Subfolders simu.png
In order to facilitate the visualization of the results the Perspectives 'Output view' can be selected. Alternatively, the 'Output view' can also be selected from the menu 'Window'>'Open Perspective'>'Output'. Output view.png


Scatter Plots

The following shows the 'Scatter View' and the 'Parallel Coordinates' view:


Scatter view.png

To visualize all 1000 realizations of the density rho and the Youngs modulus E, the variables can be selected using the mouse, and drags to the 'Scatter View':


Drag rho E.png

This leads to the following:


Scatter rho E.png

A scatter of the load P and the tip displacement w_out is shown in the following scatter plot:


Scatter P w out.png



Parallel Coordinates

The 'Parallel Coordinates View' allows to show correlations between several variables:


Parallel Coord 1.png

Table View

Open a new table view, by clicking on the icon on the toolbar and then drag and drop the quantity of interest on the table. 

ResultsTable.png

Histogram

Open a new table view, by clicking on the icon on the toolbar and then drag and drop the quantity of interest on the Histogram view. 

ResultsIstogram.png

See Also