2. Monte Carlo simulation with Code_Aster#

In the context of Monte Carlo simulation, uncertainty modeling involves the generation of random variables and possibly stochastic processes. In what follows, it is assumed that the user has chosen laws that well characterize the \(m\) uncertain parameters. To do this, we can use test results, expert judgment or the principle of maximum entropy (see [R4.03.05]). Very often, it can be assumed that the various sources of uncertainty are independent. We can then perform random draws according to the \(m\) marginal laws of random variables. In some cases, we can also include more complex quantities (non-scalar) such as random matrices or stochastic processes.

We also speak of an experimental design to refer to the drawing method and the resulting sample. In Code_Aster, Monte Carlo simulation according to an experimental design is possible using the distributed calculations option [U2.08.07].

2.1. Realization of the experience plan#

All methods whose draws are independent can be implemented via the distribution of calculations with*Code_Aster*. In particular, we can use random draws using the Latin hypercube method (Latin Hypercube Sampling — LHS) or the almost Monte Carlo method (quasirandom sequences like the Sobol suite,…) [bib4, bib5].

  • Random variables: uncertainties in the parameters of the finite element model (material parameters, values of a set, elastic stop stiffness, Young’s modulus, etc.).

  • Random matrices: In structural dynamics on a modal basis, random variables can be the values of the generalized mass, stiffness, and damping matrices of the finite element model. In this approach, we draw these random matrices using the GENE_MATR_ALEA [U4.36.06] operator. In this approach, both model and modeling uncertainties are modelled using a probabilistic approach called « non-parametric ».

  • Random excitations: the GENE_FONC_ALEA operator makes it possible to generate stationary random signals from the power spectral density. The operator GENE_ACCE_SEISME makes it possible to generate seismic signals that are not stationary in amplitude and in frequency content. In other cases, it is possible to have a database containing signals that model a random physical phenomenon. This may be the case in seismic analysis where a set of accelerograms measured in situ can be provided by seismologists.

There are two possibilities for carrying out the experimental design: 1) either we create the sample of the sets of parameters beforehand according to the desired drawing method and we store it in a data file, for this we can use a dedicated software such as Open TURNS or even the dedicated toolboxes of Python and Matlab2) or we use one of the Code_Aster operators to generate a realization of a stochastic process or a random matrix. In the case of a dynamic transient calculation, it is thus possible to use random time loads generated by the Code_Aster. Of course, both options can be used together.

Note: If, as part of a seismic analysis, we have a sample of \(\mathit{Ns}\) accelerograms, we can reduce ourselves, for the design of the experiment, to a discrete random variable taking values from \(1\) to \(\mathit{Ns}\). Each integer designates one of the achievements of the random process (i.e. an accelerogram). The drawing by Hypercube Latin then consists in going through the integers from \(1\) to \(\mathit{Ns}\).

**Warning: The commands* GENE_MATR_ALEA and GENE_FONC_ALEA generate the same sequence of random variables within the same Code_Aster execution. Thus, from one execution to the next, a command file that is exactly the same (same command calls in the same order with the same arguments) will provide exactly the same results. This is because the random variable generator used by Code_Aster is always initialized to the same value. If you want to generate different results from one execution to another, then you have to use the keyword INIT_ALEA. In contrast, GENE_ACCE_SEISME generates random independent seismic signals.

2.2. Definition and launch of distributed studies with Code_Aster#

In the astk window, you need to:

For more details, you can consult the tutorial [U2.08.07].

2.3. Retrieve calculation results in a file#

The results of the calculations distributed with Code_Aster are written in output files found in the \(\mathit{Ns}\) directories named \({\mathit{CALC}}_{i}\) , \(i\mathrm{=}\mathrm{1,}\mathit{Ns}\) (cf. [U2.08.07]). In order to proceed with post-processing by statistical software (such as Open TURNS or even the dedicated toolboxes of Python and Matlab, R), it is necessary to gather the sample of outputs in a single results file. This can be done very easily via a Python script.