An effective and straightforward method to implement topology optimization using high-level programming is presented. The method uses the LiveLink for MATLAB, which couples the commercial COMSOL Multiphysics software with MATLAB programming environment via COMSOL Application Programming Interface (API). The integrated environment allows one to implement advanced and customized functions and methods from scratch easily. Topology optimization of an acoustic-structure interaction problem with a mixed displacement–pressure (u/p) formulation is employed to demonstrate the effectiveness of the presented implementation method to design multiphysics problems systematically. The governing equations of the system are derived in a weak form, which is inserted directly in equation-based modeling in COMSOL Multiphysics via MATLAB programming environment. The tight integration of MATLAB and COMSOL Multiphysics allows one to easily pass the matrices and derivatives to perform design sensitivity analysis. A comprehensive code to perform the optimization of the acoustic-structure interaction problem is provided in Appendix. The well-structured code can be used as a platform for educational and research purposes, and it can be extended to other topology optimization applications involving various types of physical problems that use the equation-based modeling functionality of COMSOL.
- Acoustic-structure interaction (ASI)
- COMSOL LiveLink for MATLAB
- Mixed u/p formulation
- Topology optimization