Grégoire Allaire PDF 2

1
OPTIMAL DESIGN OF STRUCTURES (MAP 562)
G. ALLAIRE
July 6-17th, 2015
Department of Applied Mathematics, Ecole Polytechnique
LECTURE II
OPTIMAL CONTROL AND
PARAMETRIC (OR SIZING)
OPTIMIZATION
CIMPA Summer School on Current Research in Finite Element
Methods, IIT Mumbai
G. Allaire, Ecole Polytechnique
Optimal design of structures
2
Control of an elastic membrane
For f ∈ L2 (Ω), the vertical displacement u of the membrane is solution of

 −∆u = f + v in Ω
 u=0
on ∂Ω,
where v is a control force which is our optimization variable (for example, a
piezzo-electric actuator). We define the set of admissible controls
2
K = v ∈ L (ω) | vmin (x) ≤ v(x) ≤ vmax (x) in ω and v = 0 in Ω \ ω .
We want to control the membrane in order to reach a prescribed displacement
u0 ∈ L2 (Ω) by minimizing (c > 0)
Z
1
inf J(v) =
|u − u0 |2 + c|v|2 dx .
v∈K
2 Ω
G. Allaire, Ecole Polytechnique
Optimal design of structures
3
✞
☎
Existence of an optimal control
✝
✆
Proposition.
There exists a unique optimal control v ∈ K.
Proof. v → u is an affine function from K into H01 (Ω).
The integrand of J is a positive ”polynomial” of degree two in v.
v → J(v) is strongly convex on K which is convex.
Remark. The existence is often more delicate to prove, but the important
thing here is to compute a gradient J ′ (v) for numerical purposes.
Important notice: the solution u of the p.d.e. depends on the control v.
G. Allaire, Ecole Polytechnique
Optimal design of structures
4
✞
☎
Gradient and optimality condition
✝
✆
The safest and simplest way of computing a gradient is to evaluate the
directional derivative
Z
j(t) = J(v + tw) ⇒ j ′ (0) = hJ ′ (v), wi =
J ′ (v)w dx .
Ω
By linearity, we have u(v + tw) = u(v) + tũ(w) with

 −∆ũ(w) = w in Ω
 ũ(w) = 0
on ∂Ω.
In other words, ũ(w) = hu′ (v), wi.
Since J(v) is quadratic the computation is very simple and we obtain
Z
Z (u(v) − u0 )ũ(w) + cvw dx,
J ′ (v)w dx =
Ω
Ω
Unfortunately J ′ (v) is not explicit because we cannot factorize out
w in ũ(w) !
G. Allaire, Ecole Polytechnique
Optimal design of structures
5
✞
☎
Adjoint state
✝
✆
To simplify the gradient formula we use the so-called adjoint state p, defined
as the unique solution in H01 (Ω) of

 −∆p = u − u
in Ω
0
 p=0
