Skip to main content
Log in

A 101-line MATLAB code for topology optimization using binary variables and integer programming

  • Educational Paper
  • Published:
Structural and Multidisciplinary Optimization Aims and scope Submit manuscript

Abstract

This paper presents a MATLAB code with the implementation of the Topology Optimization of Binary Structures (TOBS) method first published by Sivapuram and Picelli (Finite Elem Anal Des 139: pp. 49–61, 2018). The TOBS is a gradient-based topology optimization method that employs binary design variables and formal mathematical programming. Besides its educational purposes, the 101-line code is provided to show that topology optimization with integer linear programming can be efficiently carried out, contrary to the previous reports in the literature. Compliance minimization subject to a volume constraint is first solved to highlight the main features of the TOBS method. The optimization parameters are discussed. Then, volume minimization subject to a compliance constraint is solved to illustrate that the method can efficiently deal with different types of constraints. Finally, simultaneous volume and displacement constraints are investigated in order to expose the capabilities of the optimizer and to serve as a tutorial of multiple constraints. The 101-line MATLAB code and some simple enhancements are elucidated, keeping only the integer programming solver unmodified so that it can be tested and extended to other numerical examples of interest.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8
Fig. 9
Fig. 10
Fig. 11
Fig. 12
Fig. 13
Fig. 14
Fig. 15
Fig. 16
Fig. 17

