%
% MONOD MODEL FITTING EXAMPLE
%
% Bob Newell, January 1996
%
% sos function for nonlinear regression
%
%-----------------------------------------------
function sos = Monod_Function( p )
%
global mudat
global sdat
%
global yhat
%
% residuals and model calculation vectorised
yhat = p(1) .* sdat ./ ( p(2) + sdat );
resid = mudat - yhat;
% calculate sos
sos = resid * resid';
%
return;