on ∂Ω.
We multiply the equation for ũ(w) by p and conversely
Z
Z
equation for p × ũ(w) ⇒
∇p · ∇ũ(w) dx = (u − u0 )ũ(w) dx
Ω
equation for ũ(w) × p
⇒
Z
Ω
Ω
∇ũ(w) · ∇p dx =
Z
wp dx
Ω
Comparing these two equalities we deduce that
Z
Z
Z
Z
J ′ (v)w dx = (p + cv)w dx.
wp dx ⇒
(u − u0 )ũ(w) dx =
Ω
G. Allaire, Ecole Polytechnique
Ω
Ω
Ω
Optimal design of structures
6
☎
✞
Conclusion on the adjoint state
✝
✆
We found an explicit formula of the gradient
J ′ (v) = p + cv.
☞ Adjoint method: computation of the gradient by solving 2 boundary value
problems (u and p).
☞ If one does not use the adjoint: for each direction w one must solve 2
boundary value problems (u and ũ(w)) to evaluate hJ ′ (v), wi.
For example, if J ′ (v) is a vector of dimension n, its n components are
obtained by solving (n + 1) problems !
☞ Very efficient in practice: it is the best possible method.
☞ Inconvenient: if one uses a black-box software to compute u, it can be
very difficult to modify it in order to get the adjoint state p.
G. Allaire, Ecole Polytechnique
Optimal design of structures
7
✞
☎
Further remarks on the notion of adjoint state
✝
✆
☞ If the state equation is not self-adjoint (the bilinear form is not
symmetric), the operator of the adjoint equation is the transposed or
adjoint of the direct operator.
☞ If the state equation is time dependent with an initial condition, then the
adjoint equation is time dependent too, but backward with a final
condition.
☞ If the state equation is non-linear, the adjoint equation is linear.
The adjoint is not just a trick ! It can be deduced from the Lagrangian of the
problem.
G. Allaire, Ecole Polytechnique
Optimal design of structures
8
✞
☎
General method to find the adjoint equation
✝
✆
We consider the state equation as a constraint and, for any
(v̂, û, p̂) ∈ L2 (Ω) × H01 (Ω) × H01 (Ω), we introduce the Lagrangian of the
minimization problem
Z
Z
1
|û − u0 |2 + c|v̂|2 dx +
p̂(∆û + f + v̂) dx,
L(v̂, û, p̂) =
2 Ω
Ω
where p̂ is the Lagrange multiplier for the constraint which links the two
independent variables v̂ and û.
Integrating by parts yields
Z
Z
1
|û − u0 |2 + c|v̂|2 dx + (−∇p̂ · ∇û + f p̂ + v̂ p̂) dx.
L(v̂, û, p̂) =
2 Ω
Ω
Proposition. The optimality conditions are equivalent to the stationnarity of
the Lagrangian, i.e.,
∂L
∂L
∂L
=
=
= 0.
∂v
∂u
∂p
G. Allaire, Ecole Polytechnique
Optimal design of structures
9
✄
✂Proof ✁
•
∂L
∂p
•
∂L
∂u
= 0 ⇒ by definition, we recover the equation satisfied by the state u.
= 0 ⇒ equation satisfied by the adjoint state p. Indeed,
Z
∂L
ℓu (t) = L(v̂, û + tφ, p̂) ⇒ ℓ′u (0) = h
, φi =
((û − u0 )φ − ∇p̂ · ∇φ) dx
∂u
Ω
which is the variational formulation of the adjoint equation.
•
∂L
∂v
= 0 ⇒ formula for J ′ (v). Indeed,
ℓv (t) = L(v̂ + tw, û, p̂)
G. Allaire, Ecole Polytechnique
⇒
ℓ′v (0) = h
∂L
, wi =
∂v
Z
(cv̂ + p̂)w dx
Ω
Optimal design of structures
10
☎
✞
Simple formula for the derivative
✝
✆
In the preceding proof we obtained
∂L
J (v) =
(v, u, p)
∂v
′
with the state u and the adjoint p (both depending on v).
It is not a surprise ! Indeed,
J(v) = L(v, u, p̂)
∀p̂
because u is the state. Thus, if u(v) is differentiable, we get
∂L
∂L
∂u
hJ (v), wi = h
(v, u, p̂), wi + h
(v, u, p̂),
(w)i
∂v
∂u
∂v
′
We then take p̂ = p, the adjoint, to obtain
∂L
hJ (v), wi = h
(v, u, p), wi
∂v
′
G. Allaire, Ecole Polytechnique
Optimal design of structures
11
☎
✞
Another interpretation of the adjoint state
✝
✆
The adjoint state p is the Lagrange multiplier for the constraint of the state
equation. But it is also a sensitivity function.
Define the Lagrangian
Z
Z
1
|û − u0 |2 + c|v̂|2 dx + (−∇p̂ · ∇û + f p̂ + v̂ p̂) dx.
L(v̂, û, p̂, f ) =
2 Ω
Ω
We study the sensitivity of the minimum with respect to variations of f .
We denote by v(f ), u(f ) and p(f ) the optimal values, depending on f . We
assume that they are differentiable with respect to f . Then
∇f J(v(f )) = p(f ).
p gives the derivative (without further computation) of the minimun with
respect to f !
Indeed J(v(f )) = L(v(f ), u(f ), p(f ), f ) and
G. Allaire, Ecole Polytechnique
∂L
∂v
=
∂L
∂u
=
∂L
∂p
= 0.
Optimal design of structures
12
PARAMETRIC (OR SIZING)
OPTIMIZATION
G. Allaire, Ecole Polytechnique
Optimal design of structures
13
Optimization of a membrane thickness
Membrane occupying a bounded domain Ω in IRN . Forces f ∈ L2 (Ω),
displacement u ∈ H01 (Ω) which is solution of

 − div (h∇u) = f in Ω,
 u=0
