• Aucun résultat trouvé

A Bayesian inversion approach to recovering material parameters in hyperelastic solids using dolfin-adjoint

N/A
N/A
Protected

Academic year: 2021

Partager "A Bayesian inversion approach to recovering material parameters in hyperelastic solids using dolfin-adjoint"

Copied!
75
0
0

Texte intégral

(1)

A Bayesian inversion approach to

recovering material parameters in

hyperelastic solids using dolfin-

adjoint

Jack S. Hale, Patrick E. Farrell, Stéphane P. A. Bordas

Hmsqnctbshnm Sgdaq`mc Sxonfq`ogx

Bnkntq

Ok`bhmfsgdaq`mc Rs`shnmdqx NsgdqhcdmshÜdqr Dwghahshnmr. Rhfm`fd OnvdqOnhms Sq`cdl`qj.Vda Bdqdlnmh`k Dw`lokdr Sdbgmhb`k hmenql`shnm

aq`mcbnkntqr`mcbnkntqo`kdssd

Sgdaq`mcbnkntqÎNwenqcaktd

The University is possibly unique in having a colour with which it is associated throughout the world:Nwenqcaktd.

Nwenqcaktd(or PANTONE © 282) is the main brand colour. Please refer to page 21 for more detailed and technical information on the use of Oxford blue.

Sgdaq`mcl`qjrÎak`bjnmkx

In print media where only black is available (such as press

advertisement or black and white laser printing) it is acceptable to use the brand in black. However, it is important that the black artwork versions are used, as use of the Oxford blue artwork versions could result in a half-tone grey being produced.

Okd`rdmnsd9 do not print letterheads in colour on a laser printer or inkjet as the colour of the brand will not be right. Please print in black using the black artwork versions.

