Virtual experiments have become an indispensable tool for the design and the accuracy assessment of novel measurement procedures and instruments. Virtual experiments are particularly relevant in modern optics due to its challenging demands for highly accurate measurements. This paper introduces SimOptDevice, a flexible library for opto-mechanical virtual experiments. After describing the scope and general structure of the library, its underlying mathematical tools used for solving the related numerical tasks are described. Finally, the application of SimOptDevice to a recent interferometric measurement procedure is presented.

The author's copyright for this publication is transferred to the Physikalisch-Technische Bundesanstalt (PTB).

Following the advance of technology and the demand for highly accurate measurements, optical instruments and experiments have become very complex in recent years. In addition, sophisticated data analysis has become an important part of modern optical measurement devices. To ensure that a measurement principle is fit for its purpose, it is beneficial to first test it in a virtual environment prior to building the physical setup. That way, experimenters can save time and costs in the development of novel procedures. Furthermore, virtual experiments are often essential for the assessment of accuracies that can be reached.

For these reasons, virtual experiments have become an important tool in
optics. Examples of applications are non-null interferometer calibration

The Physikalisch-Technische Bundesanstalt (PTB) has developed the
SimOptDevice software library for optical virtual experiments. SimOptDevice
is a flexible library implemented in MATLAB^{®}

In this paper we will describe the structure of SimOptDevice and its underlying mathematical methods. We will address the key issues of optical virtual experiments and refer to the corresponding solutions implemented in SimOptDevice. The purpose of this paper is to describe the mathematical methods necessary for implementing a complex optical simulation environment, enabling readers to set up a software solution of their own.

The general structure of SimOptDevice and its basic principles are described
in Sect.

The SimOptDevice library can be used to perform virtual optical measurements with complex beam paths running through a series of optical elements. It considers nested scanning stages accounting for translations and rotations, and supports the use of various sensors such as cameras. SimOptDevice is based on the application of ray optics.

The basic principle of SimOptDevice is a system of hierarchical coordinate
systems, combined with ray tracing routines. Within each coordinate system,
optical elements can be placed. A related local coordinate system is assigned
to each considered optical element, along with a superordinate coordinate
system relative to which the local coordinate system is defined. In this way,
a tree structure of coordinate systems is built. Each local coordinate system
can undergo individual rotations and translations with respect to its
superordinate system. The coordinates of each element can be transformed into
any of the other employed coordinate systems. Those transformations are made
simple by using homogeneous coordinates which are introduced in
Sect.

The power of SimOptDevice lies in tracing rays and performing ray aiming
accurately and efficiently according to the laws of refraction and reflection
while being in control of all optimization parameters and the applied
algorithms. Using the library for our experiments, we view and verify all
intermediate results, which is very helpful for tuning the algorithms for
each specific problem. Whereas ray tracing follows a ray through the optical
system when start point and direction are given, ray aiming seeks the path
through the system for given start and end points. The latter is a highly
nonlinear optimization problem. Details are described in
Sect.

The accurate modelling of all elements of a measurement setup is another advantage of SimOptDevice. This includes not only optical elements like lenses, mirrors and sensors but also linear stages and rotary tables. Ensembles of elements can be saved and reused in other virtual experiments.

During development, the software has been successfully checked against ray tracing results obtained by ZEMAX. This included comparisons of optical path lengths and of points reached by ray tracing. The differences were in the sub-nanometre range.

One key feature of SimOptDevice is its easy way to transform coordinates from
any local system to any other coordinate system within the defined structure
(see Fig.

Example of the hierarchical structure of coordinate systems in
SimOptDevice.

With this coordinate definition, a translation or rotation is represented by
a

Ray propagation through the defined object is performed by sequential ray
tracing. For this tracing method the order of elements passed by a ray is
known in advance and optical paths are computed element by element.
SimOptDevice computes the ray paths locally in each optical element system.
At the boundary

transformation of

calculation of the ray's geometrical path length

determination of next intersection point

calculation of normal vector

calculation of the new ray direction

Schematics of a ray tracing step. Each topography

This is classical ray tracing with the particular feature that at each
boundary the intersection point and the new direction are calculated in the
new local coordinate system. Step 3 is calculated analytically for planes and
spherical surfaces and has to be calculated numerically for more complex
surfaces like Zernike surfaces, aspheres, or surfaces described by a Gauss function. If the ray passes

Given a start point ^{®}'s parallel nonlinear solver routines,
e.g.

Ray aiming principle: the start and end points

A requirement for successful ray aiming is that the destination
point

Examples from the tilted-wave interferometer (TWI) simulation.

The tilted-wave interferometer (TWI) is an interferometric measurement device
for form measurements of asphere ^{®} routine

In order to accomplish an accurate recovery of the specimen surface, it is
necessary to obtain an accurate model of the TWI

SimOptDevice has also been used for uncertainty evaluation

SimOptDevice is a versatile library for conducting virtual opto-mechanical experiments that has been applied successfully in several projects and studies. SimOptDevice can model a large number of optical elements and sensors which can be combined flexibly to cover a wide range of experimental setups.

We have explained the mathematical concepts within the library. A detailed description of our ray tracing and ray aiming procedures and of the determination of Jacobian matrices, needed for efficiently solving the nonlinear inverse problems, was given. This will be useful for readers interested in implementing virtual optical experiments. We also conclude that SimOptDevice can be used to simulate very complex opto-mechanical systems.

No data sets were used in this article.

The authors declare that they have no conflict of interest.

This article is part of the special issue “Sensors and Measurement Systems 2018”. It is a result of the “Sensoren und Messsysteme 2018, 19. ITG-/GMA-Fachtagung”, Nürnberg, Germany, from 26 June 2018 to 27 June 2018.

The authors sincerely thank the EMPIR organization. The EMPIR is jointly funded by the EMPIR participating countries within EURAMET and the European Union (15SIB01: FreeFORM). Edited by: Eric Starke Reviewed by: two anonymous referees