Hello.
I guess my question is fairly straight forward. However, I am not very used to any optimization procedures, so any help will be appreciated.
Assuming I have a source and a detector, and some surfaces inbetween in a non-sequential setting. I need to write a merit funtion that maximizes flux on the detector - but only for rays hitting a specific surface in between source and detector. While this is easily done by filter strings in a simple detector view, I was unsure on how to implement this in the optimization. Therefore Zemax provided some help a while ago in form of this ZPLM operand
detector = PVHX()
clear = NSDD(1,0,0,0)
NSTR 1, 0, 0, 0, 0, 0, 0, 1, 'Test.ZRD', 'H4'
ZRDPLAYBACK 'Test.ZRD', 1, detector, 1
X = NSDD(1, detector, -3, 0)
OPTRETURN 0, X
So I specify my detector in H(x) and then clear all detectors, run a raytrace with the filter string applied (in this case hit surface 4) and point it back to the detector. So now this returns the rays hitting the detector under consideration of H4, correct?
However, how do I use that in the merit funtion editor now? Would someone be able to provide me with a working example of such a merit function to get this ZPLM implemented?
Best Regards
Moritz