Quantifying Uncertainty in Engineering Analysis Mike Giles and Devendra Ghate giles@comlab.ox.ac.uk Oxford University Computing Laboratory Quantifying Uncertainty – p. 1/18
Motivation Engineering analysis assumes perfect knowledge of the geometry and mathematical model. Engineering design assumes we can manufacture exactly what is designed. In reality, there is much uncertainty: manufacturing tolerances uncertain modelling parameters Next big trend in engineering analysis is to quantify the consequences of these. Quantifying Uncertainty – p. 2/18
Approaches At one extreme, there are stochastic PDEs, able to cope with extremely large uncertainties (e.g. variation in rock porosity in oil reservoir modelling), but very complex and computationally demanding. We’re interested in the other extreme: limited to very small uncertainties relatively simple and computationally inexpensive usually only concerned with one or two output functionals (e.g. lift, drag) often interested only in first order (variance) and second order (mean perturbation) effects sometimes, also interested in confidence limits Quantifying Uncertainty – p. 3/18
Explicit Uncertainty Propagation Monte Carlo simulations; Moment method with first, second and third order Taylor expansions; Moment method with adjoint error correction. Quantifying Uncertainty – p. 4/18
Taylor Expansion f ( µ x ) + f ′ ( µ x )( x − µ x ) + f ′′ ( µ x ) ( x − µ x ) 2 y = f ( x ) = 2! + f ′′′ ( µ x ) ( x − µ x ) 3 + O (( x − µ x ) 4 ) 3! where the primes denote derivative with respect to x , and µ x is mean of x . First Order Taylor series approximation: µ y = f ( µ x ) � 2 σ 2 σ 2 � f ′ ( µ x ) = y x Quantifying Uncertainty – p. 5/18
Taylor Expansion Second Order Taylor series approximation: f ( µ x ) + f ′′ ( µ x ) σ 2 = µ y x 2! f ′′ ( µ x ) 2 σ 2 σ 2 x + f ′ ( µ x ) f ′′ ( µ x ) S ( x ) σ 3 = y x 2 + f ′′ ( µ x ) ( K ( x ) − 1) σ 4 x 2! Similarly third order Taylor series approximation can be derived involving skewness and Kurtosis terms. Quantifying Uncertainty – p. 6/18
MC for Test Functions Histogram of MC simulations for sin(x) Histogram of MC simulations for cos(x) 4 5 x 10 x 10 2.5 3.5 3 2 2.5 Frequency Frequency 1.5 2 1.5 1 1 0.5 0.5 0 0 −1 −0.8 −0.6 −0.4 −0.2 0 0.2 0.4 0.6 0.8 1 −0.4 −0.2 0 0.2 0.4 0.6 0.8 1 Range Range Frequency distribution for sin(x) and cos(x) for normally 4 – sample size = 10 6 . distributed x with µ x = 0 , σ x = π Quantifying Uncertainty – p. 7/18
Mean: Moment Methods Mean of sin(x) Mean of cos(x) −4 x 10 8 1 MC for sin(x) 1stOrder sin(x) 0.99 6 2ndOrder sin(x) 3rdOrder for sin(x) 0.98 4 Mean of cos(x) Mean of sin(x) 0.97 2 0.96 MC for cos(x) 0 1stOrder cos(x) 0.95 2ndOrder cos(x) 3rdOrder for cos(x) −2 0.94 −4 0.93 −6 0.92 0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 Standard Deviation of x Standard Deviation of x Figure 1: Prediction of µ y with increasing σ x Quantifying Uncertainty – p. 8/18
Variance: Moment Methods Variance of sin(x) Variance of cos(x) 0.16 0.012 MC for sin(x) MC for cos(x) 1stOrder sin(x) 1stOrder cos(x) 0.14 2ndOrder sin(x) 2ndOrder cos(x) 0.01 3rdOrder for sin(x) 3rdOrder for cos(x) 0.12 Variance of cos(x) Variance of sin(x) 0.008 0.1 0.08 0.006 0.06 0.004 0.04 0.002 0.02 0 0 0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 Standard Deviation of x Standard Deviation of x Figure 2: Prediction of σ 2 y with increasing σ x Quantifying Uncertainty – p. 9/18
Implicit Uncertainty Propagation Let u be the solution of a set of non-linear algebraic equations f ( u ( x ) , x ) = 0 , and an output functional of interest, J ( u ( x ) , x ) . The adjoint equation corresponding to this functional is � T � T � ∂f � ∂J f + = 0 . ∂u ∂u Given approximate solutions u ∗ and f ∗ , ∗ ) T f ( u ∗ , x ) . J ( u ( x ) , x ) ≈ J ( u ∗ , x ) + ( f Quantifying Uncertainty – p. 10/18
MC using Adjoint Error Correction To avoid the cost of computing exact u , Monte-Carlo simulations are performed using adjoint error correction. The following options are available: ∗ = f µ x u ∗ = u µ x , f u ∗ = u µ x + du ∗ = f µ x dx ( x − µ x ) , f u ∗ = u µ x + du ∗ = f µ x + df dx ( x − µ x ) , dx ( x − µ x ) f Quantifying Uncertainty – p. 11/18
Test Case N ( u ( x ) , x ) = u + u 3 − x = 0 , J ( u ( x ) , x ) = u 2 . nonlinear equation solved by Newton iteration; adjoints are calculated analytically; du dx and df dx are calculated analytically. Quantifying Uncertainty – p. 12/18
Results µ x = 5 ; σ 2 x = 1 Mean of u 2 Variance of u 2 2.3 0.16 2.298 0.14 2.296 0.12 Variance of function Mean of function 2.294 0.1 2.292 0.08 2.29 0.06 MC MC 2.288 0.04 1stOrder Taylor 1stOrder Taylor 2ndOrder Taylor 2ndOrder Taylor Adjoint−1 Adjoint−1 2.286 0.02 Adjoint−2 Adjoint−2 Adjoint−3 Adjoint−3 2.284 0 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Standard Deviation of x Standard Deviation of x Quantifying Uncertainty – p. 13/18
Results µ x = 0 ; σ 2 x = 1 Mean of u 2 Variance of u 2 2 0.5 0.45 1 0.4 0 0.35 Variance of function Mean of function −1 0.3 MC 1stOrder Taylor 2ndOrder Taylor −2 0.25 Adjoint−1 Adjoint−2 Adjoint−3 0.2 −3 0.15 MC −4 1stOrder Taylor 0.1 2ndOrder Taylor Adjoint−1 −5 Adjoint−2 0.05 Adjoint−3 −6 0 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Standard Deviation of x Standard Deviation of x Quantifying Uncertainty – p. 14/18
Computational Cost One nonlinear solution One adjoint solution N linear solutions for du dx (N = # of uncertain parameters) N linear solutions for df dx M inexpensive approximate MC evaluations Quantifying Uncertainty – p. 15/18
Cheap Hessian Evaluation Functional and nonlinear equations: ∂j = ∂J ∂u + ∂J j ( x ) = J ( u, x ) = . ⇒ ∂x i ∂u ∂x i ∂x i ∂f ∂u + ∂f f ( x, u ) = 0 = = 0 . ⇒ ∂u ∂x i ∂x i Adjoint equation and gradient: � T � T � ∂f � ∂J f + = 0 , ∂u ∂u � − 1 ∂f � ∂f ∂j = − ∂J + ∂J T ∂f + ∂J = f . ∂x i ∂u ∂u ∂x i ∂x i ∂x i ∂x i Quantifying Uncertainty – p. 16/18
Cheap Hessian Evaluation Second derivative of functional and nonlinear equations: ∂ 2 j ∂ 2 u = ∂J + D 2 i,j J, ∂x i ∂x j ∂u ∂x i ∂x j ∂ 2 u ∂f + D 2 i,j f = 0 , ∂u ∂x i ∂x j i,j J ≡ ∂ 2 J + ∂ 2 J ∂ 2 J ∂ 2 J ∂u ∂u ∂u ∂u D 2 + + ∂u 2 ∂x i ∂x j ∂u∂x i ∂x j ∂u∂x j ∂x i ∂x i ∂x j and D 2 i,j f is defined similarly. ∂ 2 j T D 2 i,j f + D 2 = = f i,j J. ⇒ ∂x i ∂x j Quantifying Uncertainty – p. 17/18
Cheap Hessian Evaluation Computational cost: One nonlinear solution; N o adjoint solutions, one for each output; N i linear solutions, one for each input; inexpensive evaluation of D 2 i,j f , D 2 i,j J using forward-on-forward AD. Not a new idea (Taylor, Green, Newman and Putko, 2003) but worth pursuing? Quantifying Uncertainty – p. 18/18
Recommend
More recommend