dx4

Contents

landscape lens setup

global cv th rn;
cv = [ 0 0.25 -0.15 0 0];
th = [ 0  0  0 0 0];
rn = [ 1 1.5 1 1 1];

generate contours

n=128;
u1 = linspace(-0.2,0.4,n);
u2 = linspace(-50,30,n);
map = zeros(n,n);
map1 = map;
map2 = map;
for (r=1:n)
    v(2)=u2(r);
    for (c=1:n)
        v(1)=u1(c);
        f = land(v);
        map(r,c)=f'*f;
        map1(r,c)=f(1);
        map2(r,c)=f(2);
    end
end
close all;
z = log(map);
zmin = min(min(z))
z = z + 12;
mesh(u1,u2,z);
hold on
contour(u1,u2,z,12,'LineWidth',1.25);
hold off;
zmin =

  -10.1039

show zero contours

pos = get(gcf,'Position');
pos(3)=480;
pos(4)=480;
set(gcf,'Position',pos);
contour(u1,u2,map2,[0 0],'b');
axis square;
hold on;
contour(u1,u2,map1,[0 0],'k');
hold off;
xlabel('curvature of first surface');
ylabel('distance to stop');

contour

contour(u1,u2,z,12,'LineWidth',1.25);
axis square
xlabel('curvature of first surface');
ylabel('distance to stop');

optimize

[s damp sigma] = seek([0.25 -10],@land);
 n      sigma     pmin    %step
 1      56.97
 2      1.515   1.9999   94.301
 3      0.585   0.5427   84.851
 4      0.183   0.9343   49.066
 5    0.04363   0.9625    7.713
 6   0.004778   0.9383    5.434
 7 1.905e-005   1.0040    0.387
 8 8.417e-010   1.0000    0.002
 9 3.176e-019   1.0000    0.000
k = (1:length(sigma))-1;
subplot(2,1,1);
plot(k,log10(sigma),'ko-','LineWidth',2);
grid;
xlabel('iteration');
ylabel('log10(merit)');
subplot(2,1,2);
plot(k,damp,'ko-','LineWidth',2);
grid;
xlabel('iteration');
ylabel('damping');