%
% Figure 20.13a Penalty Functions
%
z = [0:0.1:5]';
j = 5 - 2 * z;
%
g = z - 2.5;
%
jj = j;
for mu = [ 2 8 25 ],
  jdash = j + mu * max( 0, g ).^2;
  jj = [ jj jdash ];
end;
%
plot( z, jj, '-' );
set( gca, 'fontsize', 16 );
axis( [ 0 5 -5 50 ] );
xlabel( 'Decision variable z' );
ylabel( 'Objective function J''(z)' );
%
hold on;
plot( [ 2.5 2.5 ], [ -5 15 ], '-' );
hold off;
%
stext( 2.7, 43, '\16 Penalty' );
stext( 2.7, 40, '\16 Weights' );
stext( 2.8, 33, '\16 \mu = 25' );
stext( 3.5, 20, '\16 \mu = 8' );
stext( 4.0,  7, '\16 \mu = 2' );
stext( 1.55, 12, '\16 Constraint' );
stext( 1.8,  7, '\16 z < 2.5' );
%
printsto -f1 -deps2 fig20-13a.eps
%
