Semi-automatic transition from simulation to one-shot ... · Semi-automatic transition from...
Transcript of Semi-automatic transition from simulation to one-shot ... · Semi-automatic transition from...
Semi-automatic transition from simulation to one-shotoptimization with equality constraints
Lisa Kusch, Tim Albring, Andrea Walther, Nicolas Gauger
Chair for Scientific Computing, TU Kaiserslautern, www.scicomp.uni-kl.deInstitute of Mathematics, Universitat Paderborn
September 15, 2016
AD 2016
Outline
1 The One-Shot Approach with Additional Constraints
2 AD-Based Discrete Adjoint in SU2
3 Multi-Objective Optimization
4 Application and ResultsApplication to Airfoil DesignMulti-Objective Optimization with Single ConstraintMulti-Objective Optimization with Multiple ConstraintsSecond-Order Adjoints
5 Summary and Outlook
Kusch,Albring,Walther,Gauger From simulation to one-shot optimization with constraints 2/ 18
Problem Definition
PDE-constrained optimization problem
minu,y
f (y , u)
s.t. c(y , u) = 0,
h(y , u) = 0
→fixed point iteration||Gy || ≤ ρ < 1
minu,y
f (y , u)
s.t. G (y , u) = y ,
h(y , u) = 0
objective function f ∈ R, state y ∈ Y ⊂ Rn, design u ∈ U ⊂ Rm
state equation c : Y × U → Y , constraints h : Y × U → V ⊂ Rp
(notation: G = (G (y , u)− y , h(y , u))T )
⇒ one-shot approach using the AD-based discrete adjoint[Hamdi, Griewank(2010)],[Walther, Gauger, Kusch, Richert(2016)]
L(y , y , u) = f (y , u) + (G (y , u)− y)T y + hTµ = N(y , y , µ, u)− yT y
Kusch,Albring,Walther,Gauger From simulation to one-shot optimization with constraints 3/ 18
The One-Shot Approach with Additional Constraints
KKT point (discrete)
y∗ = Ny (y∗, y∗, µ, u∗)T = G (y∗, u)
y∗ = Ny (y∗, y∗, µ, u∗)T = fy (y∗, u∗)T + Gy (y∗, u∗)T y∗
0 = Nu(y∗, y∗, µ, u∗)T = fu(y∗, u∗)T + Gu(y∗, u∗)T y∗
0 = Nµ(y∗, y∗, µ, u∗)T = h(y∗, u∗)
One-shot approach with equality constraints
for k = 1, ...
yk+1 = G (yk , uk)
yk+1 = Ny (yk , yk , µk , uk)
uk+1 = uk − B−1k Nu(yk , yk , µk , uk)
µk+1 = µk − B−1k h(yk , uk)
Kusch,Albring,Walther,Gauger From simulation to one-shot optimization with constraints 4/ 18
Convergence Propertiesdoubly augmented Lagrangian
La(y , y , µ, u) =α
2||G (y , u)||2 +
β
2||Ny (y , y , µ, u)T − y ||2 + N − yT y
correspondence and descent condition√αβ(1− ρ) > 1 +
β
2||Nyy || (1)
and α ≥ ‖2(G>u )1...p(G>y )+(Nyu)1...p − (Nuu)1...p1...p‖/‖(Gu)1...p‖2
⇒ exact penalty function, descent for all large symmetric pos. def. B, B
choice of B
B ≈ ∇2uuL
a(y , y , u) ⇒ B = αGTu Gu + βNT
yuNyu + Nuu
Kusch,Albring,Walther,Gauger From simulation to one-shot optimization with constraints 5/ 18
Implementation Details
BFGS Update: B∆u ≈ ∇uLa(y , y , µ, u + ∆u)−∇uL
a(y , y , µ, u) =: r
calculate ∇uLa = α∆yT
k Gu + αhTu h + β∆yTk Nyu + Nu
Nu and ∆yTk Gu + hTu h can be obtained with reverse mode of AD from u
y = G (y , u)
v = f (y , u)
w = h(y , u)
u = fu(y , u)T v + Gu(y , u)T y + hu(y , u)T w
finite difference over reverse / tangent over reverse
∆yTk Nyu ≈
1
h(Nu(yk + h∆yk , yk , µk , uk)− Nu(yk , yk , µk , uk)) (2)
curvature condition: set Bk = I if rTk ∆uk ≤ 0
Kusch,Albring,Walther,Gauger From simulation to one-shot optimization with constraints 6/ 18
Open-source multiphysics suite SU2Under active development (Stanford University, TU Kaiserslautern, TUDelft,...)
FV discretization of (U)RANS equations and turbulence models usinghighly modular C++ code-structure, additional PDE solvers
Multi-grid and local time-stepping methods
Several space and time discretizations, MPI, python scripts
optimization environment based on continuous or discrete adjoint,integrated AD support [Albring, Sagebaum, Gauger(2015)]
Kusch,Albring,Walther,Gauger From simulation to one-shot optimization with constraints 7/ 18
Discrete-Adjoint Solver in SU2
operator overloading (frequent extensions/improvements)
shape optimization → mesh deformation as additional constraint in theoptimization problem M(u) = x
fixed-point form yk+1 = Ny (yk , yk , µk , uk)T
CoDiPack
open-source (https://github.com/SciCompKL/CoDiPack)
use of expression templates
different tape implementations
Performance SU2 (NASA Common Research Model)
Runtime Factor: 1.2
Memory Factor: 7.2
Kusch,Albring,Walther,Gauger From simulation to one-shot optimization with constraints 8/ 18
Multi-Objective Optimization Problem
miny ,u
F(y , u)
s.t. c(y , u) = 0, (3)
h(y , u) ≥ 0
(4)
Pareto dominance:
x dominates x if
∀i ∈ {1, ..., k} : fi (x) ≤ fi (x)
∃j ∈ {1, ..., k} : fj(x) < fj(x)
Kusch,Albring,Walther,Gauger From simulation to one-shot optimization with constraints 9/ 18
Methods for Multi-Objective Optimization
common: weighted sum,evolutionary algorithms
ε-constraint method[Marglin(1967)]
miny ,u
fsj (y , u)
s.t. c(y , u) = 0, (5)
h(y , u) = 0,
fi (x) ≤ f(j)i
∀ i ∈ {1, ..., k} i 6= sj
connected: equality constraints
Kusch,Albring,Walther,Gauger From simulation to one-shot optimization with constraints 10/ 18
Application (Airfoil Design)
aerodynamic shape optimizationof NACA 0012 airfoil
objectives: drag coefficient cd , liftcoefficient cl
bounded design variables:38 Hicks-Henne bump functions(bounds: [-0.005,0.005])
constraints: moment, thickness
steady Euler equations, transonicflow (Mach 0.8 and AOA 1.25)
Kusch,Albring,Walther,Gauger From simulation to one-shot optimization with constraints 11/ 18
Result: Lift Constraintpreconditioner B = 20, µ0 = 0, target lift: 0.4backtracking line search, trial step size: 1, α = 20, β = 2
0 400 800 1,200 1,600 2,000
0
0.4
Iteration
10cdcl
10||Nu||
0 500 1,000 1,500 2,000
−8
−6
−4
−2
Iteration
primal residualadjoint residual
Kusch,Albring,Walther,Gauger From simulation to one-shot optimization with constraints 12/ 18
Resulting Pareto-optimal Front
0 0.1 0.2 0.3 0.4 0.5 0.6 0.70
1
2
3·10−3
lift coefficient
dra
gco
effici
ent
Kusch,Albring,Walther,Gauger From simulation to one-shot optimization with constraints 13/ 18
Result: Lift, Moment, Thickness Constrainttarget lift: 0.3, moment: 0.0, thickness: 0.12preconditioner diag(20, 20, 100), µi,0 = 0
0 500 1,000 1,500 2,000 2,500 3,000 3,500 4,000
0
0.3
Iteration
10cdcl
10||Nu||cm
thickn.
Kusch,Albring,Walther,Gauger From simulation to one-shot optimization with constraints 14/ 18
Resulting Pareto-optimal Front
0 0.2 0.4 0.60
1
2
3
4·10−3
lift coefficient
dra
gco
effici
ent
Kusch,Albring,Walther,Gauger From simulation to one-shot optimization with constraints 15/ 18
Using Second-Order Adjoints
Tangent over Reverse: ∆yTk Nyu
˙uT = (yTGuy + vT fyu + wThyu)y + other terms (6)
⇒ Set v = 1, w = µ, y = y , y = ∆y , Read from ˙u (Runtime Factor: 1.6)
DataType: ActiveReal<RealForward, ChunkTape<RealForward, int>>
GetMixedDerivative: tape.getGradient(x[adjPos++]).getGradient()
0 200 400 600 800 1,000 1,200 1,400 1,600 1,800 2,000−0.5
0
0.5
1·10−2
Iteration
objective second orderobjective finite differences
Kusch,Albring,Walther,Gauger From simulation to one-shot optimization with constraints 16/ 18
Summary and Outlook
SummarySemi-automatic transition from simulation to optimization involving
AD-based discrete adjoint in SU2
constrained one-shot method and
deterministic multi-objective optimization
Outlook
different application in SU2 (multi-disciplinary)
investigations on preconditioner for constraints
Thank you for your attention!
Kusch,Albring,Walther,Gauger From simulation to one-shot optimization with constraints 17/ 18
References
Hamdi, A. and Griewank, A.
Properties of an augmented lagrangian for design optimization.Optimization Methods and Software 25(4), 645–664 (2010).
Walther, A., Gauger, N., Kusch, L., and Richert, N.
On an extension of one-shot methods to incorporate additional constraints.Optimization Methods and Software (2016).
Albring, T., Sagebaum, M., and Gauger, N.
Development of a consistent discrete adjoint solver in an evolving aerodynamic design framework.AIAA 2015-3240 (2015).
Marglin, S. A.
Public investment criteria.Allen & Unwin London, (1967).
Kusch,Albring,Walther,Gauger From simulation to one-shot optimization with constraints 18/ 18