%
%  Flux Model for Clarifier Model from Diehl and Jeppsson
%
%----------------------------------------------------------------
%
function vsx = Flux_Model( x )
%
global coef
global bulkslope
%
%----------------------------------------------------------------
%
% this flux model can be modified with another
%
vsx = coef(1) * x .* exp( - coef(2) * x );
vsx=vsx(:);
%
%----------------------------------------------------------------
%
% but don't touch this part which is used once at
% the start to locate the limiting flux region
%
if bulkslope == 0,
  return;
elseif bulkslope < 0,
  vsx = - vsx;
  return;
else,
  vsx = vsx + bulkslope * x;
  return;
end;
%--------------------------------------------------------------
