function Cp = cp_eq9(T,S)
%==========================================================
% Equation (9)
% Calculates Specific Heat of Seawater
%
% Inputs:
% T : Temperature (K)
% S : Salinity (g/kg)
%
% Output:
% Cp : Specific Heat (kJ/kg.K)
%==========================================================
% -------- Validity Check --------
if T < 273.15 || T > 453.15
error('Temperature must be between 273.15 K and 453.15 K');
end
if S < 0 || S > 180
error('Salinity must be between 0 and 180 g/kg');
end
% -------- Coefficients --------
A = 5.328 ...
- 9.76e-2*S ...
+ 4.04e-4*S.^2;
B = -6.913e-3 ...
+ 7.351e-4*S ...
- 3.15e-6*S.^2;
C = 9.6e-6 ...
- 1.927e-6*S ...
+ 8.23e-9*S.^2;
D = 2.5e-9 ...
+ 1.666e-9*S ...
- 7.125e-12*S.^2;
% -------- Specific Heat --------
Cp = A ...
+ B.*T ...
+ C.*T.^2 ...
+ D.*T.^3;
end
To embed this project on your website, copy the following code and paste it into your website's HTML: