The NSDE operand allows Tristimulus and power data from the Detector Color object to be placed in the merit function. This data may be extracted simply for purposes of investigation, or for purposes of optimization. For example, a system could be set up to determine the correct ratio of various source colors that will generate a desired output color.

The setup of such a system is provided in the file “Color optimization setup.ZMX”. The archive (.ZAR) file for this system is located on the last page of this article. In this example, three source rays land on a single-pixel Detector Color object. The wavelength of each source is different, and the three different wavelengths are defined in the Wavelength Data dialog box:

Wavelength definition for NSDE example

The initial power of each source is 1 Watt. The resulting color generated by the mixing of these three wavelengths is a powder blue:

Initial True Color results for equal power at each wavelength

We can quantify this color in a number of ways: using the Tristimulus XYZ values associated with the color, the Chromaticity xy values associated with the color, or the Chromaticity u’v’ values associated with the color. You may read more about these different color definitions in the article entitled “How to Model Colored and Tristimulus Sources”. The NSDE operand provides values for all of these various color definitions, as described in the chapter of the ZEMAX manual entitled “Optimization”. In this example, the color will be characterized using the Chromaticity xy values.

To use the NSDE operand to obtain Tristimulus or power data from the Detector Color object, we first need to have an NSDE operand in the merit function that clears the detector. Then, an NSTR operand is needed to run the ray trace inside of the merit function. Subsequent NSDE operands may then be used to evaluate results on the detector. This sequence of operands is identical to what is needed when using the NSDD operand with the Detector Rect, Detector Surf, or Detector Volume objects – see the article entitled “How to Optimize Non-Sequential Optical Systems” for more details.

The powder blue color associated with the initial setup of the example has a Chromaticity x value of 0.27 and a Chromaticity y value of 0.29, as determined using the NSDE operand with Data = 5 and 6, respectively:

Initial chromaticity values for equal power at each wavelength

The total power reaching the detector in Watts and Lumens is also reported back in the merit function using the NSDE operand with Data = 1 and Data = 3, respectively. The total power in Watts is 3.0, as expected (since each source has a power of 1 W), and the total power in Lumens is 786.8, consistent with the value shown on the Detector Color object itself.

The targets for the desired color have been set to 0.50 and 0.35 for the Chromaticity x and y values, respectively. The optimization variables in this case are the power associated with each source:

Initial power at each wavelength

If we perform optimization using the Damped Least Squares algorithm, we quickly find a solution:

Optimized values for power at each wavelength to achieve desired color

that yields the desired color:

Optimized chromaticity values show agreement with defined targets

Resulting True Color image of optimized system

These optimized results are provided in the file “Color optimization results.ZMX”. The archive (.ZAR) file for this system is located on the last page of this article.

The total power of the system has increased from 3.0 to 5.7 Watts and from 786.8 to 1134.9 Lumens. Additional operands could be added to constrain the total power of the system, if needed.