%
% Figure 20.13b Barrier Functions
%
z = [0:0.1:5]';
j = 5 - 2 * z;
plot( z, j, 'w-' );
set( gca, 'fontsize', 16 );
axis( [ 1 4 -5 25 ] );
xlabel( 'Decision variable z' );
ylabel( 'Objective function J''(z)' );
hold on;
%
z = [ 1:0.005:3.495 ]';
j = 5 - 2 * z;
g = z - 3.5;
%
jj = [];
for mu = [ 0.5 2 10 ],
  jdash = j - 1 ./ ( mu * g );
  jj = [ jj jdash ];
end;
%
plot( z, jj, '-' );
%
plot( [ 3.5 3.5 ], [ -5 50 ], '-' );
hold off;
%
stext( 2.3, 17, '\16 Barrier' );
stext( 2.3, 15, '\16 Weights' );
stext( 2.5, 11, '\16 \mu = 0.5' );
stext( 2.3,  8, '\16 \mu = 2.0' );
stext( 2.1,  5, '\16 \mu = 10' );
stext( 2.35, -3, '\16 Constraint  z < 3.5' );
%
arrow( [ 3.1 10 ], [ 3.25 8 ] );
arrow( [ 2.9 8 ], [ 3.35 3 ] );
arrow( [ 2.65 5 ], [ 3.4 0 ] );
%
printsto -f1 -deps2 fig20-13b.eps
%
