We use exact ray tracing, implemented in Python (under modules on Canvas) or in JavaScript as a HTML web page. We use lens parameters for Newport lenses made from BK7 glass.
The exact ray tracing scripts use the Newport KPX079 25.4 mm diameter plano-convex lens.
In the figure below, the rays are incident parallel to the optical axis. The red, green, and blue colored rays, encounter the lens at radial distance 0.25, 0.55, and 0.85 cm from the center of the lens. When the curved side of the lens faces the incident beam, the focal length does not strongly depend of the radial distance, and spherical aberrations are minimized. However, when the flat side of the lens faces the incident beam, the focal length does strongly depend of the radial distance, and the circle of least confusion is shifted a large distance away from the paraxial focus.

The Python script 'spherical aberration plano convex' uses a 3D ray-tracing
algorithm based on Snell's Law and the sagittal equations of a spherical surface
to visualize how light passes through a lens. The script illustrates spherical
aberration. You will notice that the green rays (marginal) cross the
optical axis at a different point than the red rays (paraxial). This is
because spherical surfaces do not focus all light to a single point.
In this specific script, the Y-axis is treated as the depth (the path the light
travels), which is why the plot aspect ratio and limits are elongated on the
Y-axis.
The Javascript program does not draw the rays themselves, but displays their
arrival position on a screen.
Single
lens exact ray tracing (utk.edu)
Lens 2 is the same plano-convex lens used above.
Click on the link, use lens 2, and change the beam radius to find the paraxial
focus and the circle of least confusion.
In the figure below, skew rays approach the lens at an angle of ~6 degrees.. The red, green, and blue colored rays, encounter the lens at radial distance 0.25, 0.55, and 0.85 cm from the center of the lens. When the curved side of the lens faces the incident beam, the position of the focal plane and the focal length do not strongly depend of the radial distance. However, when the flat side of the lens, the position of the focal plane and the focal length do strongly depend of the radial distance and we easily observe a coma aberration.

The script 'coma plano convex' simulates Coma, an off-axis aberration where rays entering the lens at an angle do not converge to a single point, instead forming a comet-like shape. Compared to the previous script, the main difference here is the non-zero alpha value, which tilts the incoming light. The alpha = -0.1 line introduces a tilt. In the previous spherical aberration script, the light was entering perfectly parallel to the axis. The line x0 = x1 + z1*np.tan(np.arccos(gamma)) is used to trace the rays from a tilted wave-front so they hit the lens correctly distributed across the aperture.
For the same lens, the Javascript program displays the a arrival position of
the rays on a screen.
Single
lens exact ray tracing (utk.edu)
Use lens 2, rotate the lens by ~15 degrees, change the beam radius, and observe
coma.
To observe astigmatism we want to use a lens that minimizes spherical
aberration and coma. We use the Newport KPX106 plano convex lens with the
curved side facing the beam.
Single
lens exact ray tracing (utk.edu)
Use lens 4. Use a large bean radius. For some image distance, find
the object distance (circle of least confusion). Rotate lens by ~15
degrees. Move the screen an observe astigmatism.
The Python script 'astigmatism-fan' simulates Astigmatism, an aberration that
occurs when an off-axis object point creates rays in two perpendicular
planes—the meridional (tangential) plane and the sagittal plane—that focus at
different distances.
In the code, these are visualized as "fans" of rays, the red rays represent one
plane, and the green rays represent the other.