Spot Radius Optimization in QUADOA® Optical CAD
An optimization in QUADOA® Optical CAD has three ingredients: variables, a merit function with goals and constraints, and an optimizer. This tutorial optimizes an achromatic doublet from the examples folder: the radii become variables, the merit function minimizes the RMS spot radius for all fields and wavelengths, and a hard constraint keeps the image-space NA at 0.2 or above. After the local optimization, the maximum spot radius is 18 µm.
Key points
- Click the variable icon next to a parameter (or press Space) to make it a variable.
- Add a merit function with Merit Function in the Optimization tab or right-click → Add Merit Function in System Setup.
- A merit function contains a ray trace (sequence, field, wavelength, configuration) with goals and constraints, plus global goals and constraints.
- Hard constraints use Lagrange multipliers; soft constraints act like weighted goals.
- The Local Optimizer finds the nearest minimum quickly; the optimizer needs more goals than variables.
Terms used in this article
- Variable
- A parameter the optimizer may change.
- Merit function
- The weighted sum of squared deviations of all goals from their targets, which the optimizer minimizes.
- Goal
- A target value for a quantity computed from the system, such as the RMS spot radius.
- Constraint
- A limit that must (hard) or should (soft) be respected, such as a minimum NA.
How to set variables
- Open the Optical Design Editor.
- Click the variable icon next to the radius of surface 1, surface 2 and surface 3 of the doublet. The Space key toggles the variable state of the selected parameter.
- Also make the focal position (the Z position of the image surface) variable, because the focus is defined by the numerical aperture.
Variables appear in the Variable List of the merit function, where you can also set lower and upper limits. For radii, the limits are given as curvature (1/R), so that a change from concave to convex does not jump through infinity. Some parameters, such as aperture radii, cannot be variables because they do not affect the ray paths.
How to create the merit function
- Click Merit Function in the Optimization tab, or right-click Optimization in the System Setup Editor and choose Add Merit Function.
- Expand the merit function and its Ray Trace. Select the sequence, the fields and wavelengths (here: all) and, for multi-configuration systems, the configuration.
- Right-click the ray trace and add an aberration goal: Spot Radius RMS. It appears under Optimization Goals.
Each goal has a Target and a Weight (default 1.0). Its contribution is (Value − Target) × Weight; the merit function value is the sum of the weighted squared deviations. The relative importance of fields and wavelengths is set by their own weights in the source.
How to add constraints
- Right-click the ray trace and add an optical property constraint: Image Space NA.
- Set the operator and target: > 0.2, and the type Hard (Lagrange multiplier).
| Bound type | Behavior |
|---|---|
| Hard (Lagrange) | Does not add to the merit function, but forces the optimizer to stay within the bound. Avoid starting outside hard bounds. |
| Soft (weighted) | Ignored when fulfilled; when violated, it contributes like a weighted goal |
Below the ray traces, Global Constraints hold limits that are not computed from rays, such as center and edge thicknesses or air gaps.
How to run the optimization
- Click Local Optimization in the Optimization tab.
- Select the merit function, here Merit Function 1.
- Under Update Views, choose to update the 3D view and the plots during optimization.
- Click Optimize.
The result: the maximum spot radius over all wavelengths is 18 µm, and the image-space NA meets its target of 0.2. The local optimizer is a damped least squares (Levenberg-Marquardt) solver; it needs more goals than variables, which a spot radius goal provides because it is built from many rays. To improve the result further, let the optimizer exchange the glasses; see material substitution.
Video tutorial: spot radius optimization
This 5-minute video optimizes an achromatic doublet for spot radius with an image-space NA constraint.
Video length: 4:37 min · Also on YouTube: Spot Radius Optimization of an Achromatic Doublet in QUADOA® Optical CAD
Frequently asked questions
Click the variable icon next to the parameter in the Optical Design Editor, or select the parameter and press the Space key.
Add a merit function, select sequence, fields and wavelengths in its Ray Trace, and add the goal Spot Radius RMS with a right-click on the ray trace.
Hard constraints use Lagrange multipliers and force the optimizer to stay within the bounds. Soft constraints are ignored when fulfilled and act like weighted goals when violated.
Rays that are vignetted when the optimizer starts are excluded from that run. In a later run they may be included again, so a spot size can appear larger even though the merit function improved.
As curvature (1/R) rather than radius, so that the limits stay meaningful when a surface changes from concave to convex.


