Given sufficient parameters (i.e. wavelength and frequency, bulk modulus and density) this function calculates the speed of sound.
Usage
soundSpeed(
medium = NULL,
method = NULL,
wl = NULL,
f = NULL,
bulkModulus = NULL,
density = NULL,
...
)
Details
The speed of sound can be calculated using the following methods:
cramer Uses the method described in cramer1993;textualsonicscrewdriver. Additional parameters are:
temp Temperature
temp.unit Temperature unit
pressure Pressure
pressure.unit Pressure unit
RH Relative humidity
MoleFracCO2 Mole fraction of CO2
seewave Delegates the calculation of the speed of sound in air to the package
seewave
seewave2008sonicscrewdriver. This calculation is . performed as \(\text{speed} = 331.4 + 0.6 \times \text{temp}\). Additional parameters are:temp Temperature
Examples
soundSpeed(medium="air")
#> [1] 343
soundSpeed(medium="sea water")
#> [1] 1500
soundSpeed(method="cramer", temp=14, pressure=3, RH=10)
#> [1] 342.682
soundSpeed(method="cramer", temp=14, temp.unit="C", pressure=3, pressure.unit="kPa", RH=10)
#> [1] 342.682
t <- 1:30
s <- lapply(t, \(x){soundSpeed(method="cramer", temp=x)})