Aberrations are departures from ideal image formation. In an ideal paraxial optical system, all rays from a single object point would meet at exactly one image point.
Real systems do not behave so perfectly. Even a simple spherical lens can bring different rays to slightly different axial positions, and different wavelengths can also focus at different distances.
This calculator previews those two effects in a simplified way: spherical aberration and chromatic aberration.
In the paraxial limit, a lens is described by a single focal length \(f_0\). If incoming rays are nearly parallel and remain close to the optical axis, they focus near that ideal paraxial focus.
But when the rays pass farther from the axis, a spherical surface does not bring them to exactly the same point. The result is spherical aberration.
In a ray picture, marginal rays focus either closer to the lens or farther away than the paraxial rays, depending on the sign and geometry of the aberration.
This causes a focus spread along the axis rather than a single perfect crossing point.
To preview that behavior, this calculator uses a simple educational model
\[
f(y)=f_\lambda\left[1-S\left(\frac{|y|}{a}\right)^2\right].
\]
Here \(y\) is the ray height at the lens, \(a\) is the aperture radius, and \(S\) is a dimensionless spherical-aberration strength.
When \(S=0\), the focus does not depend on height and the lens behaves ideally in this simplified model.
When \(S>0\), marginal rays focus differently from paraxial rays, so the bundle spreads.
This is not meant to be an exact Seidel-theory expression; it is a clean preview formula that makes the geometric effect easy to see.
The second effect is chromatic aberration. In a refracting lens, the refractive index depends on wavelength. Because of that, blue light and red light generally do not have exactly the same focal length.
A common rule of thumb is that shorter wavelengths often focus slightly closer than longer wavelengths in ordinary glass.
This calculator previews that by allowing the focal length to vary with wavelength:
\[
f_\lambda=f_0\left[1-D\left(\frac{550-\lambda}{550}\right)\right].
\]
In this expression, \(D\) is a simple dispersion-strength parameter and \(\lambda\) is the wavelength in nanometers.
The value \(550\ \text{nm}\) is used as a reference because it is near the middle of the visible spectrum.
Again, this is an educational approximation rather than a full material-dispersion model, but it reproduces the main idea:
different colors focus at different axial positions.
When both effects are active, the total previewed focus for a ray depends on both its height and its wavelength. That means a bundle of rays no longer converges to one axial point.
Instead, there is an entire focus region. The calculator reports that spread as an axial bundle-focal range, which is a simple way to connect the ray picture to visible blur.
In the sample case of a spherical lens with \(f_0=50\ \text{cm}\), the paraxial rays still aim near \(50\ \text{cm}\), but marginal rays may shift forward depending on the chosen spherical-aberration strength.
If chromatic dispersion is also turned on, blue, green, and red groups are shown with slightly different paraxial focal positions.
The outgoing bundle therefore develops both a height-based and a wavelength-based spread.
This kind of preview is especially useful when discussing telescope blur, lens stopping-down, and why better-corrected optics often need multiple elements.
Stopping down a system reduces the largest ray heights, which tends to reduce spherical aberration because the marginal rays are removed.
Chromatic aberration, by contrast, is controlled mainly by material choice and by combining lens elements of different dispersion, as in achromatic doublets.
At the university level, aberrations are described more rigorously with wave optics, third-order Seidel coefficients, ray fans, spot diagrams, and full design software.
Still, the simplified preview here captures the basic geometry: spherical aberration means different ray heights focus differently, and chromatic aberration means different wavelengths focus differently.
That is exactly the core idea students need before moving to more advanced optical design.