of 40/40
Accurate uncertainty quantiﬁcation using adjoint solutions Praveen. C 1 and K. Duraisamy 2 1 TIFR Center for Applicable Mathematics Bangalore 2 Dept. of Aeronautics and Astronautics Stanford University Health, Safety and Environment Group BARC 6-7 October, 2010 Praveen. C (TIFR-CAM) UQ using adjoints BARC, 7 Oct 2010 1 / 40

• View
219

1

Embed Size (px)

### Text of Accurate uncertainty quantification using adjoint...

• Accurate uncertainty quantification using adjointsolutions

Praveen. C1 and K. Duraisamy2

1TIFR Center for Applicable MathematicsBangalore

2Dept. of Aeronautics and AstronauticsStanford University

Health, Safety and Environment GroupBARC

6-7 October, 2010

Praveen. C (TIFR-CAM) UQ using adjoints BARC, 7 Oct 2010 1 / 40

• Problem of UQ I

Consider a system with governing equation

R(, u) = 0

where Rn, u X RM and R X RM . This defines theimplicit relation

u = u()

are some parameters in the problem, e.g, material properties, initialconditions, boundary conditions, etc.

u represents the state of the system

Output functional of interest

I = I() = I(, u())

Praveen. C (TIFR-CAM) UQ using adjoints BARC, 7 Oct 2010 2 / 40

• Problem of UQ II

In practice, the parameters could be random or uncertain. In thatcase, u() and I() are random variables.

We will assume that the probability structure of the input variables is given in terms of their PDF. Then the problem of UQ is to find theprobability structure of the output I()

The relationship

I()

is implicit, and requires the solution of the model R = 0

R(, u) = 0 u() I()

which is usually computationally expensive because M 1

Praveen. C (TIFR-CAM) UQ using adjoints BARC, 7 Oct 2010 3 / 40

• Our approach to UQ

Aleatoric uncertainties

Small number (14) of uncertain parameters Non-intrusive collocation approach

Choose samples 1, . . . , Ns Solve the deterministic problems, R(j , u(j)) = 0 Form a grid of simplex elements covering Estimate moments through multi-element quadrature

We also compute adjoint solutions v at the sample points

I

u(j , u(j)) + v(j)T

R

u(j , u(j)) = 0, j = 1, . . . ,Ns

Choose the samples in an adaptive, goal-oriented mannere.g., reduce the error in the mean value

J = I(, u())d

Praveen. C (TIFR-CAM) UQ using adjoints BARC, 7 Oct 2010 4 / 40

• Simplex elements

Praveen. C (TIFR-CAM) UQ using adjoints BARC, 7 Oct 2010 5 / 40

• Simplex elements need less samples

Samples located on boundary of elementsSamples shared by neighbouring elements

Praveen. C (TIFR-CAM) UQ using adjoints BARC, 7 Oct 2010 6 / 40

• Stochastic simplex grid and quadrature

contributing the maximum error is identified and three additional samples are evaluated at the midpointsof its edges. While more complicated adaptive refinement criteria can be used, such a simple strategy isemployed for demonstrative purposes. This process is then repeated until a desired error tolerance is achieved.Figures 2 and 3 show the sampling nodes and elements at the 20th and 50th iterations, respectively. Figure4 shows the error in the computed objective function before and after error correction when linear andquadratic reconstructions are employed.

0 0.2 0.4 0.6 0.8 1

0

0.2

0.4

0.6

0.8

1

!1

! 2

Figure 1: Initial sampling locations (NS = 5) and elements

0 0.2 0.4 0.6 0.8 1

0

0.2

0.4

0.6

0.8

1

!1

! 2

Figure 2: Mesh at 20th pass (NS = 5 + 19 3)

References

[1] Ghanem, R., and Spanos, P., Stochastic Finite Elements: A Spectral Approach, Dover Publications,2003.

[2] Pierce, N., and Giles, M., Adjoint and Defect Error Bounding and Correction for Functional Estimates,Journal of Computational Physics, 200, pp. 769794, 2002.

