dx7

Contents

triplet setup

clear;
global cv th rn dn;
cv = [ 0 0 0 0 0 0 0 0];
%th = [ 0 0 0 0 0 0 0 0];
th = [ 0 2 0 1 0 3 0 0];
sk16 = [1.617271 1.622861 1.627559];
f4 = [1.611644 1.620578 1.628484];
bk7 = [1.514322 1.51680 1.522376];
rn = [ 1 sk16(2) 1 f4(2) 1 bk7(2) 1 1];
dn = [ 0 sk16(3)-sk16(1) 0 f4(3)-f4(1) 0 bk7(3)-bk7(1) 0 0];
sa = [0 6.5 6.5 6.5  0 6.5 6.5 6.5 0];
lp = find(rn>1);
as = 5;

v = [1/50 -2/50]';

trip1 code

cv(2:3)=lens_shape(v(1),1,rn(2)); % shape 1 (convex-plano)
cv(4:5)=lens_shape(v(2),0,rn(4)); % shape 2 (equi-concave)
cv(6)=0;
yap = 50/8;
uco = tan(2.0*pi/180);
scl = yap^2/2;
ya = parax([yap 0],cv,th,rn);
usolve = -0.125;
yn=ya(7,1);
% paraxial height solve for image distance
th(7) = -yn/usolve;
ya(8,1) = 0;
% paraxial angle solve for power
if (abs(yn)>1e-6)
    cv(7)= -(rn(7)*usolve-rn(6)*ya(6,2))/((rn(7)-rn(6))*yn);
end
ya(7,2)=usolve;


show_lens
drawsys
system prescription

sn           rd           th           rn
 0      0.00000      0.00000      1.00000
 1     31.14305      2.00000      1.62286
 2      0.00000      0.00000      1.00000
 3    -31.02890      1.00000      1.62058
as     31.02890      0.00000      1.00000
 5      0.00000      3.00000      1.51680
 6    -13.41606     50.63215      1.00000
 7      0.00000      0.00000      1.00000

paraxial raytrace

sn           ya           ua           yc           uc         clap
 0      6.25000      0.00000     -0.06678      0.03492      6.31678
 1      6.25000     -0.07702     -0.06678      0.02234      6.31678
 2      6.09595     -0.12500     -0.02210      0.03626      6.11805
 3      6.09595     -0.00190     -0.02210      0.02210      6.11805
 4      6.09405      0.11880      0.00000      0.03581      6.09405
 5      6.09405      0.07832      0.00000      0.02361      6.09405
 6      6.32902     -0.12500      0.07084      0.03309      6.39985
 7      0.00000     -0.12500      1.74604      0.03309      1.74604

        W040         W131         W222         W220         W311        W220P
       57.99       -13.86         0.31         0.42         0.04        -0.25

Chromatic Aberrations

       axial      lateral
       -3.10         0.33
th(3)=5;
th(5)=7;
trip1(v);
show_lens
drawsys
system prescription

sn           rd           th           rn
 0      0.00000      0.00000      1.00000
 1     31.14305      2.00000      1.62286
 2      0.00000      5.00000      1.00000
 3    -31.02890      1.00000      1.62058
as     31.02890      7.00000      1.00000
 5      0.00000      3.00000      1.51680
 6    -14.89584     50.63215      1.00000
 7      0.00000      0.00000      1.00000

paraxial raytrace

sn           ya           ua           yc           uc         clap
 0      6.25000      0.00000     -0.27680      0.03492      6.52680
 1      6.25000     -0.07702     -0.27680      0.02493      6.52680
 2      6.09595     -0.12500     -0.22694      0.04046      6.32290
 3      5.47095     -0.00961     -0.02466      0.02466      5.49561
 4      5.46134      0.09365      0.00000      0.03996      5.46134
 5      6.11686      0.06174      0.27975      0.02635      6.39660
 6      6.30207     -0.12500      0.35879      0.02752      6.66086
 7     -0.02694     -0.12500      1.75197      0.02752      1.77891

        W040         W131         W222         W220         W311        W220P
       50.46         0.55        -0.40         0.01         0.07        -0.21

Chromatic Aberrations

       axial      lateral
        1.47         1.24
