|
1.INTRODUCTIONNumerical recipes course is often in optical engineering curricula. It is necessary to be able to making numerical simulation for various physical processes, in particular in optics. Simple mathematical functions are usually using in exercises in such courses [1]. It gives to student good understanding of numerical recipes, their accuracy and others properties. However, we can see that it does not guarantee ability to use these recipes for practical calculations and connection between theory and its practical usage. In Applied and Computer Optics Department of ITMO University we use examples from optical image modeling and quality analysis as exercises. It makes studying of numerical recipes more useful from practical point of view, gives deeper understanding of optical processes and applications. Moreover we use interest to computer science for studying optics. There are several studying numerical recipes: 2.NUMERICAL DIFFERENTIATION RECIPENumerical differentiation is the simplest numerical recipe, but it has useful application in aberration theory. It is well known that the first derivation of wave aberration by pupil coordinate is a lateral aberration, and the second derivation is a longitudinal aberration [2]. Usually wave aberration is described with Zernike polynomials: where ρ, φ polar pupil coordinates, m - power of φ, n - power of ρ, cnm - coefficient (shows contribution of each aberration type), - radial polynomial. As exercise each student gets his own set of Zernike polynomials for differentiation, and calculates the first and the second derivative (in fact lateral and longitudinal aberrations) by forward and central difference methods. Also student evaluates accuracy of computation as difference between values calculated by numerical recipe and by analytical derivation. Thus in additions to methods of numerical differentiation students also study practical usage of Zernike polynomials and mathematical connection between wave, lateral, and longitudinal aberrations. Example of exercise:Calculate first and second derivation of wave aberration function W(ρx, ρy) by ρx and ρy in the interval ρ ∈ [−1;1] by forward and central difference methods in case only 3-order spherical aberration is presented: Draw plots of wave, lateral and longitudinal aberrations, calculated by numerical recipes and analytically. Draw plot of final accuracy form differentiation step. Solution of exercise: 3.NUMERICAL INTEGRATION RECIPEIn numerical integration part we study Gaussian method and Newton-Cotes method. For studying accuracy of these methods we use simple mathematical function (cos for example). Good example of using numerical integration in optics is calculation of encircled energy by point spread function: where - point spread function, - canonical coordinates on image. Example of exercise:
4.APPROXIMATION RECIPEIn approximation recipe we study least squares method. An optical example is approximation of index of refraction. If we know several indices of refraction for glass, we can calculate coefficients of Herzberger dispersion formula [3]: where , . It is enough to know the six values of refraction index for calculating of coefficients μ1, …, μ6 for one glass, but it could be more. A system of linear equations in matrix for m ≥ 6 refraction indexes is: where are known values of refraction index for wavelengths λi, m is number of known refraction indices, μ1, …, μ6 are coefficients of Herzberger dispersion formula. Using least squares method for the system of linear equations (4): Example of exercise: The known index of refraction values for optical glass F2 are ni = 1.662241, nF = 1.628440, ne = 1.620541, nC = 1.611600, nr = 1.608862, nt = 1.599483. Develop index of refraction calculation procedure for wavelength from 0.3 to 2 um. Calculate indexes of refraction for λh = 0.40466 um, λd = 0.58756 um, λspec = 0.64380 um. Check calculation in http://glassbank.ifmo.ru. Solution of exercise: Calculated index of refraction values: nλh = 1.6467860, nλd = 1.6165512, nλspec = 1.6123803. Reference index of refraction values [2]: nλh = 1.6468077, nλd = 1.6165511, nλspec = 1.6123800. Those, calculation accuracy is less than 10−5. 5.FAST FOURIER TRANSFORM RECIPEThe most interesting optical application of numerical recipe is Fourier transform [4]. For studying Fourier transform and its properties we use typical function (delta-function, rectangle, etc.). As simple optical example we use calculation of point spread function by given pupil function. There are variety of tasks with complicated area of pupil (central obscuration, synthetic aperture), pupil with non-uniform transmission or with given types of aberrations (specified with Zernike polynomials). Additionally we are considering normalization problem for PSF calculation: where f(ρx, ρy) - pupil function, H′ - normalization factor. Pupil function is: where τ(ρx,ρy) - transmission, W(ρx,ρy) - wave aberration, Ω0 - pupil area in canonical coordinates. Normalization factor is: Example of exercise: Solution of exercise: CONCLUSIONSAs we can see, it is a lot of interesting and useful examples in optics for using them in numerical recipes course. It makes studying of numerical recipes more useful from practical point of view. Also it gives deeper understanding of optical processes and applications. Our experience shows that it really works. After this course student use numerical recipes with confidence in other courses, in bachelor and master thesis, and later in profession. REFERENCESWilliam H. Press, Saul A. Teukolsky, William T. Vetterling, Brian P. Flannery, Numerical Recipes: The Art of Scientific Computing, 3rdCambridge University Press,2007). Google Scholar
Born M., Wolf E., Principles of Optics, Cambridge University Press,1999). https://doi.org/10.1017/CBO9781139644181 Google Scholar
Bach H., Neuroth N., The Properties of Optical Glass, Springer Science & Business Media,2012). Google Scholar
Goodman J.W., Introduction to Fourier Optics, McGraw-Hill,1996). Google Scholar
|