Optical ray-tracing and lens optimisation
An optical-design workbench for tracing rays through rotationally symmetric lens systems and optimising selected imaging performance measures.
Project definition
Problem statement
Changing lens curvature, thickness, spacing, glass, aperture, or image plane affects focus, aberrations, field performance, manufacturability, and cost in interacting ways.
The physics and numerical problem is to implement Snell-law ray tracing correctly, define a bounded merit function, optimise without invalid geometries, and verify results against analytical and published reference systems.
Project objectives
- Model rotationally symmetric spherical and selected aspheric surfaces, thicknesses, apertures, stops, and image planes.
- Implement paraxial and exact meridional or skew ray tracing with refractive-index dispersion.
- Calculate focal properties, ray fans, spot diagrams, distortion, field curvature, and selected aberration proxies.
- Optimise selected radii, spacings, and image position under physical and manufacturing constraints.
- Verify ray intersections, refraction, focus, and optimisation against known cases.
System design
System modules
Optical system editor
Defines surfaces, curvature, conic or aspheric terms, thickness, material, aperture, stop, fields, and wavelengths.
Ray-tracing engine
Calculates surface intersections, normals, refraction, total internal reflection, propagation, and image-plane hits.
Paraxial analyser
Calculates effective focal length, principal planes, pupil quantities, magnification, and first-order checks.
Image-quality analyser
Produces spot diagrams, ray fans, focus curves, distortion, field, and wavelength comparisons.
Optimisation workbench
Applies bounded variables, constraints, merit terms, local or global methods, and iteration history.
Methodology
System workflow
- 01Load optical system
The student selects a prepared singlet, doublet, telescope, or camera objective and its fields and wavelengths.
- 02Verify baseline
Paraxial and exact rays are traced and checked for valid intersections, refraction, and apertures.
- 03Measure performance
Focus, spots, ray errors, distortion, and field and wavelength behaviour form the baseline.
- 04Optimise
Selected design variables change within curvature, thickness, spacing, aperture, and material constraints.
- 05Compare design
Before and after systems are compared for merit, image quality, constraint margins, and sensitivity.
Demonstration scenario
A prepared achromatic doublet is traced at three wavelengths and several field angles. The baseline shows longitudinal colour and off-axis spot growth. The optimiser adjusts selected curvatures and image position, then the workbench compares ray diagrams, spot sizes, focus, merit, and constraint margins.
Engineering
Technical architecture
- Web application
- Nuxt, Vue, and Three.js for system editing, ray diagrams, spot plots, focus curves, and comparison.
- Optics API
- FastAPI for systems, ray jobs, analyses, optimisation, tolerances, results, and exports.
- Data layer
- PostgreSQL for system versions, surfaces, glasses, fields, wavelengths, runs, and metrics.
- Numerical engine
- Python, NumPy, and SciPy for geometry, Snell refraction, dispersion, paraxial matrices, merit functions, and optimisation.
- Verification
- Planar-interface, spherical-surface, thin-lens, paraxial, reversibility, and prepared reference-system tests.
Testing
Evaluation
Evaluation measures
- Ray-intersection and refraction error against analytical cases
- Paraxial focal-property agreement with thin-lens and matrix calculations
- Spot, focus, and distortion agreement with prepared reference systems
- Merit-function improvement while satisfying geometry and aperture constraints
- Optimisation repeatability and sensitivity to initial design and variable bounds
- Trace and optimisation time across surfaces, fields, wavelengths, rays, and iterations
System boundaries
- The first version models rotationally symmetric geometrical optics and selected aberration measures.
- Diffraction, polarisation, scattering, coatings, stray light, thermal effects, tolerancing, and full manufacturability are outside the initial scope.
- Optimised results require independent optical software checks, tolerance analysis, and physical testing.
- The software does not provide laser-safety evaluation or instructions for unsafe optical exposure.
Included
- 01Lens surface, material, field, wavelength, and aperture interface
- 02Paraxial, exact-ray, aberration, and optimisation modules
- 03Ray, spot, focus, distortion, and performance visualisations
- 04Prepared optical systems, reference cases, and results
- 05Complete source code in a private GitHub repository
- 06Complete project documentation with synopsis, abstract, methodology, optical diagrams and equations, optimisation results, screenshots, and conclusion
- 07Setup and usage guide
Project record
No buyer information is collected on this page.
- Permanent project ID
- GP-PH-15XE4K0
- Catalogued
- 21 Aug 2026
- Completed
- Pending
- Verified
- Pending
- Demonstration
- Added when ready
Handover
After purchase
- 01Payment is confirmed
The project is marked unavailable and cannot be purchased again.
- 02Repository access is granted
The buyer's submitted GitHub account receives access to the private repository.
- 03The purchase record is delivered
The certification sheet is prepared from the reviewed buyer details and sent privately by email.