Water sound speed calculator

版本 1.3.0.0 (2.5 KB) 作者: Chad Greene
Calculate the sound speed of water for any given temperature, pressure, and salinity.
1.1K 次下载
更新时间 2012/4/25

查看许可证

OUTPUT: sound speed in m/s

INPUTS:
This function allows any or all inputs to be scalar or vectors. However, dimensions of all vector inputs must agree.

T_degrees_C is temperature in [°C]
P_kPa is absolute pressure [kPa]
S_ppt is salinity in ppt; most often close enough to psu for practical purposes. For freshwater use S_ppt = 0 or leave blank

If you have data from a CTD cast, you might have values for temperature, pressure, and salinity in the following format. (These example values are entirely hypothetical):
T_profile = [22 22 21 19 18];
P_profile = [101 150 199 240 300];
S_profile = [35.5 35 34.5 34 34.5];

Or you might have constant values for one or all of the input parameters:
T_const = 22;
P_const = 110;
S_const = 33;

ANY OF THE INPUTS FOLLOWING WILL WORK:
c_water(T_const,P_const,S_const)
c_water(T_const,P_const)
c_water(T_const)
c_water()
c_water
c_water(T_profile)
c_water(T_profile,P_profile)
c_water(T_profile,P_profile,S_profile)
c_water(T_profile,P_profile,S_const)
c_water(T_profile,P_const,S_profile)
c_water(T_profile,P_const,S_const)
c_water(T_const,P_profile,S_profile)
c_water(T_const,P_const,S_profile)
c_water(T_const,P_profile,S_const)
c_water(T_const,P_profile)
c_water(T_profile,P_const)

GRAPHICAL EXAMPLE
d = 0:5000; % for depth of 0 to 5 kilometers
p = 101.325+1025*9.81*d/1000; % pressure equivalent in kPa
t = [20:-10/500:10 10*ones(1,4500)]; % a very simplified thermocline model
c = c_water(t,p,32);
plot(c,-d)
ylabel('depth (m)')
xlabel('sound speed (m/s)')

Note: This calculator assumes a complete absence of bubbles. Even a small amount of gas in the water column may significantly affect sound speed. See Wood's model for the bulk sound speed of multiphase media.

引用格式

Chad Greene (2024). Water sound speed calculator (https://www.mathworks.com/matlabcentral/fileexchange/35916-water-sound-speed-calculator), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R2011a
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Beamforming and Direction of Arrival Estimation 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
版本 已发布 发行说明
1.3.0.0

Acknowledged the "raytrace" function by Val Schmidt.

1.2.0.0

Clarified the validity of this function as it relates to bubbles in the water column.

1.1.0.0

Any or all of the input values may now be arrays or constants.

1.0.0.0