dx3
Contents
define system
global cv th rn;
cv = [ 0 0.25 -0.15 0];
th = [ 0 0 0 0];
rn = [ 1 1.5 1 1];
take two steps
x = [ 0.25 -0.15]';
for (k=1:2)
[A fz] = calculate_derivatives(@sing2,x);
s = -A\fz;
x = x + s;
end
[A fz] = calculate_derivatives(@sing2,x);
s = -A\fz;
1D search along solution vector
p = linspace(0,3,101);
for (k=1:101)
f = fz + A*(p(k)*s);
fig1(k)=norm(f);
f = sing2(x+p(k)*s);
fig2(k)=norm(f);
end
plot results
idx=find(fig1<0.025);
plot(p(idx),fig1(idx),p,fig2);
xlabel('search');
ylabel('merit function');