Optik Optik: Optics
Optik Optik: Optics
Optik
Optik 116 (2005) 270–276
Optics
www.elsevier.de/ijleo
Abstract
The various non-linear transformations incurred by the rays in an optical system can be modelled by matrix
products up to any desired order of approximation. Mathematica software has been used to find the appropriate
matrix coefficients for the straight path transformation and for the transformations induced by conical surfaces, both
direction change and position offset. The same software package was programmed to model optical systems in seventh
order. A Petzval lens was used to exemplify the modelling power of the program.
r 2005 Elsevier GmbH. All rights reserved.
0030-4026/$ - see front matter r 2005 Elsevier GmbH. All rights reserved.
doi:10.1016/j.ijleo.2005.01.021
ARTICLE IN PRESS
J.B. Almeida / Optik 116 (2005) 270–276 271
The first package is distributed standard with Mathema- scanned in order to find the appropriate one. We can
tica and is useful for performing vector operations. The write the exact solution with two commands:
second one is a proprietary package which performs series
sd ¼ Simplify[s1 /. Snell[[3]]],
expansion in different way. The standard series expansion
td ¼ Simplify[t1 /. Snell[[3]]],
for multi-variable functions sets the limit for each
variable’s exponent independently but not for the order which will output very long expressions very impractical
of the monomials. The expansion package sets a limit for for use.
the monomials’ order, so that each variable’s exponent is
adjusted accordingly; for details see Appendix B.
2.3.1. Series expansion
The solutions of Eq. (1) must be expanded in
2.2. Surface definition series to the desired order of approximation for which
we use a function from the expansion package. Deal-
The method is applicable to any surface which can be ing with axis-symmetric systems it is useful to
defined by an equation of the type f ðx; y; zÞ ¼ 0: For resort to complex coordinates; the two solutions
instance, a conic of revolution could be defined as are thus combined into one single complex solution,
surface[x_, y_, z_] ¼ Sqrt[xˆ 2 + yˆ 2 + zˆ 2] then expanded to the fifth order and sim-
+ e*z - r. plified:
sexpand ¼ Expansion[sd + I*td, s, t, Xx,
We are going to need the normal to the surface at any Yy, 5],
point; this can be found applying gradient to the surface sexpand ¼
expression Simplify[PowerExpand[sexpand]].
n ¼ Grad[surface[Xx, Yy, Zz],
Cartesian[Xx,Yy,Zz]]. The result of the Expansion function is a list of
coefficients, most of them zero. The expansion package
provides a function VectorBase which outputs a list
2.3. Snell’s law of all the monomials that can be built with the given list
of variables up to the desired order. This can be left-
Snell’s law is usually written as scalar relationship multiplied by the coefficient list in order to get a
between sines of the angles the rays form with the polynomial:
normal on both sides of the surface, but it can also be
expressed as a vector relationship using cross products sexpand ¼ sexpand . VectorBase[s, t, x, y,
[2]. Let us define to unit vectors representing the ray 5].
directions on the two sides of the surface:
v ¼ {s, t, Sqrt[1 - sˆ 2 - tˆ 2]},
v1 ¼ {s1, t1, Sqrt[1-s1ˆ 2-t1ˆ 2]}. 2.3.2. Complex coordinates
Although combined into one single complex coordi-
v and v1 represent the unit vectors, s, t, s1 and t1 are nate in sexpand, the output ray direction cosines
direction cosines. are still expressed in terms of real input ray position and
Snell’s law requires that the cross-product of the ray direction coordinates; this must be corrected by an
direction with the surface normal, multiplied by the appropriate coordinate change, followed by suitable
refractive index be equal on both sides manipulation and simplification:
u v n ¼ v1 n, (1) Apply[Plus,Simplify[MonomialList
where u represents the refractive index ratio of the two [ComplexExpand[sexpand /.
media. We ask Mathematica to find the solutions of Eq. {x -4 (X + Conjugate[X])/2,
(1) for the surface in question y -4 (X - Conjugate[X])/(2*I),
s -4 (S + Conjugate[S])/2,
Snell ¼ Solve½fu CrossProduct½v; n t -4 (S - Conjugate[S])/(2*I)}, {X,S},
¼ CrossProduct½v1; n; surface½Xx; Yy; Zz ¼¼ 0g, TargetFunctions-4Conjugate],
{X, Conjugate[X], S, Conjugate[S]},
fs1; t1; Zzg.
CoefficientDomain-
4RationalFunctions]]].
Eq. (1) has four solutions, corresponding to positive
and negative angles, in the forward and the reverse Mathematica will output an expression for the above
directions. The solutions found by Mathematica must be command, which is reproduced bellow in a slightly
ARTICLE IN PRESS
272 J.B. Almeida / Optik 116 (2005) 270–276
xexpand
¼ Simplify[PowerExpand[Expansion[x mations induced by a single element in air and a straight
+s*e/Sqrt[1 - sˆ 2 - tˆ 2] path; they are multiplied successively, in reverse order
+I*(y + t*e/Sqrt[1 - sˆ 2 - tˆ 2]), s, relative to the transformations, in order to model the
t, x, lens:
y, 5]]];
Table[lens[i]
xexpand ¼ xexpand . VectorBase[s, t, x, y,
¼ Lens[f4[[i]],-18.44,-40.23,3] .
5],
Distance[35].
Apart[xexpand /.
Lens[bk7[[i]],41.42,103.08,8] .
{x -4 (X + Conjugate[X])/2,
Distance[25].
y -4 (X - Conjugate[X])/(2*I),
Lens[bk7[[i]],-72.05,-92.6,7] .
s -4 (S + Conjugate[S])/2,
Distance[4].
t -4 (S - Conjugate[S])/(2*I)}, r].
Lens[bk7[[i]],53.12,-799.9,10] .
The final output is Distance[60],{i,1,3}].
1
8 ð8eS þ 8X þ 4eS 2 ConjugateðSÞ þ 3eS 3 ConjugateðSÞ2 Þ The last factor, Distance[60], corresponds to the
distance from the aperture stop to the first surface. The
Table[] function is used to generate models for all
3. Simulation of a Petzval lens three wavelengths.
Table[simage[i] ¼ ComplexExpand avoids the need to re-calculate over and over. This
[Im[imagex[i]/. x-4I x]],{i,1,3}]. package is fast and allows the simulation of very
complex optical systems; one such example was demon-
3.4. Ray analysis strated in the form of a Petzval lens.
Work is now going on to extract more possibilities from
Finally, we perform some ray analysis by plotting ray the software, namely for plotting wavefronts and ray-
intercept curves for two different values of the field densities, and will be the object of other publications.
given by the variable s; the results are shown in Fig. 2:
Table[timage0 ¼ timage[1] /. x -4 0, Appendix A. The ‘‘Sphericl’’ package
Plot[{timage[1] - timage0, timage[2] -
timage0, This package provides all the functions needed for the
timage[3] - timage0}, {x, -23, 23}, implementation of seventh-order matrix models of optical
PlotRange -4 {Automatic, {-0.5, 0.5}}, systems. Some auxiliary functions are also defined in order
PlotStyle -4 {{Thickness[0.01]}, to facilitate other optical system calculations. This
{Thickness[0.01], appendix describes in detail the fundamental functions
Dashing[{0.04}]}, {Thickness[0.01], and gives only short mentions of the others.
Dashing[{0.04, 0.04, 0.003, 0.04}]}}, The package makes use of the axis symmetry to
AxesStyle -4 Thickness[0.005], reduce matrix size to 40
40; so all the coordinates are
AxesLabel -4 {"mm", "mm"}], {s, 0, 0.09, assumed to be complex. One ray, at any specific position
0.087155}]. is characterized by one complex position coordinate and
on complex direction cosine coordinate.
sˆ 2*xˆ 2*Conjugate[s]ˆ 2*Conjugate[x], second line contains the expansion coefficients for
sˆ 2*xˆ 2*Conjugate[s]ˆ 3, Snell’s law according to paragraph 2.3:
sˆ 3*x*Conjugate[x]ˆ 3,
refraction[n1_, n2_, r_] : ¼
sˆ 3*x*Conjugate[s]*Conjugate[x]ˆ 2,
Module[{matrix,u},
sˆ 3*x*Conjugate[s]ˆ 2*Conjugate[x],
matrix ¼ IdentityMatrix[40];
sˆ 3*x*Conjugate[s]ˆ 3,
u ¼ n1/n2;
sˆ 4*Conjugate[x]ˆ 3,
matrix[[2]]
sˆ 4*Conjugate[s]*Conjugate[x]ˆ 2,
¼ {(u-1)/r,u,(uˆ 2-u)/(2 rˆ 3),(uˆ 2-u)/(2
sˆ 4*Conjugate[s]ˆ 2*Conjugate[x],
rˆ 2),(uˆ 2-u)/(2
sˆ 4*Conjugate[s]ˆ 3},
rˆ 2),(uˆ 2-u)/(2 r),0,0, (uˆ 4-u)/(8
ray].
rˆ 5),(uˆ 4-uˆ 2)/(4
rˆ 4),(uˆ 4-uˆ 2)/(8 rˆ 3),(uˆ 4-uˆ 2)/(4
rˆ 4),u(2uˆ 3-3 u + 1)/(4 rˆ 3),
A.2. Otherlines
(uˆ 4 - uˆ 2)/(4 rˆ 2),(uˆ 4-uˆ 2)/(8 rˆ 3),(uˆ 4-
uˆ 2)/(4 rˆ 2),(uˆ 4-u)/(8
All the transformation matrices have a common
r),0,0,0, (uˆ 6-u)/(16 rˆ 7),uˆ 2 (3uˆ 4 - 2uˆ 2
structure characterized by two lines of series expansion
- 1)/(16 rˆ 6),3
coefficients followed by 38 lines of elements derived
uˆ 4(uˆ 2-1)/(16 rˆ 5),(uˆ 6-uˆ 4)/(16 rˆ 4),
from the former by algebraic operations. The other-
uˆ 2(3 uˆ 4-2 uˆ 2-1)/(16
lines[] function is an internal function which accepts
rˆ 6),u(9uˆ 5-10uˆ 3 + 1)/(16 rˆ 5),uˆ 2(9 uˆ 4-
as input any 40
40 matrix and outputs another matrix
11 uˆ 2 + 2)/(16 rˆ 4), 3
with the same first two lines and lines 3–40 built
uˆ 4(uˆ 2-1)/(16 rˆ 3),3 uˆ 4(uˆ 2-1)/(16
according to the common rules.
rˆ 5),uˆ 2(9 uˆ 4-11 uˆ 2+2)/(16
It is impossible to list all the implementation lines for
rˆ 4), u(9 uˆ 5-10 uˆ 3+1)/(16 rˆ 3),uˆ 2(3 uˆ 4-
this function, for reasons of size; we will then resort to
2 uˆ 2-1)/(16
an explanation of the procedures for determining the
rˆ 2),uˆ 4(uˆ 2-1)/(16 rˆ 4),3 uˆ 4(uˆ 2-1)/(16
coefficients for one of the 38 lines.
rˆ 3), uˆ 2(3 uˆ 4-2
Suppose we want to find the coefficients for a line which
uˆ 2-1)/(16 rˆ 2),u(uˆ 5-1)/(16 r),0,0,0,0},
corresponds to the monomial X j Conjugate ½X k S l
otherlines[matrix]].
Conjugate½Sm : We start by defining a square matrix t of
dimension 40, with known elements on the first two rows:
t ¼ IdentityMatrix[40], A.4. Screen
t[[1]] ¼ Table[a[i],{i,1,40}],
t[[2]] ¼ Table[b[i],{i,1,40}]. This is an external function which is used internally
to determine the surface offset and externally to deal
The matrix is right-multiplied by the vector base of with spherical image surfaces. The structure is similar to
coordinate monomials and the first two elements of the the previous one but now its the first line which is
product are isolated: defined
X1 ¼ (t . Terms[{X, S}])[[1]], Screen[r_] :¼ Module[{matrix},
S1 ¼ (t . Terms[{X, S}])[[2]]. matrix ¼ IdentityMatrix[40];
The procedure then involves determining the product matrix[[1]] ¼ {1,0,0,0,1/
(2r),0,0,0,0,0,0,
X1ˆ j Conjugate[X1]ˆ k S1ˆ l Conjugate[S1]ˆ m 1/(8 rˆ 3),0,0,0,1/(4
and selecting just the terms up to the seventh order. The r),0,0,0,0,0,0,0,0,1/(16
same procedure must be repeated for all the 38 lines. rˆ 5),0,0,0,0,1/(16 rˆ 3),0,0,0,0,3/(16
These are lengthy calculations which must be performed r),0,0,0,0,0},
only once. The function otherlines[] incorporates the otherlines[matrix]].
results of those calculations and is fast to operate.
A.5. Back
A.3. Refraction
This is an internal function used to determine the
reverse offset.
This is an internal function which receives as input the
refractive indices of the two media and the curvature back[r_] :¼ Module[{matrix},
radius and outputs a transformation matrix whose matrix ¼ IdentityMatrix[40],
ARTICLE IN PRESS
276 J.B. Almeida / Optik 116 (2005) 270–276