|
653. DIFSA: A Program to Simulate a Set of Experimental
Diffraction Efficiencies
by Michael B. Sponsler, Department of Chemistry,
Syracuse University, Syracuse, New York 13244
DIFSA is a FORTRAN program that simulates a set of
experimental diffraction efficiencies, providing the
best refractive index profile that would produce most
nearly the experimental data. The program is intended
for optically thin (Raman-Nath), unslanted gratings.
Optimization of the refractive index profile, expressed
as a Fourier series, is achieved through simulated
annealing.
The diffraction calculation algorithm was taken from
the literature (R. Magnusson and T. K. Gaylord, Opt.
Commun., 25, 129-132 (1978)). This calculation is done
in the subroutine FCN. The rest of the program was
adapted from SIMANN. The original comments from SIMANN
have been retained or slightly modified where
appropriate and are marked with a single "c" or "C".
All new comments are marked with "CC".
All input to the program is contained in the file,
dif.inp. The input format can be determined from the
READ and FORMAT statements in the main program,
following this comment block. The current limit of 16
on the number of diffraction orders may be changed in
the PARAMETER statements in FCN, SA, and the main
program. The limit of 8 on the number of Fourier terms
may not be changed without additional lines of code in
FCN.
Usage Notes: DIFSA has been run on several platforms:
PCs (486) and mainframe (VMS and UNIX). The execution
time depends on the number of Fourier terms (N), the
number of diffraction orders (NORD), and on a number of
optimization variables. Further, larger coefficient
values (X) lead to quite significant increases in
computation time due to the larger number of terms that
must be evaluated in FCN. Therefore, even if all other
aspects are equal, two different data sets may differ
markedly in required CPU time. With this caveat,
however, here is a benchmark: an optimization with N =
6, NORD = 9, NS = 20, NT = 5, T = 0.4, RT = 0.5, and
EPS = 1.0E-3 took 294 seconds of CPU time on a UNIX
mainframe. The program was compiled with optimization
for run-time speed, cutting the CPU time about in half.
A Word of Caution: Although simulated annealing is one
of the best ways to achieve global minimization, the
results are still function dependent. The simulation
"function" in FCN takes enough computation time that
one must often cut down the optimization variables
(primarily NS and NT) from their recommended values.
This decreases the probability that the global minimum
will be found. Therefore, multiple runs are suggested,
varying either the random number seeds or the starting
coefficients, in order to see whether multiple
solutions will be found. Remember that the true
solution is not necessarily the global minimum (or even
a local minimum), since there is error in the
experimental values. Multiple solutions are
encountered more frequently when more Fourier terms are
used, so it is recommended that the minimum number of
terms required to achieve a good fit be used.
Lines of Code: 1191
FORTRAN 77 (RS/6000)
|