%
% Exercise 2.2: Carbon Removal Process
%
% Bob Newell, May 1996
%
%-----------------------------------------------------------
%
function y = Carbon_Plant_Outputs( t, x )
global p
%
% x = [ 1=Ss1 2=So1 3=Ss2 4=So2 5=Ss3 6=So3 ];
% y = [ 1=v_in 2=Ss_in 3=So_in 4=Xh_in
%       5=Ss1 6=Ss2 7=Ss3 8=So1 9=So2 10=So3 ];
% p = [ 1=muhat 2=Ks 3=Koh 4=Yh 5=bh 6=fp
%       7=a 8=b 9=So_sat
%       10=vol1 11=vol2 12=vol3
%       13=Kla1 14=Kla2 15=Kla3
%       16=flow 17=cod ];
%
%-----------------------------------------------------------
  [ n, m ] = size( x );
  if m == 1,
    x = x';
    n = 1;
  end;
  y = zeros( n, 10 );
%
  for i = 1:n,
    % influent conditions
    y(i,1) = p(16);
    y(i,2) = p(17);
    y(i,3) = 1;
    y(i,4) = 850;
    % output data
    y(i,5) = x(i,1);
    y(i,6) = x(i,3);
    y(i,7) = x(i,5);
    y(i,8) = x(i,2);
    y(i,9) = x(i,4);
    y(i,10) = x(i,6);
  end;
%-----------------------------------------------------------
% the end!   
