当前位置:
文档之家› 基于matlab的光学实验仿真
基于matlab的光学实验仿真
Abstract—In the college physics course, a Matlab method to simulate the physical phenomena was introduced. Utilizing the method, students can do experiments by the computer, in a short time. Results show that it is quite helpful for students to understand the basic concepts, develop low-level algorithms and resolve high-level problems. An example of simulating optical phenomena in in-class teaching and research was presented; the experiment result and the result of simulation with Matlab were compared. Keywords-Simulation; optical phenomena; Interference; Fast Fourier Transform(FFT); Fraunhofer Diffraction
2009 First International Workshop on Education Technology and Computer Science
Simulation of Optical Phenomena with Matlab
Yuhong Zhang
College of Science Tianjin University of Commerce Tianjin, 300134, P.R. China e-mail: lxyzhyh@
978-0-7695-3557-9/092009.539
72
r=(x.^2+y.^2); Distrib=[2*GasWid+2*(Radius-sqrt(Radius^2r))*1e9]/LofWave; In=abs(cos(Distrib*pi*2)); % the strength of the light green=abs(LofWave-500)/200; % red red=1-green; % green blue=abs(LofWave-540)/240; %blue ImgStr(:,:,1)=In*red; % array of the light ImgStr(:,:,2)=In*green; ImgStr(:,:,3)=In*blue; Pc=imshow(ImgStr,[]); Fig. 2-2 Interference pattern of Newton’s ring Simulation with Matlab Matlab supports procedural programming and has many object-oriented programming capabilities[5]. A basic data structure in Matlab system is the array. Matlab has many functions for processing arrays that are useful. Multidimensional arrays are supported. A 1-D array maybe referred to as a vector. A 2-D array is referred to as a matrix. The system has another data structure called cell arrays where the elements are cells. A cell can hold other arrays of any size and type. It is a flexible and useful data structure. The terms array and matrix are sometimes used interchangeably. There are built-in functions for performing standard matrix operations as described in linear algebra topics. The data of an image can be stored in an array or matrix in this notation; in the simulation of Newton’s ring, we store the data of interference pattern in a matrix: one column store the x place, one column for y place, and another column for the color information[6]. The matrix operations are often the most efficient ways to implement algorithms since they have been optimized. C. Simulation code and result In the simulation of our program, we set parameter of light and the setup: wave length, the length of air gap between the circular optical surface and the plate optical surface. A plane convex lens touches a plane parallel plate and an air gap of width H is formed between the lens and the plate. We call the radius of curvature of the spherical surface R and the radius of the rings of the pattern r. We divide the simulation space, with x and y, then calculate the light strength of interference point. The color information of these points on the pattern plate is stored in the array, use the Matlab image function to show the array with a pattern, see the Fig. 2-3. Table 2-1 The source code of the Newton’s ring close all; figure('Position',[90 164 873 483]); LofWave=589.3; %wave length Radius=5.1; %radius of the lens GasWid=5; % length of the air gap a1=axes('Position',[0.4,0.16,0.4,0.7]); [x,y]=meshgrid(linspace(-0.005,0.005,200)); B.
with Matlab and shows the simulation pattern of Newton’s ring interference. Implementing the Fourier transform with Matlab is given first in section 3, through Fast Fourier Transform (FFT) function of Matlab, we design program to simulate the phenomena of Fraunhofer diffraction. II. SIMULATION OF THE NEWTON’S RING Wherever Times is specified, Times Roman or Times New Roman may be used. If neither is available on your word processor, please use the font closest in appearance to Times. Avoid using bit-mapped fonts if possible. True-Type 1 or Open Type fonts are preferred. Please embed symbol fonts, as well, for math, etc. A. Interference by amplitude division A circular interference pattern may be observed if a spherical surface is placed on a flat surface[4]. The ring pattern is called “Newton’s rings” and this can be used to determine the radius of curvature of the spherical surface. An experimental setup is shown in Fig. 2-1.
Microscope
Extended light source
Optical surface