An efficient 146-line 3D sensitivity analysis code of stress-based topology optimization written in MATLAB
Abstract
This paper presents an efficient and compact MATLAB code for three-dimensional stress-based sensitivity analysis. The 146 lines code includes the finite element analysis and p-norm stress sensitivity analysis based on the adjoint method. The 3D sensitivity analysis for p-norm global stress measure is derived and explained in detail accompanied by corresponding MATLAB code. The correctness of the analytical sensitivity is verified by comparison with finite difference approximation. The nonlinear optimization solver is chosen as the Method of moving asymptotes (MMA). Three typical volume-constrained stress minimization problems are presented to verify the effectiveness of sensitivity analysis code. The MATLAB code presented in this paper can be extended to resolve different stress related 3D topology optimization problems. The complete program for sensitivity analysis is given in the Appendix and is intended for educational purposes. MATLAB code is additionally provided in electronic supplementary material for a simple cantilever beam optimization.
Type
Publication
Optimization and Engineering
Authors
Recent PhD in Mechanical Engineering
Praveen Vulimiri recently completed his PhD in Mechanical Engineering from the University of Pittsburgh as part of the Ansys Additive Manufacturing Research Laboratory in October 2025. His thesis dissertation focused on including data-driven surrogate models for architectural and multiphysics constraints for topology optimization and product design. Prior to the PhD program, Praveen received his BS in Mechanical Engineering from the University of Pittsburgh in August 2019 with certificates in Simulation in Engineeering Design and in Innovation, Product Design, and Entrepreneurship. For two years, he worked as a Thermal Engineer for Iris Rover to successfully land the first American lunar rover.