on ∂Ω.
It is called parametric (or sizing) optimization because the computational
domain Ω is fixed. The thickness h(x) is just a parameter.
Admissible set of thicknesses h, defined by
Z
Uad = h ∈ L∞ (Ω) , hmax ≥ h(x) ≥ hmin > 0 in Ω,
h(x) dx = h0 |Ω| .
Ω
G. Allaire, Ecole Polytechnique
Optimal design of structures
14
Parametric shape optimization problem:
inf J(h) =
h∈Uad
Z
j(u) dx
Ω
where u depends on h through the state equation, and j is a C 1 function from
IR to IR such that |j(u)| ≤ C(u2 + 1) and |j ′ (u)| ≤ C(|u| + 1).
Examples:
☞ Compliance or work done by the load (a measure of rigidity)
j(u) = f u
☞ Least square criteria to reach a target displacement u0 ∈ L2 (Ω)
j(u) = |u − u0 |2
G. Allaire, Ecole Polytechnique
Optimal design of structures
15
Computation of a continuous gradient

 − div (h∇u) = f
 u=0
U = {h ∈ L∞ (Ω) ,
in Ω
on ∂Ω.
∃h0 > 0 such that h(x) ≥ h0 in Ω} .
Lemma. The application h → u(h), which gives the solution u(h) ∈ H01 (Ω)
for h ∈ U , is differentiable and its directional derivative at h in the direction
k ∈ L∞ (Ω) is given by
hu′ (h), ki = v,
where v is the unique solution in H01 (Ω) of

 − div (h∇v) = div (k∇u)
 v=0
G. Allaire, Ecole Polytechnique
in Ω
on ∂Ω.
Optimal design of structures
16
Proof. Formaly, one simply differentiates the equation with respect to h.
However, to be mathematically rigorous one should rather work at the level of
the variational formulation.
To compute the directional derivative, we define h(t) = h + tk for t > 0. Let
u(t) be the solution for the thickness h(t). Deriving with respect to t leads to

 − div (h(t)∇u′ (t)) = div (h′ (t)∇u(t)) in Ω
 u′ (t) = 0
on ∂Ω,
and, since h′ (0) = k, we deduce u′ (0) = v.
G. Allaire, Ecole Polytechnique
Optimal design of structures
17
Lemma. For h ∈ U , let u(h) be the state in H01 (Ω) and
Z
J(h) =
j u(h) dx ,
Ω
where j is a C 1 function from IR into IR such that |j(u)| ≤ C(u2 + 1) and
|j ′ (u)| ≤ C(|u| + 1) for any u ∈ IR. The application J(h), from U into IR, is
differentiable and its directional derivative at h in the direction k ∈ L∞ (Ω) is
given by
Z
′
′
hJ (h), ki =
j u(h) v dx ,
Ω
where v = hu′ (h), ki is the unique solution in H01 (Ω) of

 − div (h∇v) = div (k∇u) in Ω
 v=0
on ∂Ω.
Proof. By simple composition of differentiable applications.
G. Allaire, Ecole Polytechnique
Optimal design of structures
18
✞
☎
Adjoint state
✝
✆
We introduce an adjoint state p defined as the unique solution in H01 (Ω) of

 − div (h∇p) = −j ′ (u) in Ω
 p=0
