
RMS optical path difference meritoid
This meritoid is normally used with a target of zero.

The calculation has two modes, depending on the target value:
- Multi-residual mode (target equal to zero)
- The OPD values for the traced rays, divided by the tolerance, are passed independently to the optimizer as residuals. This allows the Levenberg-Marquardt method to "see" the OPD surface to zero-in efficiently on the lowest RMS value.
- Mono-residual mode (target not equal to zero)
- The OPD values for the traced rays are collapsed to a single number: the RMS OPD. The deviation of this single number from the specified target value, divided by the tolerance, is passed to the optimizer as a residual. In this case the Levenberg-Marquardt method can have difficulties if the RMS OPD can not be made to cross the target (this method assumes that residuals do not have turning points near the minimum of the merit function).
Parameters
Use centroid as reference
If the checkbox is checked, the meritoid calculates the centroid of the rays on the image surface and uses this as the center of the reference sphere. If the checkbox is unchecked, the center of the reference sphere is the point where the chief ray for the specified field point (the ray passing through the center of the pupil) hits the image surface.
Field coordinate
Hx and Hy are the reduced field coordinates (between -1 and 1) of the image point for which the calculation is to be performed.
Polychromatic/Monochromatic
Selecting Polychromatic will use the specified wavelengths and weights from the Sources window. Selecting Monochromatic will use the wavelength specified in the combo box (you can use the arrow to pick from any of the defined wavelengths or you can enter your own value. The wavelength is specified in nanometers (nm).
# of rays
The rays traced fill the pupil on a hexapolar pattern assuming a circular pupil, with the ring spacing such that the pupil radius is half-way between rings. The number of points will automatically adjust itself to a hex number (1, 7, 19, 37, 61, 91, ...).
Units
The units pop-up menu allows you to select what units of length are to be used to display the result and to calculate the residual.

Selecting "waves" from the units menu causes the result to be expressed in terms of the wavelength of the primary wave.
Target
The target is specified in the same units as the displayed value. If the target is zero (the usual case) the meritoid is multi-residual as described above.
Tolerance
The tolerance is specified in the same units as the displayed value and specified target. Using this tolerance a dimensionless residual is created in the usual way.