[3] Giles, M., and Pierce, N., An introduction to the adjoint approach to design, Flow, Turbulence andCombustion, 65(3-4):393-415, 2000.

3

Sample points

J (u) = I(u())d =

NE

i=1EiI(u())d

EiI(u())d

Nq

j=1

wijI(u(ij))

But we do not know uij = u(ij)

Praveen. C (TIFR-CAM) UQ using adjoints BARC, 7 Oct 2010 7 / 40

• Finite element interpolation I

Let u() is a finite element interpolation of u(), e.g. using P1 or P2finite elements.

If u is a Pr interpolant, then we can approximate the mean value as

J (u) =NE

i=1

Nq

j=1

wijI(u(ij)) = J (u) +O(r+1)

We will

reduce the error in the above approximation

derive estimate for remaining error which can be used for choosingthe sample points

Praveen. C (TIFR-CAM) UQ using adjoints BARC, 7 Oct 2010 8 / 40

• Error estimation I

The mean value can be computed as

J (u) =NE

i=1

Nq

j=1

wijI(u(ij)) +O(s+1)

where the quadrature is exact for polynomials of degree s. Then

I(uij) = I(uij) + [I(uij) I(uij)]

= I(uij) +I

u(uij)(uij uij) +O(u u2)

If u is exact for polynomials of degree r, then we can expect

u u = O(r+1)

where is a measure of the stochastic element size, e.g., the length ofthe largest side.

Praveen. C (TIFR-CAM) UQ using adjoints BARC, 7 Oct 2010 9 / 40

• Error estimation IIWe will choose s + 1 2(r + 1), so that the error will be dominated bythe interpolation error in stochastic space. Since

R(uij) = 0

introducing vij , we can write

I(uij) = I(uij) + {I

u(uij)(uij uij) + vTij[R(uij) R(uij) +R(uij)]}

+O(u u2)

= I(uij) + [I

u(uij) + vTij

R

u(uij)] (uij uij) + vTijR(uij)

+O(u u2)

If we choose vij to be a solution of the adjoint equation at quadraturenode ij

I

u(uij) + vTij

R

u(uij) = 0,

Praveen. C (TIFR-CAM) UQ using adjoints BARC, 7 Oct 2010 10 / 40

• Error estimation III

then the corrected functional is

I(uij) = I(uij) + vTijR(uij) +O(u u2)

Let v() be the Pr interpolation of the adjoint solution at the samplepoints. Then the corrected functional is

I(uij) = I(uij) + vTijR(uij)

+ [Iu

(uij) + vTijR

u(uij)] (uij uij) + (vij vij)TR(uij)

+(vij vij)TR

u(uij)(uij uij) +O(u u2)

Praveen. C (TIFR-CAM) UQ using adjoints BARC, 7 Oct 2010 11 / 40

• Error estimation IV

Define

Rij(v) = [I

u(uij)]

T

+ [Ru

(uij)]T

v

then

J (u) =NE

i=1

Nq

j=1

wijI(uij) +NE

i=1

Nq

j=1

wij vTijR(uij)

+NE

i=1

Nq

j=1

wij {(vij vij)TR(uij) + [Rij(vij)]T (uij uij)}

+O(2(r+1))= J (u) +CC +RE +O(2(r+1))

Praveen. C (TIFR-CAM) UQ using adjoints BARC, 7 Oct 2010 12 / 40

We cannot compute RE exactly since we do not know uij and vij . Sowe will try to estimate RE approximately.

Since uij and vij are interpolations of the exact solutions, we can expect

R(uij) 0 and Rij(vij) 0

Let L and Q denote the P1 and P2 interpolation operators in therandom space. Then estimtate

RE =NE

i=1

Nq

j=1

wij {(Qvij Lvij)TR(uij) + [Rij(vij)]T (Quij Luij)}

We have a break-up of the error into elemental contributions

RE =NE

i=1i

