Summary
The error function, also called the merit function, is a single number that characterizes an optical system during optimization. This function normally contains several terms that describe defects in an optical system, and the job of an optical design program is to minimize the error function. An error function should be accurate, efficient, and complete.
The GENII error function, ncorporated in OSLO EDU, uses multiple items of data from each traced ray to build a compact error function that is well-suited to interactive design. It uses only 10 rays to derive a 31-term error function that makes use of the relationships between classical aberrations and exact ray data. The individual terms are normalized so that a value of 1.0 represents a normal tolerance for the term, making it easy to see the significant defects in a design and apply appropriate weighting, if necessary. A knowledge of lens design has been used in the construction of the GENII error function, which is why we sometimes call it an expert designer error function. The user only needs to specify the spatial frequency at which the system is to be optimized, which makes it easy to use.
Discussion
The GENII error function is designed to handle systems of moderate complexity, such as camera lenses and other systems having three to eight elements. It is not sufficiently comprehensive to handle very large systems, and is not efficient for handling singlets or doublets. The following description, extracted from the OSLO program documentation[1], describes its general construction.
The GENII error function uses terminology somewhat different from the rest of OSLO. The GENII merit function M is constructed from targets and is defined by

where Aj is the actual value (the value for the existing lens) of the jth target and Dj is the desired value (the value for the program to work to) for the jth target. Tj is the tolerance of the jth target (for example, the acceptable amount that the jth target is permitted to deviate from its desired value in either direction). N is the number of targets. Aj Dj is the amount that the jth target is in error and (Aj Dj)/Tj is the error measured in tolerances, so (Aj Dj)/Tj is the number of tolerances that the jth target deviates from its desired value. In other words, 1/Tj is a weighting factor on the error Aj Dj. M is the weighted sum of the squared errors. The use of tolerances simplifies the interpretation of the error function by effectively establishing a common unit of measure for different types of operands. For a general discussion of this approach, see Chapter 11 of Smith's book[2].
The default error function from GENII has a consistent set of targets and tolerances to control classical aberrations, i.e., it is assumed that the lens is rotationally symmetric. Color correction is performed using Conrady Dd operands and there is no control on secondary color. Since it is designed to balance aberrations in a focal plane shifted from the paraxial image plane, the image distance should be allowed to vary during optimization. If the lens is capable of being diffraction limited, this error function can usually drive it there. If the lens is not capable of being diffraction limited, a reasonable aberration balance can be achieved. If the lens is f/1.5 or faster, this error function may not work well because too few rays are traced.
The rays used in the error function are selected on the assumption that there will be some vignetting. If there is no vignetting, the off-axis rays should be moved further out in the aperture. For some lenses, better correction may be achieved by moving the axial marginal ray in to 0.9 or 0.95, rather than 1.0.
The GENII error function creates a field points set with three entries (FBY = 0.0, 0.7, and 1.0) and a ray set with 8 rays. Ray 1 (a real chief ray) is used to compute field curvature and distortion operands. Ray 2 is used for the axial marginal ray. Rays 3, 4, and 5 are the aperture rays for the 0.7 field point and rays 6, 7, and 8 are the aperture rays for the 1.0 field point. The aperture coordinates for these rays may need to be adjusted based on the desired vignetting.
The GENII error function command in OSLO generates a set with 43 operands, of which only 31 have non-zero weight. These 31 operands comprise the error function. The other operands (with zero weight) are used as intermediate steps in forming GENII-style target definitions. All tolerances are computed from the specified frequency (design_spatial_frequency) and the exit angle of the paraxial axial ray, which is held at its initial value. The basic tolerance from which the others are computed is the tolerance on the transverse ray error for the on-axis marginal ray. This tolerance, Dy, is set at .167 times the reciprocal of the design spatial frequency. The active operands are described in the table below.
Description of Active Operands |
Field |
Tolerance |
| Exit angle of paraxial axial ray, u¢ | 0.0001 |
|
| Focus shift penalty | 3Dy |
|
| Marginal transverse ray error on-axis | 0.0 |
Dy |
| Marginal OPD on-axis | u¢ Dy/3 |
|
| Marginal DMD for axial color | u¢ Dy/3 |
|
| Percent distortion | 1 |
|
| Tangential field curvature (transverse measure) | 3(0.7)Dy |
|
| Sagittal field curvature (transverse measure) | 0.7 |
3(0.7)Dy |
| Primary aperture coma exact in field | 3.2u¢ Dy |
|
| Transverse ray error in upper aperture | 4(0.7)Dy |
|
| OPD in upper aperture | u¢ Dy/3 |
|
| DMD for lateral color in upper aperture | u¢ Dy/3 |
|
| Transverse ray error in lower aperture | 4(0.7)Dy |
|
| OPD in lower aperture | u¢ Dy/3 |
|
| DMD for lateral color in lower aperture | u¢ Dy/3 |
|
| x component of transverse ray error for sagittal ray | 0.7 |
4(0.7)Dy |
| y component of transverse ray error for sagittal ray (coma) | Dy |
|
| OPD on sagittal ray | u¢ Dy/3 |
|
| Percent distortion | 1 |
|
| Tangential field curvature (transverse measure) | 3Dy |
|
| Sagittal field curvature (transverse measure) | Dy |
|
| Primary aperture coma exact in field | 3.2u¢ Dy |
|
| Transverse ray error in upper aperture | 4Dy |
|
| OPD in upper aperture | 1.0 |
u¢ Dy/3 |
| DMD for lateral color in upper aperture | u¢ Dy/3 |
|
| Transverse ray error in lower aperture | 4Dy |
|
| OPD in lower aperture | u¢ Dy/3 |
|
| DMD for lateral color in lower aperture | u¢ Dy/3 |
|
| x component of transverse ray error for sagittal ray | 4Dy |
|
| y component of transverse ray error for sagittal ray (coma) | Dy |
|
| OPD on sagittal ray | u¢ Dy/3 |
1. OSLO Version 5 Program Reference, Rev. 5.2 Addendum, p620, Sinclair Optics (1997).
2. Warren J. Smith, "Modern Optical Engineering (Second Edition)", McGraw-Hill 1990, ISBN 0-07-059174-1.