Bnkntqo`kdssd

There is also a palette of preferred colours that have been selected to compliment the Nwenqcaktd. These colours are for use in

graphic elements within designs such as backdrops, graphic shapes

For more technical information on Oxford blue please refer to page 20

For more technical information on the colour palette please refer to page 21

Use the black artwork versions only when no colours are available

The main brand colour is

Oxford Blue

(or Pantone©282)

1

(2)

Overview

Why?

Bayesian approach to inversion.

Relate classical optimisation techniques to the Bayesian inversion approach.

Example problem: sparse surface observations of a solid block.

Use dolfin-adjoint and petsc4py to solve the problem.

(3)

Why?

(4)
(5)
(6)
(7)
(8)

Q: What can we infer about the parameters inside the domain, just from displacement observations on the

outside?

Q: Which parameters am I most uncertain about?

(9)
(10)

Bayesian Approach

Deterministic event - totally predictable.

Random event - unpredictable.

Bayesian approach to inverse problems:

The world is unpredictable.

Consider everything as a random variable.

(11)

Terminology

Observation. Displacements.

Parameter. Material property.

Parameter-to-observable map. Finite deformation hyperelasticity.

y

x

f (x )

(12)

Bayes Theorem

posterior(x | y) likelihood(y | x) prior(x)

Goal: Given the observations, find the posterior distribution of the unknown parameters.

(13)

Three step plan

1. Construct the prior.!

2. Construct the likelihood.

3. Calculate/explore the posterior.

(14)

Constructing a prior

(with DOLFIN)

Must reflect our subjective belief about the unknown parameter.

Difficulty:!

How to transfer qualitative information to quantitative.

(15)

!

Simple example involving a PDE solve: Smoothing Prior

https://bitbucket.org/snippets/jackhale/rk6xA

!

(16)

Reminder…

Let x0 Rn and Rn n be a symmetric positive definite matrix. A multivariate Gaussian random variable X with mean x0 and covariance is a random variable with the probability density:

(x ) = 1

2 | | exp 1

2(x x0)T 1(x x0) . When X follows a multivariate Gaussian, we use the following notation:

X N (x0, ).

(17)

Qualitative: I think my parameter is smooth and is probably around zero at the boundary.

(18)

Imagine a parameter related to a physical quantity in 1-dimensional space. Often, the value of parameter at a point is related to the value of the parameters next to it.

X i = 1

2 (X i −1 + X i +1 ) + W j

With:

W = N (0, γ 2 I)

AX = W

(19)

mesh = UnitIntervalMesh(160)

V = FunctionSpace(mesh, “CG”, 1) u = TrialFunction(V)

v = TestFunction(V)

...a = (1.0/2.0)*h*inner(grad(u), grad(v))*dx class W(Expression):

def eval(self, value, x):

value[0] = np.random.normal() ...

W = interpolate(W(), V) A = assemble(A)

...

(20)

Boundary conditions

1. Dirichlet: set to zero.

2. Extend definition of Laplacian outside domain.

(21)

values = np.array([1.0, -0.5], dtype=np.float_) rows = np.array([0], dtype=np.uintp)

cols = np.array([0, 1], \

dtype=np.uintp) A.setrow(0, cols, values) cols = np.array([V.dim() - 1, V.dim() - 2], \

dtype=np.uintp)

A.setrow(V.dim() - 1, cols, values) A.apply("insert")

(22)

!

(23)

! 2 −1 −T

(24)
(25)

Exploring the posterior

(26)

x MAP = arg max

x ∈R

n

π posterior (x | y)

x MAP

x

cov(x | y)

(27)

x CM =

!

R

n

x π posterior (x | y) dx

x MAP

x CM

cov(x | y)

(28)

cov(x | y) =

!

Rn(x − xcm)(x − xcm)T πposterior(x | y) dx ∈ Rn×n

x MAP

x

cov(x | y)

(29)

OK, but how can we use

dolfin-adjoint to do this?

Aim: Connect Bayesian approach to classical optimisation techniques.

(30)

posterior(x | y) likelihood(y | x) prior(x)

x MAP = arg max

x ∈R

n

π posterior (x | y)

x

MAP

cov(x | y)

(31)

Assumptions

1. I think my parameter is Gaussian (prior).

2. My parameter to observable map is linear and my noise model is Gaussian.

X ∼ N (x 0 , Γ prior ), X ∈ R n

Y = AX + E, Y ∈ R m , A ∈ R m ×n

E ∼ N (0, Γ ), Y ∈ R m

(32)

Plug it in…

posterior(x | y) likelihood(y | x) prior(x)

πposterior(x|y) ∝ exp

!

1

2(y − Ax)T Γ−1noise(y − Ax)

"

×exp

!

1

2(x − x0)TΓ−1prior(x − x0)

"

(33)

x MAP = arg max

x ∈R

n

π posterior (x | y)

ln posterior(x | y) = 1

2(y Ax)T noise1 (y Ax) + 1

2(x x0)T prior1 (x x0)

= 1

2 y Ax 2 1

noise

+ 1

2 x x0 2 1

prior

x

MAP

= arg min

x∈Rn

!

− ln π

posterior

(x | y)

"

πposterior(x|y) ∝ exp

!

1

2(y − Ax)TΓ−1noise(y − Ax)

"

×exp

!

1

2(x − x0)TΓ−1prior(x − x0)

"

(34)

Optimise

g(xMAP) := x 1

2 y Ax 2 1

noise

+ 1

2 x x0 2 1

prior x=xmap

= AT noise1 (y Axmap) + prior1 (xmap x0)

= 0

xMAP = !Γ−1prior − AT Γ−1noiseA"−1 (AT Γnoisey + Γpriorx0)

(35)

xMAP = !Γ−1prior − AT Γ−1noiseA"−1 (AT Γnoisey + Γpriorx0)

H := ∇ x g = Γ −1 prior − A T Γ −1 noise A

(36)

8.1 Basics 8 GAUSSIANS

then

p(xa|xb) = Nxaµa, ˆa) n ˆµa = µa + ⌃cb 1(xb µb)

ˆ a = a cb 1Tc (353) p(xb|xa) = Nxbµb, ˆb) n ˆµb = µb + ⌃Tc a 1(xa µa)

ˆ b = b Tc a 1c (354) Note, that the covariance matrices are the Schur complement of the block ma- trix, see 9.1.5 for details.

8.1.4 Linear combination

Assume x ⇠ N (mx, ⌃x) and y ⇠ N (my, ⌃y) then

Ax + By + c ⇠ N (Amx + Bmy + c, A⌃xAT + B⌃yBT ) (355) 8.1.5 Rearranging Means

NAx[m, ⌃] =

pdet(2⇡(AT 1A) 1)

pdet(2⇡⌃) Nx[A 1m, (AT 1A) 1] (356) If A is square and invertible, it simplifies to

NAx[m, ⌃] = 1

| det(A)|Nx[A 1m, (AT 1A) 1] (357) 8.1.6 Rearranging into squared form

If A is symmetric, then 1

2xT Ax + bT x = 1

2(x A 1b)T A(x A 1b) + 1

2bT A 1b 1

2Tr(XT AX) + Tr(BT X) = 1

2Tr[(X A 1B)T A(X A 1B)] + 1

2Tr(BT A 1B) 8.1.7 Sum of two squared forms

In vector formulation (assuming ⌃1, ⌃2 are symmetric) 1

2(x m1)T 1 1(x m1) (358) 1

2(x m2)T 2 1(x m2) (359)

= 1

2(x mc)T c 1(x mc) + C (360)

c 1 = 1 1 + ⌃2 1 (361)

mc = (⌃1 1 + ⌃2 1) 1(⌃1 1m1 + ⌃2 1m2) (362)

C = 1

2(mT1 1 1 + mT2 2 1)(⌃1 1 + ⌃2 1) 1(⌃1 1m1 + ⌃2 1m2)(363) 1

mT 1m + mT 1m

(364) ln posterior(x | y) = 1

2(y Ax)T noise1 (y Ax) + 1

2(x x0)T prior1 (x x0)

= 1

2 y Ax 2 1

noise

+ 1

2 x x0 2 1

prior

(37)

ln posterior(x | y) = 1

2 y Ax 2 1

noise

+ 1

2 x x0 2 1

prior

= 1

2 x xMAP H

π posterior ∼ N (x MAP , H −1 )

(38)

Back to the problem…

(39)

Find xMAP that satisfies:

minx

1

2 y f (x ) 2 1

noise

+ 1

2 x x0 2 1

prior

,

where the parameter-to-observable map f : Rn Rm is is defined such that:

F(f (x ), x ) = Dv (f (x ), x ) dx = 0 v HD1 ( ), x L2( ), where

(u, x ) = (u, x ) dx t · u ds, (u, x ) = x

2(Ic d) x ln(J) +

2 ln(J)2, F = X = I + u,

C = FT F, IC = tr(C),

J = detF.

(40)

from dolfin import *

mesh = UnitSquareMesh(32, 32)

!U = VectorFunctionSpace(mesh, "CG", 1) V = FunctionSpace(mesh, "CG", 1)

# solution

u = Function(U)

# test functions v = TestFunction(U)

# incremental solution du = TrialFunction(U)

mu = interpolate(Constant(1.0), V)

lmbda = interpolate(Constant(100.0), V)

!dims = mesh.type().dim() I = Identity(dims)

F = I + grad(u) C = F.T*F

J = det(F) Ic = tr(C)

!dims = mesh.type().dim() I = Identity(dims)

F = I + grad(u) C = F.T*F

J = det(F) Ic = tr(C)

phi = (mu/2.0)*(Ic - dims) - mu*ln(J) + (lmbda/

2.0)*(ln(J))**2 Pi = phi*dx

# gateux derivative with respect to u in direction v F = derivative(Pi, u, v)

# and with respect to u in direction du J = derivative(F, u, du)

!u_h = Function(U)

F_h = replace(F, {u: u_h}) J_h = replace(J, {u: u_h})

solve(F_h == 0, u_h, bcs, J=J_h)

(41)

u_obs << File(“observations.xdmf”)

J = Functional(inner(u - u_obs, u - u_obs)*dx + \ inner(mu, mu))

m = Control(mu)

J_hat = ReducedFunctional(J, m) ...

dJdm = Jhat.derivative()[0]

H = Jhat.hessian(dm)[0]

(42)

Wait a second…

x MAP

x

cov(x | y)

(43)

x MAP

x CM

cov(x | y)

H −1 (x MAP )

(44)

π posterior ∼ N (x MAP , H −1 )

π posterior approx ∼ N (x MAP , H −1 (x MAP ))

xMAP

x

cov(x | y)

H−1(xMAP)

(45)

Solving

Strategy: Use hooks in dolfin-adjoint to solve with petsc4py-based contexts.

(46)

Parameter-to-observable map. Newton-Krylov method.

Inner solve with GAMG preconditioned GMRES (KSP) with near-null-space set.

Newton with second-order backtracking line search (SNES).

(47)

• 20% extension test, 16 Core Xeon, 1.12 million cells, ~29 secs to residual of 1E-10.

Colin27 brain atlas

(48)

MAP estimator.

Bound constrained Quasi-Newton BLMVM with More-Thuente line search (TAO).

No Riesz map.

(49)

Principal Component Analysis.

Trailing: BLOPEX Locally Optimal Block Preconditioned Gradient method (SLEPc/

BLOPEX).

Leading: Krylov Schur (SLEPc).

(50)
(51)
(52)
(53)
(54)
(55)

Back to uncertainty

quantification…

(56)
(57)
(58)

Q: What can we infer about the parameters inside the domain, just from displacement observations on the

outside?

Q: Which parameters am I most uncertain about?

(59)

π posterior ∼ N (x MAP , H −1 )

π posterior approx ∼ N (x MAP , H −1 (x MAP ))

xMAP

xCM

cov(x | y)

H−1(xMAP)

(60)

H ∈ R n ×n

Big Dense

Expensive to calculate Only have action

(61)

H = QΛQ T

Γ post = H −1 = Q T Λ −1 Q

(62)
(63)

Trailing Eigenvector

Direction in parameter space least constrained by the observations

(64)

x map

(65)
(66)
(67)

Leading Eigenvectors

Direction in parameter space most constrained by the observations

(68)
(69)
(70)
(71)
(72)
(73)

Matches trends from Flath et al. p424 for linear parameter to observable maps.

Γ prior

Γpost

(74)

Full Hessian.

4000+ actions.

2000 to calculate H. 2000 to extract.

Partial Hessian.

501 actions for 292 for leading.

209 to calculate H. 292 to extract.

Huge savings in computational cost.

Scales with model dimension.

Implement low-rank update.

(75)

Summary

We are developing methods to access uncertainty in the recovered parameters in hyperelastic materials.

This is done within the framework of Bayesian inversion.

dolfin-adjoint makes assembling the equations relatively easy, solving them is tougher.

Next steps: efficient low-rank updates, Hamiltonian MCMC.

Références

Documents relatifs

Parameter estimates are obtained by using ASCAT σ 0 measurements together with auxiliary Leaf Area Index (LAI ) and soil-moisture (SM) datasets provided by the Interactions

Estimation of hydrological and thermal parameters in the hyporheic zone using a novel Bayesian inverse modeling approach... Geophysical Research

Q: What can we infer about the parameters inside the domain, just from displacement observations on

We formulate the problem in the Bayesian inference framework [1]; given noisy and sparse observations of a body, some prior knowledge on the parameters and a parameter-to-observable

By grounding our analysis on an ad hoc dataset, we aim to understand how three of the most visible scientific publishing locations in the field of game studies have produced a

Under the Bayesian methodology for statistical inverse problems, the posterior distribution encodes the probability of the material parameters given the available

Indeed, one of the main approaches in stochastic modelling, known as the Monte Carlo method, is to run a (large) number of simulations for each value of the parameters and to

Calibration of the fat and muscle hyperelastic material parameters for the assessment of the internal tissue deformation in relation to pressure ulcer prevention.. Connesson,