USML
|
Wavefront characteristics at a specific point in time.
The wave_queue class maintains a circular queue of wave_front objects. On each iteration, the wave_front objects computes the derivative terms needed by the wave_queue's Adams-Bashforth propagator.
where:
Note that these derivatives can be computed without any knowledge of the next or previous wavefront. Any parts of the calculation that require knowledge of next or previous wavefronts are implemented in the wave_queue class.
In this implementation, many of the intermediate terms are cached as private data members in the wave_front object to reduce the number of times that common terms need to be re-allocated in memory.
wave_front | ( | ocean_model & | ocean, |
const seq_vector * | freq, | ||
unsigned | num_de, | ||
unsigned | num_az, | ||
const wposition * | targets = NULL , |
||
const matrix< double > * | sin_theta = NULL |
||
) |
Create workspace for all properties.
Most of the real work of initialization is done after construction so that the previous, current, and next elements can each be initialized differently.
ocean | Environmental parameters. |
freq | Frequencies over which to compute loss (Hz). |
num_de | Number of D/E angles in the ray fan. |
num_az | Number of AZ angles in the ray fan. |
targets | Position of each eigenray target. Eigenrays are not computed if this reference is NULL. |
sin_theta | Reference to sin(theta) for each target. Used to speed up compute_target_distance() calc. Not used if eigenrays are not being computed. |
|
private |
Compute the sound_speed, sound_gradient, and attenuation elements of the ocean profile.
Compute terms in the sound speed profile as fast as possible.
It also clears the phase of the wavefront. Later, the reflection_model will incorporate reflection effects and wave_queue::step() will convert them into an accumulated attenuation and phase.
|
private |
Compute a fast approximation of the distance squared from each target to each point on the wavefront.
The speed-up process uses the fact that the haversine distance formula can be replace sin(x/2)^2 with (x/2)^2 when the latitude and longitude differences between points is small.
distance^2 = r1*r1 + r2*r2 - 2*r1*r2 * { 1-2*( sin^2[(t1-t2)/2] + sin(t1)sin(t2)sin^2[(p1-p2)/2] ) }
distance^2 = r1*r1 + r2*r2 - 2*r1*r2 * { 1-2*( [(t1-t2)/2]^2 + sin(t1)sin(t2)[(p1-p2)/2]^2 ) }
It also uses the fact that sin(x) is precomputed for each target and each point of the wavefront in an eariler step of the update() function. This approach allows us to approximation distances in spherical coordinates without the use of any transindental function.
void find_edges | ( | ) |
Find all edges and caustics in the ray fan.
Sets on_edge(de,az) to true if it is on the edge of the ray fan or one of its neighbors has a different surface, bottom, or caustic count.
void init_wave | ( | const wposition1 & | pos, |
const seq_vector & | de, | ||
const seq_vector & | az | ||
) |
Initialize position and direction components of the wavefront.
Computes normalized directions from depression/elevation and azimuthal angles. Each row in the output corresponds to a new depression/elevation angle and and each column represents a new azimuth. Used during wave_queue class initialization.
pos | Initial location in spherical earth coordinates. |
de | Initial depression/elevation angles at the source location (degrees, positive is up). |
az | Initial azimuthal angles at the source location (degrees, clockwise from true north). |
|
inline |
Number of AZ angles in the ray fan.
|
inline |
Number of D/E angles in the ray fan.
void update | ( | ) |
Update wave element properties based on the current position and direction vectors.
For each point on the wavefront, it computes ocean profile parameters, Adams-Bashforth derivatives, and the distance to each eigenray target.
|
private |
Square of the speed of sound divided by rho (cached intermediate term).
|
private |
Cotangent of colatitude (cached intermediate term).
|
private |
Sound speed gradient divided by sound speed (cached intermediate term).
|
private |
Frequencies over which to compute propagation effects (Hz).
Reference to data managed by wave_queue class.
|
private |
Environmental parameters.
Reference to data managed by wave_queue class.
|
private |
Sine of colatitude (cached intermediate term).
|
private |
Sin of colatitude for targets (cached intermediate term).
Reference to data managed by proploss class. Not used if eigenrays are not being computed.
matrix< vector< double > > attenuation |
Non-spreading component of propagation loss in dB.
Stores the cumulative result of interface reflection losses and losses that result from the attenuation of sound in sea water.
matrix<int> bottom |
Cumulative # of bottom reflections encountered at this point in time.
matrix<int> caustic |
Cumulative # of caustics encountered at this point in time.
A caustic is defined as a place on the wavefront where a ray is tangent to the boundary of a shadow zone. The wave_queue::find_edges() function updates this field whenever the closest ray to a edge in the wavefront crosses one of its neighbors without changing the number of bounces. Note that this model also subtracts a PI/2 phase shift from the next ray if caustic detected.
matrix<double> distance |
Distance from old location to this location.
Used by wave_front::compute_profile() to compute the attenuation of sound in sea water for each position change in the wavefront.
matrix< matrix<double> > distance2 |
Distance squared from each target to each point on the wavefront.
Not used if targets attribute is NULL.
wvector ndir_gradient |
First derivative of normalized direction with respect to time.
Used by the Adams-Bashforth algorithm to compute the next direction.
wvector ndirection |
Normalized propagation direction of each point on the wavefront in spherical earth coordinates.
Equal to the true propagation direction divided by the speed of sound. Also equal to the wavenumber vector divided by the angular frequency of the sound.
matrix<bool> on_edge |
Mark places where the wavefront changes the surface, bottom, or caustics.
matrix< vector< double > > phase |
Non-spreading component of phase change in radians.
Stores the cumulative result of the phase changes from interface reflections and caustics.
wposition pos_gradient |
First derivative of position with respect to time.
Used by the Adams-Bashforth algorithm to compute the next position.
wposition position |
Location of each point on the wavefront in spherical earth coordinates.
Updated by the propagator each time the wavefront is iterated.
wvector sound_gradient |
Sound speed gradient at each point on the wavefront.
matrix<double> sound_speed |
Speed of sound at each point on the wavefront.
matrix<int> surface |
Cumulative # of surface reflections encountered at this point in time.
const wposition* targets |
Position of each eigenray target.
Reference to data managed by proploss class. Eigenrays are not computed if this reference is NULL.