on ∂Ω.
Theorem. The cost function J(h) is differentiable on U and
J ′ (h) = ∇u · ∇p .
If h ∈ Uad is a local minimizer of J in Uad , it satisfies the necessary optimality
condition
Z
∇u · ∇p (k − h) dx ≥ 0
Ω
for any k ∈ Uad .
G. Allaire, Ecole Polytechnique
Optimal design of structures
19
Proof. To make explicit J ′ (h), we must eliminate v = hu′ (h), ki. We use the
adjoint state for that: multiplying the equation for v by p and that for p by v,
we integrate by parts
Z
Z
h∇p · ∇v dx = −
j ′ (u)v dx
Ω
Z
Ω
Ω
h∇v · ∇p dx = −
Z
Ω
k∇u · ∇p dx
Comparing these two equalities we deduce
Z
Z
k∇u · ∇p dx,
j ′ (u)v dx =
hJ ′ (h), ki =
Ω
Ω
for any k ∈ L∞ (Ω). Since ∇u · ∇p belongs to L1 (Ω), we check that J ′ (h) is
continuous on L∞ (Ω).
G. Allaire, Ecole Polytechnique
Optimal design of structures
20
✞
☎
How to find the adjoint state
✝
✆
For independent variables (ĥ, û, p̂) ∈ L∞ (Ω) × H01 (Ω) × H01 (Ω), we introduce
the Lagrangian
Z
Z L(ĥ, û, p̂) =
j(û) dx +
p̂ − div ĥ∇û − f dx,
Ω
Ω
where p̂ is a Lagrange multiplier (a function) for the constraint which
connects u to h. By integration by parts we get
Z
Z ĥ∇p̂ · ∇û − f p̂ dx,
L(ĥ, û, p̂) =
j(û) dx +
Ω
Ω
The partial derivative of L with respect to u in the direction φ ∈ H01 (Ω) is
Z
Z ∂L
′
ĥ∇p̂ · ∇φ dx,
h
(ĥ, û, p̂), φi =
j (û)φ dx +
∂u
Ω
Ω
which, when it vanishes, is nothing else than the variational formulation of the
adjoint equation.
G. Allaire, Ecole Polytechnique
Optimal design of structures
21
☎
✞
A simple formula for the derivative
✝
✆
The Lagrangian yields the following formula
J ′ (h) =
∂L
(h, u, p)
∂h
with the state u and the adjoint p.
This is not a surprise ! Indeed,
J(h) = L(h, u, p̂)
∀p̂
because u is the state. Thus, if u(h) is differentiable, we get
∂L
∂L
∂u
hJ (h), ki = h
(h, u, p̂), ki + h
(h, u, p̂),
(k)i
∂h
∂u
∂h
′
Then, taking p̂ = p, the adjoint, we obtain
hJ ′ (h), ki = h
G. Allaire, Ecole Polytechnique
∂L
(h, u, p), ki
∂h
Optimal design of structures
22
The self-adjoint case: the compliance
When j(u) = f u, we find p = −u since j ′ (u) = f . This particular case is said
to be self-adjoint.
We use the dual or complementary energy
Z
Z
f u dx =
min
h−1 |τ |2 dx .
τ ∈L2 (Ω)N
Ω
− divτ =f
in
Ω
Ω
We can rewrite the optimization problem as a double minimization
Z
h−1 |τ |2 dx ,
min
inf
h∈Uad
τ ∈L2 (Ω)N
− divτ =f
in
Ω
Ω
and the order of minimization is irrelevent.
G. Allaire, Ecole Polytechnique
Optimal design of structures
23
✄
✂An existence result ✁
We rewrite the problem under the form
Z
inf
h−1 |τ |2 dx .
(h,τ )∈Uad ×H
Ω
with H = {τ ∈ L2 (Ω)N , − divτ = f in Ω}.
Lemma. The function φ(a, σ) = a−1 |σ|2 , defined from IR+ × IRN into IR, is
convex and satisfies
a
′
φ(a, σ) = φ(a0 , σ0 ) + φ (a0 , σ0 ) · (a − a0 , σ − σ0 ) + φ(a, σ − σ0 ),
a0
where the derivative is given by
φ′ (a0 , σ0 ) · (b, τ ) = −
b
2
2
|σ
|
+
σ0 · τ.
0
2
a0
a0
Theorem. There exists a minimizer to the compliance minimization problem.
G. Allaire, Ecole Polytechnique
Optimal design of structures
24
✞
☎
Optimality conditions for compliance minimization
✝
✆
Lemma. Take τ ∈ L2 (Ω)N . The problem
Z
h−1 |τ |2 dx
min
h∈Uad
admits a minimizer h(τ )

