Matrix Methods

This project involves performing thin lens calculations using a matrix representation of optical elements. See the slides for an explanation of the details. The end result is that we have two matrix operators for refraction and translation transitions:

Refraction:

$$\hat{R}\left|r_0\right\rangle = \begin{bmatrix} 1 & 0 \\ \frac{n_l - n_r}{R n_r} & \frac{n_l}{n_r} \end{bmatrix} \begin{bmatrix} y_0 \\ \alpha_0\end{bmatrix}$$

Translation

$$\hat{T}\left|r_0\right\rangle = \begin{bmatrix} 1 & L \\ 0 & 1 \end{bmatrix} \begin{bmatrix} y_0 \\ \alpha_0\end{bmatrix}$$

Where $n_l$ and $n_r$ are the indices of refraction on the left and right (respectively) of the refractive interface. $R$ is the radius of curvature of the refractive interface (positive if the center of curvature is to the right, negative to the left). $y_0$ is the height of the ray before the transition, $\alpha_0$ is the angle (in radians) of the ray before the transition. $L$ is the length of the translation. Various combinations of these two operators can describe very complicated lens systems easily!

Here's the example worked out in the slides:


In [1]:
import numpy as np
import matplotlib.pyplot as pl

In [2]:
ng=1.5  # index of glass
na=1.0  # index of air
h=0.01  # start with ray 1.0 cm above axis
R=0.15  # radius of curvature of lens

ray1 = np.array([[h],[0.0]])

ray1


Out[2]:
array([[0.01],
       [0.  ]])

In [3]:
T1 = np.array([[1.0, 3.0],
            [0.0, 1.0]
            ])
T1


Out[3]:
array([[1., 3.],
       [0., 1.]])

In [4]:
ray2 = T1.dot(ray1)  # matrix multiplication is handled by the "dot" method of an array
ray2


Out[4]:
array([[0.01],
       [0.  ]])

In [5]:
R1 = np.array([[1.0, 0.0],               # entering the curved surface
            [(na-ng)/(ng*R), na/ng]])
R1


Out[5]:
array([[ 1.        ,  0.        ],
       [-2.22222222,  0.66666667]])

In [6]:
ray3 = R1.dot(ray2)
ray3


Out[6]:
array([[ 0.01      ],
       [-0.02222222]])

In [7]:
R2 = np.array([[1.0,0.0],              # exiting the planer surface
            [0.0, ng/na]])
R2


Out[7]:
array([[1. , 0. ],
       [0. , 1.5]])

In [8]:
ray4=R2.dot(ray3)
ray4


Out[8]:
array([[ 0.01      ],
       [-0.03333333]])

In [9]:
fl=-ray4[0,0]/ray4[1,0]         # calculate the focal length from the height and angle of the ray.
fl


Out[9]:
0.3

In [10]:
na*R/(ng-na)                    # compare to the "lens makers" equation result.


Out[10]:
0.3

In [11]:
M = R2.dot(R1.dot(T1))   # system matrix
M


Out[11]:
array([[ 1.        ,  3.        ],
       [-3.33333333, -9.        ]])

In [12]:
M.dot(ray1)             # system acting on ray1


Out[12]:
array([[ 0.01      ],
       [-0.03333333]])

Project 6

We'll measure the properties of a thick lens in class. We'll measure a laser beam passing through this lens. Using these ideas, compute the trajectory of a ray through the lens. Compare the computed trajectory to your measured values.


In [12]: