CODE V Enewsletter

September 2014

CODE V Quick Tip: Using Error Function Components to Set Optimization Weights

The optimization error function can consist of various components besides the aberration content. If there are weighted constraints (with WTC or PTC), then there will be a constraint component; if you have enabled reduce tolerance sensitivity controls (SAB), there will be a separate component for the tolerance sensitivity. As a designer, you can, and should, adjust the relative weights of each component for optimum results, but how can you access this component information?

You can plot the error function components by enabling the Create Error Function vs. Cycle chart on the Automatic Design Output/Exit Controls tab, or by using the EFP command. The error function breakdown is also part of the text output generated by the optimizer each cycle.

Create Error Function vs. Cycle chart
Error Function vs. Cycle Number

Create Error Function vs. Cycle Chart

Knowing the contribution of each component of the error function can help you to pick appropriate component weights to start an optimization. For example, you can set a weight on the constraint component so that it has a contribution similar to the aberration component to ensure that the optimizer pays equal attention to both components at the start of the optimization. With the tolerance sensitivity error function SAB, you may wish to try optimizing with different starting ratios between the two.

You can check the starting contribution from each component by running an evaluation-only optimization cycle with the maximum number of cycles set to 0 (MXC 0). You can check the contribution from each component, and adjust optimization weights using this information.

For example, the command  

AUT;MXC 0;SAB FA 1;EFL = (efl);DIY FL = 0; WTC 1;GO

can generate output with this error function content:


ABERR F. =     1407.08283001
SAB F.   =      588.84811418
CONST F. =      173.50310670
ERR. F.  =     2169.43405088

In order to efficiently determine the best ratios between components, you could use a macro that tries several different ratios. You can use the database item (AUT.ERF) to report the total error function after the optimization, but to get to the different components, you’ll need to capture the optimization output into a Worksheet Buffer and extract the right data from it. Macro syntax to accomplish this task could look like:

BUF Y !Record output into worksheet buffer B0

!Run an evaluation only optimization cycle
AUT;MXC 0;SAB FA 1;EFL = (efl);DIY FL = 0; WTC 1;GO

BUF N !Stop recording into worksheet buffer B0

!Search B0 for string "SAB F." and store it in variable ^AUTSAB

!This reports ^AUTSAB = 588.848

You can then use the ratio ^AUTSAB/(AUT.ERF) to determine a suitable tolerance sensitivity (SAB) weight. Note that doubling a weight factor will multiply the error function contribution by the square of the weight. For example, changing the SAB weight to 2 in the example above will cause the tolerance sensitivity contribution to jump to 2355, or 4 times the contribution when the weight was 1.

CODE V Glass Catalog Updates Available for Download

Updates to the CODE V glass catalog, including the Hoya and Schott manufacturers’ catalogs, are now available for download from the Customer Portal. The zipped file includes an updated GLASS.CAT file, glass catalog data files, installation instructions, and a history of CODE V glass database changes.