mjhoptics / ray-optics

geometric ray tracing for optical systems
BSD 3-Clause "New" or "Revised" License
263 stars 54 forks source link

Modeling a Varioptic lens at 0 power #21

Closed neherh closed 3 years ago

neherh commented 3 years ago

I am looking to model a varioptic lens at 0 power; meaning that the lens acts as a series of flat interfaces. How might I include that in a sequential model using your library?

For reference, this is what I did in a ray transfer matrice equation to model it:

def create_flat_interface(): """ flat interface"""

    # varioptic/flat interface matrix
    flat_oil = sym.Matrix([[1, 0],[0, substrate_dict['WATER']/substrate_dict['OIL']]])
    flat_water = sym.Matrix([[1, 0],[0, substrate_dict['AIR']/substrate_dict['WATER']]])
    flat_air = sym.Matrix([[1, 0],[0, substrate_dict['OIL']/substrate_dict['AIR']]])

    interface_dist = sym.Matrix([[1,d_interface],[0,1]])
    varioptic_interface = flat_air * interface_dist * flat_oil * interface_dist *flat_water #

    return varioptic_interface
neherh commented 3 years ago

I think I figured it out and would like confirmation.

add_surface function can input a list like so: [curvature, dist, n-value, v-number (abbe number)]

so to create a varioptic lense where we have 2 flat interfaces of water and oil it would be:

n_water = 1.3 n_oil = 1.5 v_water = 60 v_oil = 38

sm.add_surface([0, 6.3/2, n_water, v_water]) sm.add_surface([0, 6.3/2, n_oil, v_oil])

mjhoptics commented 3 years ago

Hello, yes that looks like the way to go. I'm not really familiar with how those devices work so let me know if you have further issues.