Abstract
We present a 250-line Matlab code for topology optimization for linearized buckling criteria. The code is conceived to handle stiffness, volume and buckling load factors (BLFs) either as the objective function or as constraints. We use the Kreisselmeier-Steinhauser aggregation function in order to reduce multiple objectives (viz. constraints) to a single, differentiable one. Then, the problem is sequentially approximated by using MMA-like expansions and an OC-like scheme is tailored to update the variables. The inspection of the stress stiffness matrix leads to a vectorized implementation for its efficient construction and for the sensitivity analysis of the BLFs. This, coupled with the efficiency improvements already presented by Ferrari and Sigmund (Struct Multidiscip Optim 62:2211–2228, 2020a), cuts all the computational bottlenecks associated with setting up the buckling analysis and allows buckling topology optimization problems of an interesting size to be solved on a laptop. The efficiency and flexibility of the code are demonstrated over a few structural design examples and some ideas are given for possible extensions.
References
Andreassen E, Clausen A, Schevenels M, Lazarov BS, Sigmund O (2011) Efficient topology optimization in matlab using 88 lines of code. Struct Multidiscip Optim 43 (1):1–16. https://doi.org/10.1007/s00158-010-0594-7
Bathe KJ (1982) Finite element procedures in engineering analysis, 1st edn. Prentice-Hall, Englewood Cliffs
Bendsøe MP, Sigmund O (2004) Topology optimization: Theory, methods and applications. Springer, New York
de Borst R, Crisfield MA, Remmers JJC, Verhoosel CV (2012) Non–linear finite element analysis of solids and structures, 2nd edition edn. John Wiley & Sons, New York
Bourdin B (2001) Filters in topology optimization. Int J Numer Methods Eng 50(9):2143–2158. https://doi.org/10.1002/nme.116
Brent R (1973) Algorithms for minimization without derivatives. Prentice Hall, Englewood Cliffs
Bruns TE, Tortorelli DA (2001) Topology optimization of non-linear elastic structures and compliant mechanisms. Comput Methods Appl Mech Eng 190(26):3443–3459. https://doi.org/10.1016/S0045-7825(00)00278-4http://www.sciencedirect.com/science/article/pii/S0045782500002784
Bruyneel M, Colson B, Remouchamps A (2008) Discussion on some convergence problems in buckling optimisation. Struct Multidiscip Optim 35(2):181–186
Crisfield MA (1991) Nonlinear finite element analysis of solid and structures, vol I. Wiley, New York
Dunning PD, Ovtchinnikov E, Scott J, Kim A (2016) Level–set topology optimization with many linear buckling constraints using and efficient and robust eigensolver. Int J Numer Methods Eng 107 (12):1029–1053
Engblom S, Lukarski D (2016) Fast matlab compatible sparse assembly on multicore computers. Parallel Comput 56:1–17
Ferrari F, Sigmund O (2019) Revisiting topology optimization with buckling constraints. Struct Multidiscip Optim 59(5):1401–1415. https://doi.org/10.1007/s00158-019-02253-3
Ferrari F, Sigmund O (2020a) A new generation 99 line matlab code for compliance topology optimization and its extension to 3d. Struct Multidiscip Optim 62:2211–2228
Ferrari F, Sigmund O (2020b) Towards solving large-scale topology optimization problems with buckling constraints at the cost of linear analyses. Comput Methods Appl Mech Eng 363:112,911. https://doi.org/10.1016/j.cma.2020.112911
Gao X, Ma H (2015) Topology optimization of continuum structures under buckling constraints. Comput Struct 157:142–152
Gravesen J, Evgrafov A, Nguyen DM (2011) On the sensitivities of multiple eigenvalues. Struct Multidiscip Optim 44(4):583–587
Groenwold AA, Etman LFP (2008) On the equivalence of optimality criterion and sequential approximate optimization methods in the classical topology layout problem. Intern J Numer Methods Eng 73:297–316
Guest JK, Prévost J H, Belytschko T (2004) Achieving minimum length scale in topology optimization using nodal design variables and projection functions. Int J Numer Methods Eng 61(2):238–254. https://doi.org/10.1002/nme.1064
Guest JK, Asadpoure A, a SH (2011) Eliminating beta continuation from heaviside projection and density filter algorithms. Struct Multidiscip Optim 44(4):443–453
Kennedy GJ, Hicken JE (2015) Improved constraint-aggregation methods. Comput Methods Appl Mech Eng 289(Supplement C):332–354
Kreisselmeier G, Steinhauser R (1979) Systematic control design by optimizing a vector performance index. IFAC Proc Vol 12(7):113–117. iFAC Symposium on computer aided design of control systems, Zurich, Switzerland, 29-31 August
Lehoucq R, Sorensen DC (1996) Deflation techniques for an implicitly re-started arnoldi iteration. SIAM J Matrix Anal Appl 17:789–821
Lund E (2009) Buckling topology optimization of laminated multi–material composite shell structures. Compos Struct 91(2):158–167
Neves MM, Sigmund O (2002) Topology optimization of periodic microstructures with a penalization of highly localized buckling modes. Int J Numer Methods Eng 54(6):809–834
Raspanti CG, Bandoni JA, Biegler LT (2000) New strategies for flexibility analysis and desing under uncertainties. Comput Chem Eng 24:2193–2209
Rodrigues HC, Guedes JM (1995) Necessary conditions for optimal design of structures with a nonsmooth eigenvalue based criterion. Struct Optim 9:52–56
Seyranian AP, Lund E, Olhoff N (1994) Multiple eigenvalues in structural optimization problems. Struct Optim 8(4):207–227
Sigmund O (2001) A 99 line topology optimization code written in Matlab. Struct Multidiscip Optim 21(2):120–127. https://doi.org/10.1007/s001580050176
Sigmund O (2007) Morphology–based black and white filters for topology optimization. Struct Multidiscip Optim 33(4):401–424
Stewart G (2002) A Krylov-Schur algorithm for large eigenproblems. SIAM J Matrix Anal Appl 23(3):601–614
Svanberg K (1987) The method of moving asymptotes - A new method for structural optimization. Int J Numer Methods Eng 24(2):359–373
Svanberg K (2002) A class of globally convergent optimization methods based on conservative convex separable approximations. SIAM J Optim 12(2):555–573. https://doi.org/10.1137/S1052623499362822
Svanberg K (2007) MMA and GCMMA–two methods for nonlinear optimization. available for download at https://people.kth.se/krille/mmagcmma.pdf
Wahlbin LB (1995) Superconvergence in Galerkin finite element methods. In: Lecture Notes in Mathematics. Lecture Notes in Mathematics, vol 1605. Springer, Berlin
Wang F, Lazarov B, Sigmund O (2011) On projection methods, convergence and robust formulations in topology optimization. Struct Multidiscip Optim 43(6):767–784
Wendland H (2018) Numerical linear algebra: An introduction. Cambridge texts in applied mathematics. Cambridge University Press, Cambridge
Wrenn G (1989) An indirect method for numerical optimization using the Kreisselmeir–Steinhauser function. Tech. rep.. https://books.google.it/books?id=LjsCAAAAIAAJ
Xia L, Breitkopf P (2015) Design of materials using topology optimization and energy-based homogenization approach in matlab. Struct Multidiscip Optim 52(6):1229–1241. https://doi.org/10.1007/s00158-015-1294-0
Yago D, Cante J, Lloberas-Valls O, Oliver J (2021) Topology optimization using the UNsmooth VARiational Topology OPtimization (UnVarTop) method: an educational implementation in Matlab. Structural and Multidisciplinary Optimization 63:955–981
Zienkiewicz O, Taylor R (2005) The finite element method for solid and structural mechanics, 6th edn. Elsevier, Amsterdam
Funding
The authors FF and JKG received support from the National Aeronautics and Space Administration (NASA) under Grant No. 80NSSC18K0428. OS is supported by the Villum Fonden through the Villum Investigator Project “InnoTop”.
Author information
Authors and Affiliations
Corresponding author
Ethics declarations
Disclaimer
The opinions, findings, and conclusions or recommendations expressed in this paper are those of the authors and do not necessarily reflect the views of NASA.
Replication of results
Matlab code is listed in the Appendix and available at www.topopt.dtu.dk. The stenglib package, containing the fsparse function, is available for download at https://github.com/stefanengblom/stenglib.
Additional information
Responsible Editor: Shikui Chen
Publisher’s note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Appendices
Appendix: 1. Notes
Let \(X^{e} = \left [{x^{e}_{i}},{y^{e}_{i}}\right ]^{k}_{i=1}\) be the array collecting the coordinates of a k-noded element and \(N(\xi ,\zeta ) = \left [ N_{1}(\xi ,\zeta ), N_{2}(\xi ,\zeta ), \ldots , N_{k}(\xi ,\zeta )\right ]\) be the array collecting the shape functions, where (ξ,ζ) are the logical coordinates (Bathe 1982). The (x,y)-gradient of the shape functions is computed as ∇(x,y)N = J− 1∇(ξ,ζ)N, where the (ξ,ζ)-gradient and Jacobian are
The discretized deformation gradient (B1) and strain-displacement operator (B0) are then recovered as
where L is the placement matrix (here shown for a \(\mathcal {Q}_{4}\) element)
and I2 is the identity matrix of order 2.
The operations above have a remarkably compact implementation in the code of Appendix C, for the particular case of a \(\mathcal {Q}_{4}\) element (see lines extracted below).
The instructions above could be further simplified, since we are considering a uniform discretization (i.e., J is constant). However, the current definition is general enough to be easily extended to higher order elements by only modifying the definition of dN.
Appendix: 2. Details on the re-design rule and on the KS aggregation function
Let us have the two sets of functions {g0(i)(x)}i= 1…,q and {gj(x)}j= 1…,s and the following optimization problem
We replace \(J^{KS}_{0}\left (\mathbf {x} \right ) := J^{KS}[g_{0(i)}\left (\mathbf {x} \right )]\) to the “\(\max \limits \)” operator in the objective, and \(J^{KS}_{1}\left (\mathbf {x} \right ) := J^{KS}\left [g_{j}\left (\mathbf {x} \right )\right ]\) to the set of constraints, obtaining the single-objective, single-constraint problem
which is analogous to (13). At the current design point (xk = ξ) the objective and constraint functions are expanded in terms of intervening variables ye(xe), e = 1,…m, each selected such to build a convex approximation. Choosing an MMA-like form for the intervening variables (Svanberg 1987), the objective (i = 0) and constraint (i = 1) are expanded as
where \({p^{i}_{e}}(\boldsymbol {\xi }) = \max \limits \{\partial _{e}J^{KS}_{i}(\boldsymbol {\xi }),0\} \geq 0\) and \({q^{i}_{e}}(\boldsymbol {\xi }) = \min \limits \{\partial _{e}J^{KS}_{i}(\boldsymbol {\xi }),0\} \leq 0\) and (Le,Ue), e = 1,…,m are the moving asymptotes, such that Le < (xe,ξe) < Ue.
Once (33) is substituted into (32), the Lagrangian of the problem reads
where κ ≥ 0 is the Lagrange multiplier. The stationarity condition of the Lagrangian with respect to xe
can be solved explicitly, giving the primal update map
where 0 < δ− < δ+ < 1 are the adaptive move limits, depending on the asymptotes and we have highlighted the dependence on the dual variable κ. This latter can be computed from the following equation, obtained by formally substituting (36) into (34) and imposing stationarity with respect to κ
The re-design procedure is implemented in the routine ocUpdate, listed at the bottom of this section. The input parameters are the current re-design step (loop), the current design point, objective sensitivity, constraint value and sensitivity (xT, dg0, g1, dg1), the design variables at the two previous iterations (xOld, xOld1), and the current asymptotes (as). The input ocPar=[move,asReduce,asRelax] collects the steplenght (move) and the two numbers used for tightening and relaxing the asymptotes according to the smoothness of the optimization history (asReduce,asRelax).
The evolution of the asymptotes and their link with the adaptive bounds δ− and δ+ (called xL and xU) are conceptually identical to that suggested by Svanberg (1987) (see lines 4–13). Following Guest et al. (2011) we allow the tightening of the initial asymptotes to accomodate large β values, by passing this parameter to the ocUpdate routine. The user can also reset the asymptotes whenever continuation is applied on the penalization and projection parameters, by passing the additional variable restartAsy.
The primal update (36) and stationarity condition (37) are defined on lines 20–23, based on the positive variables p0, q0, p1 and q1, representing \((U_{e}-\xi _{e})^{2}{p^{i}_{e}}\) and \(-(\xi _{e}-L_{e})^{2}{q^{i}_{e}}\), i = 0, 1, respectively (lines 17–18). The dual variable κ is computed between lines 26 and 33 accounting for three possible situations: given the search window \([0, \bar {\kappa }]\) (e.g., \(\bar {\kappa } = 10^{6}\))
-
1.
If \(\psi (0)\psi (\bar {\kappa }) < 0 \rightarrow \) the Lagrange multiplier is within \((0, \bar {\kappa })\), and we compute it by the built-in Matlab function fzero, applying a version of the Brent’s algorithm (Brent 1973) (lines 27–28);
-
2.
\(\psi (0)<0 \rightarrow \) the constraint is not active within the current local expansion. Thus, we set κ = 0 and xe = xe(0) (line 30);
-
3.
\(\psi (\bar {\kappa })>0 \rightarrow \) the constraint cannot be fulfilled within the current local expansion (i.e., we cannot find a feasible solution). In this case, we set \(\kappa = \bar {\kappa }\) and \(x_{e} = x_{e}(\bar {\kappa })\) (line 32);
We stress that the present update rule can still be interpreted as an “OC-like” scheme since, for the simple case of a single constraint we are concerned with, the primal map (36) can be written out explicitly.
In our testing we have generally observed good behavior of this update rule. However, we acknowledge that the rather heuristic update for the special cases 2 and 3 may lead to oscillations in the convergence history, or even breakdowns. Since a robust optimizer is beyond the reach of a 35-line optimization routine and beyond the purpose of this paper, the users who might face bad behavior of the ocUpdate are recommended to replace it with the MMA. As an example, considering the classic Matlab version of the MMA “mmasub” (Svanberg 2007), the buckling maximization problem, with compliance and volume constraint, can be solved by replacing lines 224–226 with the following
if the user still wants to consider a single, KS aggregated constraint. Alternatively, the following call
can be used for treating the two constraints separately. The parameters a0MMA,aMMA,ccMMA and ddMMA can be selected as recommended in Svanberg (2007).
1.1 A2.1 Some properties of the KS function
Given the set of functions {gi(x)}i= 1…,q, where each \(g_{i}\colon \mathbb {R}^{m}\rightarrow \mathbb {R}\) is not necessarily smooth, we can build the smooth Kreisselmeier-Steinhauser (KS) aggregation function (Kreisselmeier and Steinhauser 1979)
depending on the parameter \(\rho \in [1, \infty )\) and where \(g_{\ast }(\mathbf {x}) = \max \limits _{i=1,\ldots ,q}\{g_{i}(\mathbf {x})\}\). Equation (38) is a convex function if and only if all its arguments gi, i = 1,…,q are convex and fulfill \(g_{\ast }(\mathbf {x}) \leq J^{KS}[g_{i}](\mathbf {x}) \leq g_{\ast }(\mathbf {x}) + \ln (\rho ^{-1} q_{a})\), where the right inequality is tight at points where qa functions simultaneously attain the maximum value (Wrenn 1989; Raspanti et al. 2000).
With the aggregation of several constraint functions in mind, the following considerations are in order. At a given point x, if all gi(x) > 0, then g∗(x) > 0 and (gi − g∗)(x) ≤ 0 for all i. If all gi(x) < 0, then g∗(x) < 0 and (gi − g∗)(x) ≤ 0 for all i. In both cases JKS[gi](x) ≥ g∗(x) and, if all the terms are negative this means that JKS[gi](x) is closer to zero than all gi(x). Thus, it gives an upper bound to the constraint that is closer to become active. The interesting case is when some gi(x) > 0 and some other gj(x) < 0. Obviously, g∗(x) > 0 and JKS[gi](x) gives an upper bound to the positive maximum; in other words, to the most violated constraint.
Appendix: 3. Matlab code
Rights and permissions
About this article
Cite this article
Ferrari, F., Sigmund, O. & Guest, J.K. Topology optimization with linearized buckling criteria in 250 lines of Matlab. Struct Multidisc Optim 63, 3045–3066 (2021). https://doi.org/10.1007/s00158-021-02854-x
Received:
Revised:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s00158-021-02854-x