Docs / Lens design
Design, optimise, and tolerance optical systems with real glass catalogs and automatic damped least-squares optimisation.
Lens design is the process of choosing the right sequence of surfaces, glasses, and spacings to form a sharp, clear image of an object. In a perfect world, a single thin piece of glass would do this flawlessly. In reality, light of different wavelengths bends differently (dispersion), and spherical surfaces don't bring all rays to the same focus (spherical aberration).
In Photonica, you don't just simulate what an existing lens does—you can actively design new ones by defining variables and letting the optimiser find the best parameters to meet your targets.
While thin-lens approximations are useful for sketches, Photonica calculates precise ray traces using exact trigonometric ray tracing. However, for initial paraxial setup, the thick lens equation is used to compute focal length and principal planes:
Where P is the total optical power, P₁ and P₂ are the powers of the front and back surfaces, d is the center thickness, and n is the refractive index of the glass.
Aberrations are departures from perfect imaging. Photonica calculates and displays these in real-time.
The quickest way to evaluate aberrations in Photonica is by looking at the Spot Diagram, which traces a grid of rays from a single point source and plots where they intersect the image plane.
Photonica features a built-in damped least-squares (DLS) optimiser. You define a merit function—a single number that represents how "bad" the lens is—and the optimiser adjusts variables to minimize it.
| Variables | Operands (Targets) |
|---|---|
| Radius of curvature / Curvature | RMS Spot Size (Radial or X/Y) |
| Thickness / Air spacing | Effective Focal Length (EFL) |
| Conic constant (Aspheres) | Collimation / Beam divergence |
| Tilt (X, Y) | Chromatic focus shift |
| Decenter (X, Y) | Magnification |
A classic exercise is designing an achromatic doublet—a lens made of two different glasses that brings two wavelengths (usually red and blue) to the same focus, significantly reducing chromatic aberration.
A lens that works in simulation might be impossible to build. Manufacturing always introduces errors. Photonica includes a Monte-Carlo tolerancing engine to predict real-world yield.
You specify tolerances for radii, thicknesses, tilts, and decenters. Photonica then generates hundreds of random, perturbed systems. For each system, it can optionally adjust a compensator (like the final detector position, simulating a technician refocusing the lens) before evaluating the final performance.
If you already have designs from industry-standard tools, you don't need to rebuild them from scratch. Photonica supports importing .zmx lens prescriptions.
Drag and drop a .zmx file into the window. Photonica will map standard surfaces, glasses, and apertures.