function y = expansionFactor(p,dp,bbeta,k)
% expansionFactor  Multiplier to account for compressibility of air in nozzle
%
% Synopsis:  y = expansionFactor(p,dp,bbeta,k)
%
% Input: p     = pressure upstream of the nozzle
%        dp    = pressure drop across the nozzle
%        bbeta = ratio of nozzle diameter to plenum diameter
%        k     = specific heat ratio for the gas
%
% Output:  y = expansion factor appearing in equation for flow rate through
%              long radius nozzle
acon = (p-dp)/p;    % (alpha) ratio of nozzle exit pressure to approach pressure
t1 = (k-1)/k;
ak = acon^(2/k);
t2 = ( ak/t1 ) * ( 1- acon^t1)/(1-acon);
b4 = bbeta^4;
t3 = (1-b4)/(1-b4*ak);
y = sqrt(t2*t3);
