function white_E9_3
% white_E9_3  Calculations in Example 9.3 of White, "Fluid Mechanics"
%             4th edition, McGraw-Hill, 1999, p.582

% --- properties of air
k = 1.4;      %  specific heat ratio
cp = 1005;    %  specific heat at constant pressure, J/kg/K = m^2/(s^2 K)
R = 287;      %  gas constant, J/kg/K = m^2/(s^2 K)

% --- given values at station 1
V1 = 240;     %  velocity, m/s
T1 = 320;     %  temperature, K
p1 = 170;     %  pressure, kPa

% --- Compute properties at station 1
a1 = sqrt(k*R*T1)       %  speed of sound at station 1
Ma1 = V1/a1             %  Mach number at station 1
T01 = T1/isenTT0(Ma1)   %  stagnation temperature at station 1
p01 = p1/isenpp0(Ma1)   %  stagnation pressure at station 1

rho1 = p1/R/T1              %  density at station 1
rho01 = rho1/isenrr0(Ma1)   %  stagnation density at station 1

Vmax = sqrt(2*cp*T01)           %  maximum attainable velocity
Vstar = sqrt(2*k*R*T01/(k+1))   %  sonic velocity for conditions at station 1

% --- Assume flow is adiabatic between stations 1 and 2
%     and compute properties at station 2

T02 = T01;     %  adiabatic flow between 1 and 2
V2 = 290;      %  velocity at station 2, given
p2 = 135;      %  pressure at station 2, kPa, given

T2 = T02 - 0.5*V2^2/cp    %  temperature at station 2, from definition of T0
Ma2 = isenMaTT0(T2/T02)   %  Mach number at station 2
p02 = p2/isenpp0(Ma2)     %  stagnation pressure at station 2

