Bug 1055 - Wrong UAN's Thorp absorption loss model formula
Wrong UAN's Thorp absorption loss model formula
Status: RESOLVED FIXED
Product: ns-3
Classification: Unclassified
Component: devices
ns-3.10
All All
: P5 normal
Assigned To: Andrea Sacco
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-02-15 08:10 EST by Salva Climent
Modified: 2012-11-09 04:23 EST (History)
2 users (show)

See Also:


Attachments
Thorp patch (1.43 KB, patch)
2011-09-05 10:44 EDT, Salva Climent
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Salva Climent 2011-02-15 08:10:19 EST
Hello,

I was revising the implementation of the Thorp's absorption loss model in the UAN model and found that the if condition inside the  GetAttenDbKyd method maybe is mistaken. According to [1] it should be freqKhz >= 0.4

[1] Harris, A. F. and Zorzi, M. 2007. Modeling the underwater acoustic channel in ns2. In Proceedings of the 2nd international Conference on Performance Evaluation Methodologies and Tools
Comment 1 Salva Climent 2011-02-27 08:32:26 EST
Hi,

I’ve done a little bit of research… 

In [1] the attenuation is in db/km. According to [2] Thorp’s attenuation formula in db/kyard is:

Fsq = f * f
alpha = 0.1*Fsq / (1 + Fsq) + 40*Fsq / (4100 + Fsq) + 2.75 * 10 ^-4*Fsq + 0.003

This formula takes care of the attenuation at very low frequencies (but it doesn’t specify which range). 

In [3] another formula is used for freq below 1kHz:

alpha = Bs + 0.11*Fsq*K*(1+Fsq) + 0.011Fsq

where K is the coefficient which accounts for the regional variation of the boron-related effects. Bs is the additions attenuation coefficient independent of the frequency. Its value depend on the type of water mass and range from 0.2 * 10^-3 to 4.2* 10^-3. This time, attenuation is calculated in db/km.

And the next formula is used in [3] for freq. between 100Hz and 3kHz, also in db/km:

alpha = 0.11*Fsq / (1 + Fsq) + 44*Fsq / (4100 + Fsq)

In [4], I think the original Thorp work, the following formula is shown (in db/kyard):

alpha = 0.1*Fsq / (1 + Fsq) + 40*Fsq / (4100 + Fsq)

Maybe someone can take a look at [5]. I don’t have access to it and it seams to be a review of all the work done by Thorp in this matter.

[1] Harris, A. F. and Zorzi, M. 2007. Modeling the underwater acoustic channel in ns2.

[2] Urick, R. J.. Principles of underwater sound. 3rd edition

[3] Brekhovskikh L.M. and Lysanov Yu.P. Fundamentals of ocean acoustics. Second Edition

[4] Thorp, W.H., 1967. Analytic Description of the Low-Frequency Attenuation Coefficient.

[5] Thorp, W.H., Feb 1973. Attenuation of low frequency sound in the ocean
Comment 2 Andrea Sacco 2011-08-16 14:41:47 EDT
Hi Salva,
I'll take a look at the code according to your observations but, for what I remeber the attenuation's formula was correct. I will read your references and take a look at my master thesis..

Andrea
Comment 3 Andrea Sacco 2011-08-22 07:50:26 EDT
Hi Salva,
you were right, the condition into the code is wrong. It should be >= 400 Hz.

I've read all the references you posted and they were the same I've found during my thesis work. IMHO they seem to be revisions of the base fitting curve.

Regarding the code, it has been ported from the ns-2 model made by Zorzi and Harris. There appear for the first time the two approximation's zones (400 Hz boundary) and, it has been ported into ns-3 as it was. I can't access [5] to verify if there is a boundary at 400 Hz in that last work from Thorp but, I can try to ask Prof. Zorzi if he can justify his code.

Keep in touch,
Andrea

