1 #ifndef __JACOUSTICS__JSOUNDVELOCITY__ 
    2 #define __JACOUSTICS__JSOUNDVELOCITY__ 
   17 namespace JACOUSTICS {}
 
   18 namespace JPP { 
using namespace JACOUSTICS; }
 
   20 namespace JACOUSTICS {
 
   60       this->
a  += this->
b * (z0 - this->
z0);
 
  114                                const double z2)
 const 
  116       const double eps = 1.0e-8;
 
  118       const double v1  = (*this)(z1);
 
  119       const double v2  = (*this)(z2);
 
  120       const double lv  = log(v2/v1);
 
  123         return t_s * fabs((z2 - z1) * 
b / lv);
 
  125         return 0.5 * t_s * (v1 + v2);
 
  139                            const double z2)
 const 
  141       const double eps = 1.0e-8;
 
  143       const double ct  = (z2 - z1) / D_m;
 
  144       const double v1  = (*this)(z1);
 
  145       const double v2  = (*this)(z2);
 
  148         return fabs(log(v2/v1) / (ct*
b));
 
  150         return 2.0 * D_m / (v1 + v2);
 
  164                                       const double z2)
 const 
  166       const double eps = 1.0e-8;
 
  168       const double ct  = (z2 - z1) / D_m;
 
  169       const double v1  = (*this)(z1);
 
  170       const double v2  = (*this)(z2);
 
  173         return fabs(log(v2/v1) / ((z2 - z1) * 
b));
 
  175         return 2.0 / (v1 + v2);
 
  188       if (in >> velocity.
a) {
 
  209       out << velocity.
a << 
' ' << velocity.
b << 
' ' << velocity.
z0;
 
virtual double getDistance(const double t_s, const double z1, const double z2) const 
Get distance travelled by sound. 
 
esac print_variable DETECTOR INPUT_FILE OUTPUT_FILE CDF for TYPE in
 
JSoundVelocity(const double a, const double b, const double z0)
Constructor. 
 
virtual double getTime(const double D_m, const double z1, const double z2) const 
Get propagation time of sound. 
 
static const JSoundVelocity getSoundVelocity(1541.0,-17.0e-3,-2000.0)
Function object for velocity of sound. 
 
virtual double getInverseVelocity(const double D_m, const double z1, const double z2) const 
Get inverse velocity of sound. 
 
Implementation for velocity of sound. 
 
JSoundVelocity operator[](const double z0) const 
Get sound velocity at given depth. 
 
friend std::istream & operator>>(std::istream &in, JSoundVelocity &velocity)
Read sound velocity from input. 
 
Interface for velocity of sound. 
 
JSoundVelocity & set(const double z0)
Set depth. 
 
virtual double operator()(const double z) const 
Get velocity of sound at given depth relative to seabed. 
 
virtual double operator()() const 
Get velocity of sound. 
 
friend std::ostream & operator<<(std::ostream &out, const JSoundVelocity &velocity)
Write sound velocity to output.