apochromat design

Contents

clear
load glass;

gn = char('F2', 'KZFSN5', 'N-FK51A');
wvl = [ 0.48613 0.58756 0.65627 ];

look-up glass in Schott glass table

ng = size(gn);
idx = zeros(ng);
for k=1:ng(1)
    idx(k) = strmatch(gn(k,:),glass.name);
end

calculate index of refraction at three wavelengths

rndx = zeros(length(wvl),ng(1));
for k=1:ng(1)
    m = idx(k);
    rndx(:,k) = sellmeier(glass.disperse(m,:),wvl);
end

powers = [1/50 1/50 1/50]';
cvd = (rndx-1)\powers;

disp('cvd');
disp(cvd);
cvd
    0.0634
   -0.0972
    0.0911

global cv th rn;
cv = [0 cvd(1) 0 cvd(2) 0 cvd(3) 0];
th = [0  0  0  0  0  0  0];
rn = ones(3,length(th));
rn(:,2) = rndx(:,1);
rn(:,4) = rndx(:,2);
rn(:,6) = rndx(:,3);
% test powers
[power bend] = get_powers(cv,rn);

disp([power bend]);
fprintf('\ntotal power: %g\n',sum(power));
    0.0393    1.0000
   -0.0636    1.0000
    0.0443    1.0000


total power: 0.02
% test lens shape

cv(2:3) = lens_shape(power(1),0,rn(2,2));
cv(4:5) = lens_shape(power(2),0,rn(2,4));
cv(6:7) = lens_shape(power(3),0,rn(2,6));

power = get_powers(cv,rn);
disp('curvatures');
disp(cv);
fprintf('\ntotal power: %g\n',sum(power));
curvatures
  Columns 1 through 5

         0    0.0317   -0.0317   -0.0486    0.0486

  Columns 6 through 7

    0.0455   -0.0455


total power: 0.02

generate defect maps

n=128;
u1 = linspace(-4,4,n);
u2 = linspace(-4,4,n);
map = zeros(n,n);
map1 = map;
map2 = map;
map3 = map;
%map4 = map;
v = [0 0 -0.119];
for r=1:n
    v(2)=u2(r);
    for c=1:n
        v(1)=u1(c);
        f = apochromat(v);
        map(r,c)=f'*f;
        map1(r,c)=f(1);
        map2(r,c)=f(2);
        map3(r,c)=f(3);
        %map4(r,c)=f(4);
    end
end
z = log10(map)+3;
str = sprintf('shape of third element %7.4g',v(3));

show zero contours

pos = get(gcf,'Position');
disp(pos);
%pos(3)=480;
%pos(4)=480;
set(gcf,'Position',pos);
contour(u1,u2,map2,[0 0],'b');
axis square;
hold on;
contour(u1,u2,map3,[0 0],'r');
contour(u1,u2,map1,[0 0],'k');
%contour(u1,u2,map4,[0 0],'g');
hold off;
xlabel('shape of first element');
ylabel('shape of second element');
title(str);
   360   246   560   420

contour

contour(u1,u2,z,12,'LineWidth',1.25);
axis square
xlabel('shape of first element');
ylabel('shape of second element');

design

[xo vout hp] = cycle([0.25 0.44 0.6],@apochromat);
hold on
plot(vout(:,1),vout(:,2),'ko-','LineWidth',2);
hold off
disp('solution');
disp(xo);
  #      merit    damping        chg  r      ratio
  1      1.083      0.577        114  3  6.47e-005
  2      1.046     0.0468       13.3  3  6.89e-005
  3      1.025     0.0351       9.86  3  7.55e-005
  4      1.007     0.0318       8.67  3  7.84e-005
  5     0.9904     0.0315       8.22  3  7.55e-005
  6     0.9729     0.0335       8.26  3  6.67e-005
  7     0.9532     0.0386       8.83  3  5.51e-005
  8     0.9279     0.0507       10.4  3  4.36e-005
  9     0.8819     0.0929       15.7  3  3.34e-005
 10     0.4844       0.38       36.6  3  2.38e-005
 11     0.4354      0.166       5.81  3  1.48e-005
 12     0.3856      0.202       5.11  3  1.48e-005
 13     0.3259      0.281       4.99  3   1.5e-005
 14     0.2402      0.479       5.34  3  1.51e-005
 15    0.07142          1          5  3  1.53e-005
 16 5.024e-007          1      0.156  3  1.56e-005
 17 3.631e-010          1    0.00013  3  1.56e-005
 18 2.445e-013          1  5.04e-009  3  1.56e-005
solution
   -2.4596
    1.4076
   -0.1190

show_progress(hp);
close
r = log10(abs(map1));
g = log10(abs(map2));
b = log10(abs(map3));
rmax = max(max(r));
rmin = min(min(r));
r = (r-rmin)/(rmax-rmin);
gmax = max(max(g));
gmin = min(min(g));
g = (g-gmin)/(gmax-gmin);
bmax = max(max(b));
bmin = min(min(b));
b = (b-bmin)/(bmax-bmin);
rgb = cat(3,r,g,b);
imshow(rgb);
save apo1 cv th rn xo wvl