function e = boltzmann_stage_error_func(P, stages, areas)
% function e = boltzmannerrorfunc(x, bottom, top, tm, slope, s)
%
% This function calculates the error between the estimated output from the
% Boltzmann function and the input sizes.
%
% Dr. A. I. Hanna (2007)
y = boltzmann(P(1), P(2), P(3), stages);
% plot(stages, y)
% clf
% plot(stages, y)
% hold on
% plot(stages, areas, 'rx');
% drawnow;
e = sum((areas - y(:)).^2);
e
return;