%
% RTD Simulator - Request Object Definition
%
% Bob Newell, January 1996
%
function objects = rtdentry
objects = [];
i = 1;
type = 1;
while type < 5,
%
% add pulse object, always the first
%
  if type == 1,
    disp( ['Object ' num2str(i) ': Tracer Injection'] );
    objects = [ objects ; [type 0 0 0 0 0 0 0 0 0 0 1] ];
    objects(i,2) = input( '  Type (0=impulse,1=pulse,2=step) > ' ); 
    objects(i,3) = input( '  Enter tracer amount (height) > ' );
  end;
%
% get connectivity and flowrates
%
  if type < 5,
    for j = 2:5,
      newvalue = input( ['  Output ' ...
                     num2str(j-1) ' to object (0=end) > '] );
      if length( newvalue ) == 0,
	    newvalue = 0;
      end;
	  if newvalue == 0,
        break;
	  else,
	    objects(i,2*j) = newvalue;
      end;
      objects(i,2*j+1) = input( '  Flowrate (Ml/d) > ' );
    end;
  end;
%
% get object type and respective data
%
  i = i + 1;
  type = input( 'Object (2=well-mixed,3=plug-flow,4=mixing-tee,5=sink,6=end) > ' );
  if type == 2,
    objects = [ objects ; [type 0 0 0 0 0 0 0 0 0 0 1] ];
    disp( ['Object ' num2str(i) ': Well-Mixed Tank'] );
    objects(i,2) = input( '  Enter vessel volume (Ml) > ' );
  elseif type == 3,
    objects = [ objects ; [type 0 0 0 0 0 0 0 0 0 0 1] ];
    disp( ['Object ' num2str(i) ': Plug-Flow Tank'] );
    objects(i,2) = input( '  Enter vessel volume (Ml) > ' );
    objects(i,3) = input( '  Enter dispersion constant (0-1) > ' );
    if objects(i,3) < 0, objects(i,3) = 0; end;
    if objects(i,3) > 1, objects(i,3) = 1; end;
  elseif type == 4,
    objects = [ objects ; [type 0 0 0 0 0 0 0 0 0 0 1] ];
    disp( ['Object ' num2str(i) ': Mixing Tee'] );
  elseif type == 5,
    objects = [ objects ; [type 0 0 0 0 0 0 0 0 0 0 1] ];
    disp( ['Object ' num2str(i) ': Sink'] );
  end;
end;
%
return;
