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
- 1
A Bayesian inversion approach to recovering material parameters in - - PowerPoint PPT Presentation
Jack S. Hale, Patrick E. Farrell, Stéphane P. A. Bordas
inversion approach.
block.
2
3
4
5
6
7
8
Q: What can we infer about the parameters inside the domain, just from displacement observations on the
Q: Which parameters am I most uncertain about?
9
10
hyperelasticity.
11
πposterior(x | y) ∝ πlikelihood(y | x)πprior(x) Goal: Given the observations, find the posterior distribution of the unknown parameters.
12
13
Must reflect our subjective belief about the unknown parameter. Difficulty: How to transfer qualitative information to quantitative.
14
https://bitbucket.org/snippets/jackhale/rk6xA
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) =
2π|Γ|
2(x − x0)TΓ−1(x − x0)
When X follows a multivariate Gaussian, we use the following notation: X ∼ N(x0, Γ).
16
17
Qualitative: I think my parameter is smooth and is probably around zero at the boundary.
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.
With:
18
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
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
24
25
26
x∈Rn πposterior(x | y)
27
28
cov(x | y) =
Aim: Connect Bayesian approach to classical
29
πposterior(x | y) ∝ πlikelihood(y | x)πprior(x)
x∈Rn πposterior(x | y)
30
noise model is Gaussian.
31
πposterior(x | y) ∝ πlikelihood(y | x)πprior(x)
32
πposterior(x|y) ∝ exp
2(y − Ax)TΓ−1
noise(y − Ax)
2(x − x0)TΓ−1
prior(x − x0)
x∈Rn πposterior(x | y)
ln πposterior(x | y) = 1 2(y Ax)TΓ1
noise(y Ax) + 1
2(x x0)TΓ1
prior(x x0)
= 1 2y Ax2
Γ1
noise
+ 1 2x x02
Γ1
prior
xMAP = arg min
x∈Rn
πposterior(x|y) ∝ exp
2(y − Ax)TΓ−1
noise(y − Ax)
2(x − x0)TΓ−1
prior(x − x0)
g(xMAP) := x
2y Ax2
Γ1
noise
+ 1 2x x02
Γ1
prior
= ATΓ1
noise(y Axmap) + Γ1 prior(xmap x0)
= 0
xMAP =
prior − ATΓ−1 noiseA
−1 (ATΓnoisey + Γpriorx0)
34
xMAP =
prior − ATΓ−1 noiseA
−1 (ATΓnoisey + Γpriorx0)
prior − ATΓ−1 noiseA
35
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 Σ−1
2 (x − m2)
(359) = −1 2(x − mc)T Σ−1
c (x − mc) + C
(360) Σ−1
c
= Σ−1
1
+ Σ−1
2
(361) mc = (Σ−1
1
+ Σ−1
2 )−1(Σ−1 1 m1 + Σ−1 2 m2)
(362) C = 1 2(mT
1 Σ−1 1
+ mT
2 Σ−1 2 )(Σ−1 1
+ Σ−1
2 )−1(Σ−1 1 m1 + Σ−1 2 m2)(363)
−1 2 ⇣ mT
1 Σ−1 1 m1 + mT 2 Σ−1 2 m2
⌘ (364)
ln πposterior(x | y) = 1 2(y Ax)TΓ1
noise(y Ax) + 1
2(x x0)TΓ1
prior(x x0)
= 1 2y Ax2
Γ1
noise
+ 1 2x x02
Γ1
prior 36
37
ln πposterior(x | y) = 1 2y Ax2
Γ1
noise
+ 1 2x x02
Γ1
prior
= 1 2x xMAPH
38
39
Find xMAP that satisfies: min
x
1 2y f (x)2
Γ1
noise
+ 1 2x x02
Γ1
prior
, where the parameter-to-observable map f : Rn Rm is is defined such that: F(f (x), x) = Dv
v H1
D(Ω), x L2(Ω),
where Π(u, x) =
ψ(u, x) = x 2(Ic d) x ln(J) + λ 2 ln(J)2, F = ∂φ ∂X = I + u, C = FTF, IC = tr(C), J = detF.
from dolfin import * mesh = UnitSquareMesh(32, 32)
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)
I = Identity(dims) F = I + grad(u) C = F.T*F J = det(F) Ic = tr(C)
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)
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
43
44
posterior ∼ N(xMAP, H−1(xMAP))
xMAP xCM cov(x | y)
H−1(xMAP)
45
Strategy: Use hooks in dolfin-adjoint to solve with petsc4py-based contexts.
method.
(KSP) with near-null-space set.
search (SNES).
46
47
cells, ~29 secs to residual of 1E-10. Colin27 brain atlas
48
More-Thuente line search (TAO).
49
Preconditioned Gradient method (SLEPc/ BLOPEX).
50
51
52
53
54
55
56
57
58
Q: What can we infer about the parameters inside the domain, just from displacement observations on the
Q: Which parameters am I most uncertain about?
59
posterior ∼ N(xMAP, H−1(xMAP))
xMAP xCM cov(x | y)
H−1(xMAP)
60
Big Dense Expensive to calculate Only have action
61
62
Wikipedia Commons
63
Direction in parameter space least constrained by the
64
65
66
67
Direction in parameter space most constrained by the
68
69
70
71
72
73
Matches trends from Flath et al. p424 for linear parameter to observable maps.
Γ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.
the recovered parameters in hyperelastic materials.
inversion.
relatively easy, solving them is tougher.
MCMC.
75