(In reply to comment #1)
> Hi,
> 
> I’ve done a little bit of research… 
> 
> In [1] the attenuation is in db/km. According to [2] Thorp’s attenuation
> formula in db/kyard is:
> 
> Fsq = f * f
> alpha = 0.1*Fsq / (1 + Fsq) + 40*Fsq / (4100 + Fsq) + 2.75 * 10 ^-4*Fsq + 0.003
> 
> This formula takes care of the attenuation at very low frequencies (but it
> doesn’t specify which range). 
> 
> In [3] another formula is used for freq below 1kHz:
> 
> alpha = Bs + 0.11*Fsq*K*(1+Fsq) + 0.011Fsq
> 
> where K is the coefficient which accounts for the regional variation of the
> boron-related effects. Bs is the additions attenuation coefficient independent
> of the frequency. Its value depend on the type of water mass and range from 0.2
> * 10^-3 to 4.2* 10^-3. This time, attenuation is calculated in db/km.
> 
> And the next formula is used in [3] for freq. between 100Hz and 3kHz, also in
> db/km:
> 
> alpha = 0.11*Fsq / (1 + Fsq) + 44*Fsq / (4100 + Fsq)
> 
> In [4], I think the original Thorp work, the following formula is shown (in
> db/kyard):
> 
> alpha = 0.1*Fsq / (1 + Fsq) + 40*Fsq / (4100 + Fsq)
> 
> Maybe someone can take a look at [5]. I don’t have access to it and it seams to
> be a review of all the work done by Thorp in this matter.
> 
> [1] Harris, A. F. and Zorzi, M. 2007. Modeling the underwater acoustic channel
> in ns2.
> 
> [2] Urick, R. J.. Principles of underwater sound. 3rd edition
> 
> [3] Brekhovskikh L.M. and Lysanov Yu.P. Fundamentals of ocean acoustics. Second
> Edition
> 
> [4] Thorp, W.H., 1967. Analytic Description of the Low-Frequency Attenuation
> Coefficient.
> 
> [5] Thorp, W.H., Feb 1973. Attenuation of low frequency sound in the ocean
Comment 4 Andrea Sacco 2011-08-29 04:14:11 EDT
(In reply to comment #3)

Salva,
I've contacted Prof. Zorzi and I've talked with one student of his research group.
We've managed to find the origin of the Thorp's attenuation formula, and it is in II.A of [1]. The limit of 400 Hz is an interpretation of the "few hundred Hz" sentence, stated into the article.

Keep in mind that the formula is a fitting of experimental data as shown in [2].

The formula is in dB/km and this should be fixed into the uan code.


I think we could proceed with this two things:
- fixing the frequency limit into the GetAttenDbKyd method changing the if condition with ">= 0.4"
- fixing the conversion from dB/km to dB/kYd

The first point is trivial. About the second one, as in ns-3 positioning's model are used meters as units of measure, I suggest to keep the formula in dB/km and change the method's implementation and its name. To keep backward compatibility, I suggest to change the implementation of the GetAttenDbKyd method to give correctly converted values and implement a new method GetAttenDbKm with no conversions. I also suggest to change the GetPathLossDb implementation to use the GetAttenDbKm formula and no coordinates conversions.


I'll wait for some comments.

Regards,
Andrea


[1] Milica Stojanovic, "On the Relationship Between Capacity and Distance in an Underwater Acoustic Communication Channel," in ACM MC2R, http://www.mit.edu/~millitsa/resources/pdfs/bwdx.pdf
[2] Brekhovskikh L.M. and Lysanov Yu.P. Fundamentals of ocean acoustics.
Second Edition
Comment 5 Salva Climent 2011-08-30 06:21:17 EDT
(In reply to comment #4)

Hi Andrea,

I think is a good way to go, do you want me to make the changes and upload a patch file?

> (In reply to comment #3)
> 
> Salva,
> I've contacted Prof. Zorzi and I've talked with one student of his research
> group.
> We've managed to find the origin of the Thorp's attenuation formula, and it is
> in II.A of [1]. The limit of 400 Hz is an interpretation of the "few hundred
> Hz" sentence, stated into the article.
> 
> Keep in mind that the formula is a fitting of experimental data as shown in
> [2].
> 
> The formula is in dB/km and this should be fixed into the uan code.
> 
> 
> I think we could proceed with this two things:
> - fixing the frequency limit into the GetAttenDbKyd method changing the if
> condition with ">= 0.4"
> - fixing the conversion from dB/km to dB/kYd
> 
> The first point is trivial. About the second one, as in ns-3 positioning's
> model are used meters as units of measure, I suggest to keep the formula in
> dB/km and change the method's implementation and its name. To keep backward
> compatibility, I suggest to change the implementation of the GetAttenDbKyd
> method to give correctly converted values and implement a new method
> GetAttenDbKm with no conversions. I also suggest to change the GetPathLossDb
> implementation to use the GetAttenDbKm formula and no coordinates conversions.
> 
> 
> I'll wait for some comments.
> 
> Regards,
> Andrea
> 
> 
> [1] Milica Stojanovic, "On the Relationship Between Capacity and Distance in an
> Underwater Acoustic Communication Channel," in ACM MC2R,
> http://www.mit.edu/~millitsa/resources/pdfs/bwdx.pdf
> [2] Brekhovskikh L.M. and Lysanov Yu.P. Fundamentals of ocean acoustics.
> Second Edition
Comment 6 Andrea Sacco 2011-09-01 08:14:36 EDT
(In reply to comment #5)

Salva,
you can write a patch and create a codereview issue for the bugfix, if you want. Next, we'll wait for at least one review (maybe from Tom or Leonard) and then I can upload a conclusive patch.

Let me know.

Regards,
Andrea
Comment 7 Salva Climent 2011-09-05 10:44:20 EDT
Created attachment 1239 [details]
Thorp patch
Comment 8 Salva Climent 2011-09-05 10:48:15 EDT
Here you have the patch with the changes. I kept the GetAttenDbKyd method as you suggested, although I think it can be safely removed since it is a private method and no one else is using it.

Regards,
Salva
Comment 9 Andrea Sacco 2011-11-12 06:37:04 EST
Merged.

changeset 7580:3ae0a64434f0
Comment 10 Salva Climent 2012-02-29 09:54:36 EST
According to the bibliography, the line 91 of the uan-prop-model-thorp.cc should be changed from this:

      atten = 0.11 * fsq / (1 + fsq) + 44 * fsq / (4100 + freqKhz)
        + 2.75 * 0.0001 * fsq + 0.003;

to:
      atten = 0.11 * fsq / (1 + fsq) + 44 * fsq / (4100 + fsq)
        + 2.75 * 0.0001 * fsq + 0.003;

Changing the freqKhz to a fsq.
Comment 11 Andrea Sacco 2012-11-09 04:23:25 EST
Fixed: changeset 9128