She tightened the mesh. The tutorial’s notes whispered in her memory about spatial discretization and dispersion—“refine where fields vary rapidly.” She increased the mesh inside the defect and around the holes, pushing the simulation cost higher. Hours later, the spectrum sharpened. One small peak that had been a smear began to stand out. She leaned forward.
: Mimics a laser beam focusing onto a surface.
Do not shrink the entire simulation grid just to resolve a tiny feature. Place a localized Mesh Override Region over critical interfaces (like a thin slot waveguide) to keep the global simulation running fast.
To prevent numerical solutions from diverging, the time step must be strictly bound by the spatial grid sizes (
: Add the FDTD solver region and define boundary conditions, such as PML (Perfectly Matched Layers) to absorb outgoing waves.
The Finite-Difference Time-Domain (FDTD) method discretizes space and time using a staggered grid known as the .
: Choose 2D (fast prototyping) or 3D (accurate physical results). Boundary Conditions (BCs) :
After a quick memory check, run the solver. Post-processing tools and scripting allow you to visualize mode profiles, far-field projections, and power flow. Pro Tips for New Users The Convergence Test: Before trusting your results, perform a mesh convergence test
switchtolayout; widths = [0.4e-6, 0.45e-6, 0.5e-6, 0.55e-6]; for(i=1:length(widths)) switchtolayout; setnamed("waveguide", "y span", widths(i)); run; T = getresult("monitor", "T"); matlabsave("sweep_width_" + num2str(widths(i)*1e9) + "nm.mat", T); Use code with caution.
: Best for periodic structures, metasurfaces, and thin-film stacks.
Absorbs outgoing light completely, simulating open space. Use this for boundaries where light escapes.