sfstoolbox / sfs-matlab

SFS Toolbox for Matlab/Octave
https://sfs-matlab.readthedocs.io
MIT License
97 stars 39 forks source link

Correct g0 for 2.5D WFS point source and focussed source #124

Closed hagenw closed 7 years ago

hagenw commented 7 years ago

Looking at the definition of g0 for a point source using a reference point and using a reference line and comparing those to the definitions provided in Start (1997) eq. (3.16) or Verheijen (1997) eq. (A.14) there seems to be a mismatched in the sign:

\sqrt(\frac{\xref}{\xref-\xs})

vs.

\sqrt(\frac{\xref}{\xref+\xs})

This pull request changes our implementation to be in line with the documentation at http://sfstoolbox.org, which is in line with Schultz (2016).

@fs446 could you please have a look, if this pull request is the correct implementation or if the implementation before was correct, but not the documentation?

fietew commented 7 years ago

@hagenw: Please use the test function test_wfs_25d in order to check, if the changed driving functions produce correct amplitudes. I feel, that the driving functions are not correct anymore. The variables in the code do not necessarily represent the variables of the formulas. An example: For the WFS 2.5D driving function for a point source (reference line):

% Distance ref-line to linear ssd
dref = vector_product(xref-x0,nx0,2);
% Distance source and linear ssd
ds = vector_product(xs-x0,nx0,2);

ds has a sign and is not an absolute value. It is always negative, if the source is "behind" the array (general case for a non-focussed point source). Hence dref - ds makes sense and is correct. If you want to change it to dref + ds then you also have to change definition of ds.

The correction factor for focussed sources is not the same as for point sources. The minus sign is correct here imho.

hagenw commented 7 years ago

As @fietew pointed out, these changes were wrong.

fs446 commented 7 years ago

This gain factor occurs for virtual point source and the parallel reference line. The mismatch/confusion is due to different definitions and conventions of the used coordinates. Both are correct under the following assumption/setups:

\sqrt(\frac{\xref}{\xref-\xs})

is correct for a SSD on y-axis (or z-axis), a virtual spherical monopole in xy-plane (or xz-plane) for \xs<0 and a reference line at xref>0. Here, \xs and \xref are handled as coordinate system values w.r.t. the x dimension. See the stuff that led to eq. (2.140) in Schultz (2016). In Start (1997) is a sign typo w.r.t. this derivation, compare eq. (3.14) and Schultz (2016) eq. (2.139).

\sqrt(\frac{\xref}{\xref+\xs})

is the correct version, when \xs and \xref are handled as the shortest possible distances! from the virtual point source to the SSD and the reference line to the SSD resp., cf. Fig. 2.3 in Schultz (2016). This factor is useful when the driving function should be given in in general vector notation, cf. eq. (2.131) in Schultz (2016). Eq. (3.16) in Start (1997) is essentially the same conclusion. This version is used in the SFS tollbox docu at the moment, right?

On 21 Dec 2016, at 3:30 PM, Hagen Wierstorf notifications@github.com wrote:

Looking at the definition of g0 for a point source using a reference point and using a reference line and comparing those to the definitions provided in Start (1997) eq. (3.16) or Verheijen (1997) eq. (A.14) there seems to be a mismatched in the sign:

\sqrt(\frac{\xref}{\xref-\xs}) vs.

\sqrt(\frac{\xref}{\xref+\xs}) This pull request changes our implementation to be in line with the documentation at http://sfstoolbox.org, which is in line with Schultz (2016).

@fs446 could you please have a look, if this pull request is the correct implementation or if the implementation before was correct, but not the documentation?

You can view, comment on, or merge this pull request online at:

https://github.com/sfstoolbox/sfs-matlab/pull/124

Commit Summary

• Correct g0 for 2.5D WFS point source with reference line • Remove citation for g0 2.5D WFS point source default • Correct g0 for 2.5D WFS focussed source with reference point • Correct g0 for 2.5D WFS focussed source with reference line File Changes

• M SFS_monochromatic/driving_functions_mono/driving_function_mono_wfs_fs.m (18) • M SFS_monochromatic/driving_functions_mono/driving_function_mono_wfs_ps.m (8) • M SFS_time_domain/driving_functions_imp/driving_function_imp_wfs_fs.m (18) • M SFS_time_domain/driving_functions_imp/driving_function_imp_wfs_ps.m (8) Patch Links:

https://github.com/sfstoolbox/sfs-matlab/pull/124.patchhttps://github.com/sfstoolbox/sfs-matlab/pull/124.diff — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

hagenw commented 7 years ago

Yes, we use the shortest possible distance definition: http://sfstoolbox.org/en/latest/#equation-D.wfs.ps.2.5D.refline