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 MATLABs 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 MATLABs 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.dtu.dk.
翻译:我们提供了一套200行的缩略语 MATLAB 代码,以展示如何将地形优化(TopOpt)作为一种反向设计工具在光子中使用,以设计二维电金属和金属反射器作为实例,物理模型使用有限元素法解决,代码使用MATLABs Fmincon算法解决优化问题。除了介绍该代码本身外,我们还简要讨论了一些扩展,并提供了执行其中一些代码所需的代码。最后,我们展示了使用梯度法比基于遗传-阿尔高西姆法(使用 MATLABs ga 算法)在光子中解决反向设计问题的优越性(使用MATLAB ga 算法) 。 MATLAB 软件可以在纸上免费查阅,可从https://www.topott.dtu.dk下载。