global cv th rn;
cv = [ 0 0.25 -0.15];
th = [ 0 0 0];
rn = [ 1 1.5 1 ];
x = [ 0.25 -0.15]';
for (k=1:5)
fprintf('step %d\n\n',k);
fprintf('starting point: %.6f %.6f\n',x); % display starting point
[A fz] = calculate_derivatives(@sing2,x);
if (k==1) % display starting A matrix
A
end
[U S V] = svd(A,0)
fz
s = -A\fz;
x = x + s;
end
step 1
starting point: 0.250000 -0.150000
A =
0.5000 -0.5000
-0.0292 0.1958
0.7891 -1.3307
U =
-0.4058 -0.8321
0.1059 -0.4537
-0.9078 0.3190
S =
1.7030 0
0 0.1797
V =
-0.5416 -0.8407
0.8407 -0.5416
fz =
0.1500
-0.0183
0.1323
step 2
starting point: -0.155673 -0.283581
U =
-0.5111 -0.8536
0.1434 0.0310
-0.8475 0.5201
S =
1.3483 0
0 0.1855
V =
-0.5308 -0.8475
0.8475 -0.5308
fz =
0.0140
-0.0144
0.0692
step 3
starting point: -0.074541 -0.173431
U =
-0.8269 -0.5597
0.1437 -0.1159
-0.5437 0.8205
S =
0.8501 0
0 0.1375
V =
-0.6260 -0.7799
0.7799 -0.6260
fz =
-0.0006
-0.0067
0.0199
step 4
starting point: 0.016005 -0.083650
U =
-0.9671 -0.2542
0.0926 -0.3692
-0.2367 0.8939
S =
0.7309 0
0 0.0746
V =
-0.6879 -0.7258
0.7258 -0.6879
fz =
-0.0002
-0.0031
0.0052
step 5
starting point: 0.071000 -0.029008
U =
-0.9918 -0.0973
0.0490 -0.8884
-0.1181 0.4486
S =
0.7129 0
0 0.0330
V =
-0.7039 -0.7103
0.7103 -0.7039
fz =
0.0000
-0.0008
0.0018
function f = sing2(v); % % f(1) is power error % f(2) is coma % f(3) is spherical aberration global cv th rn; cv(2)=v(1); % first surface curvature cv(3)=v(2); % second surface curvature yap = 5.0; uco = 0.1; scl = yap^2/2; ya = parax([yap 0],cv,th,rn); yc = parax([0 uco],cv,th,rn); f(1) = -ya(4,2)/ya(1,1) - 1/20; % power error w = ford(ya,yc,cv,th,rn,1); f(2) = w(2)/scl; f(3) = w(1)/scl; f = f';
Maintained by John Loomis, last updated 6 Feb 2003