[f v]=trip3;
%[xo vout hp]=cycle(v,@trip3);
%[A fz] = calculate_derivatives(@trip3,xo);
[A fz] = calculate_derivatives(@trip3,v);
[U W V] = svd(A,0);
d = diag(W);
n = length(d);
sing = 1e-8;
semilogy(1:n,d,'ko',0,1);
%semilogy(1:n,d,'ko',[0 n],sing*max(d)*[1 1],'b--');
ylabel('eigenvalues');
fprintf('eigenvalues: min %g max %g\n',min(d),max(d));
eigenvalues: min 0.00985783 max 34518
Va  = abs(V);
totals = sum(Va);
size(Va)
size(totals)
Vn = Va./(ones(size(totals))'*totals);
% variable names
vname = cellstr(['cv2'; 'cv3'; 'cv4'; 'cv5'; 'cv6'; 'cv7'; 'th3'; 'th5']);
for k=1:8
    str = char(vname(k));
    fprintf('%3s %6.1f %6.1f %6.1f %6.1f %6.1f %6.1f %6.1f %6.1f\n',str,100*Vn(:,k));
end
imwrite(imresize(Vn,16,'nearest'),'html/dx7.jpg');
ans =

     8     8


ans =

     1     8

cv2   15.5   15.3   14.6   14.9   18.8   21.0    0.0    0.0
cv3   29.3   26.7    0.1    1.4    1.5   40.8    0.1    0.1
cv4   21.7   11.8   36.2   17.7    3.7    8.6    0.0    0.3
cv5    0.5   17.0   21.1   33.4   17.9    9.6    0.2    0.2
cv6   14.8   10.2    7.2   13.1   36.0   18.2    0.1    0.4
cv7   25.0   29.6   13.9   18.7   10.2    2.4    0.1    0.2
th3    0.2    0.8    0.2    0.5    0.6    0.2    1.9   95.6
th5    0.0    0.0    0.2    0.3    0.3    0.1   97.1    1.9

This image shows the above array

optimize

[xo vout hp] = cycle(v,@trip3);
  1      41.56       0.24       44.2  8
  2      32.14      0.716       75.7  8
  3      3.006      0.683       27.1  8
  4      1.818      0.504       6.51  8
  5      0.674      0.933       5.37  8
  6  0.0003815          1       0.29  8
  7 2.654e-008          1   0.000552  8
  8 1.158e-012          1  3.77e-008  8
show_lens
system prescription

sn           rd           th           rn
 0      0.00000      0.00000      1.00000
 1     18.74934      2.00000      1.62286
 2   -200.66262      7.38428      1.00000
 3    -13.83423      1.00000      1.62058
as     10.58907      4.35964      1.00000
 5     36.40854      3.00000      1.51680
 6    -10.61340     44.39750      1.00000
 7      0.00000      0.00000      1.00000

paraxial raytrace

sn           ya           ua           yc           uc         clap
 0      6.25000      0.00000     -0.47878      0.03492      6.72878
 1      6.25000     -0.12794     -0.47878      0.03132      6.72878
 2      5.99412     -0.22623     -0.41615      0.05212      6.41027
 3      4.32355     -0.01992     -0.03129      0.03129      4.35484
 4      4.30363      0.21993      0.00000      0.05071      4.30363
 5      5.26244      0.09575      0.22110      0.03137      5.48354
 6      5.54969     -0.12500      0.31519      0.03223      5.86488
 7      0.00000     -0.12500      1.74604      0.03223      1.74604

        W040         W131         W222         W220         W311        W220P
       -0.00        -0.00         0.00         0.00        -0.00         0.00

Chromatic Aberrations

       axial      lateral
       -0.00        -0.00

optimization progress plot

sigma = hp(:,1);
damp = hp(:,2);

n = length(sigma);
k = (1:n)-1;
subplot(2,1,1);
if n<20
%plot(k,log10(sigma),'ko-','LineWidth',2);
    semilogy(k,sigma,'ko-','LineWidth',2);
else
    semilogy(k,sigma,'k','LineWidth',2);
end
grid;
xlabel('iteration');
ylabel('merit value');
subplot(2,1,2);
if n<20
    plot(k(2:n),damp(2:n),'ko-',0,1.1,'LineWidth',2);
else
    plot(k(2:n),damp(2:n),'k',0,1.1,'LineWidth',2);
end
grid;
xlabel('iteration');
ylabel('damping');

final design

subplot(1,1,1)
drawsys

show steps

sz = size(vout);
disp(sz)
for k=1:8
    str = sprintf('iteration %d',k);
    v = vout(k,:);
    trip3(v);
    subplot(2,4,k);
    drawsys;
    axis([0 25 -8 8]);
    title(str);
end
     9     8