Praveen. C (TIFR-CAM) UQ using adjoints BARC, 7 Oct 2010 13 / 40

To reduce the remaining error RE, we choose sample points where REis large.

Find the element i which makes the largest contribution i to theremaining error, and then divide this element by adding a new sample.

Praveen. C (TIFR-CAM) UQ using adjoints BARC, 7 Oct 2010 14 / 40

1 Sample the primal solution u() and adjoint solution v() at thefour vertices and center of , i.e., Ns = 5

2 Construct a grid of simplex elements using the Ns samples

3 Construct the stochastic approximations u() and v() to theprimal and adjoint solutions

4 Compute J (u) and CC5 For each simplex element i, compute i and RE

6 Choose the element with the largest value of the element error andadd a new sample at the middle of the largest side

7 If RE > TOL, set Ns = Ns + 1 and go to step 2Praveen. C (TIFR-CAM) UQ using adjoints BARC, 7 Oct 2010 15 / 40

• Numerical examples

Two random variables, uniformly distributed

u() = linear (P1) or quadratic interpolation (Venditti-Darmofal) Symmetric quadrature on triangles using Dunavant rules

Uniform refinement: N1/2s

Plot log(error) against log(Ns) to find order of convergence

Praveen. C (TIFR-CAM) UQ using adjoints BARC, 7 Oct 2010 16 / 40

• Algebraic example I

The governing equation is given by

R(u, 1, 2) =1

2u2 1u

1

2exp(2) = 0

where 1, 2 [0,1] are uniform random variables. The randomfunctional of interest is I(u) = u2 and we would like to compute itsmean value

J = 1

0

1

0I(u)d1d2

Praveen. C (TIFR-CAM) UQ using adjoints BARC, 7 Oct 2010 17 / 40

• Algebraic example IRandom functional I(1, 2)

1

2

0 0.2 0.4 0.6 0.8 10

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

1

2

3

4

5

6

7

8

0

0.5

1

0

0.5

10

2

4

6

8

10

1

2

1

2

3

4

5

6

7

8

Praveen. C (TIFR-CAM) UQ using adjoints BARC, 7 Oct 2010 18 / 40

• Algebraic example IConvergence rates under uniform refinement

100

101

102

1012

1010

108

106

104

102

100

sqrt(Number of samples)

Err

or

Convergence rates for algebraic example I under uniform refinement:() 2.2, () 4.5, () 3.3, () 5.8

Praveen. C (TIFR-CAM) UQ using adjoints BARC, 7 Oct 2010 19 / 40

• Algebraic example I: Adaptive refinement

0 20 40 60 80 100 120 140 160

3.86

3.88

3.9

3.92

3.94

3.96

3.98

4

4.02

Number of samples

Mea

n fu

nctio

nal

JJ + CCJexact

0 20 40 60 80 100 120 140 160

3.86

3.87

3.88

3.89

3.9

3.91

3.92

3.93

Number of samples

Mea

n fu

nctio

nal

JJ + CCJexact

100

101

102

103

106

105

104

103

102

101

100

101

Number of samples

% E

rror

JJ + CC

100

101

102

103

107

106

105

104

103

102

101

100

101

Number of samples

% E

rror

JJ + CC

Praveen. C (TIFR-CAM) UQ using adjoints BARC, 7 Oct 2010 20 / 40

• Algebraic example I: Adaptive refinement

0 20 40 60 80 100 120 140 160

0.986

0.988

0.99

0.992

0.994

0.996

0.998

1

1.002

Number of samples

Fra

ctio

n of

err

or r

ecov

ered

by

int

0 20 40 60 80 100 120 140 1600.988

0.99

0.992

0.994

0.996

0.998

1

1.002

Number of samples

Fra

ctio

n of

err

or r

ecov

ered

by

int

0 0.2 0.4 0.6 0.8 10

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

1

2

0 0.2 0.4 0.6 0.8 10

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

1

2

Praveen. C (TIFR-CAM) UQ using adjoints BARC, 7 Oct 2010 21 / 40

