We provide a compact 200 line MATLAB code demonstrating how topology optimization (TopOpt) as an inverse design tool may be used in photonics, targeting the design of two-dimensional dielectric metalenses and a metallic reflector as examples. The physics model is solved using the finite element method, and the code utilizes MATLAB's fmincon algorithm to solve the optimization problem. In addition to presenting the code itself, we briefly discuss a number of extensions and provide the code required to implement some of these. Finally, we demonstrate the superiority of using a gradient-based method compared to a genetic-algorithm-based method (using MATLAB's ga algorithm) for solving inverse design problems in photonics. The MATLAB software is freely available in the paper and may be downloaded from https://www.topopt.mek.dtu.dk.
翻译:我们提供了一个200行的缩略语 MATLAB 代码,以展示如何将地形优化(TopOpt)作为一种反向设计工具用于光感学中,以设计二维电金属和金属反射器作为实例。物理模型使用有限元素法解决,该代码使用MATLAB的Fmincon算法解决优化问题。除了介绍该代码本身外,我们还简要讨论了一些扩展,并提供了执行其中一些代码所需的代码。最后,我们展示了使用梯度法比基于遗传-阿尔哥里特姆法(使用MATLAB的加算法)在光感学中解决反向设计问题的优越性(使用MATLAB的加算法),MATLAB软件可以在纸上免费查阅,可从https://www.topott.mek.dtu.dk下载。