function pcout = demoPumpCurve(n)
% demoPumpCurve  Generate the pump curve for the pump used in Example 12.4
%                of Munson, Young and Okiishi
%
% Synopsis:  demoPumpCurve
%            demoPumpCurve(n)
%            pc = demoPumpCurve(...)
%
% Input:  n = (optional) degree of polynomial used in curve fit for
%             the pump data.  Default:  n = 3 (cubic)
%
% Output:  Print coefficients of the pump curve coefficients; plot the
%          pump curve; and return coefficients if user requests them.
%
%          pc = coefficients of polynomial for the pump curve

if nargin<3,  n=3;  end

% --- Data for pump curve
Q = [ 0  400  800  1400  1800  2200  2300]*6.309e-5;   %  m^3/s
h = [88   86   81   70     60    46    40]*0.3048;     %  m

pc = makePumpCurve(Q,h,n);   %  polynomial curve fit of degree n

% -- Return polynomial coefficients if user asks for them
if nargout>0,  pcout = pc;  end

end