Skip to content

Error in optimization: Error function has no weight

Question

"I am using OSLO-EDU and attempting to follow an example from your documentation (i.e. the OSLO Optics Reference). I can follow everything just fine until I get to optimization. When I follow the directions and attempt to perform an optimization iteration, I get the error message:
 Error in iterate: No constraint operands defined
And when I list my error function operands in the text window (one way is to type "ope" on the command line), it appears that the Error Function RMS error has no value. What is wrong?"

Synopsis

Error in optimization: Error function has no weight

Solution

The problem is simple but multi-faceted:
  1. The main problem is that the error function you have assembled has zero weight. Add a weight of 1.0 to each operand to mimic the example from the OSLO Optics Reference
  2. The error message that OSLO displays is not very helpful. It should say something like:
     Error in iterate: Error function is defined with zero weight
    A correction to this error message will be fixed in a future release of OSLO.
  3. A small but significant change was made to OSLO since the Optics Reference was last published. The "Ray Operands" and "Aberration Operands" error functions used to be created with all operands having a weight of 1.0. Then the user was told to delete the ones that were not wanted. There were several user related problems with this approach - most notably: deleting operands made it difficult for the user to "bring back" operands that they might want later. Starting with OSLO 6.3.1, we changed OSLO so that when the "Ray Operands" or "Aberration Operands" are created, they are now created with a weight of zero. In current releases of OSLO, the user just needs to change the weights of the desired operands to 1.0 (or any non-zero positive number). Any operand that has a non-zero operand weight will be added to the calculation of the Error Function. This interface change will be displayed properly in the next printing of the OSLO Optics Reference.