Skip to content

weakly-scattering prolate spheroid #29

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
jmjech opened this issue Dec 10, 2024 · 5 comments
Open

weakly-scattering prolate spheroid #29

jmjech opened this issue Dec 10, 2024 · 5 comments
Labels
enhancement New feature or request

Comments

@jmjech
Copy link
Collaborator

jmjech commented Dec 10, 2024

In reviewing code to calculate the scattering by a weakly-scattering prolate spheroid found in:
https://github.com/CRIMAC-WP4-Machine-learning/Prol_Spheroid,
I compared their results to those in echoSMs and to the benchmark.

The results and parameters are in the attached file, WkProlateSpheroid.ods.

The Prol_Spheroid results matched the benchmark quite well, with some errors at the nulls. Their code bombed when I got to 258 kHz (for a prolate spheroid with a=0.07 m and b=0.01 m), which is why there are no values beyond this frequency.

However, the echoSMS PSMS model did not fare as well. I ran this on a google cloud workstation, linux-base e2-standard-8.

Here is my code:

from echosms import PSMSModel, BenchmarkData, ReferenceModels
from sys import exit
import numpy as np

rm = ReferenceModels()
# help(rm)
# dir(rm)
rm_type = 'weakly scattering prolate spheroid'
print('Reference model selected: {0}'.format(rm_type))
# select the model
model = PSMSModel()
# the reference model target type information
rm_spec = rm.specification(rm_type)
# get the parameters for that reference model target type
rm_par = rm.parameters(rm_type)

bmd = BenchmarkData()
bmd_pd = bmd.freq_dataset  # this is a Pandas DataFrame
# benchmark data column names
bmd_colnames = bmd_pd.columns
# map the reference model to the benchmark data column
rmbmd_map = {}
for i in range(len(bmd_colnames)-1):
    rmbmd_map[rm.names()[i]] = bmd_colnames[i+1]

# benchmark target selection
# match the benchmark data to the reference model
if (rm_type not in rmbmd_map.keys()):
    print('Reference Model:  {0} does not have benchmark data. Exiting'.format(rm_type))
    exit()
bmd_type = rmbmd_map[rm_type]

# use the same frequencies as the benchmark, convert to Hz
rm_par['f'] = bmd_pd['frequency (kHz)']*1e3
rm_par['theta'] = 90

TS = model.calculate_ts(rm_par)

# comparison to the benchmark data
jech_index = np.mean(np.abs(TS - bmd_pd[bmd_type]))

WkProlateSpheroid.ods

I did find the echoSMs PSMS model calculated for the full range of f and was considerably faster (but I didn't do any time trials).

@gavinmacaulay
Copy link
Collaborator

I had seen the errors in the echoSMs results but had forgotten about them until this reminder... I'll have another go at finding the error. Note that this error is only for weakly scattering (pressure release and rigid agree well).

A few notes:

  • the CRIMAC code uses the same Fortran prolate spheroid library as echoSMs,
  • the echoSMs code is using an simplifying approximation when doing weakly scattering that I don't see the CRIMAC code doing - this might be contributing to the differences in calculation times.
  • Currently, the prolate spheroid model in echoSMs doesn't do strongly scattering fluid filled (e.g., gas)

@gavinmacaulay
Copy link
Collaborator

It turns out that the approximation used for weakly scattering (eqn after (17b) in Jech et al) is not valid when the density contrast is very close to 1 (as it is for the benchmark weakly scattering prolate spheroid). Sound speed contrasts very close to 1 are ok.

This behaviour is demonstrated in Figure 3 of Gonzalez et al (2016). The echoSMs PSMS code produces the same curve as the 'approx' curve in figure 3 - the echoSMs implementation is probably correct. It's just that the approximation is not valid for the weakly scattering prolate spheroid in the Jech et al paper. The text after eqn 17b in the Jech et al paper says that this approximation was used for the benchmark calculations, but perhaps this is not quite correct.

The solution is to implement the full fluid boundary condition in echoSMs's PSMS model (as per eqn (15) in Jech et al).

Gonzalez, J. D., Lavia, E. F., Blanc, S., & Prario, I. (2016). Acoustic scattering by prolate and oblate liquid spheroids. Proceedings of the 22nd International Congress on Acoustics. Acoustics for the 21st Century, Buenos Aires. http://www.ica2016.org.ar/ica2016proceedings/ica2016/ICA2016-0298.pdf

@gavinmacaulay gavinmacaulay added the enhancement New feature or request label Dec 12, 2024
@gavinmacaulay
Copy link
Collaborator

New version of echoSMs, v0.6.2, is now available that implements the full equations for weakly scattering boundaries. This gives the same TS results at the CRIMAC code (and so very close to the benchmark results). But, the code fails as the frequency increases, so more work is needed.

@jmjech
Copy link
Collaborator Author

jmjech commented Dec 13, 2024

It could very well be that the weakly-scattering model did not use the approximation. I believe Sawada-san has retired, so it may be difficult to confirm, but I'll check.
The CRIMAC code bombed at 258 kHz, so there does seem to be an upper limit. I don't know if the limit is based on frequency alone or "L"/lambda where "L" is some characteristic length such as semi-major or semi-minor lengths, total length, ... or some other metric.

@gavinmacaulay
Copy link
Collaborator

The Gonzalez et al (2016) implementation of the PSMS (done in Julia) achieved good results up to 1.8 MHz with the Jech et al parameters, so there is hope! Another promising result from that paper was that they successfully ran their model with a gas interior, something that didn't work with the PSMS implementation used in the Jech at al paper.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants