---
date: last-modified
---

# Multi-element lens calculations: The ABCD matrix {#sec-resource-optics-abcd}

{{< include "../includes/WIP-callout.qmd" >}}

[Return to Multi-element Lenses](../optics-06-morelenses.qmd) | [Return to book home](../../index.qmd)

[Source chat reference](https://chatgpt.com/share/66fc291d-6780-8002-b144-e42045f37ea2).


Yes, you can compute the effective focal length of a multi-element lens system if you know the refractive index, curvatures, and positions of each lens element. To do this, you would use the matrix method (or ray transfer matrix analysis), which is a standard approach in geometric optics for analyzing systems with multiple optical elements. Here's a general outline of the process:

Steps:
Lensmaker's Equation for Individual Lenses: For each individual spherical lens, you can use the lensmaker's equation to find the focal length ( f ) of the lens:
[
\frac{1}{f} = (n - 1) \left( \frac{1}{R_1} - \frac{1}{R_2} \right)
]
where:
( n ) is the refractive index of the lens material,
( R_1 ) and ( R_2 ) are the radii of curvature of the lens surfaces (positive for convex, negative for concave).
Ray Transfer Matrices: For each optical element, you can describe its effect on a ray of light using a matrix. The main matrices used are:
Refraction through a lens:
[
\begin{pmatrix}
1 & 0 \
-\frac{1}{f} & 1
\end{pmatrix}
]
where ( f ) is the focal length of the lens.
Propagation through free space (distance ( d )):
[
\begin{pmatrix}
1 & d \
0 & 1
\end{pmatrix}
]
Multiplying Matrices: Multiply the matrices for each lens and spacing in sequence from the first element to the last. This will give you an overall system matrix ( M ) of the form:
[
M = \begin{pmatrix}
A & B \
C & D
\end{pmatrix}
]
where ( A ), ( B ), ( C ), and ( D ) are the elements of the resulting matrix after multiplication.
Effective Focal Length: The effective focal length ( f_{\text{eff}} ) of the system can be found from the matrix ( M ) using the relation:
[
f_{\text{eff}} = -\frac{1}{C}
]
where ( C ) is the element in the bottom-left of the system matrix ( M ).
Example:

For a system of two lenses separated by a distance ( d ):

Calculate the individual focal lengths ( f_1 ) and ( f_2 ) using the lensmaker's equation.
Multiply the matrices for the first lens, the propagation through the distance ( d ), and the second lens.
Extract ( C ) from the resulting matrix and compute the effective focal length.

This method is scalable to any number of lenses and is commonly used in optical system design.

Would you like help with a specific example or more details about this process?

The ray transfer matrix (also known as the ABCD matrix) is a formalism used in geometrical optics to describe how light rays propagate through optical systems, including lenses, mirrors, and free space. It provides a way to predict how a light ray's position and angle change as it passes through an optical element.

Ray Parameters

The ray transfer matrix acts on the ray's state, which is typically described by two parameters:

Position ( y ): The height (or transverse displacement) of the ray relative to the optical axis.
Angle ( \theta ): The angle that the ray makes with the optical axis.

In matrix notation, the ray's state is expressed as a column vector:
[
\mathbf{r} = \begin{pmatrix}
y \
\theta
\end{pmatrix}
]

This vector contains the position ( y ) and the angle ( \theta ) of the ray at a particular point in the optical system.

Ray Transfer Matrix

The ray transfer matrix ( M ), also called the system matrix, describes how the position and angle of the ray change as it passes through an optical element. For an optical system or element, the transfer matrix is written as:
[
M = \begin{pmatrix}
A & B \
C & D
\end{pmatrix}
]
This matrix transforms the ray parameters from one side of the optical element (or system) to the other. The relation between the ray parameters before and after the system is:
[
\begin{pmatrix}
y_2 \
\theta_2

\end{pmatrix}

\begin{pmatrix}
A & B \
C & D
\end{pmatrix}
\begin{pmatrix}
y_1 \
\theta_1
\end{pmatrix}
]
where:

( y_1 ) and ( \theta_1 ) are the initial position and angle of the ray (before the element),
( y_2 ) and ( \theta_2 ) are the position and angle after the element.

The matrix elements ( A ), ( B ), ( C ), and ( D ) depend on the type of optical element (lens, free space, mirror, etc.).

Interpretation of Matrix Elements
( A ): Describes how the initial position ( y_1 ) influences the final position ( y_2 ).
( B ): Describes how the initial angle ( \theta_1 ) influences the final position ( y_2 ) (this is related to the system's "focusing" effect).
( C ): Describes how the initial position ( y_1 ) influences the final angle ( \theta_2 ) (related to the system's "bending" of rays).
( D ): Describes how the initial angle ( \theta_1 ) influences the final angle ( \theta_2 ).
Example of Ray Propagation through Free Space

In free space, over a distance ( d ), the ray transfer matrix is:
[
M = \begin{pmatrix}
1 & d \
0 & 1
\end{pmatrix}
]
This matrix implies that:

The ray's position changes according to ( y_2 = y_1 + d\theta_1 ), meaning the ray moves along a straight line depending on its initial angle.
The ray's angle remains unchanged: ( \theta_2 = \theta_1 ).
Example of Ray Propagation through a Thin Lens

For a thin lens with focal length ( f ), the ray transfer matrix is:
[
M = \begin{pmatrix}
1 & 0 \
-\frac{1}{f} & 1
\end{pmatrix}
]
This matrix implies that:

The ray's angle changes according to ( \theta_2 = \theta_1 - \frac{y_1}{f} ), which corresponds to the focusing effect of the lens.
The position of the ray is unchanged: ( y_2 = y_1 ).
Ray Propagation through a System

To predict the behavior of a ray through a multi-element optical system, you multiply the matrices of each individual element. The overall matrix for the system is the product of the matrices of the elements in the order the ray encounters them. This final matrix can then be used to find the ray's final position and angle after passing through the entire system.

In summary, the ray transfer matrix predicts how the position and angle of a ray evolve as it propagates through an optical element or system. By multiplying the ray's initial state by the transfer matrix, you can calculate its state after traversing the optical system.

Yes, you are correct! When using the ray transfer matrix to calculate the propagation of a ray through a lens, you generally assume that:

The ray enters the lens from the left side.
The radius of curvature of the lens surface on the left-hand side (where the ray first encounters the lens) is ( R_1 ).
The radius of curvature of the lens surface on the right-hand side (where the ray exits the lens) is ( R_2 ).

In terms of ray transfer matrices, the process looks like this:

Ray Transfer Matrix Setup

For a single spherical lens, the complete ray transfer matrix involves two primary types of matrices:

Refraction at the surfaces of the lens (at ( R_1 ) and ( R_2 )),
Propagation through the thickness of the lens (if it has a non-negligible thickness).

You would calculate the overall matrix by multiplying these matrices in sequence, taking into account:

Free-space propagation before and after the lens (if relevant),
The two refractions at the curved surfaces ( R_1 ) and ( R_2 ),
Propagation through the lens medium (if the lens has some thickness ( t )).
Standard Case (Thin Lens Approximation)

In the thin lens approximation (where the thickness of the lens is negligible), you don't need to consider propagation through the lens. The ray transfer matrix for a thin lens is given by:
[
M_{\text{lens}} = \begin{pmatrix}
1 & 0 \
-\frac{1}{f} & 1
\end{pmatrix}
]
where ( f ) is the focal length of the lens, which you can calculate using the lensmaker's equation:
[
\frac{1}{f} = (n - 1) \left( \frac{1}{R_1} - \frac{1}{R_2} \right)
]
Here:

( n ) is the refractive index of the lens material,
( R_1 ) is the radius of curvature of the surface the ray first encounters (left-hand side),
( R_2 ) is the radius of curvature of the surface the ray exits through (right-hand side).
Full Calculation for a Thick Lens

If the lens is thick, meaning it has a non-negligible thickness ( t ), the full ray transfer matrix would consist of three steps:

Refraction at the first surface (with radius ( R_1 )):
[
M_{\text{refraction 1}} = \begin{pmatrix}
1 & 0 \
\frac{n_1 - n_2}{R_1} & \frac{n_1}{n_2}
\end{pmatrix}
]
where:
( n_1 ) is the refractive index of the medium on the left (e.g., air),
( n_2 ) is the refractive index of the lens material,
( R_1 ) is the radius of curvature of the first surface (positive for convex, negative for concave).
Propagation through the lens material (distance ( t )):
[
M_{\text{propagation}} = \begin{pmatrix}
1 & t/n_2 \
0 & 1
\end{pmatrix}
]
where ( t ) is the thickness of the lens and ( n_2 ) is the refractive index of the lens.
Refraction at the second surface (with radius ( R_2 )):
[
M_{\text{refraction 2}} = \begin{pmatrix}
1 & 0 \
\frac{n_2 - n_1}{R_2} & \frac{n_2}{n_1}
\end{pmatrix}
]
where:
( n_1 ) is again the refractive index of the medium outside the lens (e.g., air),
( n_2 ) is the refractive index of the lens material,
( R_2 ) is the radius of curvature of the second surface (positive for convex, negative for concave).
Matrix Product for Thick Lens

To calculate the total effect of the lens on the ray, you multiply these matrices in sequence:
[
M_{\text{total}} = M_{\text{refraction 2}} \times M_{\text{propagation}} \times M_{\text{refraction 1}}
]

The result of this matrix product gives you the overall transformation of the ray’s position and angle as it enters and exits the lens system.

Applying the Matrix to the Ray

Once you have the total ray transfer matrix ( M_{\text{total}} ), you can apply it to the initial ray vector ( \mathbf{r}_1 = \begin{pmatrix} y_1 \ \theta_1 \end{pmatrix} ), where ( y_1 ) is the initial position of the ray and ( \theta_1 ) is its angle of incidence with respect to the optical axis.

The output ray vector ( \mathbf{r}2 = \begin{pmatrix} y_2 \ \theta_2 \end{pmatrix} ) is given by: [ \mathbf{r}_2 = M{\text{total}} \mathbf{r}_1
]
where ( y_2 ) is the position of the ray after exiting the lens and ( \theta_2 ) is its new angle.

Summary
The ray enters the lens on the left, and the matrix describes how its position and angle are transformed.
( R_1 ) is the radius of curvature on the left side of the lens (where the ray enters), and ( R_2 ) is on the right (where the ray exits).
The matrix product results in a new ray vector ( \mathbf{r}_2 = \begin{pmatrix} y_2 \ \theta_2 \end{pmatrix} ), which gives the ray's position and angle after it exits the lens.

This approach is widely used in designing and analyzing optical systems, particularly in lens systems with multiple elements!

Optics designers use multi-element lenses instead of simple thin lenses for several important reasons. While a single thin lens can perform basic focusing and image formation, multi-element lenses are necessary to address more complex optical requirements and improve image quality in advanced applications. Here are some of the main reasons:

1. Correction of Aberrations
Spherical Aberration: In a single lens, spherical surfaces cause spherical aberration, where rays passing through the edge of the lens focus at a different point than rays passing near the center. Multi-element lenses can be designed to correct this by combining lenses of different shapes and refractive indices.
Chromatic Aberration: A single lens causes chromatic aberration because different wavelengths of light are refracted by different amounts (dispersion), leading to color fringing around images. Multi-element lenses, such as achromatic doublets (two lenses made of different materials), can reduce or eliminate chromatic aberration by compensating for the wavelength-dependent behavior of light.
Coma and Astigmatism: Coma (where off-axis points appear distorted or smeared) and astigmatism (where vertical and horizontal lines focus at different distances) are other common aberrations that multi-element lens systems help to correct.
2. Improved Image Quality Across a Wide Field of View
A single thin lens may perform well on-axis (directly in front of the lens), but off-axis performance tends to degrade, leading to issues like distortion, vignetting, and aberrations. Multi-element lenses can be optimized to deliver consistent image quality across a wider field of view, making them essential for applications like wide-angle photography and cinematography.
3. Faster Apertures
Designers can achieve larger apertures (lower f-numbers) with multi-element lenses while maintaining acceptable image quality. A simple thin lens with a large aperture will introduce significant aberrations, but with multiple lens elements, optical performance can be preserved even at wide apertures, enabling more light to enter the system and allowing for better low-light performance and shallower depth of field.
4. Control of Distortion
Distortion (such as barrel or pincushion distortion) occurs when straight lines in the scene appear curved in the image. A simple lens often introduces some distortion, especially for wide-angle fields of view. Multi-element lenses, such as zoom lenses or complex prime lenses, are specifically designed to control and minimize distortion, resulting in more accurate image reproduction.
5. Zoom Capabilities
Simple lenses offer a fixed focal length, but many optical systems, such as camera zoom lenses, require variable focal lengths. Multi-element zoom lenses allow designers to change the focal length smoothly while maintaining focus. This flexibility is crucial for many applications, such as photography, videography, and surveillance.
6. Compact Design with High Performance
High-performance optical systems, such as those used in smartphones, microscopes, and high-quality cameras, require compact lenses with excellent image quality. A multi-element design allows designers to achieve a balance between compactness and optical correction. The use of multiple elements can help to shorten the overall length of the lens system while still providing the required focal length and performance.
7. Wide Wavelength and Spectral Range
In specialized applications (e.g., infrared imaging or ultraviolet optics), different lens materials may be required to handle different parts of the spectrum efficiently. A multi-element lens can use various materials (like glass, plastic, or crystalline materials) to optimize performance across a wide spectral range.
8. Mechanical and Manufacturing Constraints
It is often easier and more cost-effective to manufacture and assemble several simpler lens elements than to attempt to create a single lens element with highly complex shapes or specialized properties. Additionally, multi-element lenses allow designers to use standard lens shapes and coatings while achieving the desired optical properties, simplifying the design and production process.
9. Reduction of Ghosting and Flare
Light reflecting internally between the surfaces of lens elements can create ghost images or flare, reducing image contrast. By using multi-element lenses with anti-reflection coatings and optimized element arrangement, designers can reduce these unwanted effects and improve the clarity of the image.
10. Flexibility for Specialized Applications
Multi-element lenses provide flexibility to tailor the design to specific tasks. For example:
Telephoto lenses for long-range imaging.
Wide-angle lenses for capturing more of a scene.
Macro lenses for close-up imaging with minimal distortion.
Anamorphic lenses for cinematic effects.

Each type of lens may require multiple elements to achieve its particular optical objectives without compromising image quality.

11. Customization for Precision and Performance
Advanced applications in scientific instruments, medical imaging, and industrial inspection require precise optical systems that may need a combination of elements to achieve the necessary accuracy. In such cases, a single lens cannot provide the high level of precision required, but a multi-element design can be carefully engineered for the exact performance needed.
Summary

Multi-element lenses are used because they allow optics designers to correct various aberrations, improve image quality, achieve wide fields of view, provide zoom functionality, control distortion, and optimize performance for specific applications. In contrast, a simple thin lens is limited in its ability to manage these factors, particularly when dealing with complex or high-performance optical systems.

---

[Return to Multi-element Lenses](../optics-06-morelenses.qmd) | [Return to book home](../../index.qmd)



