LensForge Icon

Using the merit function plotter

The merit function plotters lets you make a graph of merit function value as a function of any variable that can be used in optimization. This lets you explore the sensitivity of the merit function to the various parameters.

To plot a merit function:

  1. Open the Merit plot window (menu command Tools > Merit plot)
  2. Select the key path that you want to vary. The popup list will contain all parameters that have been set to variable in the surface data editor.
  3. Enter the range delta (the parameter will vary from nominal-delta to nominal+delta).
  4. Select the analyzer (merit function) that you want to plot
  5. Select the aspect of the merit function that you want to plot (see below)
  6. Press the Calculate button to generate the plot

Below is an overview of the merit function plotter window, indicating the various features.

merit function plotter overview

Key path

This is the key path of the construction parameter that you want to vary. The popup list will contain all parameters that have been set to variable in the surface data editor, for example. You can also type in key paths that have to explicitly been set to variable.

We will add various chromatic plots to LensForge in a future version, but if you use the key path primaryWave.wavelength you can make plots of merit functions versus wavelength.

Present value

This is the present value of the construction parameter. It is read-only (you can not change it here).

Delta

Delta is how far from its present value to vary the construction parameter. The parameter is varied over an interval from its present value minus delta to its present value plus delta.

Number of points

How many values of the construction parameter are used to span the interval.

Analyzer (Merit function)

This popup menu lets you select which of your merit functions you want to evaluate. The small arrow to the right of this menu is a little popup menu that lets you modify the selected merit function, and so on.

Aspects of the merit function

Merit function value

This plots the value of the merit function (the half sum of squared residuals defined in the usual way).

Residuals

This plots the residual of each term in the merit function independently. The color of the curve is specified by the color of the meritoid (use the merit function editor to change it). Recall that residuals are dimensionless values.

For multi-residual meritoids like RMS spot size, two curves are plotted: μ + σ and μ - σ where μ is the mean of the meritoid's residuals and σ is their standard deviation.

Term values

This plots the value of each term in the merit function independently. The color of the curve is specified by the color of the meritoid (use the merit function editor to change it). The quantity plotted is the quantity that would appear in the Present value readout in the merit function editor and has the units that are specified there.

See also