Class that models surfaces for optical calculations

Introduction

As with any kind of optical modeling and computation, optical calculations using truncated power series algebra (TPSA) require modeling of surfaces used for refraction, reflection, and drifts. With TPSA, surfaces are modeled using TPSA instances of the class TPSA to represent both surfaces directly, and their gradients with respect to transverse coordinates. The class Surf described in this note models surfaces in this manner.

A surface is most directly modeled as single TPSA object representing displacement of the surface as a function of transverse (x and y) coordinates. Two of these functions are used directly in the synthesis of maps through a drift spaces, where the surfaces delimiting the ends of the space are represented by these two functions.

In contrast to drift spaces, maps corresponding to refraction or reflection by a surface are computed from the gradients of the surface. While gradients are computed directly from the functions, when the functions are represented by TPSA objects, derivatives involve reduction of order. For this reason, to preserve order, specification of surfaces for calculating drifts, reflection, and refraction require that both the functions and their gradient be provided. So the most elementary method of specifying surfaces is to explicitly provide the function and its gradient to one of the constructors of the Surf class.

The Surf class also has a constructor for the most commonly (almost universally) used surfaces in optics – the conic sections. This constructor requires an argument giving the surface's radius of curvature, and optionally the conic constant whose default is zero (sphere), and higher-order coefficients representing departures from a conic. The function (with its gradient) returned has axial symmetry.

Surfaces in two dimensions (x and x') and four dimensions (x, y, x', and y') are returned depending on the number of variable in the underlying TPSA. If not two or four, an exception is thrown.

Applications can be built by including the source code of this class in the build, or by calling procedures in TPSA.dll

Usage

First the basics. This initializes TPSA.

TPSA(4, 3)	' initializes TPSA

Ordinarily optical calculations require the initialization of TPSAMaps, which automatically initializes TPSA.

TPSAMaps(4, 3)	' also initializes TPSA

The simplest way to construct functions in TPSA is through the transverse variables represented by TPSA objects. We create those this way:

dim x as tpsa = TPSA.one(1)	' transverse variable
dim y as tpsa = TPSA.one(2)	' transverse variable 
dim xp as tpsa = TPSA.one(3)	' slope variable
dim yp as tpsa = TPSA.one(4)	' slope variable

A parabolic surface is created like this:

dim R as double = 17
dim s1 as Surf = New Surf((x^2 + y^2)/(2*R), new TPSA() {x/R, y/R})

That is the first constructor.

The second constructor primarily for conic sections creates surfaces described by the formula

(r/R)^2/(1+sqrt(1-(1+cc)(r/R)^2))

for the conic part, where r is radius off the axis of the conic, R is the radius of curvature, and cc is the conic constant. The conic constant is zero for a sphere, -1 for a parabola, < -1 for a hyperbola, -1 < cc < 0 for a prolate spheroid, and > 0 for an oblate speheroid. Instances of the class are created using the syntax:

dim s as Surf = new Surf(R, cc, CVI, ...)

The parameters CVI, ... are coefficients of higher-order terms starting at sixth order. All parameters are optional except for roc. To be clear, the higher-order terms are added to the functional form of the conic; they do not replace the higher-order terms of that functional form.

An important point about this class is that it is targeted towards geometrical-optics calculations. As such, it assumes that the number of variables of the TPSA is even, and that the first half are transverse variables, while the second half are slope variables, which are otherwise irrelevant to this class. Furthermore, the maximum number of variables allowed by the constructor is four. So the class allows v to be either 2 or 4; any other and an ApplicationException exception is thrown.

Two instance properties of the Surf are the function itself and the one- or two-component gradient.

dim f as TPSA = s.fctn
dim grad() as TPSA = s.grad

The only other member function of this class is ToString, which returns a string represention of the instance.

s.ToString

A flat surface is returned by the shared function flat.

dim flat as Surf = Surf.flat

Other notes

References

  1. Conic section, Wikipedia (http://en.wikipedia.org/wiki/Conic_section).
  2. N. Towne, Implementation of truncated power series algebra under the Microsoft .NET framework, (TPSA.html).
  3. .NET framework, Wikipedia (http://en.wikipedia.org/wiki/Dot_net_framework).
  4. Martin Berz, AIP Conf. Proc. -- March 10, 1992 -- Volume 249, pp. 456-489, The Physics of Particle Accelerators Vol. I (based on the US Particle Accelerator School (USPAS) Seminars and Courses); doi:10.1063/1.41975.

Nathan Towne
12/2011