Differential evolution and Nelder-Mead polish as implemented

DE/rand/1, F=0.8, CR=0.7, pop 15–30, Nelder-Mead polish — line by line.

Lesson 4 of 5 · ~10 min read

The AR Stack Optimizer does not run a gradient method. Reflectance as a function of thickness is non-convex, oscillatory, and full of local minima. A gradient descent lands in the nearest valley and stays there. Differential evolution (DE) is a population-based method that samples the whole search space before committing — exactly the right tool for this problem.

DE/rand/1/bin, in the exact form the tool runs

Each generation, every member xi of the population gets a trial ui built from three other randomly-chosen members:

ui,j = xr1,j + F · (xr2,j − xr3,j), with crossover prob. CR
(1.4.1)

The AR optimiser uses F = 0.7 and CR = 0.9. Population size is 15 · (number of layers), so 30 for a 2-layer stack, 120 for an 8-layer. Generations: min(80, max(30, layers·15)). Bounds per layer: [5, 500] nm — not the 5 µm the grid once allowed, because wide bounds let the optimiser hide behind aliasing.

Selection is greedy

  1. Pick three distinct members r1, r2, r3, none equal to i.
  2. Build the trial vector with the mutation formula above, clamped to [5, 500] nm per dimension.
  3. Evaluate the merit function on the trial (full-part TMM across the band at 2 nm step).
  4. If the trial scores ≤ the current member, it replaces it. Otherwise the current member survives.

No annealing schedule, no self-adapting F, no restart. The simplest DE that works. For an 8-layer AR on glass with a visible-band target it converges to its final mean R in roughly 40–60 generations — a few seconds of wall-clock.

Nelder-Mead polish

DE is exploratory. Once it has located the right basin, the population stops moving much because every trial lands near the current best. The optimiser hands the DE winner to a Nelder-Mead simplex as a starting point, builds an initial simplex by perturbing each coordinate ±5 nm, and runs at most 50 iterations with α=1, γ=2, ρ=0.5, σ=0.5. If Nelder-Mead finds a strictly lower cost, it replaces the DE answer; otherwise the DE answer stands.

On most designs the polish is small — a few hundredths of a percent — because DE already sits near the local minimum. On tight stacks it is the difference between 0.63 % mean R and 0.61 %. The optimiser surfaces both numbers (the DE result and the polished result) so you can see what the polish bought you.