~ubuntu-branches/ubuntu/maverick/openturns/maverick

« back to all changes in this revision

Viewing changes to doc/src/ExamplesGuide/OpenTURNS_ExamplesGuide.tex

  • Committer: Bazaar Package Importer
  • Author(s): Christophe Prud'homme
  • Date: 2008-11-18 06:32:22 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20081118063222-pa0qncclrerrqkg2
Tags: 0.12.2-1
* New upstream release
* Bug fix: "New upstream release available (0.12.2)", thanks to Jerome
  Robert (Closes: #506005).
* Applied patch by J. Robert.
* debian/control: build-depends on libxml2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
%Copyright (c)  2005  EDF-EADS-PHIMECA.
 
3
%  Permission is granted to copy, distribute and/or modify this document
 
4
%  under the terms of the GNU Free Documentation License, Version 1.2
 
5
%  or any later version published by the Free Software Foundation;
 
6
%  with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
 
7
%  Texts.  A copy of the license is included in the section entitled "GNU
 
8
%  Free Documentation License".
 
9
 
 
10
\documentclass[11pt]{article}
 
11
\usepackage{makeidx}
 
12
\usepackage{index}
 
13
\usepackage[dvips]{graphicx}
 
14
\usepackage{color}
 
15
\usepackage{psfrag}
 
16
\usepackage{longtable}
 
17
\usepackage{mdwtab}
 
18
\usepackage{hhline}
 
19
\usepackage{amsmath}
 
20
\usepackage{amssymb}
 
21
\usepackage{fancyhdr}
 
22
 
 
23
 
 
24
\usepackage{Math_Notations}
 
25
\usepackage{listings}
 
26
 
 
27
\newcommand{\espace}{{\strut\\}}
 
28
\newcommand{\D}{{\mathrm{d}}}
 
29
 
 
30
\newcommand{\requirements}[2]{{
 
31
\noindent%
 
32
\begin{tabular}{||p{2.3cm}||p{12.7cm}||}
 
33
  \hhline{|t:=:t:=:t|} 
 
34
  Requirements\vfill & \parbox{12cm}{
 
35
                   {#1}
 
36
                 } \\
 
37
  \hhline{|:=::=:|}
 
38
  Results\vfill      & \parbox{12cm}{
 
39
                   {#2}
 
40
                 } \\
 
41
  \hhline{|b:=:b:=:b|}
 
42
\end{tabular}
 
43
}}
 
44
 
 
45
\newcommand{\longrequirements}[2]{{
 
46
\noindent%
 
47
\begin{longtable}{||p{2.3cm}||p{12.7cm}||}
 
48
  \hhline{|t:=:t:=:t|} 
 
49
  Requirements\vfill & \parbox{12cm}{
 
50
                   {#1}
 
51
                 } \\
 
52
  \hhline{|:=::=:|}
 
53
  Results\vfill      & \parbox{12cm}{
 
54
                   {#2}
 
55
                 } \\
 
56
  \hhline{|b:=:b:=:b|}
 
57
\end{longtable}
 
58
}}
 
59
 
 
60
\setlength{\textwidth}{18.5cm}
 
61
\setlength{\textheight}{23cm}
 
62
\setlength{\hoffset}{-1.04cm}
 
63
\setlength{\voffset}{-1.54cm}
 
64
\setlength{\oddsidemargin}{0cm}
 
65
\setlength{\evensidemargin}{0cm}
 
66
\setlength{\topmargin}{0cm}
 
67
\setlength{\headheight}{1cm}
 
68
\setlength{\headsep}{0.5cm}
 
69
\setlength{\marginparsep}{0cm}
 
70
\setlength{\marginparwidth}{0cm}
 
71
\setlength{\footskip}{1cm}
 
72
\setlength{\parindent}{0cm}
 
73
 
 
74
\pagestyle{fancy}
 
75
\fancyhf{} \rhead{\bfseries \thepage} \lhead{\bfseries \nouppercase Open TURNS -- Example Guide}
 
76
\rfoot{\bfseries \copyright 2005 EDF - EADS - PhiMeca} \lfoot{}
 
77
 
 
78
\makeindex
 
79
 
 
80
\begin{document}
 
81
 
 
82
\begin{titlepage}
 
83
\vspace*{2cm}
 
84
\begin{center}
 
85
{\huge \bf Examples Guide}
 
86
\input{GenericInformation.tex}
 
87
\end{center}
 
88
 
 
89
\end{titlepage}
 
90
 \newpage
 
91
\tableofcontents
 
92
 
 
93
 
 
94
% -------------------------------------------------------------------------------------------------
 
95
\newpage
 
96
\section{Example 1 : deviation of a cantilever beam}
 
97
 
 
98
\subsection{Presentation of the study case}
 
99
 
 
100
This Example Guide regroups several Use Cases described in the Use Cases Guide in order to show one example of a complete study. \\
 
101
 
 
102
This example has been presented in the ESREL 2007 conference in the paper : {\itshape Open TURNS, an Open source initiative to Treat Uncertainties, Risks'N Statistics in a structured industrial approach}, from A. Dutfoy(EDF R\&D), I. Dutka-Malen(EDF R\&D), R. Lebrun (EADS innovation Works) \& all.\\
 
103
 
 
104
Let's consider the following analytical example of a cantilever beam, of Young's modulus $E$, length $L$, section modulus $I$. One end is built in a wall and we apply a concentrated bending load at the other end of the beam. The deviation (vertical displacement) y of the free end is equal to : 
 
105
$$
 
106
y(E, F, L, I) = \frac{FL^3}{3EI}
 
107
$$
 
108
 
 
109
\begin{figure}[Hhbtp]
 
110
\begin{center}
 
111
  \psfrag{F}{F}
 
112
  \psfrag{E}{E}
 
113
  \psfrag{L}{L}
 
114
  \psfrag{I}{I}
 
115
  \psfrag{a}{a}
 
116
  \psfrag{e}{e}
 
117
  \includegraphics[width=10cm]{poutre.pdf}
 
118
\end{center}
 
119
\caption{cantilever beam under a ponctual bending load.}
 
120
\end{figure}
 
121
 
 
122
 
 
123
The objective of this study is to evaluate the influence of uncertainties of the input data $(E, F, L, I)$ on the deviation $y$.\\
 
124
 
 
125
We consider a steel beam with a hollow square section of length $a$ and of thickness $e$. Thus, the flexion section inertie of the beam is equal to $I = \displaystyle \frac{a^4 - (a-e)^4}{12}$. The beam length is $L$. The Young's modulus is $E$. The charge applied is $F$.\\
 
126
 
 
127
The  values used for the deterministic studies are : 
 
128
$$
 
129
\left\{
 
130
\begin{array}{lcl}
 
131
 E & = & 3.0e9 Pa\\
 
132
 F & = & 300 N\\
 
133
 L & = & 2.5m\\
 
134
 I & = & 4.0e-6 m^4.
 
135
\end{array}
 
136
\right.
 
137
$$
 
138
which corresponds to the point $(3.0e7, 30000, 250, 400)$ when the lenght $L$ is given in unit $cm$ et noo in the standard unit $m$.\\
 
139
 
 
140
 
 
141
This example treats the following points of the methodology : 
 
142
\begin{itemize}
 
143
  \item[$\bullet$] Min/Max approach : evaluation of the range of the output variable of interest (deviation)
 
144
\begin{itemize}
 
145
  \item with a deterministic experiment plane,
 
146
  \item with a random experiment plane,
 
147
\end{itemize}
 
148
  \item[$\bullet$] Central tendancy approach : evaluation of the central indicators of the output variable of interest (deviation)
 
149
\begin{itemize}
 
150
  \item Taylor variance decomposition,
 
151
  \item Random sampling,
 
152
  \item Kernel smoothing of the distribution of the output variable of interest,
 
153
\end{itemize}
 
154
  \item[$\bullet$] Threshold exceedance approach : evaluation of the probability that the output variable of interest (deviation) 30$\geq 30cm$
 
155
\begin{itemize}
 
156
  \item FORM,
 
157
\item Monte Carlo simulation method,
 
158
\item Directional Sampling method,
 
159
 \item Importance Sampling method.
 
160
\end{itemize}
 
161
\end{itemize}
 
162
 
 
163
 
 
164
\subsection{Probabilistic modelisation}
 
165
 
 
166
\subsubsection{Marginal distributions}
 
167
 
 
168
The random modelisation of the input data is the following one :  
 
169
\begin{itemize}
 
170
  \item[$\bullet$] E = Beta$(*)$ where $r = O.93,t = 3.2,a = 2.8e7,b = 4.8e7$,
 
171
  \item[$\bullet$] F  = LogNormal, where the mean value is $E[F] = 30000$, the standard deviation is $\sqrt{Var[F]} = 9000$ and the min value is $min(E) = 15000$,
 
172
  \item[$\bullet$] L  = Uniform on $[250; 260]$,
 
173
  \item[$\bullet$] I  = Beta$(*)$ where $r = 2.5,t = 4.0,a = 3.1e2,b = 4.5e2$.
 
174
\end{itemize}
 
175
(*) We recall here the expression of the probability density function of the Beta distribution : 
 
176
$$
 
177
\displaystyle  p(x) = \frac{(x-a)^{(r-1)}(b-x)^{(t-r-1)}}{(b-a)^{(t-1)}B(r,t-r)}\boldsymbol{1}_{[a,b]}(x)
 
178
$$
 
179
where $r>0$, $t>r$ and $a < b$.
 
180
 
 
181
 
 
182
 
 
183
\subsubsection{Dependence structure}
 
184
 
 
185
We suppose that the probabilstic variables $L$ and $I$ are dependent. This dependence may be explained by the manufacturing process of the beam : the thiner the beam has been laminated, the longer it is.\\
 
186
We modelise the dependence structure by a Normal copula, parameterized from the Spearman correlation coefficient of both correlated variables : $\rho_S = -0.2$.\\
 
187
Then, the Spearman correlation matrix of the input random vector $(E,F,L,I)$ is : 
 
188
$$
 
189
R_S = \left (
 
190
\begin{array}{cccc}
 
191
  1 & 0 & 0 & 0 \\
 
192
  0 & 1 & 0 & 0 \\
 
193
  0 & 0 & 1 & -0.2 \\
 
194
  0 & 0 & -0.2 & 1
 
195
\end{array}
 
196
\right)
 
197
$$
 
198
 
 
199
 
 
200
 
 
201
 
 
202
 
 
203
\subsection{Min/Max approach}
 
204
 
 
205
 
 
206
\subsubsection{Deterministic experiment plane}
 
207
 
 
208
We consider a composite experiment plane, where : 
 
209
\begin{itemize}
 
210
  \item the levels of the centered and reducted grid are +/-0.5, +/-1., +/-3.,
 
211
  \item the unit per dimension (scaling factor) is given by the standard deviation of the marginal distribution of the corresponding variable,
 
212
  \item the center is the mean point of the input random vector distribution.
 
213
\end{itemize}
 
214
 
 
215
 
 
216
 
 
217
\subsubsection{Random sampling}
 
218
 
 
219
We evaluate the range of the deviation from a random sample of size $10^4$.
 
220
 
 
221
 
 
222
 
 
223
\subsection{Central tendancy approach}
 
224
 
 
225
 
 
226
\subsubsection{Taylor variance decomposition}
 
227
 
 
228
We evaluate the mean and the standard deviation of the deviation thanks to the Taylor variance decomposition method. The importance factors of that method rank the influence of the input uncertainties on the mean of the deviation.
 
229
 
 
230
\subsubsection{Random sampling}
 
231
 
 
232
We evaluate the mean and standard deviation of the deviation from a random sample of size $10^4$.
 
233
 
 
234
\subsubsection{Kernel smoothing}
 
235
 
 
236
We fit the distribution of the deviation with a Normal kernel, which bandwith is evaluated from the Scott rule, from a random sample of size $10^4$.\\
 
237
We superpose then the kernel smoothing pdf and the normal one which mean and standard deviation are those of the random sample of the output variable of interest in order to graphically check if the Normal model fits to the deviation distribution.
 
238
 
 
239
\subsection{Threshold exceedance approach}
 
240
 
 
241
We consider the event where the deviation exceeds $30 cm$.\\
 
242
 
 
243
\subsubsection{FORM}
 
244
 
 
245
We use the Cobyla algorithm to research the design point, which requires no evaluation of the gradient of the limit state function. We parameterize the Cobyla algorithmwit hte following parameters : 
 
246
\begin{itemize}
 
247
  \item Maximum Iterations Number = $10^3$,
 
248
  \item Maximum Absolute Error = $10^{-10}$,
 
249
  \item Maximum Relative Error = $10^{-10}$,
 
250
  \item Maximum Residual Error = $10^{-10}$,
 
251
  \item Maximum Constraint Error = $10^{-10}$.
 
252
\end{itemize}
 
253
 
 
254
 
 
255
\subsubsection{Monte Carlo simulation method}
 
256
 
 
257
We evaluate the probability with the Monte Carlo method, parameterized as follows : 
 
258
\begin{itemize}
 
259
  \item Maximum Outer Sampling = $4\, 10^4$,
 
260
  \item Block Size = $10^2$,
 
261
  \item Maximum Coefficient of Variation = $10^{-1}$.
 
262
\end{itemize}
 
263
 
 
264
We evaluate the confidence interval of level $0.95$ and we draw the convergence graph of the Monte Carlo estimator with its confidence interval of level 0.90.
 
265
 
 
266
 
 
267
 
 
268
\subsubsection{Directional Sampling method}
 
269
 
 
270
We evaluate the probability with the Directional Sampling method, whith its default parameters : 
 
271
\begin{itemize}
 
272
  \item 'Slow and Safe' for the root strategy,
 
273
  \item 'Random direction' for the sampling strategy
 
274
\end{itemize}
 
275
 
 
276
 
 
277
We evaluate the confidence interval of level $0.95$ and we draw the convergence graph of the Directional Sampling  estimator with its confidence interval of level 0.90.
 
278
 
 
279
 
 
280
\subsubsection{Latin Hyper Cube Sampling method}
 
281
 
 
282
We evaluate the probability with the Latin Hyper Cube Sampling method with the same parameters as the Monte Carlo method and we draw the convergence graph of the LHS estimator with its confidence interval of level 0.90.
 
283
 
 
284
 
 
285
 
 
286
 
 
287
 
 
288
\subsubsection{Importance Sampling method}
 
289
 
 
290
 
 
291
We evaluate the probability with the Importance Sampling method in the standard sapce, with the same parameters as the Monte carlo method. The importance distribution is the normal one, centered on the standard design point and which standard deviation is 4. The importance sampling is performed in the standard sapce.\\
 
292
 
 
293
We fix the BlockSize is fixed to 1 and the MaximumOuterIteration to $4\, 10^4$.\\
 
294
 
 
295
We draw the convergence graph of the Importance Sampling  estimator with its confidence interval of level 0.90.
 
296
 
 
297
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
298
\subsection{The Python script}
 
299
 
 
300
 
 
301
\lstset{language=python, keywordstyle=\color{black}\bfseries,tabsize=2,framexleftmargin=8mm,frame=shadowbox,rulesepcolor=\color{black},numbers=left,breaklines=true}
 
302
\lstinputlisting{scriptExample_beam.py}
 
303
 
 
304
 
 
305
 
 
306
\subsection{Output of the Python script}
 
307
 
 
308
\lstinputlisting{resultatExampleBeam}
 
309
 
 
310
 
 
311
\subsection{Figures}
 
312
 
 
313
 
 
314
The probability density function (PDF) of each marginal is given in Figures \ref{pdfE} to \ref{pdfI}.
 
315
 
 
316
 
 
317
\begin{figure}[Hhbtp]
 
318
\begin{minipage}{9.8cm}
 
319
    \begin{center}
 
320
    \includegraphics[width=7cm]{distributionE_pdf.pdf} 
 
321
    \caption{Probability density function of the parameter E}
 
322
    \label{pdfE}
 
323
    \end{center}
 
324
\end{minipage}
 
325
\hfill
 
326
\begin{minipage}{9.8cm}
 
327
    \begin{center}
 
328
    \includegraphics[width=7cm]{distributionF_pdf.pdf} 
 
329
    \caption{Probability density function of the parameter F}
 
330
    \label{pdfF}
 
331
    \end{center}
 
332
\end{minipage}
 
333
\end{figure}
 
334
 
 
335
 
 
336
\begin{figure}[Hhbtp]
 
337
\begin{minipage}{9.8cm}
 
338
    \begin{center}
 
339
    \includegraphics[width=7cm]{distributionL_pdf.pdf} 
 
340
    \caption{PDFof the parameter L}
 
341
    \label{pdfL}
 
342
    \end{center}
 
343
\end{minipage}
 
344
\hfill
 
345
\begin{minipage}{9.8cm}
 
346
    \begin{center}
 
347
    \includegraphics[width=7cm]{distributionI_pdf.pdf} 
 
348
    \caption{PDF of the parameter I}
 
349
    \label{pdfI}
 
350
    \end{center}
 
351
\end{minipage}
 
352
\end{figure}
 
353
 
 
354
The probability density function (PDF) and the cumulative density function (CDF) of the deviation fiited with the kernel smoothing metid are drawn in Figures \ref{KernelSmoothing} and  \ref{KernelSmoothing2}.
 
355
 
 
356
 
 
357
 
 
358
\begin{figure}[Hhbtp]
 
359
\begin{minipage}{9.8cm}
 
360
    \begin{center}
 
361
    \includegraphics[width=7cm]{smoothedPDF.pdf}
 
362
    \caption{PDF of the deviation with the kernel smoothing method.}
 
363
    \label{KernelSmoothing}
 
364
    \end{center}
 
365
\end{minipage}
 
366
\hfill
 
367
\begin{minipage}{9.8cm}
 
368
    \begin{center}
 
369
    \includegraphics[width=7cm]{smoothedCDF.pdf}
 
370
    \caption{CDF of the deviation with the kernel smoothing method.}
 
371
    \label{KernelSmoothing2}
 
372
    \end{center}
 
373
\end{minipage}
 
374
\end{figure}
 
375
 
 
376
 
 
377
The superposition of the kernel smoothed density function and the normal fitted from the same sample with the maximum likelihood method is drawn in Figure \ref{superp}.
 
378
 
 
379
 
 
380
\begin{figure}[Hhbtp]
 
381
\begin{center}
 
382
    \includegraphics[width=9cm]{smoothedPDF_and_GaussianPDF.pdf}
 
383
\end{center} 
 
384
    \caption{Superposition of the kernel smoothed density function and the normal fitted from the same sample.}
 
385
    \label{superp}
 
386
\end{figure}
 
387
 
 
388
The importance factors from the FORM method are given in Figure \ref{FormIF}.
 
389
 
 
390
\begin{figure}[Hhbtp]
 
391
\begin{center}
 
392
    \includegraphics[width=9cm]{ImportanceFactorsDrawingFORM.pdf}
 
393
\end{center} 
 
394
    \caption{FORM importance factors of the event : deviation > 30 cm.}
 
395
    \label{FormIF}
 
396
\end{figure}
 
397
 
 
398
The convergence graphs of the simulation methods are given in Figures \ref{MCConvergence} to \ref{LHSConvergence}.
 
399
 
 
400
 
 
401
\begin{figure}[Hhbtp]
 
402
\begin{minipage}{9.8cm}
 
403
    \begin{center}
 
404
    \includegraphics[width=7cm]{convergenceGrapheMonteCarlo.pdf}
 
405
    \caption{Monte Carlo convergence graph.}
 
406
    \label{MCConvergence}
 
407
    \end{center}
 
408
\end{minipage}
 
409
\hfill
 
410
\begin{minipage}{9.8cm}
 
411
    \begin{center}
 
412
    \includegraphics[width=7cm]{convergenceGrapheLHS.pdf}
 
413
    \caption{LHS convergence graph.}
 
414
    \label{LHSConvergence}
 
415
    \end{center}
 
416
\end{minipage}
 
417
\end{figure}
 
418
 
 
419
 
 
420
 
 
421
 
 
422
\begin{figure}[Hhbtp]
 
423
\begin{minipage}{9.8cm}
 
424
    \begin{center}
 
425
    \includegraphics[width=7cm]{convergenceGrapheDS.pdf}
 
426
    \caption{Directional Sampling convergence graph.}
 
427
    \label{DSConvergence}
 
428
    \end{center}
 
429
\end{minipage}
 
430
\hfill
 
431
\begin{minipage}{9.8cm}
 
432
    \begin{center}
 
433
    \includegraphics[width=7cm]{convergenceGrapheIS.pdf}
 
434
    \caption{LHS convergence graph.}
 
435
    \label{LHSConvergence}
 
436
    \end{center}
 
437
\end{minipage}
 
438
\end{figure}
 
439
 
 
440
 
 
441
 
 
442
 
 
443
\subsection{Results comments}
 
444
 
 
445
\subsubsection{Min/Max approach}
 
446
 
 
447
The Min/Max approach enables to evaluate the range of the deviation.\\
 
448
 
 
449
We note that the use of an experiment plane may be benefical with regard the random sampling technique as we can catch more easily (which means with less evaluations of the limit state function) the extrem values of the output variable of interest :h ere, we have managed to catch both extrem bounds of the deviation with the composite experiment plane, whereas the random sampling technique did not manage to give a good evaluation of them.\\
 
450
 
 
451
Note that the composite experiment plane has 73 points, where as the random sampling technique has been effected with $10^4$ points.
 
452
 
 
453
 
 
454
 
 
455
\subsubsection{Central tendancy approach}
 
456
 
 
457
The Taylor variance decomposition has given a good approximation of  the mean value of the deviation : the value is comparable to the one obtained with the random technique. Furthermore, note that the Taylor variance decomposition required only 1 evaluation of the limit state function, whereas the random sampling technique required $10^4$ evaluations.\\
 
458
 
 
459
The second order evaluation of the mean by the  Taylor variance decomposition method adds no information, which probably means that around the mean point of the input random vector, the limit state function is well approximated by its tangent plane.\\
 
460
 
 
461
The importance factors indicate that the mean of the deviation is mostly influenced by the uncertainty of the variable F.\\
 
462
 
 
463
The kernel smoothing technique enables to have a look on the distribution shape and  another approximation of the mean value of the deviation.\\
 
464
Note that the normal fitting on the sample is not adapted.
 
465
 
 
466
 
 
467
 
 
468
\subsubsection{Threshold exceedance approach}
 
469
 
 
470
The whole event probabilities evaluated from the simulation methods are equivalent and confirm the event probability evaluated with FORM.\\
 
471
 
 
472
Note that the FORM probability required only 176 evaluations of the limit state function whereas the Monte Carlo probability required 17300 evaluations, the Directional Sampling one 17297 evaluations and the LHS one 20300 evaluations.\\
 
473
The Importance Sampling is a simulation method but the importance density has been centered around the design point, where the threshold exceedance is concentrated. That's why the succession of the FORM technique and the Importance sampling one where the importance density is a normal distribution centered around the design point, performed in the standard space, seems to be the better compromise between the limit state evaluation calls number and the probability evaluation precision.\\
 
474
 
 
475
The simulation methods give a confidence interval, which is not possible with FORM.\\
 
476
 
 
477
FORM ranks the influence of the input uncertainties on the realisation of the threshold exceedance event : the variable F is largely the more influent. Thus, if the threshold exceedance probability is judged too high, it is recommanded to decrease the variability of the variable F first.
 
478
 
 
479
 
 
480
 
 
481
\end{document}
 
482