DESERT 4.0.0
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 <node-core.h>
43#include <underwater-mpropagation.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 */
Definition uwphysicalrogersmodel.h:50
const double getTheta_g_max(const double &_sound_speed_water_bottom) const
Definition uwphysicalrogersmodel.h:174
int debug_
Definition uwphysicalrogersmodel.h:238
const double get_M0() const
Definition uwphysicalrogersmodel.h:136
double density_water
Definition uwphysicalrogersmodel.h:235
const double getTheta_c(const double &_sound_speed_water_bottom, const double &_frequency, const double &_bottom_depth) const
Definition uwphysicalrogersmodel.h:190
double density_sediment
Definition uwphysicalrogersmodel.h:234
static const double FROMDBPERKYARDTODMPERM
Definition uwphysicalrogersmodel.h:219
const double get_g() const
Definition uwphysicalrogersmodel.h:147
const double get_Ks() const
Definition uwphysicalrogersmodel.h:116
virtual ~UnderwaterPhysicalRogersModel()
Definition uwphysicalrogersmodel.h:61
double sound_speed_water_bottom
Definition uwphysicalrogersmodel.h:229
const double getBeta() const
Definition uwphysicalrogersmodel.h:104
double sound_speed_water_surface
Definition uwphysicalrogersmodel.h:231
double getThorp(double _frequency)
Definition uwphysicalrogersmodel.h:204
double attenuation_coeff_sediment
Definition uwphysicalrogersmodel.h:236
virtual double getAttenuation(const double &_sound_speed_water_bottom, const double &_distance, const double &_frequency, const double &_bottom_depth)
Definition uwphysicalrogersmodel.cpp:168
UnderwaterPhysicalRogersModel()
Definition uwphysicalrogersmodel.cpp:55
virtual double getGain(Packet *p)
Definition uwphysicalrogersmodel.cpp:131
double bottom_depth
Definition uwphysicalrogersmodel.h:228
double sound_speed_sediment
Definition uwphysicalrogersmodel.h:233
virtual int command(int, const char *const *)
Definition uwphysicalrogersmodel.cpp:76
const double get_N0() const
Definition uwphysicalrogersmodel.h:127
const double getTheta_g(const double &_bottom_depth, const double &_distance) const
Definition uwphysicalrogersmodel.h:161