• Algebraic example II

The governing equation is given by

R(u, 1, 2) =1

2u2 1u

1

2exp(50(2 1/2)2) = 0

which is a slight modification of the previous example in order tointroduce a higher sensitivity of the solution to the random variables,1 [1/2,1], 2 [0,1] which are uniformly distributed. The randomfunctional of interest is

I(u) = u2

and we would like to estimate

J = 1

0

1

1/2I(u)d1d2

Praveen. C (TIFR-CAM) UQ using adjoints BARC, 7 Oct 2010 22 / 40

• Algebraic example IIRandom functional I(1, 2)

1

2

0.5 0.6 0.7 0.8 0.9 10

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

1.5

2

2.5

3

3.5

4

4.5

5

5.5

0.4

0.6

0.8

1

0

0.5

11

2

3

4

5

6

1

2

1.5

2

2.5

3

3.5

4

4.5

5

5.5

Praveen. C (TIFR-CAM) UQ using adjoints BARC, 7 Oct 2010 23 / 40

• Algebraic example IIConvergence rate under uniform refinement

100

101

102

1010

108

106

104

102

100

sqrt(Number of samples)

Err

or

Convergence rates for algebraic example II under uniform refinement:() 2.7, () 4.8, () 3.7, () 6.4

Praveen. C (TIFR-CAM) UQ using adjoints BARC, 7 Oct 2010 24 / 40

• Algebraic example II: Adaptive refinement

0 20 40 60 80 100 120 140 160

1.25

1.3

1.35

1.4

1.45

1.5

1.55

1.6

Number of samples

Mea

n fu

nctio

nal

JJ + CCJexact

0 20 40 60 80 100 120 140 1601.35

1.4

1.45

1.5

1.55

1.6

1.65

1.7

Number of samples

Mea

n fu

nctio

nal

JJ + CCJexact

100

101

102

103

104

103

102

101

100

101

102

Number of samples

% E

rror

JJ + CC

100

101

102

103

105

104

103

102

101

100

101

102

Number of samples

% E

rror

JJ + CC

Praveen. C (TIFR-CAM) UQ using adjoints BARC, 7 Oct 2010 25 / 40

• Algebraic example II: Adaptive refinement

0 20 40 60 80 100 120 140 1600

0.5

1

1.5

2

2.5

3

3.5

4

4.5

Number of samples

Fra

ctio

n of

err

or r

ecov

ered

by

int

0 20 40 60 80 100 120 140 1600.5

1

1.5

2

2.5

3

3.5

4

4.5

Number of samples

Fra

ctio

n of

err

or r

ecov

ered

by

int

0.5 0.6 0.7 0.8 0.9 10

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

1

2

0.5 0.6 0.7 0.8 0.9 10

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

1

2

Praveen. C (TIFR-CAM) UQ using adjoints BARC, 7 Oct 2010 26 / 40

• Convection-diffusion equation I

Consider the steady viscous Burgers equation with a random forcingterm given by

uux = uxx + s, x (0,1)u(0) = u(1) = 0

The source term s(x; 1, 2) is chosen so that the exact solution is

u(x; 1, 2) = 10x(1 x) sin((1 + 2x))

where 1, 2 [0.9,1.1] are uniform random variables. The ODE isapproximated using a finite volume method on M cells so that thegoverning equations R RM RM is given by

R(u)i =Fi+1/2 Fi1/2

x ui+1 2ui + ui1

x2 si = 0, 1 i M

Praveen. C (TIFR-CAM) UQ using adjoints BARC, 7 Oct 2010 27 / 40

• Convection-diffusion equation II

where Fi+1/2 = F (ui, ui+1) is a numerical flux function, e.g. theLax-Friedrichs flux defined as

F (u, v) = 12[f(u) + f(v)] 1

2(v u)

The boundary conditions are implemented by appropriate definition ofthe boundary fluxes. The random functional of interest is

I = xM

i=1u2i

