DESERT 3.5.1
Loading...
Searching...
No Matches
uwphysicalrogersmodel.h
Go to the documentation of this file.
1//
2// Copyright (c) 2017 Regents of the SIGNET lab, University of Padova.
3// All rights reserved.
4//
5// Redistribution and use in source and binary forms, with or without
6// modification, are permitted provided that the following conditions
7// are met:
8// 1. Redistributions of source code must retain the above copyright
9// notice, this list of conditions and the following disclaimer.
10// 2. Redistributions in binary form must reproduce the above copyright
11// notice, this list of conditions and the following disclaimer in the
12// documentation and/or other materials provided with the distribution.
13// 3. Neither the name of the University of Padova (SIGNET lab) nor the
14// names of its contributors may be used to endorse or promote products
15// derived from this software without specific prior written permission.
16//
17// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
19// TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
20// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
21// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
22// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
23// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
24// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
25// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
26// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
27// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28//
29
39#ifndef UWPHYSICALROGERSMODEL_H
40#define UWPHYSICALROGERSMODEL_H
41
42#include <underwater-mpropagation.h>
43#include <node-core.h>
44#include <uwlib.h>
45
46#include <cmath>
47#include <iostream>
48
49class UnderwaterPhysicalRogersModel : public UnderwaterMPropagation
50{
51
52public:
57
62 {
63 }
64
75 virtual int command(int, const char *const *);
76
77protected:
78 virtual double getGain(Packet *p);
79
93 virtual double getAttenuation(const double &_sound_speed_water_bottom,
94 const double &_distance, const double &_frequency,
95 const double &_bottom_depth);
96
103 inline const double
104 getBeta() const
105 {
106 return (0.477 * get_M0() * get_N0() * get_Ks()) /
107 sqrt(pow((1 - pow(get_N0(), 2)), 3));
108 }
109
115 inline const double
116 get_Ks() const
117 {
118 // TODO: fix this and find the correct value
120 }
121
126 inline const double
127 get_N0() const
128 {
130 }
131
135 inline const double
136 get_M0() const
137 {
139 }
140
146 inline const double
147 get_g() const
148 {
150 }
151
160 inline const double
161 getTheta_g(const double &_bottom_depth, const double &_distance) const
162 {
163 return std::sqrt((1.7 * _bottom_depth) / (getBeta() * _distance));
164 }
165
173 inline const double
174 getTheta_g_max(const double &_sound_speed_water_bottom) const
175 {
176 return std::sqrt((2 * get_g()) / (_sound_speed_water_bottom));
177 }
178
189 inline const double
190 getTheta_c(const double &_sound_speed_water_bottom,
191 const double &_frequency, const double &_bottom_depth) const
192 {
193 return (_sound_speed_water_bottom / (2 * _frequency * _bottom_depth));
194 }
195
203 double
204 getThorp(double _frequency)
205 {
206 double f2_ = pow(_frequency, 2);
207 // Thorp's eqution for frequencies above or below a few kHz is
208 // different.
209 if (_frequency >= 0.4)
210 return (0.11 * f2_ / (1.0 + f2_) + 44.0 * f2_ / (4100.0 + f2_) +
211 2.75e-4 * f2_ + 0.003) *
213 else
214 return (0.002 + 0.11 * f2_ / (1 + f2_) + 0.011 * f2_) *
216 }
217
218#if __cplusplus <= 199711L
219 static const double FROMDBPERKYARDTODMPERM =
220 0.001093613298338;
221#else
222 static constexpr double FROMDBPERKYARDTODMPERM =
223 0.001093613298338;
224#endif
225
226private:
227 // Variables
238 int debug_;
239};
240
241#endif /* UWPHYSICALROGERSMODEL_H */
const double getTheta_g_max(const double &_sound_speed_water_bottom) const
Maximum grazion angle for an RBR mode.
const double get_M0() const
Ratio between the density of the sediment and the density of the water.
double density_water
Water density (g/cm^3).
const double getTheta_c(const double &_sound_speed_water_bottom, const double &_frequency, const double &_bottom_depth) const
Cutoff angle of the lowest mode.
double density_sediment
Sediment density (g/cm^3).
static const double FROMDBPERKYARDTODMPERM
Conversion factor from dB/kyard to dB/m.
const double get_g() const
Magnitude of the negative sound speed profile.
const double get_Ks() const
Sediment attenuation coefficient (dB/(m*kHz))
virtual ~UnderwaterPhysicalRogersModel()
Destructor of UnderwaterMPhyBpskDb class.
double sound_speed_water_bottom
Speed of sound in water at the sea bottom level (m/s).
const double getBeta() const
Bottom loss (dB/rad) derived from the expression for the Rayleigh reflection coefficient for a two-fl...
double sound_speed_water_surface
Speed of sound in water at the sea surface level (m/s).
double getThorp(double _frequency)
Absorption coefficient calculated by using Thorp's equation.
double attenuation_coeff_sediment
Attenuation coefficient of the sediment (dB/(m*kHz)).
virtual double getAttenuation(const double &_sound_speed_water_bottom, const double &_distance, const double &_frequency, const double &_bottom_depth)
Attenuation of acoustic signal in underwater channel.
UnderwaterPhysicalRogersModel()
Constructor of UnderwaterMPhyBpskDb class.
double sound_speed_sediment
Speed of sound in the sediment (m/s).
virtual int command(int, const char *const *)
TCL command interpreter.
const double get_N0() const
Ratio between the sound speed on sound at the surface and sound speed of sound in the sediment.
const double getTheta_g(const double &_bottom_depth, const double &_distance) const
Effective angle of the last mode striped.