A 140 line MATLAB code for topology optimization problems with probabilistic parameters
Andrian Uihlein, Ole Sigmund, Michael Stingl
TL;DR
This work delivers an accessible, 140-line MATLAB code for topology optimization under probabilistic parameters, extending the top99neo lineage with a stochastic sample-based gradient approach and adaptive recombination to achieve vanishing approximation error. It combines the Optimality Criteria Method with a nearest-neighbor surrogate for integrating gradients of the expected compliance, enabling efficient handling of uncertainty in both material damage and loading. The authors provide extensive numerical demonstrations across reference, deterministic, symmetry, and uncertainty-Driven scenarios, and present variations such as damage-case reduction, data-driven force uncertainty, and mini-batching for dynamic loads. The tool emphasizes educational value and ease of modification, offering replication code and illustrating how stochastic modeling interacts with geometry, loading, and symmetry in topology optimization. Overall, the paper demonstrates that probabilistic topology optimization can be solved efficiently with a simple, well-documented implementation suitable for teaching and rapid experimentation.
Abstract
We present an efficient 140 line MATLAB code for topology optimization problems that include probabilistic parameters. It is built from the top99neo code by Ferrari and Sigmund and incorporates a stochastic sample-based approach. Old gradient samples are adaptively recombined during the optimization process to obtain a gradient approximation with vanishing approximation error. The method's performance is thoroughly analyzed for several numerical examples. While we focus on applications in which stochastic parameters describe local material failure, we also present extensions of the code to other settings, such as uncertain load positions or dynamic forces of unknown frequency. The complete code is included in the Appendix and can be downloaded from www.topopt.dtu.dk.
