Why does the merit function have different values than when I run ray trace?

  • 14 August 2023
  • 1 reply

So I’m trying to optimize a design in Zemax non-sequential. However I’m noticing that there is a discrepancy between what the MF editor reports, and what I see from running ray trace and running detector viewer. My MF looks like the following: 

And I see that the total flux (line 7) is 0.619 out of .75. This is a very good number. So then I cancel the optimization, and perform a ray trace, and when I take a look at the detector viewer, I get the following:

How can the MF editor be displaying 0.619, yet the total power, which I think is the same metric on the detector viewer is indicating 0.422?


Best answer by David.Nguyen 23 August 2023, 17:56

View original

1 reply

Userlevel 7
Badge +2

Hi @alexander_dumont,


Could you add another NSDD operand at line 8 (leave up to and including your line 7 untouched) and have a Det# value of 42 and a Pix# of -3. This new operand should report the number of hits on the detector during the Merit Function raytrace. If this value is substantially different from the Total Hits reported in your Detecro Viewer, currently 201209, it could be an indication as to what is happening.

Also, are you using the same raytracing options in the user interface as with your NSTR operand? Meaning only the Ignore Errors flag is checked?

Take care,