If no orientaiton angle should be computed only the mean orientation will be considered (para$orient$angm
).
If an average orientation should be computed (para$orient$ave_flag = 1
), either a Uniform (para$orient$PDF = 1
) or a Gaussian (para$orient$PDF = 2
) probability density function (PDF) can be applied.
In case of a Uniform PDF the limits are defined by minimum ($\theta_{min}=$ para$orient$ang0
) and maximum ( $\theta_{max}=$ para$orient$ang1
) orientation angles and the mean incident angle ( $\bar\theta =$ para$orient$angm
).
For a Gaussian PDF, the limits are defined as $\bar\theta \pm std(\theta)$ (para$orient$angm
$\pm$ para$orient$PDF_para
).
The angles for which the model should be computed are then optained as the sequence of values within the limits of the minimum and maximum orientation angles by the incremental step (para$orient$dang
).
Within ZooScatR the orientations are added to the misc list as misc$ang
for further use in the DWBA funciton.
First the width of the radius of the mid-point of each cylinder ($a$) is obtained through combinaiton of information on the target Length ($L$) and the ratio $\frac{L}{a}$.
The next step is to get the initial and final ka (the wavenumber ($k$, which equals the 2$\pi$ divided by the wavelength ($\lambda=c/f$ with $c$ = soundspeed [m/s] and $f$ the frequency [Hz])), multiplied by the radius): $ka = 2\pi \frac{f}{c_w}a = \frac{2\pi}{\lambda}a$ (in ZooScatR this equals k(c,f)*a
or 2*pi*a/lambda(c,f)
).
If the output model variable is frequency (para$simu$var_indx=1
), the range of ka depends on the maximum (para$simu$var1
) and minimum input (para$simu$var0
) frequencies. If the output variable is angles (para$simu$var_indx=2
), only the simulation frequency will be considered (para$simu$freq
). If the output variable is ka (para$simu$var_indx=3
) the the limits of ka are directly defined through the variable start and end values (para$simu$var0
, para$simu$var1
).
In ZooScatR, ka values are stored in the misc list for further use in the DWBA simulation (misc$ka
)
Get the number of ka points ($n$): length(misc$ka
Number of integration points ($n_{int}$): para$simu$ni
Initial ka ($ka_0$): misc$ka
Incident angles ($ang$): misc$ang
Number of incident angles($m$): length(misc$ang
Incident angles in radians ($th$): ang*pi/180
----Inhomogenous body-----
If a homogenous body is assumed, density ($g$) and soundspeed ($h$) contrasts are directly read from the parameters and stored as a matrix with dimensions [$n_{int}$ rows x 1 column] (g = para$phy$g0 * matrix(1, n_int, g); h = para$phy$h0 * matrix(1, n_int, h)
).
In a next step the DWBA material properties term $C_b = \gamma_k - \gamma_{\rho} = \frac{1-gh^2}{gh^2} - \frac{g-1}{g}$ is computed (Cb = (1-g*h*h)/(g*h*h) - (g-1) / g
)
Position vectors are computed using the buildpos
function.
The buildpos function returns a list containing $r_{pos}$,$th_{tilt}$, $dr$, $\gamma_t$, $taper$, $x$, $z$ and a plot of the shape.
Arbitrary shapes can be read from profile files. Profile files must contain at least 3 columns, containing the x and z coordinates as well as the tapering.
If a profile file is loaded, a small offset for the interpolation is defined (eps=2^-52
).
The coordinates are read from a file (pos
) as: xp = pos[,1]; zp = pos[,2]; taper1 = pos[,3]
and then the coordinates are calculated for the requested number of integration points ($n_{int}$).
For $z$ the sequence with length $n_{int}$ between the minimum and maximum points $zp$ are computed (z = seq(min(zp) + eps, max(zp)-eps, length=n_int)
). Coordinate points $x$ and $tapering$ are opbtained through one-dimensional linear interpolation between the points $zp$ and $xp$ or $taper$ at points $z$ (approx(zp,xp,z, method="linear")
; approx(zp,taper1,z, method="linear")
).
Then the difference from the means are computed (x = x-mean(x); z=z-mean(z)
).
The 2D-distance between the points is computed through $d_r =\sqrt{(x_n-x_{n+1})^2+(y_n+y_{n+1})^2}$ (dr=sqrt(diff(x)^2 + diff(z)^2)
)
The length equals $L=\sum{dr}$ (sum(dr)
)
Coordinates $x$ and $z$ are normalised by length $x=\frac{2x}{L}$ and $z=\frac{2z}{L}$
If no shape profile is provided, a uniformly bent regularly tapered cylinder will be generated based on the input parameters length ($L$), tapering order ($order$) and the ratio of the radius of curvature vs length $\frac{\rho}{L}$. To construct the coordinates, $\gamma$ is defined as $\frac{0.5}{\frac{\rho}{L}}$ and $ratio = 2\frac{\rho}{L}$
A smoother (smoother(yi,n)
) function is applied to the tapering. The smoother function is a simple symmetrical moving average, where the smoother factor $n$ will be set to the length $nl$ of the input values $yi$ if it is bigger than $nl$. The symmetrical moving average window size is set to $m=floor(\frac{n}{2})$.
$$y_{i;m+1:nl-m} = \overline{yi_{(i-m):(i+m)}}$$
For the $m$ first values a standard moving average would not be defined and is computed as $y_{i; 1:m}=\overline{yi_{(1:i+m)}}$ and for the values at positiosn $nl - m +1$ to $nl$ as $y_{i; nl-m+1:nl}=\overline{yi_{((i-m):min((i+m);nl))}}$
Independent of the shape, the positional vector $r_{pos}$ is computed as $\sqrt{x^2+z^2}$ and $\gamma_t=atan2(z,x)$ the inverse tangent in radians.
The directional vectors $dx$ and $dz$ are defined as $dx = (x_n-x_{n+1}) +eps$ and $dz=z_n-z_{n+1}$.
The backscattering amplifude $f$ relates to the output variable in the following way, where $y = |f|$ :
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.