and in the computations we use M = 20 cells. We are interested in themean value of the random functional given by

J = 1.1

0.9

1.1

0.9Id1d2

Praveen. C (TIFR-CAM) UQ using adjoints BARC, 7 Oct 2010 28 / 40

• Convection-diffusion equationRandom functional I(1, 2)

1

2

0.9 0.95 1 1.05 1.10.9

0.92

0.94

0.96

0.98

1

1.02

1.04

1.06

1.08

1.1

2

2.05

2.1

2.15

2.2

2.25

2.3

2.35

2.4

2.45

0.91

1.11.2

1.3

0.9

1

1.1

1.2

1.31.9

2

2.1

2.2

2.3

2.4

2.5

1

2

2

2.05

2.1

2.15

2.2

2.25

2.3

2.35

2.4

2.45

Praveen. C (TIFR-CAM) UQ using adjoints BARC, 7 Oct 2010 29 / 40

• Convection-diffusion equationConvergence rates under uniform refinement

100

101

102

1012

1010

108

106

104

102

100

sqrt(Number of samples)

Err

or

Convergence rates for convection-diffusion problem under uniformrefinement: () 2.2, () 4.4, () 3.3, () 6.3

Praveen. C (TIFR-CAM) UQ using adjoints BARC, 7 Oct 2010 30 / 40

0 20 40 60 80 100 120 140 1600.088

0.0885

0.089

0.0895

0.09

0.0905

0.091

0.0915

0.092

0.0925

0.093

Number of samples

Mea

n fu

nctio

nal

JJ + CCJexact

0 20 40 60 80 100 120 140 1600.09

0.0905

0.091

0.0915

0.092

0.0925

Number of samples

Mea

n fu

nctio

nal

JJ + CCJexact

100

101

102

103

105

104

103

102

101

100

101

Number of samples

% E

rror

JJ + CC

100

101

102

103

107

106

105

104

103

102

101

100

101

Number of samples

% E

rror

JJ + CC

Praveen. C (TIFR-CAM) UQ using adjoints BARC, 7 Oct 2010 31 / 40

0 20 40 60 80 100 120 140 160

0.986

0.988

0.99

0.992

0.994

0.996

0.998

1

1.002

Number of samples

Fra

ctio

n of

err

or r

ecov

ered

by

int

0 20 40 60 80 100 120 140 1600.99

0.992

0.994

0.996

0.998

1

1.002

Number of samples

Fra

ctio

n of

err

or r

ecov

ered

by

int

0.9 0.95 1 1.05 1.10.9

0.92

0.94

0.96

0.98

1

1.02

1.04

1.06

1.08

1.1

1

2

0.9 0.95 1 1.05 1.10.9

0.92

0.94

0.96

0.98

1

1.02

1.04

1.06

1.08

1.1

1

2

Praveen. C (TIFR-CAM) UQ using adjoints BARC, 7 Oct 2010 32 / 40

• Burgers ODE with discontinuos solution I

The governing equation is taken as steady-state inviscid Burgersequation with a source term

ddx(u

2/2) = 4xu, x (0,1)u(0) = 1 + 1, u(1) = 1 + 2

The ODE is of first order but we impose two boundary conditions; thesolution will be discontinuous in general at x = xs which is given by theRankine-Hugoniot condition as xs =

1/2 (1 + 2)/4. The random

variables 1, 2 are assumed to be uniformly distributed in [1/2,+1/2]so that the shock location xs varies in the interval [0.5,0.86]approximately. The ODE is solved using a finite-volume method withLax-Friedrichs flux, so that the governing equation R RM RM is

R(u)i =Fi+1/2 Fi1/2

x 4xiui = 0, 1 i M

Praveen. C (TIFR-CAM) UQ using adjoints BARC, 7 Oct 2010 33 / 40

• Burgers ODE with discontinuos solution II

For the computations we take M = 50 cells and the random functionalis

I = x50

i=36

ui 1.0

0.7u(x)dx

