I created a DLL to model a gradient index surface and while it is working, the modeling results are very similar to a standard surface. It seems that somehow Zemax is not using the gradient index during the refraction process. I have been investigating what I am doing wrong and got more confused. Your help will be greatly appreciated! :-)
Looking into the example from /zemax/dll/surfaces/us_grin1.c, the refractive indices used for refraction in case 5 are FD->n1 and FD->n2, which are the indices before and after the GRIN surface. In case 6, which is where the index and its derivatives are defined, the refractive index is calculated and the assignment UD->index = index is made, as well as the dn/dx, dn/dy and dn/dz.
So, I am a bit confused:
- Which refractive index is used during refraction, UD->index or FD->n2? I was expecting that I would use UD->index, but that is not what happens in case 5. How does Zemax ‘know’ that it is dealing with a gradient index material then?
- I am assuming that the ‘material column’ should be left blank when the surface is a GRIN (and the GRIN parameter columns should be populated of course). Is this correct?
- What value is passed to FD->n2 and the refraction function call, if the material column is blank?
Thank you!
- Should I leave the material column blank?