Ray-Code: An Aberration Coefficient Oriented Lens Design And Optimization Program.

RAY-CODE includes two methods of optimization: Glatzel's adaptive correction and Spencer's damped least squares with Lagrange multipliers. In Glatzel's method hard targets may be applied to selected coefficients of polynomial expansions of the aberration functions as well as to a number of opto-mechanical constraints. In Spencer's method a merit function is formed with weighted sample values of the aberration function. In addition, the same coefficients and constraints may be either assigned soft targets and weights and included into the merit function, or assigned hard targets and treated with Lagrange undetermined multipliers. Sample values of the aberration function may be obtained by interpolation with the polynomial expansion or by straightforward tracing of sets of user-defined rays. The program can be used for designing and optimizing conventional, multiple-configuration, anamorphic, afocal and other systems, and to evaluate them with all the standard methods.