From bc5f1eea9b5718c3e32d4cc0ea8b384983be6d93 Mon Sep 17 00:00:00 2001 From: Eugeniy Mikhailov Date: Wed, 17 Oct 2012 22:30:58 -0400 Subject: split coupling function and its demo to separate scripts --- prism_disk_coupling.m | 152 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 152 insertions(+) create mode 100644 prism_disk_coupling.m (limited to 'prism_disk_coupling.m') diff --git a/prism_disk_coupling.m b/prism_disk_coupling.m new file mode 100644 index 0000000..40e0980 --- /dev/null +++ b/prism_disk_coupling.m @@ -0,0 +1,152 @@ +function prism_disk_coupling(prism_angle_in_degrees, n_disk, n_prism, coupling_description) +%% Calculates incident angle for proper coupling into the disc via prism +% prism_angle_in_degrees - angle of the prism faces in degrees +% coupling_description - short annotation of the situation +% for example: +% coupling_description='Rutile prism, MgF_{2} disk, p-polarization'; + +prism_angle = prism_angle_in_degrees*pi/180; + +%% critical angle for beam from prism to disk +% recall n_d*sin(theta_disk)=n_prism*sin(theta_prism) where angles are counted from normal to the face +% and we want theta_disk to be 90 degrees for the total internal reflection +theta_prism=asin(n_disk/n_prism); +% convert to degrees +theta_prism_in_degrees=theta_prism*180/pi + +%% now lets see what angle it does with other face of the prism +theta_prism_2=(prism_angle - theta_prism); +theta_prism_in_degrees_2=theta_prism_2*180/pi + +%% now we calculate refracted angle out of the prism into the air with respect to the normal +% positive means above the normal +asin_arg=n_prism*sin(theta_prism_2); +if (abs(asin_arg)>1) error('quiting: at the right prism face we experienced total internal reflection'); end +theta_air=asin(asin_arg); +% convert to degrees +theta_air_in_degrees=theta_air*180/pi + +%% angle in the air relative to horizon +theta_air_rlh=(theta_air+prism_angle); +theta_air_rlh_in_degrees=theta_air_rlh*180/pi + +%% Lets make a picture +% 1st face of the prism lays at y=0 and spans from x=-1 to x=1 +x_face_1=linspace(-1,1); +y_face_1=0*x_face_1; +% 2nd face to the right of origin and at angle prism_angle with respect to negative x direction +x_face_2=linspace(1,0); +y_face_2=(1-x_face_2)*tan(prism_angle); +% 3rd face to the left of origin and at angle prism_angle with respect to negative x direction +x_face_3=linspace(-1,0); +y_face_3=(x_face_3+1)*tan(prism_angle); + +%% draw prism +figure(1); hold off; +plot(x_face_1, y_face_1, 'k-', x_face_2, y_face_2, 'k-', x_face_3, y_face_3, 'k-'); +hold on + +%% disk center will be located in point (0,-R); +R=.25; +dc_x=0; dc_y=-R; +x_disk=dc_x+R*cos(linspace(0,2*pi)); +y_disk=dc_y+R*sin(linspace(0,2*pi)); +plot(x_disk,y_disk,'k-') + + +%% beam trace inside the prism +% crossing of the beam with 1st (right) face of the prism +% we are solving cot(theta_prism)*x=tan(prism_angle)*(1-x) +x_cross_1=tan(prism_angle)/(tan(prism_angle)+cot(theta_prism)); +y_cross_1=x_cross_1*cot(theta_prism); +x_beam_prism_1=linspace(0,x_cross_1); +y_beam_prism_1=x_beam_prism_1*cot(theta_prism); +plot(x_beam_prism_1, y_beam_prism_1, 'r-'); + +%% beam out of prism +x_out_strt=x_cross_1; +y_out_strt=x_cross_1*cot(theta_prism); + +if (abs(theta_air_rlh)