soundSpeed: Calculate the speed of sound in a medium

View source: R/soundSpeed.R

soundSpeedR Documentation

Calculate the speed of sound in a medium

Description

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,
  ...
)

Arguments

medium

Propagation medium (e.g. "air"), or "all" to return a list of all available media.

method

Use a specific method to calculate the speed of sound (see Details).

wl

Wavelength

f

Frequency

bulkModulus

Bulk modulus

density

Density

...

Additional parameters passed to the method.

Details

The speed of sound can be calculated using the following methods:

  • cramer Uses the method described in \insertCitecramer1993;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 \insertCiteseewave2008sonicscrewdriver. This calculation is . performed as \text{speed} = 331.4 + 0.6 \times \text{temp}. Additional parameters are:

    • temp Temperature

References

\insertAllCited

Examples

soundSpeed(medium="air")
soundSpeed(medium="sea water")

soundSpeed(method="cramer", temp=14, pressure=3, RH=10)
soundSpeed(method="cramer", temp=14, temp.unit="C", pressure=3, pressure.unit="kPa", RH=10)

t <- 1:30
s <- lapply(t, \(x){soundSpeed(method="cramer", temp=x)})

sonicscrewdriver documentation built on May 29, 2024, 3:39 a.m.