Tutorial 2d - Raytracing Aspheres
This tutorial shows how even aspheres can be modeled in Optiland. We will first assess a simple spherical lens, then compare it to an even asphere.
[1]:
import numpy as np
from optiland import analysis, optic
Spherical Singlet
Let’s define a simple singlet:
[2]:
spherical = optic.Optic()
# add surfaces
spherical.surfaces.add(index=0, radius=np.inf, thickness=np.inf)
spherical.surfaces.add(
index=1,
thickness=7,
radius=20.0,
is_stop=True,
material="N-SF11",
)
spherical.surfaces.add(index=2, thickness=21.56201105)
spherical.surfaces.add(index=3)
# add aperture
spherical.set_aperture(aperture_type="EPD", value=20.0)
# add field
spherical.fields.set_type(field_type="angle")
spherical.fields.add(y=0)
# add wavelength
spherical.wavelengths.add(value=0.587, is_primary=True)
spherical.update_paraxial()
spherical.draw(num_rays=10)
[2]:
(<Figure size 1000x400 with 1 Axes>, <Axes: xlabel='Z [mm]', ylabel='Y [mm]'>)
[3]:
spot = analysis.SpotDiagram(spherical)
spot.view()
[3]:
(<Figure size 1200x400 with 1 Axes>,
[<Axes: title={'center': 'Hx: 0.000, Hy: 0.000'}, xlabel='X (mm)', ylabel='Y (mm)'>])
As we can see, this lens shows a significant amount of spherical aberration, as is typical for such a lens.
Aspherical Singlet
Let’s now define an asphere which has improved spherical aberration performance.
We define the “surface_type” attribute as “even_asphere” and we supply a list of coefficients of the aspheric terms. The aspheric surface sag equation is
\(z(r) = \frac{r^2}{R(1 + \sqrt{1 - (1 + \kappa)\frac{r^2}{R^2}})} + \alpha_2r^2 + \alpha_4r^4 + \alpha_6r^6 + \ldots\)
where \(z\) is the sag, \(R\) is the radius of curvature, \(r\) is the radial distance from the optical axis, and \(\alpha_2, \alpha_4, \alpha_6, \ldots\) are the coefficients of the asphere. The coefficient list provided to the surface is simply \([\alpha_2, \alpha_4, \alpha_6, \ldots]\).
[4]:
asphere = optic.Optic()
# add surfaces
asphere.surfaces.add(index=0, radius=np.inf, thickness=np.inf)
asphere.surfaces.add(
index=1,
thickness=7,
radius=20.0,
is_stop=True,
material="N-SF11",
surface_type="even_asphere",
conic=0.0,
coefficients=[
-2.248851e-4,
-4.690412e-6,
-6.404376e-8,
], # <-- coefficients for asphere
)
asphere.surfaces.add(index=2, thickness=21.56201105)
asphere.surfaces.add(index=3)
# add aperture
asphere.set_aperture(aperture_type="EPD", value=20.0)
# add field
asphere.fields.set_type(field_type="angle")
asphere.fields.add(y=0)
# add wavelength
asphere.wavelengths.add(value=0.587, is_primary=True)
asphere.update_paraxial()
asphere.draw(num_rays=5)
[4]:
(<Figure size 1000x400 with 1 Axes>, <Axes: xlabel='Z [mm]', ylabel='Y [mm]'>)
[5]:
spot = analysis.SpotDiagram(asphere)
spot.view()
[5]:
(<Figure size 1200x400 with 1 Axes>,
[<Axes: title={'center': 'Hx: 0.000, Hy: 0.000'}, xlabel='X (mm)', ylabel='Y (mm)'>])
We can see that the rays now focus much closer to the optical axis and that the spot size has reduced significantly.
Conclusions:
This tutorial introduced the even asphere surface type.
To use an aspheric surface, we simply specify surface_type=’even_asphere’ and provide the list of aspheric coefficients.
This tutorial used an asphere that had alredy been optimized for minimal wavefront error. We ignored these details here, but future tutorials will elaborate on the asphere optimization process.