This repository contains a complete optimization workflow that couples MATLAB with Lumerical FDTD to design and fine-tune nanophotonic structures. It uses a multi-objective genetic algorithm (gamultiobj
) to optimize geometric parameters—such as silicon layer thickness, ring resonator dimensions, and periodicity—to minimize propagation losses in dual-polarized optical simulations.
The code interfaces directly with Lumerical using its MATLAB API to:
- Modify simulation parameters dynamically (e.g. radii, gaps, heights)
- Run electromagnetic simulations using Lumerical FDTD
- Extract electric field data and compute a figure of merit based on FWHM
- Store optimized results into a text log for further analysis
This setup is ideal for:
- Silicon photonics research
- Metasurface or optical waveguide design
- Simulation-driven geometry optimization
- Projects requiring polarization-aware, multi-parameter tuning
optimizer_lum_mix.m
– Main optimization function using dual-polarization runs.optimizer_lum.m
– Sub-function that modifies simulation parameters, runs Lumerical, and extracts figures of merit (FWHM-based loss).results.txt
– Appended file storing results from successful optimization runs.test1_b.fsp
– Lumerical FDTD project file containing the base simulation setup.main_script.m
– Initializes the MATLAB-Lumerical API, retrieves initial parameters, and runs the optimizer.
- MATLAB (Tested with R2021+)
- Lumerical FDTD Solutions (v202 or compatible)
- MATLAB API for Lumerical installed and path added:
- Clone this repository:
git clone https://github.com/yourusername/lumerical-optimizer.git
cd lumerical-optimizer
-
Open MATLAB, set your working directory to the repo folder.
-
Make sure your Lumerical FDTD file path is correctly set in main_script.m:
-
Run the main script
Variables Optimized:
-
Silicon height, breadth
-
Inner/outer radii of concentric rings
-
Gap between features
-
Rect width, periodicity, etc.
-
You must modify the code to match your own .fsp file structure — this includes renaming monitors, structures, or sources (e.g., "structure_group", "monitor_2", "source") as used in your own simulation file.
-
Lumerical must be installed and licensed on the same machine as MATLAB.
-
Consider parallelizing for speed by setting 'UseParallel',true in optimoptions.
This project is licensed under the GNU General Public License v3.0 – see the LICENSE
file for details.
You are free to use, modify, and distribute this code, but derivative works must remain open-source and patent use is restricted.