Needs["Rayica`Rayica`"]

+++++++++++++++++++++++++

Optimization of Aspheric Components

Rayica can be used to optimize nearly every optical set-up. Such optimization can involve aspheric components. Rayica has built-in functions for modelling both aspheric and toriodal lenses and mirrors. In this example, we will examine how to use Rayica for optimizing the design of an aspheric lens. The AsphericLens function is used to model aspheric lenses in Rayica. You can get an overview of the use of AsphericLens with the ?AsphericLens:

In[46]:=

?AsphericLens

In order to get started, we can use the DataToRayica[AsphericLens] in order to pull a typical aspheric lens system from Rayica's built-in database of catalog elements.

In[52]:=

DataToRayica[AsphericLens]

Out[52]=

Below is a plot of the reported system. Note that there is a second window present present in addition to the aspheric lens. This element models the effects of an optical window used with many laser diodes. For our further work, however, this element will be omitted.

In[54]:=

ShowSystem[%];

We can now use the generated aspheric lens as a started condition for our optimization. First we assign symbolic values to accompany each numeric parameter in the previously generated aspheric lens. These symbolic parameters are used in the optimization procedure. We do not assign symboic values to the lens aperture parameters since these are not relavent to the optimization procedure.

In[55]:=

alens = AsphericLens[{{curva,0.9},{ka,-0.696917},{ca1,0},{ca2,0},{ca3,-0.0869628},{ca4,-0.0133304},{ca5,-0.153352},1.3},

{{curvb,-0.9},{kb,-6.99529},{cb1,0},{cb2,0},{cb3,-0.171893},{cb4,-0.0409008}, {cb5,0.0885435}, 1.13},2.4, 1.03,{ComponentMedium→CO550}]

Out[55]=

Each aspheric lens surface is internally represented by an equation which you can examine from the SymbolicSurfaceFunction of the lens as follows.

In[59]:=

SymbolicSurfaceFunction/.(Surfaces/.alens)[[{1,4}]]

Out[59]=

For the default settings of the lens, each symbolic parameter is assigned a numeric value for the purposes of making a numeric trace of the system. These assignments are stored in SymbolicValues.

In[60]:=

?SymbolicValues

Here are the SymbolicValues for alens.

SymbolicValues/.(Surfaces/.alens)

We will now place a light source in front of this lens and trace rays to a screen surface placed a fixed distance from the lens.

plot = TurboPlot[{WedgeOfRays[20,NumberOfRays->11],Move[alens,2.5],Move[Screen[2.5],5]},PlotType->TopView];

Here we can see that the rays are not focusing to the smallest possible point on the screen. Using FindSpotSize, we can measure the spot size on the screen.

SpotSize/.FindSpotSize[plot]

Finally we can use OptimizeSystem to determine values for the aspheric lens parameters that generate a better focus.

?OptimizeSystem

sol = OptimizeSystem[{WedgeOfRays[20,NumberOfRays->11],Move[alens,2.5],Move[Screen[2.5],5]}]

After 1720 iterations, OptimizeSystem has found better values the aspheric lens coefficients to minimize the spot size of the trace, as revealed by TurboPlot and FindSpotSize below.

bestplot = TurboPlot[plot,PlotType->TopView,sol];

SpotSize/.FindSpotSize[bestplot]

Created by Mathematica (September 2, 2005)