Hi,
I am trying to optimize a simple lens that focuses and couples a Gaussian beam into two different fibers. I want to optimize a lens that will yield the best combined coupling efficiency for both fibers. Just to clarify, the beam will be coupled into one fiber at a time, but the same lens will be used to couple a Gaussian beam into both fibers. The fibers are represented by .zbf files which are loaded in the Fiber Data tab in Physical Optics. Right now, I’ve written two ZPL macros that will each open a different .zbf, and they are called in the MFE using two separate ZPLM operands. Each ZPLM operand is immediately followed by a POPD operand to get the coupling efficiency which is then optimized, as shown below.

I am not sure if this works as intended. When optimizing, are the operands in the MFE cycled in a loop, so to speak? Also is there a more elegant way of doing this, other than using ZOS-API, or should I use ZOS?
Thank you,
Sam