∗

h
(x)


h(τ )(x) =
hmin



hmax
Ω
in Uad given by
if hmin < h∗ (x) < hmax
with h∗ (x) =
∗
if h (x) ≤ hmin
if h∗ (x) ≥ hmax
where ℓ ∈ IR+ is the Lagrange multiplier such that
Z
Ω
|τ (x)|
√ ,
ℓ
h(x) dx = h0 |Ω|.
Proof. The function h → Ω h−1 |τ |2 dx is convex from Uad into IR and we
easily compute its derivative.
R
G. Allaire, Ecole Polytechnique
Optimal design of structures
25
Numerical algorithm
✞
☎
Projected gradient
✝
✆
1. Initialization of the thickness h0 ∈ Uad (by example, a constant function
which satisfies the constraints).
2. Iterations until convergence, for n ≥ 0:
hn+1 = PUad hn − µJ ′ (hn ) ,
where µ > 0 is a descent step, PUad is the projection operator on the
closed convex set Uad and the derivative is given by
J ′ (hn ) = ∇un · ∇pn
with the state un and the adjoint pn (associated to the thickness hn ).
To make the algorithm fully explicit, we have to specify what is the projection
operator PUad .
G. Allaire, Ecole Polytechnique
Optimal design of structures
26
We characterize the projection operator PUad
PUad (h) (x) = max (hmin , min (hmax , h(x) + ℓ))
where ℓ is the unique Lagrange multiplier such that
Z
PUad (h) dx = h0 |Ω|.
Ω
The determination of the constant ℓ is not explicit: we must use an iterative
algorithm based on the property of the function
Z
ℓ → F (ℓ) =
max (hmin , min (hmax , h(x) + ℓ)) dx
Ω
which is strictly increasing on the interval [ℓ− , ℓ+ ], reciprocal image of
[hmin |Ω|, hmax |Ω|]. Thanks to this monotonicity property, we propose a simple
iterative algorithm: we first bracket the root by an interval [ℓ1 , ℓ2 ] such that
F (ℓ1 ) ≤ h0 |Ω| ≤ F (ℓ2 ),
then we proceed by dichotomy to find the root ℓ.
G. Allaire, Ecole Polytechnique
Optimal design of structures
27
☞ In practice, we rather use a projected gradient algorithm with a variable
step (not optimal) which guarantees the decrease of the functional
J(hn+1 ) < J(hn ).
☞ The algorithm is rather slow. A possible acceleration is based on the
quasi-Newton algorithm.
☞ The overhead generated by the adjoint computation is very modest : one
has to build a new right-hand-side (using the state) and solve the
corresponding linear system (with the same rigidity matrix).
☞ Convergence is detected when the optimality condition is satisfied with a
threshold ǫ > 0
|hn − max (hmin , min (hmax , hn − µn J ′ (hn ) + ℓn ))| ≤ ǫµn hmax .
G. Allaire, Ecole Polytechnique
Optimal design of structures
28
Thickness optimization of an elastic plate
h
Ω


− divσ = f




 σ = 2µh e(u) + λh tr(e(u)) Id

u=0




 σn = g