As the parameters vary randomly, the shock can be inside or outsidethe domain of integration.

Praveen. C (TIFR-CAM) UQ using adjoints BARC, 7 Oct 2010 34 / 40

• Burgers ODESample solutions

0 0.2 0.4 0.6 0.8 12

1.5

1

0.5

0

0.5

1

1.5

2

x

u

NumericalExact

0 0.2 0.4 0.6 0.8 12

1.5

1

0.5

0

0.5

1

1.5

2

x

u

NumericalExact

(a) 1 = 1/2, 2 = 1/2, (b) 1 = 1/2, 2 = 1/2

Praveen. C (TIFR-CAM) UQ using adjoints BARC, 7 Oct 2010 35 / 40

• Burgers ODERandom functional I(1, 2)

1

2

0.5 0 0.50.5

0.4

0.3

0.2

0.1

0

0.1

0.2

0.3

0.4

0.5

0.5

0.4

0.3

0.2

0.1

0

0.5

0

0.5 0.50

0.50.6

0.5

0.4

0.3

0.2

0.1

0

0.1

2

1

0.5

0.4

0.3

0.2

0.1

0

Praveen. C (TIFR-CAM) UQ using adjoints BARC, 7 Oct 2010 36 / 40

• Burgers ODEConvergence rate under uniform refinement

100

101

102

107

106

105

104

103

102

101

sqrt(Number of samples)

Err

or

Convergence rates for Burgers problem under uniform refinement:() 2.0, () 5.2, () 3.4, () 5.3

Praveen. C (TIFR-CAM) UQ using adjoints BARC, 7 Oct 2010 37 / 40

0 20 40 60 80 100 120 140 1600.37

0.365

0.36

0.355

0.35

0.345

0.34

0.335

0.33

0.325

0.32

Number of samples

Mea

n fu

nctio

nal

JJ + CCJexact

0 20 40 60 80 100 120 140 1600.37

0.365

0.36

0.355

0.35

0.345

0.34

0.335

Number of samples

Mea

n fu

nctio

nal

JJ + CCJexact

100

101

102

103

104

103

102

101

100

101

Number of samples

% E

rror

JJ + CC

100

101

102

103

104

103

102

101

100

101

Number of samples

% E

rror

JJ + CC

Praveen. C (TIFR-CAM) UQ using adjoints BARC, 7 Oct 2010 38 / 40

0 20 40 60 80 100 120 140 1600.8

1

1.2

1.4

1.6

1.8

2

2.2

2.4

2.6

Number of samples

Fra

ctio

n of

err

or r

ecov

ered

by

int

0 20 40 60 80 100 120 140 1601

0

1

2

3

4

5

Number of samples

Fra

ctio

n of

err

or r

ecov

ered

by

int

0.5 0 0.50.5

0.4

0.3

0.2

0.1

0

0.1

0.2

0.3

0.4

0.5

1

2

0.5 0 0.50.5

0.4

0.3

0.2

0.1

0

0.1

0.2

0.3

0.4

0.5

1

2

Praveen. C (TIFR-CAM) UQ using adjoints BARC, 7 Oct 2010 39 / 40

• Summary/Future work

Adjoint solutions allow to control error in statistical moments

Stochastic samples can be chosen in an optimal way

Provides way to gurantee accuracy of UQ

Automatic differentiation can be used for obtaining adjointsolutions

Non-intrusive approach allows application to complex problems

However, it is limited to small number of uncertain parameters

Need for non-oscillatory approach in case of discontinuousdependance u()

Need to include error of spatial discretization

Praveen. C (TIFR-CAM) UQ using adjoints BARC, 7 Oct 2010 40 / 40

Documents
Documents
Documents
Documents
Documents
Documents
Documents
Documents
Documents
Documents
Documents
Documents
Documents
Documents
Documents
Documents
Documents
Documents
Documents
Documents
Documents
##### Bioassays praveen tk
Health & Medicine
Documents
Documents
Documents
Documents
Documents
Documents
Documents
Documents