MMA Presentation
MMA Presentation
Topology Optimization Example with Microstructure and 3D Printed Structure for the NPR
Minimum Compliance Design [1] Material Designed by Erik et.al [2]
[1] Ji-Hong Zhu, Wei-Hong Zhang, Liang Xia, “Topology Optimization in Aircraft and Aerospace Structures Design,” Archieves of Computational Methods in Engineering,
vol. 23, pp. 595-622, 2016 3
[2] Erik Andreassen, Boyan S. Lazarov, Ole Sigmund, “Design of Manufacturable 3D Extremal Elastic Microstructure,” Mechanics of Materials, vol. 69, pp. 1-10, 2014.
General form of Structural Optimization Problem
𝑃: minimize 𝐴1 + 𝐴2
𝐹𝑐𝑜𝑠 𝛼
subject to ≤ 𝜎0 ,
𝐴1
𝐹𝑠𝑖𝑛 𝛼
≤ 𝜎0
𝐴2
𝐴1 , 𝐴2 ≥ 0
Two bar truss [1] Graphical Solution [1]
4
[1] Peter W. Christensen, Anders Klarbring, An Introduction to Structural Optimization, Linkoping, Sweden: Springer Science, 2009.
KKT conditions
• Solving for the stationary points
1. ℒ 𝒙, 𝝀 = 𝑓0 𝒙 + σ𝑚
𝑖=1 𝜆𝑖 𝑓𝑖 (𝒙)
3. 𝜆𝑖 𝑓𝑖 𝒙 = 0,
4. 𝑓𝑖 𝑥 ≤ 0
5. 𝜆𝑖 ≥ 0
Geometrical interpretation [1]
• Negative of gradient of objective function should be the linear combination of gradients of active
constraints.
• At point 𝒙1 in figure −𝛻𝑓0 𝒙1 = 𝜆1 𝛻𝑓1 𝒙1 + 𝜆2 𝛻𝑓2 𝒙1 , 𝜆1 ≥ 0, 𝜆2 ≥ 0, so 𝒙1 is a KKT point and
consequently optimal solution.
• There does not exist any 𝜆2 ≥ 0 and 𝜆3 ≥ 0 such that −𝛻𝑓0 𝒙2 = 𝜆2 𝛻𝑓2 𝒙2 + 𝜆3 𝛻𝑓3 (𝒙2 ). Consequently,
𝒙2 is not a KKT point and hence not an optimal solution.
5
[1] Peter W. Christensen, Anders Klarbring, An Introduction to Structural Optimization, Linkoping, Sweden: Springer Science, 2009.
Iterative Approach
Approach requiring function and gradient information
• Sub-problem 𝑃𝑘
𝑘
𝒙 ∈ 𝕊,
Given 𝒙 ,
Calculate
𝒙𝑘+1 = 𝒙
ෝ𝑘 𝑓𝑖 (𝒙 ) and 𝛻𝑓𝑖 (𝒙𝑘 )
𝑘
𝕊 = {𝒙 ∈ ℝ𝑛 : 𝑥𝑗min ≤ 𝑥𝑗 ≤ 𝑥𝑗max , 𝑗 = 1, … , 𝑛
• Objective function and constraints are linearized with respect to intermediate variables
• 𝜙𝑗 𝑥𝑗 = 𝑥𝑗
𝜕𝑓
• 𝑓ሚ𝑖 (𝒙) = 𝑓𝑖 𝒙𝑘 + σ𝑛𝑗=1 𝜕𝑥 ฬ 𝑥𝑗 − 𝑥𝑗𝑘
𝑗 𝒙𝑘
𝜕𝑓
• 𝑓𝑖 𝒙𝑘 and 𝜕𝑥 ฬ are constants → separable approximation.
𝑗 𝒙𝑘
• Approximated functions are affine functions i.e. 𝒂𝑻 𝒙 + 𝒃 (𝒂, 𝒃 constants) → Convex approximation.
7
Approximation Methods Cont..
2. Convex Linearization (CONLIN)
1
• Statically determinate structures stresses and displacements are function of .
𝐴𝑗
1 1
• Linearization with inverse variables → 𝜙𝑗 𝑥𝑗 =
𝑥𝑗 𝑥𝑗
𝜕𝑓 2 1 1
• 𝑓ሚ𝐼 𝒙 = 𝑓 𝒙𝑘 + σ𝑛𝑗=1 − 𝑥 ฬ −
𝜕𝑥𝑗 𝑗 𝑘 𝑥𝑗 𝑥𝑗𝑘
𝒙
8
Approximation Methods Cont..
• Convex Linearization (CONLIN)
• Hessian (𝛻 2 𝑓ሚ 𝒙 ). • Non-diagonal terms will be zero
• Diagonal terms has to be non-negative
𝜕 2 𝑓ሚ 𝜕 2 𝑓ሚ 𝜕 2 𝑓ሚ 2
⋯ Separable Func. 2 𝑥𝑗𝑘
𝜕𝑥12 𝜕𝑥1 𝜕𝑥2 𝜕𝑥1 𝜕𝑥𝑛 𝜕2 𝑓ሚ 𝜕𝑓
• =− ฬ
𝜕 2 𝑓ሚ 𝜕 2 𝑓ሚ 𝜕 2 𝑓ሚ 𝜕𝑥𝑗2 𝜕𝑥𝑗 𝑘 𝑥𝑗3
… 𝒙
𝛻 2 𝑓ሚ 𝒙 = 𝜕𝑥2 𝜕𝑥1 𝜕𝑥22 𝜕𝑥2 𝜕𝑥𝑛
𝜕𝑓
⋮ . ⋱ ⋮ • ฬ ≤0
2 ሚ
𝜕 𝑓 2 ሚ
𝜕 𝑓 2 ሚ
𝜕 𝑓 𝜕𝑥𝑗 𝑘
𝒙
⋯
𝜕𝑥𝑛 𝜕𝑥1 𝜕𝑥𝑛 𝜕𝑥2 𝜕𝑥𝑛2 • Function will be convex
• Conservativeness 2
𝜕𝑓 𝑥𝑗𝑘 −𝑥𝑗 Disadvantages
• 𝑓෫ ෫
𝐼 𝒙 − 𝑓𝑙 𝒙 = − 𝜕𝑥 ฬ •
𝜕𝑓
ฬ ≤0
𝑗 𝒙𝑘 𝑥𝑗 𝜕𝑥𝑗 𝑘
𝒙 • Too slow convergence
for some variables.
Conclusion • Sometimes oscillation
𝜕𝑓 occurs about point
• Use 𝑥𝑗 for whom 𝜕𝑥 𝑖 ฬ > 0 for direct approximation because of less
𝑗 𝒙𝑘
𝜕𝑓 conservativeness.
• Use 𝑥𝑗 for whom 𝜕𝑥 𝑖 ฬ ≤ 0 for inverse approximation
𝑗 𝒙𝑘 9
Method of Moving Asymptotes (MMA)
• Generalization of CONLIN
Original form of MMA
1 𝜕𝑓 𝑘 𝑘
, for those 𝑥𝑗 whose ฬ >0 𝑝𝑖𝑗 𝑞𝑖𝑗
𝑈𝑗 −𝑥𝑗 𝜕𝑥𝑗 𝑘
𝒙 • 𝑓ሚ𝑖𝑘 𝒙 = 𝑟𝑖𝑘 + σ𝑛𝑗=1 +
• 𝜙𝑗 𝑥𝑗 = , 𝑗 = 1, … , 𝑛 𝑈𝑗𝑘 −𝑥𝑗 𝑥𝑗 −𝐿𝑘𝑗
1 𝜕𝑓
, for those 𝑥𝑗 whose ฬ ≤0 2 𝜕𝑓𝑖 𝜕𝑓𝑖
𝑥𝑗 −𝐿𝑗 𝜕𝑥𝑗 𝑘
𝒙 𝑈𝑗𝑘 − 𝑥𝑗𝑘 , if >0
𝑘 𝜕𝑥𝑗 𝜕𝑥𝑗
• 𝐿𝑗 and 𝑈𝑗 are so-called Moving Asymptotes . 𝐿𝑗𝑘 < 𝑥𝑗𝑘 < 𝑈𝑗𝑘 • 𝑝𝑖𝑗 = 𝜕𝑓𝑖
0, if ≤0
𝜕𝑥𝑗
𝜕𝑓𝑖
Convexity Check 0, if ≥0
𝑘 𝜕𝑥𝑗
𝑘 𝑘 • 𝑞𝑖𝑗 =
𝜕2 𝑓ሚ𝑖𝑘 2𝑝𝑖𝑗 2𝑞𝑖𝑗 2 𝜕𝑓𝑖 𝜕𝑓𝑖
• = 3 + 3 − 𝑥𝑗𝑘 − 𝐿𝑗𝑘 , if <0
𝜕𝑥𝑗2 𝑈𝑗𝑘 −𝑥𝑗 𝑥𝑗 −𝐿𝑘𝑗
𝜕𝑥𝑗 𝜕𝑥𝑗
𝑘 𝑘
𝜕2 𝑓ሚ𝑖𝑘 𝑝𝑖𝑗 𝑞𝑖𝑗
• = 0 if 𝑗 ≠ 𝑙 • 𝑟𝑖𝑘 = 𝑓𝑖 𝒙 𝑘
− σ𝑛𝑗=1 +
𝜕𝑥𝑗 𝜕𝑥𝑙 𝑈𝑗𝑘 −𝑥𝑗𝑘 𝑥𝑗𝑘 −𝐿𝑘𝑗
• Requires function values and first
𝜕2 𝑓ሚ𝑖𝑘 𝑘 𝑘 order derivatives.
• ≥ 0 since 𝑝𝑖𝑗 ≥ 0 and 𝑞𝑖𝑗 ≥0
𝜕𝑥𝑗2
10
Method of Moving Asymptotes (MMA) Cont..
• Simplification of second derivative 𝑔 𝑥 =𝑥+𝑥 − 2 𝑥4
at 𝑥 0 = 1, 𝑔𝑥 𝑥 0 = 2.9 > 0
𝜕𝑓 40
2𝜕𝑥 𝑖
𝑗 𝜕𝑓𝑖
𝑘, if >0
𝜕2 𝑓ሚ𝑖𝑘 𝑈𝑗𝑘 −𝑥𝑗 𝜕𝑥𝑗
• =
𝜕𝑥𝑗2 𝜕𝑓
2𝜕𝑥 𝑖
𝑗 𝜕𝑓𝑖
− , if <0
𝑥𝑗 −𝐿𝑘𝑗
𝑘 𝜕𝑥𝑗
• For 𝑘 > 2
𝑆slower if 𝑥𝑗𝑘 − 𝑥𝑗𝑘−1 𝑥𝑗𝑘−1 − 𝑥𝑗𝑘−2 < 0
• 𝑈𝑗𝑘 = 𝑥𝑗𝑘 + 𝑆(𝑈𝑗𝑘−1 − 𝑥𝑗𝑘−1 )
𝑆 = 𝑆faster if 𝑥𝑗𝑘 − 𝑥𝑗𝑘−1 𝑥𝑗𝑘−1 − 𝑥𝑗𝑘−2 > 0
• 𝐿𝑗𝑘 = 𝑥𝑗𝑘 − 𝑆(𝑥𝑗𝑘−1 − 𝐿𝑗𝑘−1 )
1 if 𝑥𝑗𝑘 − 𝑥𝑗𝑘−1 𝑥𝑗𝑘−1 − 𝑥𝑗𝑘−2 = 0
• 0 < 𝑆slower < 1 → Asymptotes are brought closer to 𝑥𝑗𝑘 , conservativeness increases.
• 𝑆faster > 1 → Asymptotes are brought further away from 𝑥𝑗𝑘 , Conservativeness decreases.
12
Modifications in Original MMA
𝑚
1
minimize 𝑓ሚ0 𝒙 + 𝑎0 𝑧 + (𝑐𝑖 𝑦𝑖 + 𝑑𝑖 𝑦𝑖2 ) Standard structural optimization form
2 𝑃: minimize 𝑓0 𝒙 𝑥𝜖𝑅𝑛
𝑖=1 𝑎0 = 1
subject to 𝑓ሚ𝑖 𝒙 − 𝑎𝑖 𝑧 − 𝑦𝑖 ≤ 𝑏𝑖 , 𝑖 = 1, … , 𝑚 𝑎𝑖 = 0, subject to 𝑓𝑖 𝒙 ≤ 0, for 𝑖 = 1, … , 𝑚
𝑥𝑗min ≤ 𝑥𝑗 ≤ 𝑥𝑗max , 𝑗 = 1, … , 𝑛 𝒙 ∈ 𝕊,
𝑧 ≥ 0, 𝑦𝑖 ≥ 0, 𝑖 = 1, … , 𝑚 𝑑𝑖 = 0 𝕊 = {𝒙 ∈ ℝ𝑛 : 𝑥𝑗min ≤ 𝑥𝑗 ≤ 𝑥𝑗max , 𝑗
• 𝑎𝑖 , 𝑐𝑖 , and 𝑑𝑖 are non-negative real numbers 𝑐𝑖 = a large = 1, … , 𝑛
number • 𝑦𝑖 becomes positive to provide
𝑖 = 1, … , 𝑚. feasible solution at initial iterations.
𝑎0 = 𝑎1 = ⋯ 𝑎𝑝 = 1 𝑓0 𝑥 = 0, 𝑚 = 𝑝 + 𝑞
𝑎𝑝+1 = ⋯ 𝑎𝑝+𝑞 = 0 𝑓𝑖 𝑥 = ℎ𝑖 (𝑥),𝑖 = 1, . . , 𝑝
𝑑𝑖 = 0, 𝑐𝑖 = a large number 𝑓𝑝+𝑖 𝑥 = 𝑔𝑖 𝑥 , 𝑖 = 1, . . , 𝑞
No
𝜈 =𝜈+1
(𝑘,𝜈)
calculate 𝑓ሚ𝑖 ,
Formulate & solve sub-problem to get
ෝ 𝑘,𝜈
𝒙 14
MMA Test on Benchmark Optimization Problems
• Code provided by Prof. Krister Svanberg was used for generating sub-problem.
• Modified code for implementation of GCMMA was tested on Rosenbrock function.
• Function and gradient information required is either provided explicitly or calculated using FEM and
Sensitivity Analysis.
• Sub-problem is solved using Primal-Dual Interior Point Algorithm.(Code provided by Prof. Krister
Svanberg)
15
MMA Test on Benchmark Optimization Problems Cont..
Constraint function minimization problem
• Rosenbrock function constraint with a cubic and a
line • Constraint function II
• Minimize 𝑓 𝑥 = 1 − 𝑥1 2
+ 100 𝑥2 − 𝑥12 2 • Minimize 𝑓 𝑥 = 𝑥12 + 𝑥2 − 11 2 + 𝑥1 + 𝑥22 − 7 2
[1] Kang Seok Lee and Zong Woo Geem, “A New Meta-Heuristic Algorithm for Continuous Engineering Optimization: Harmony Search Theory and Practice,” Computer 16
Methods in Applied Mechanics and Engineering, vol. 194, pp. 3902-3933, 2005.
MMA Test on Benchmark Optimization Problems Cont..
Structural Engineering optimization problem with all continuous variables.
• Three bar truss
• Explicit Expression for constraints and gradients.
• Objective is to minimize weight. Literature [1] MMA MMA (FEM)
• Design variables are 𝑥1 , 𝑥2 cross sectional areas of member. 𝑥1 0.7886 0.7880 0.7870
• Constraints on max stress in each bar. 𝑥2 0.4840 0.4101 0.4130
• 3 Nonlinear inequality constraints.
𝑓(𝑥) 263.8958 263.9000 263.9000
• 𝑙 = 100 cm , 𝑃 = 2 KN/cm2 , 𝜎 =2 KN/cm2
[1] Tapabrata Ray and K.M. Liew, “Society and Civilization : An Optimization Algorithm Based on the Simulation of Social Behaviour,” IEEE Transactions on 17
Evolutionary Computation, vol. 7, no. 4, August 2003.
MMA Test on Benchmark Optimization Problems Cont..
Structural Engineering optimization problem with all continuous variables.
Welded beam problem
• Minimize cost of welding
• Four design variables 𝑥1 ℎ , 𝑥2 𝑙 , 𝑥3 𝑡 , and 𝑥4 𝑏 Literature
MMA
• Constraints on shear stress, bending stress, buckling [1]
Literature[1] 110000
Harmony Search
22
23
Appendix
Convex Programming
• If the objective function and all constraints in Problem 𝑃 are convex then problem 𝑃 is said to be convex.
• For function to be convex following conditions need to followed
• A set 𝒮 ⊂ ℝ𝑛 is convex if for all 𝒙𝟏 , 𝒙𝟐 ∈ 𝒮 and all 𝜆 ∈ 0,1 , it holds that
𝜆𝒙𝟏 + 1 − 𝜆𝒙𝟐 ∈ 𝒮
• A function 𝑓: 𝒮 → ℝ is convex (on the convex set 𝒮) if, for all 𝒙𝟏 , 𝒙𝟐 ∈ 𝒮 with 𝒙𝟏 ≠ 𝒙𝟐 and 𝜆 ∈ 0,1 , it
holds that
𝑓 𝜆𝒙𝟏 + 1 − 𝜆 𝒙𝟐 ≤ 𝜆𝑓 𝒙𝟏 + (1 − 𝜆)𝑓(𝒙𝟐 )
𝑘,𝜈 𝑘,𝜈
(𝑘,𝜈) 𝑝𝑖𝑗 𝑞𝑖𝑗
• 𝑓ሚ𝑖 𝒙 = 𝑟𝑖𝑘,𝜈 + σ𝑛𝑗=1 +
𝑈𝑗𝑘 −𝑥𝑗 𝑥𝑗 −𝐿𝑘𝑗
27
Adjoint Method for Sensitivity Analysis
𝜕𝑓 𝑇
• 𝑲 𝒙𝑘 𝝀=
𝜕𝑼
𝜕𝑓
• will be zero if function is not explicit expression of design variable.
𝜕𝑥𝑗
𝑑𝑭
• will be zero if forcing condition is not explicit expression of design variable.
𝑑𝑥𝑗
𝐸
𝜕𝑓𝑖 𝜕 𝐿 −𝐶 −𝑆 𝐶 𝑆 {𝑈 𝑒 }
• =
𝜕𝑼 𝜕𝑼
𝜕𝑓𝑖 𝜕𝑓𝑖 𝜕𝑓𝑖 𝜕𝑓𝑖 𝜕𝑓𝑖
• = 𝑘 = 1, … , 𝑛𝑑𝑜𝑓 = , ,…,
𝜕𝑼 𝜕𝑈𝑘 𝜕𝑈1 𝜕𝑈2 𝜕𝑈𝑛𝑑𝑜𝑓
𝜕𝑓𝑖 1, 𝑓𝑗 is constraint on 𝑈𝑘
=ቊ
𝜕𝑈𝑘 0, elsewere
28