with the strain tensor e(u) =
G. Allaire, Ecole Polytechnique
1
2
in Ω
in Ω
on ΓD
on ΓN
t
∇u + (∇u) .
Optimal design of structures
29
Set of admissible thicknesses:
Z
Uad = h ∈ L∞ (Ω) , hmax ≥ h(x) ≥ hmin > 0 in Ω,
h(x) dx = h0 |Ω| .
Ω
The compliance optimization can be written
Z
Z
f · u dx +
inf J(h) =
h∈Uad
Ω
ΓN
g · u ds.
The theoretical results are the same.
We apply the optimality criteria method.
G. Allaire, Ecole Polytechnique
Optimal design of structures
30
☎
✞
Boundary conditions and mesh for an elastic plate
✝
✆
FreeFem++ computations ; scripts available on the web page
http://www.cmap.polytechnique.fr/~allaire/cours X annee3.html
G. Allaire, Ecole Polytechnique
Optimal design of structures
31
☎
✞
Thickness at iterations 1, 5, 10, 30 (uniform initialization).
✝
✆
hmin = 0.1, hmax = 1.0, h0 = 0.5 (increasing thickness from white to black)
G. Allaire, Ecole Polytechnique
Optimal design of structures
32
☎
✞
Comparing the initial and final deformed shapes
✝
✆
G. Allaire, Ecole Polytechnique
Optimal design of structures
33
✞
☎
Convergence history
✝
✆
28
27
fonction objectif
26
25
24
23
22
21
20
5
10
15
20
25
30
iterations
G. Allaire, Ecole Polytechnique
Optimal design of structures
34
✞
☎
Numerical instabilities (checkerboards)
✝
✆
☞ Finite elements P 2 for u and P 0 for h ⇒ OK
☞ Finite elements P 1 for u and P 0 for h ⇒ unstable !
G. Allaire, Ecole Polytechnique
Optimal design of structures
35
☎
✞
Numerical counter-example of non-existence of an optimal shape (in elasticity)
✝
✆
We look for the design which horizontally is less deformed and vertically more
deformed.
Γ+
ΓN
ΓD
Γ−
boundary conditions
G. Allaire, Ecole Polytechnique
target displacement
Optimal design of structures
36
☎
✞
Optimal shapes for meshes with 448, 947, 3992, 7186 triangles
✝
✆
G. Allaire, Ecole Polytechnique
Optimal design of structures
37
☎
✞
No convergence under mesh refinement !
✝
✆
More and more details appear when the mesh size is decreased.
The value of the objective function decreases with the mesh size.
448
947
3992
7186
Fonction objectif
4040
4035
4030
0
10
20
30
40
50
60
70
80
90
100
Nombre d’iterations
G. Allaire, Ecole Polytechnique
Optimal design of structures
38
Regularization
Triple motivation:
☞ To avoid instabilities when using P 1 finite elements for u and P 0 for h
(less expensive than P 2-P 0).
☞ To obtain an algorithm which converges by mesh refinement.
☞ To adhere to a “regularized” framework (with existence of optimal
solutions).
G. Allaire, Ecole Polytechnique
Optimal design of structures
39
Main idea: we change the scalar product
Z
k∇u · ∇p dx ∀ k ∈ Uad .
hJ ′ (h), ki =
Ω
Previously we identified Uad to a subspace of L2 (Ω), thus
Z
hJ ′ (h), ki =
J ′ (h) k dx
⇒
J ′ (h) = ∇u · ∇p .
Ω
reg
to a subspace H 1 (Ω),
Now, we identify a “regularized” admissible set Uad
thus
Z
hJ ′ (h), ki =
(∇J ′ (h) · ∇k + J ′ (h)k) dx ,
Ω
and we deduce a new formula for the gradient

′
′

 −∆J (h) + J (h) = ∇u · ∇p
′

 ∂J (h) = 0
∂n
G. Allaire, Ecole Polytechnique
in Ω,
on ∂Ω.
Optimal design of structures
40
✞
☎
Regularized optimal shape
✝
✆
Finite elements P1 -P0 . Compliance minimization. Alternate directions
algorithm.
G. Allaire, Ecole Polytechnique
Optimal design of structures
41
✞
☎
Convergence by mesh refinement
✝
✆
Same case as the “numerical counter-examples” (meshes 448, 947, 3992, 7186).
G. Allaire, Ecole Polytechnique
Optimal design of structures
42
✄
✂Conclusion ✁
☞ Regularization works !
☞ It costs a bit more (solving an additional Laplacian to compute the
gradient).
☞ Difficulty in choosing the regularization parameter ǫ > 0 (which can be
interpreted as a lengthscale)
−ǫ2 ∆J ′ (h) + J ′ (h) = ∇u · ∇p
in Ω
☞ It has a tendency to smooth the geometric details.
G. Allaire, Ecole Polytechnique
Optimal design of structures