![]() |
||||||
|
| Script S2_2_6.m | |||
|
|||
|
%==============================================
%Thick lens %============================================== % %the refractive index of the lens n=1.993; %diameter of the lens in mm h=23; %focal length in mm f=11.077; %for b see pag.78 formula 2.4 A=n-1; B=A/n; b=2*A*f; %As a first approximation for array t is used t=1:0.1:h/2; %As a second approximation for array t is used t=5.9:0.01:6.1; %The better approximation fot the array the following row is used t=5.9:0.01:6.1; %the number of element in t maxt=length(t); %for variable used in the next loop see the problem for i=1:maxt t1=t(i); R1=(t1^2+h^2)/(4*t1); a=B*f*t1; p=[a b -1]; xc=roots(p); xr=xc'; xp=xr(1); % a positive root is requested if xr(2)>0 xp=xr(2); end R2=1/xp; R(i,:)=[R1 R2]; end %an array of maxt rows and 3 columns R %plot of R1 (formula 2.6) and R2 (formula 2.5) function of t plot(t,R(:,1),'ro-',t,R(:,2),'bd-'),grid on title('R1(red) and R2(blue) function of t') axis([5.9 6.1 23.2 23.9]) %============================================== % |
|||
| Top | |||