References

  • Allaire G (2009) A 2-D Scilab Code for shape and topology optimization by the level set method. http://www.cmap.polytechnique.fr/allaire/levelset_en.html

  • 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–16

    Article  Google Scholar 

  • Ansola LR, Querin OM, Garaigordobil JA, Alonso GC (2018) A sequential element rejection and admission (SERA) topology optimization code written in Matlab. Struct Multidiscip Optim 58(3):1297–1310. https://doi.org/10.1007/s00158-018-1939-x

    Article  MathSciNet  Google Scholar 

  • Beckers M (1999) Topology optimization using a dual method with discrete variables. Struct Multidiscip Optim 17:14–24

    Article  Google Scholar 

  • Challis VJ (2010) A discrete level-set topology optimization code written in Matlab. Struct Multidiscip Optim 41:453– 464

    Article  MathSciNet  Google Scholar 

  • Cornuéjols G (2008) Valid inequalities for mixed integer linear programs. Math Program B 112:3–44

    Article  MathSciNet  Google Scholar 

  • Deaton JD, Grandhi RV (2014) A survey of structural and multidisciplinary continuum topology optimization: post 2000. Struct Multidiscip Optim 49:1–38

    Article  MathSciNet  Google Scholar 

  • Emmendoerfer H, Fancello EA, Silva ECN (2018) Level set topology optimization for design-dependent pressure load problems. Int J Numer Methods Eng 115(7):825–848

    Article  MathSciNet  Google Scholar 

  • Feppon F, Allaire G, Bordeu F, Cortial J, Dapogny C (2019) Shape optimization of a coupled thermal fluid-structure problem in a level set mesh evolution framework. SeMA J 76(3):413– 458

    Article  MathSciNet  Google Scholar 

  • Gao T, Zhang W (2010) Topology optimization involving thermo-elastic stress loads. Struct Multidiscip Optim 42(5):725– 738

    Article  MathSciNet  Google Scholar 

  • Guest JK, Prèvost JH, Belytschko T (2004) Achieving minimum length scale in topology optimization using nodal design variables. Int J Numer Meth Eng 61(2):238–254

    Article  MathSciNet  Google Scholar 

  • Haftka RT, Gürdal Z (1991) Elements of structural optimization, 3rd edn. Kluwer Academic Publishers, Kluwer

    MATH  Google Scholar 

  • Huang X, Xie YM (2007) Convergent and mesh-independent solutions for the bi-directional evolutionary structural optimization method. Finite Elem Anal Des 43:1039–1049

    Article  Google Scholar 

  • Land AH, Doig AG (1960) An automatic method of solving discrete programming problems. Econometrica 28:497–520

    Article  MathSciNet  Google Scholar 

  • Liang Y, Cheng G (2019) Topology optimization via sequential integer programming and canonical relaxation algorithm. Comp Methods Appl Mechan Eng 348:64–96. https://doi.org/10.1016/j.cma.2018.10.050

    Article  MathSciNet  MATH  Google Scholar 

  • Liang Y, Cheng G (2020) Further elaborations on topology optimization via sequential integer programming and canonical relaxation algorithm and 128-line MATLAB code. Struct Multidiscip Optim 61:411–431

    Article  Google Scholar 

  • Neofytou A, Picelli R, Huang TH, Chen JS, Kim HA (2020) Level set topology optimization for design-dependent pressure loads using the reproducing kernel particle method. Struct Multidiscip Optim 61:1805–1820

    Article  MathSciNet  Google Scholar 

  • Picelli R, Sivapuram R (2019) Solving topology optimization with 0,1 design variables and mathematical programming: the TOBS method. In: Proceedings of the 13th world congress of structural and multidisciplinary optimization (WCSMO-13), Beijing, China

  • Picelli R, Neofytou A, Kim HA (2019) Topology optimization for design-dependent hydrostatic pressure loading via the level-set method. Struct Multidiscip Optim 60:1313–1326

    Article  MathSciNet  Google Scholar 

  • Picelli R, Ranjbarzadeh S, Sivapuram R, Gioria RS, Silva ECN (2020) Topology optimization of binary structures under design-dependent fluid-structure interaction loads. Struct Multidiscip Optim 62:2101-2116

    Article  MathSciNet  Google Scholar 

  • Querin OM, Steven GP, Xie YM (1998) Evolutionary structural optimisation (ESO) using a bidirectional algorithm. Eng Comput 15(8):1031–1048

    Article  Google Scholar 

  • Rozvany GIN, Zhou M, Birker T (1992) Generalized shape optimization without homogenization. Struct Opt 4:250–254

    Article  Google Scholar 

  • Sigmund O (2001a) A 99 line topology optimization code written in Matlab. Struct Multidiscip Optim 21:120–127

    Article  Google Scholar 

  • Sigmund O (2001b) Design of multiphysics actuators using topology optimization - Part i: one material structures. Comput Methods Appl Mech Eng 190:6577–6604

    Article  Google Scholar 

  • Sigmund O (2007) Morphology-based black and white filters for topology optimization. Struct Multidiscip Optim 33(4-5):401–424

    Article  Google Scholar 

  • Sivapuram R, Picelli R (2018) Topology optimization of binary structures using integer linear programming. Finite Elem Anal Des 139:49–61

    Article  MathSciNet  Google Scholar 

  • Sivapuram R, Picelli R (2020) Topology design of binary structures subjected to design-dependent thermal expansion and fluid pressure loads. Struct Multidiscip Optim 61:1877–1895

    Article  MathSciNet  Google Scholar 

  • Sivapuram R, Picelli R, Xie YM (2018) Topology optimization of binary microstructures involving various non-volume constraints. Comput Mater Sci 154:405–425. https://doi.org/10.1016/j.commatsci.2018.08.008

    Article  Google Scholar 

  • Svanberg K, Werme M (2005) A hierarchical neighbourhood search method for topology optimization. Struct Multidiscip Optim 29:325–340

    Article  MathSciNet  Google Scholar 

  • Svanberg K, Werme M (2006) Topology optimization by sequential integer linear programming. In: Bendsøe MP, Olhoff N, Sigmund O (eds) IUTAM symposium on topological design optimization of structures, machines and materials. Springer, Netherlands, pp 425–436

  • Vanderbei RJ (2014) Linear programming: foundations and extensions, 4th edn. Springer, US

    Book  Google Scholar 

  • Vicente WM, Picelli R, Pavanello R, Xie YM (2015) Topology optimization of frequency responses of fluid-structure interaction systems. Finite Elem Anal Des 98:1–13

    Article  Google Scholar 

  • Wei P, Li Z, Li X, Wang MY (2018) An 88-line matlab code for the parameterized level set method based topology optimization using radial basis functions. Struct Multidiscip Optim 58:831–849

    Article  MathSciNet  Google Scholar 

  • Williams P (2009) Integer programming. Springer, Boston, pp 25–70

    Book  Google Scholar 

  • Xia L, Xia Q, Huang X, Xie YM (2018) Bi-directional evolutionary structural optimization on advanced structures and materials: a comprehensive review. Arc Comput Methods Eng 25(2):437– 478

    Article  MathSciNet  Google Scholar 

  • Xie YM, Steven GP (1993) A simple evolutionary procedure for structural optimization. Comput Struct 49:885–896

    Article  Google Scholar 

  • Yoon GH (2020) Topology optimization method with finite elements based on the kε turbulence model. Comput Methods Appl Mechan Eng 361:112–784

    Article  MathSciNet  Google Scholar 

  • Zhang W, Yuan J, Zhang J, Guo X (2016) A new topology optimization approach based on moving morphable components (mmc) and the ersatz material model. Struct Multidiscip Optim 53:1243–1260

    Article  MathSciNet  Google Scholar 

  • Zuo ZH, Xie YM (2015) A simple and compact python code for complex 3D topology optimization. Adv Eng Softw 85:1–11

    Article  Google Scholar 

Download references

Funding

The first author would like to thank the support of FAPESP (São Paulo Research Foundation), grants 2018/05797-8 and 2019/01685-3 under the Young Investigators Awards program.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Renato Picelli.

Ethics declarations

Conflict of interest

The authors declare that they have no conflict of interest.

Additional information

Responsible Editor: Ming Zhou

Publisher’s note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Replication of results

The 101-line code is provided in the Appendix A. The code and its modified versions to run all examples in this paper are also provided as supplementary material. A more detailed implementation of the TOBS method is available upon request by email or for download at https://github.com/renatopicelli/tobs.

Electronic supplementary material

Below is the link to the electronic supplementary material.

(ZIP 13.8 KB)

Appendix A: 101-line TOBS code

Appendix A: 101-line TOBS code

figure a
figure b
figure c

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Picelli, R., Sivapuram, R. & Xie, Y.M. A 101-line MATLAB code for topology optimization using binary variables and integer programming. Struct Multidisc Optim 63, 935–954 (2021). https://doi.org/10.1007/s00158-020-02719-9

Download citation

  • Received:

  • Revised:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s00158-020-02719-9

Keywords

Navigation