![]() |
||||||
|
| Script S2_2_20A.m | |||
|
|||
|
%==============================================
%Focal length of a thick lensA - calculus of d2 %Function fH_Hp must be used %============================================== % %============================================== %============================================== %CORRIGENDA %In formula following (2.9) pag 101 %change G(2) with C(2) %============================================== %============================================== % %radii of the spherical surfaces of the lens, in mm R1=20; R2=-35; %refractive indexes in the air and of the lens n1=1; n2=1.993; %thickness of the lens, in mm t=5.6; %standard calculus of focal lenght nm1=n2-n1; IR1=1/R1; IR2=1/R2; ratio=nm1/n2; R1R2=R1*R2; add=ratio*t/R1R2; %power and focal length of the lens p=nm1*(IR1-IR2+add); fL=1/p % %calculus of distance d2 (see Fig. 2.61 and Fig. 2.62)) y1=1 teta1=0; D1=fH_Hp(n1,n2,R1,R2,y1,teta1,t); %the function returns the array %D1=[y2,teta2,teta3]; y2=D1(1) teta2g=D1(2)*180/pi teta3=D1(3); teta3g=teta3*180/pi d2=y2/tan(teta3) %============================================== % |
|||
| Top | |||
| Script S2_2_20B.m | |||
|
|||
|
%==============================================
%Focal length of a thick lensB - calculus of d1 %the function fH_Hp must be used %============================================== % %radii of the spherical surfaces of the lens, in mm R1=20; R2=-35; %refractive indexes in the air and of the lens n1=1; n2=1.993; %we use the value of the focal length, in mm, determined %in the previous script fL=13.5 %using y1=1; %we need a value of d1 that allows the calculus of teta1 %see figure on the right in Fig.2.62 %an array of values of d is defined %the requested value of d would be less than fL d=11.2:0.05:13.5; %the number of elements of the array d maxd=length(d); for i=1:maxd d1=d(i); teta1=-atan(y1/d1); D2=fH_Hp(n1,n2,R1,R2,y1,teta1,t); %the function returns the array %D2=[y2,teta2,teta3]; y2=D2(1); teta1g=teta1*180/pi; teta2g=D2(2)*180/pi; teta3g=D2(3)*180/pi; F(i,:)=[d1,y2,teta1g,teta2g,teta3g]; end F; plot(F(:,1),F(:,5),'ro-'),grid on title('we want the value of d1(abscissa) for which teta3g (ordinate) is zero') axis([11.5,13.5,-0.4,0.4]) %============================================== % |
|||
| Top | |||
| Function fH_Hp.m | |||
|
|||
|
%==============================================
%function fH_Hp %is necessary to run the two scripts %Focal length of a thick lensA %Focal length of a thick lensB %============================================== % function f=f1H_Hp(n1,n2,R1,R2,y1,teta1,t) %teta2 is determined (see formula (2.7)) minu1=n1/n2; a21=(1-minu1)*(1/R1); a22=minu1; a1=[1 0;a21 a22]; a2=[y1;teta1]; A=a1*a2; teta2=A(2); %y2 is determined (see formula (2.8)) b1=[1 -t;0 1]; b2=[y1;teta2]; B=b1*b2; y2=B(1); %teta3 is determined (see formula (2.9)) minu2=n2/n1; c21=(1-minu2)*(1/R2); c22=minu2; c1=[1 0;c21 c22]; c2=[y2;teta2]; C=c1*c2; C1=c1*b1*a1*a2; teta3=C1(2); % %a simpler mode to have teta3 %put only %teta3=C(2); %omitting %C1=c1*b1*a1*a2; % ris=[y2,teta2,teta3]; f=ris; %============================================== % |
|||
| Top | |||