hankel

Class summary

HankelTransform(func[, args, order, m, ...]) Hankel transform of integer order

Function summary

scratch()
vhankel_transform(f, r[, args, order, m, ...]) Hankel transform of f(r)

Module listing

Hankel transforms.

class geotecha.mathematics.hankel.HankelTransform(func, args=(), order=0, m=20, points=None, ng=10, ng0=20, shanks_ind=None)[source]

Bases: object

Hankel transform of integer order

Applies Gauss-Kronrod quadrature between zeros of the integrand. Then uses shanks extrapolation.

Parameters:

func : function or method

Function to apply hankel trasnform to. func is called with func(r, *args). func should be vectorised in r.

args : tuple, optional

Arguments to pass to f. Default args=().

order : integer, optional

Order of Hankel transform. Default order=0.

m : int, optional

Number of segments to break the integration interval into. Each segment will be between the zeros of the bessel function or order= `order’ divide by r Default ,=20.

points : list/array of float, optional

Points in addition to those defined by m at which to split the integral. Use this if f itself oscillates or there are discontinuities. Points will only be included that are less than the m zeros mentined above. Default points=None i.e. no extra points. Basically the function is never evaluated at any ofthe points, rather they form the boundary four gauss quadrature.

ng : [7,10,15,20,25,30], optional

Number of gauss points to use in integration after first zero. Default ng=10. Number of Kronrod points will automatically by 2 * ng + 1.

ng0 : [7,10,15,20,25,30], optional

Number of gauss points to use in integrating between 0 and first zero. Default ng0=20.

shanks_ind : int, optional

Start position of intervals (not including the first interval) from which to begin shanks transformation. Default shanks_ind=None i.e. no extrapolation. The first interval will never be included. Be careful when using shanks extrapolation; make sure you only begin to use it after the intgrand is well behaved. Use the plot_integrand method to check your integrand.

Returns:

f : float

Value of transform at r.

Notes

The Hankel Transform of order \(\nu\) is given by:

\[F_\nu(s)=\mathcal{H}_\nu\{f(r)\} = \int_0^{\infty}rf(r)J_\nu(sr)\,\mathrm{d}r\]

Provided \(\nu\gt1/2\) the inverse hankel transform is the same as the normal transform:

\[f(r)=\mathcal{H}_{\nu}^{-1}\{F_{\nu}(s)\} = \int_0^{\infty}sF_\nu(s)J_\nu(sr)\,\mathrm{d}s\]

References

[R103]Piessens, Robert. 2000. ‘Chapter 9 The Hankel Transform’. In The Transforms and Applications Handbook, edited by Alexander D. Poularikas, 2nd edition. Boca Raton, USA: CRC Press.

Methods

__call__(s[, a, b]) transform f(r, *args) at s
plot_integrand(s[, npts]) Plot the integrand
zeros_of_jn() Roots of Jn for determining integration intervals (0 prepended)
plot_integrand(s, npts=1000)[source]

Plot the integrand

Parameters:

s : float

Transform variable, i.e. point to evaluate transform at

npts : int, optional

Number of points to plot. Default npts=1000.

Returns:

fig : matplotlib.Figure

Use plt.show to plot

Notes

Use this to check if your parameters are appropriate.

zeros_of_jn()[source]

Roots of Jn for determining integration intervals (0 prepended)

geotecha.mathematics.hankel.scratch()[source]
geotecha.mathematics.hankel.vhankel_transform(f, r, args=(), order=0, m=20, ng=20, shanks_ind=None)[source]

Hankel transform of f(r)

This is a vectorised Hankel transform

Parameters:

f : function or method

Function to apply hankel trasnform to. f is called with f(s, *args).

r : 1d array

Coordinate(s) to evaluate transform at.

args : tuple, optional

Arguments to pass to f, default args=().

order : integer, optional

Order of hankel transform. Default order=0.

m : int, optional

Number of segments to break the integration interval into. Each segment will be between the zeros of the bessel function. Default m=20.

ng : [2-20, 32, 64, 100], optional

Number of gauss points to use in integration. Default ng=20.

shanks_ind : int, optional

Start position of intervals to start shanks extrapolation. Default shanks_ind=None i.e. no extrapolation. Be careful when using shanks extrapolation; make sure you only begin to use it after the intgrand is well behaved.

Returns:

f : 1d array of float

Value of transform at r.

See also

HankelTransform
Non vectorised Hankel transform.

Notes

The Hankel Transform of order \(\nu\) is given by:

\[F_\nu(s)=\mathcal{H}_\nu\{f(r)\} = \int_0^{\infty}rf(r)J_\nu(sr)\,\mathrm{d}r\]

Provided \(\nu\gt1/2\) the inverse hankel transform is the same as the normal transform:

\[f(r)=\mathcal{H}_{\nu}^{-1}\{F_{\nu}(s)\} = \int_0^{\infty}sF_\nu(s)J_\nu(sr)\,\mathrm{d}s\]

Note that because this implementation does not allow for input of extra point to break up the integration inteval, there is no way to account for singularities and other oscillations. If you need this control then see the HankelTransform class which is not vectorized but provides a few more options.

References

[R104]Piessens, Robert. 2000. ‘Chapter 9 The Hankel Transform’. In The Transforms and Applications Handbook, edited by Alexander D. Poularikas, 2nd edition. Boca Raton, USA: CRC Press.