You are on page 1of 3

Rui, GUO Kelen.guo@gmail.


How to Use the Program in ASAP
1. Main Function
Pyramid is the main function, which will call the other functions, for example MACROS.

2. Input
The geometry parameters are defined in MACROS function, in which you can change the size of the object, the position and the number of light, and the position of the rectangle. "COATINGS PROPERTIES
1.00000 0 0.000000 0 'REFLECT' 'ABSORB'"

Define the property of the surfaces. "UNITS MILLIMETER

Define the basic physical parameters. "CURVES
LINE 10.00000 -10.00000 LINE 10.00000 10.00000 17.32051 LINE 0.000000 0.000000 0.000000 COMPOSITE GAP -1 -1 OBJECT =1 INTERFACE COATING "REFLECT" SCATTER MODEL 1 TOWARDS EDGE 1 5" 0. 10.00000 0.000000 17.32051 10.00000 0.000000 10.00000 0. 0.000000 -10.00000

It shows part of the geometry information. These sentences will be automatically generated when you import the object, which can be built in Solidworks or other compatible applications.

This sentence needs to be added every time after the description of the curve. It means five rays will be created from every light point.
"EMITTING DISK -X 60 0 0 500 15 15 ROTATE Z -25 SHIFT Z 5 SHIFT Y -30"

A point of light is in its original position ‘X -60’, with 500 rays; the angle is 15 in two directions. First rotate round z, then shift it along z for 5 units then shift it along y for -30 units
"RECTANGLE Z 0 0.001 0.001"

Define the size of one pixel.

4. loop and "$DO 1 100" "SHIFT X (XVALUE) SHIFT Y (YVALUE)" Define the distance the pixel moved "1 100" It means that the loop will be done for 100 times. GUO Kelen.txt These two documents will be automatically created in your folder. And finally we will get a CCD of size 100*100. The information of amplitude and phase angle is in file RAYDATA_kom.txt Attention: Every time when you want to regenerate the two files. Output data 3. make sure the old files are deleted.guo@gmail.txt And the intensity of the ray is in file RAYDATA_int.txt RAYDATA_int.Rui. otherwise the data will accumulate and lead to wrong results! .

txt'). 2.100) the numbers above should be correct according to the settings of CCD. then here will be 10.100. RAYDATA_int=load('U:\privat\ASAP\RAYDATA_int. Purpose The MATLAB-program is used to reorganise the data from ASAP and finally get a graphic based on physical optics theory.Rui. when in ASAP the size is 100*100. Data RAYDATA_kom=load('U:\privat\ASAP\RAYDATA_kom. GUO Kelen.guo@gmail.txt').com How To Use The Program In MATLAB 1. the path is changeable. 3. For example. . c=mat2cell(RAYDATA_kom. Input the data from related file.100. [2 1]) the number 100 is changeable according to the size of CCD. Result Run the program and finally you will get a picture of CCD and the other information about the data.000 matrix_int=reshape(a. 10000.100) matrix_kom=reshape(reform_kom.