draw lens example

Contents

define lens

th=[0 3.0486 5.4981 1.0162 0.6215 4.6129 3.0486 0 0 ];
rn=[1 1.713 1 1.689 1 1 1.713 1 1];
cv=[0 0.0458621 0.0039265 -0.0301655 0.0454845 0 0.0104227 -0.0406946 0];
sa=[0 21 21 15 15 0 18 18 0]/2; % semiaperture (half the diameter)
lp = [2 4 7];  % index (start) of each lens in system
ast = 6; % index of aperture stop
lambda = 0.5876e-3; % wavelength in mm

draw the system

drawsys;

calculate edge thicknesses

n = length(lp);
tedge = zeros(size(lp));
for k=1:n
    kp = lp(k);
    tedge(k) = th(kp) - sag(sa(kp),cv(kp)) + sag(sa(kp),cv(kp+1));
end
tedge
clear n k kp;
tedge =

    0.5705    3.1946    0.9181

paraxial raytrace

pa = [10 0];
pc = [0 tan(20*pi/180)];

n = length(th);
pya = parax(pa, cv, th, rn);

% y height solve at last surface
th(n-1) = -pya(n-1,1)/pya(n-1,2);
pya(n,1) = 0.0;
fprintf('back focal distance %g\n',th(n-1));

pyc = parax(pc, cv, th, rn);
ck = -pyc(ast,1)/pya(ast,1);
pyc = pyc + ck*pya;
fprintf('chief ray correction %g\n',ck);
back focal distance 41.4387
chief ray correction -0.417149

show results

n = length(pya);
fprintf('\n%3s %12s %12s %12s %12s\n','srf','py','pu','pyc','puc');
for k = 1:n
    fprintf('%3d %12.6f %12.6f %12.6f %12.6f\n',k-1,pya(k,:),pyc(k,:));
end
srf           py           pu          pyc          puc
  0    10.000000     0.000000    -4.171493     0.363970
  1    10.000000    -0.190891    -4.171493     0.292105
  2     9.418049    -0.300630    -3.280980     0.491191
  3     7.765155    -0.082439    -0.580361     0.283676
  4     7.681381     0.101487    -0.292090     0.469975
  5     7.744454     0.101487     0.000000     0.469975
  6     8.212602     0.023617     2.167949     0.264953
  7     8.284600    -0.199924     2.975685     0.367524
  8     0.000000    -0.199924    18.205413     0.367524

Seidel wavefront aberrations

ford(pya,pyc,cv,th,rn,lambda);

epsilon_0 = abs(lambda/pya(n,2));
fprintf('\ndiffraction spot size %g\n',epsilon_0);
L =

    3.6397


W =

         0         0         0         0         0
   49.8614   75.0852   28.2673  121.7247   91.6513
   26.3482 -191.2013  346.8734  164.2253 -595.8681
 -119.0053  452.7291 -430.5767 -284.6453  541.4347
  -49.9249 -202.2772 -204.8880 -207.0226 -419.3894
         0         0         0         0         0
    5.3627   56.4772  148.6981   98.8004  520.2605
  108.6367 -199.3907   91.4900  141.2132 -129.5907
   21.2788   -8.5777  -20.1360   34.2956    8.4982


      W040       W131       W222       W220       W311
     21.28      -8.58     -20.14      34.30       8.50

diffraction spot size 0.00293911