COLLINS1 Collins Chart example with Relay Lenses

           by Chuck DiMarzio
              Northeastern University
              November 2008
!! This file may be copied, used, or modified for educational and
!! research purposes provided that this header information is not
!! removed or altered, and provided that the book is cited in
!! publications, as DiMarzio, Charles A., Optics for Engineers,
!! CRC Press, Boca Raton, FL, 2011.
!! http://www.crcpress.com
!! Other distribution is prohibited without permission.

Contents

Start

f1=2;b0=1.5;
               % Lens parameters above; f1 is focal length, b0 is Rayleigh
               % range for initial waist.
q0=1i*b0;
qlist=[q0];                 % keep a list of start stop points
qtrack=[q0];                % start the track at the waist
q1=qtrack(end)+f1;qtrack=[qtrack,q1];  % Move f1 and add to track
qlist=[qlist,q1];
q1p=1/(1/qtrack(end)-1/f1); % Go through lens
qlist=[qlist,q1p];
                            % Generate arc track on bprime=constant
rad=1/(-imag(1/q1p))/2;     %  Center and radius are  bprime/2
a1=angle(qtrack(end)-1i*rad);%  starting angle for arc
a2=angle(q1p-1i*rad);        %  ending angle
astep=0.01*sign(f1);
if(f1>0 & a2 < a1);a2=a2+2*pi;end;
if(f1<0 & a2 > a1);a2=a2-2*pi;end;
a=(a1:astep:a2);
curv=(1i+exp(1i*a))*rad;      % Generate the curve
qtrack=[qtrack,curv];       % Add it to the track

q2=qtrack(end)+f1;qtrack=[qtrack,q2];  % Move f1 and add to track
qlist=[qlist,q2];

zlist=real(qlist);blist=imag(qlist);
rholist=1./real(1./qlist);bplist=-1./imag(1./qlist);
disp('      z,       b,        rho,        bprime');
disp([zlist',blist',rholist',bplist']);

qtrack1=qtrack;
qlist1=qlist;

qtrack=[qtrack(end)];
qlist=[qlist(end)];

%  Going through the second lens
q1=qtrack(end)+f1;qtrack=[qtrack,q1];  % Move f1 and add to track
qlist=[qlist,q1];
q1p=1/(1/qtrack(end)-1/f1); % Go through lens
qlist=[qlist,q1p];
                            % Generate arc track on bprime=constant
rad=1/(-imag(1/q1p))/2;     %  Center and radius are  bprime/2
a1=angle(qtrack(end)-1i*rad);%  starting angle for arc
a2=angle(q1p-1i*rad);        %  ending angle
astep=0.01*sign(f1);
if(f1>0 & a2 < a1);a2=a2+2*pi;end;
if(f1<0 & a2 > a1);a2=a2-2*pi;end;
a=[a1:astep:a2];
curv=(1i+exp(1i*a))*rad;      % Generate the curve
qtrack=[qtrack,curv];       % Add it to the track

q2=qtrack(end)+f1;qtrack=[qtrack,q2];  % Move f1 and add to track
qlist=[qlist,q2];

zlim=3;blim=5;
fig17=figure;
%  collinsb;  Removed this line because plots become too confusing
         plot(real(qtrack1),imag(qtrack1),'k-',...
            real(qlist1),imag(qlist1),'ko','LineWidth',2);
xlabel('z, Axial Distance');ylabel('b, Confocal Parameter');
hold on;plot(real(qtrack),imag(qtrack),'k-.',...
            real(qlist),imag(qlist),'kx','LineWidth',4);
axis([-3,3,0,5]);
%print('-deps',[epspath,'9-17-collins.eps']);

fig17c=figure;
collinsb;plot(real(qtrack1),imag(qtrack1),'b-',...
            real(qlist1),imag(qlist1),'bo','LineWidth',2);
xlabel('z, Axial Distance');ylabel('b, Confocal Parameter');
hold on;plot(real(qtrack),imag(qtrack),'r-.',...
            real(qlist),imag(qlist),'rx','LineWidth',4);
axis([-3,3,0,5]);
%print('-deps',[epspath,'9-17c-collins.eps']);

zlist=real(qlist);blist=imag(qlist);
rholist=1./real(1./qlist);bplist=-1./imag(1./qlist);
disp('      z,       b,        rho,        bprime');
disp([zlist',blist',rholist',bplist']);


%  Single-lens this time with f=f1/2
f1=2;b0=1.5;
               % Lens parameters above
q0=1i*b0;
qlist=[q0];                 % keep a list of start stop points
qtrack=[q0];                % start the track at the waist
q1=qtrack(end)+f1;qtrack=[qtrack,q1];  % Move f1 and add to track
qlist=[qlist,q1];
q1p=1/(1/qtrack(end)-1/(f1/2)); % Go through lens
qlist=[qlist,q1p];
                            % Generate arc track on bprime=constant
rad=1/(-imag(1/q1p))/2;     %  Center and radius are  bprime/2
a1=angle(qtrack(end)-1i*rad);%  starting angle for arc
a2=angle(q1p-1i*rad);        %  ending angle
astep=0.01*sign(f1);
if(f1>0 & a2 < a1);a2=a2+2*pi;end;
if(f1<0 & a2 > a1);a2=a2-2*pi;end;
a=(a1:astep:a2);
curv=(1i+exp(1i*a))*rad;      % Generate the curve
qtrack=[qtrack,curv];       % Add it to the track

q2=qtrack(end)+f1;qtrack=[qtrack,q2];  % Move f1 and add to track
qlist=[qlist,q2];

zlist=real(qlist);blist=imag(qlist);
rholist=1./real(1./qlist);bplist=-1./imag(1./qlist);
disp('      z,       b,        rho,        bprime');
disp([zlist',blist',rholist',bplist']);

qtrack1=qtrack;
qlist1=qlist;

qtrack=[qtrack(end)];
qlist=[qlist(end)];

fig18=figure;
% collinsb; % Removed this line because plots become too confusing
         plot(real(qtrack1),imag(qtrack1),'k-',...
            real(qlist1),imag(qlist1),'ko','LineWidth',4);
xlabel('z, Axial Distance');ylabel('b, Confocal Parameter');
axis([-3,3,0,5]);
%print('-deps',[epspath,'9-18-collins.eps']);

fig18c=figure;
collinsb;plot(real(qtrack1),imag(qtrack1),'g-',...
            real(qlist1),imag(qlist1),'go','LineWidth',4);
xlabel('z, Axial Distance');ylabel('b, Confocal Parameter');
axis([-3,3,0,5]);
%print('-deps',[epspath,'9-18c-collins.eps']);
      z,       b,        rho,        bprime
   1.0e+03 *
         0    0.0015       Inf    0.0015
    0.0020    0.0015    0.0031    0.0042
   -0.0020    0.0027   -0.0056    0.0042
    0.0000    0.0027    7.6516    0.0027
      z,       b,        rho,        bprime
   1.0e+03 *
    0.0000    0.0027    7.6516    0.0027
    0.0020    0.0027    0.0056    0.0042
   -0.0020    0.0015   -0.0031    0.0042
   -0.0000    0.0015   -1.2136    0.0015
      z,       b,        rho,        bprime
         0    1.5000       Inf    1.5000
    2.0000    1.5000    3.1250    4.1667
   -1.3077    0.4615   -1.4706    4.1667
    0.6800    0.4715    1.0070    1.4522