%
% Example 16.3: ADP Process Objective Function
%
% Bob Newell, May 1996
%------------------------------------------------------
r = [ 0:0.1:1 ]';
ph = [ 6:0.2:8 ]';
n = length( r );
opcost = zeros( n, n );
%
for i = 1:n,
  for j = 1:n,
    pwr = r(i);
	cod = ( ph(j) - 7 )^2;
	caustic = ( ( ph(j) - 5 ) - r(i) ) / 2;
	opcost(i,j) = 3 * caustic + 1.3 * cod + 0.5 * pwr;
  end;
end;
%
mesh( ph, r, opcost );
set( gca, 'fontsize', 16 );
xlabel( 'pH' );
ylabel( 'Recycle' );
zlabel( 'Operating Cost' );
print -f1 -deps2 fig20-06b.eps
%
