Version 1.9.23
This release includes many updates. Various issues introduced with GRIN and discovered during testing have been resolved. One important fix addresses a race condition exposed by the ins_zoom() function. The release also adds significant enhancements to the Solver and delivers overall improvements to performance and optimization speed.
Solver Example
Constraint functions can have user-defined names. This helps interpret the output of an optimization run. Furthermore, the list of constraints is sorted by the degree to which each constraint is violated, making it much easier to focus on the most important ones. The following output shows the evaluation run of a Solver for the supplied lens, dbgauss.
Optimizer : LN_COBYLA
Local Algo : LN_COBYLA
Dimension : 21
Cost Function : user_cost
Inequality Constraints : 22
Equality Constraints : 0
------ Evaluation Run ------
Cost: 4.73e+05
<= 0 constraints
BCC_S10_Z1 : -0.3
BCC_S3_Z1 : -0.3
BCE_S10_Z1 : -0.3011
BCE_S3_Z1 : -0.434
BCC_S8_Z1 : -2.5
BCC_S5_Z1 : -2.5
BCE_S8_Z1 : -2.598
BCE_S5_Z1 : -2.974
BCE_S2_Z1 : -3.897
BCE_S11_Z1 : -4.985
BCE_S6_Z1 : -5.656
BCE_S4_Z1 : -7.324
BCE_S9_Z1 : -7.69
BCC_S2_Z1 : -7.9
BCC_S11_Z1 : -7.9
BCE_S7_Z1 : -10.06
BCC_S9_Z1 : -10.4
BCC_S6_Z1 : -11.7
BCC_S7_Z1 : -13.7
BCC_S4_Z1 : -14.3
BCC_S12_Z1 : -61.9
BCE_S12_Z1 : -64.08
= 0 constraints
----------------------------
I defined these inequality constraints using a script that I have found very useful for my work. The script defines basic lens-construction constraints that, for example, prevent center thicknesses from becoming negative during optimization. If you need this script before it is included in COPHASAL, let us know.
Constraint names follow this convention: “BC” = Basic Constraint, then “C” (center thickness) or “E” (edge thickness), followed by the surface number the constraint applies to. Note that inequality constraints are considered violated when their value is positive. In the listing above, the two constraints closest to this limit are the center thicknesses of surfaces 3 and 10. To make things clear, we can show surface labels in the lens display by right‑clicking and toggling the labels on.
One question that arises is why the edge‑thickness constraints on surfaces 3 and 10 are so tight. The reason is that the script currently uses simple heuristics to choose which marginal ray to use when defining edge‑thickness constraints: it selects the marginal ray with the shortest optical path to the next surface. This works for many cases, but the selection rule may change in a future version before release.

Lens layout with surface labels