hankel.hankel.get_h¶
-
hankel.hankel.
get_h
(f, nu, K=None, cls=<class 'hankel.hankel.HankelTransform'>, hstart=0.05, hdecrement=2, atol=0.001, rtol=0.001, maxiter=15, inverse=False)[source]¶ Determine the largest value of h which gives a converged solution.
Parameters: f : callable
The function to be integrated/transformed.
nu : float
Either the order of the transformation, or the number of dimensions (if cls is a
SymmetricFourierTransform
)K : float or array-like, optional
The scale(s) of the transformation. If None, assumes an integration over f(x)J_nu(x) is desired. It is recommended to use a down-sampled K for this routine for efficiency. Often a min/max is enough.
cls :
HankelTransform
subclass, optionalEither
HankelTransform
or a subclass, specifying the type of transformation to do on f.hstart : float, optional
The starting value of h.
hdecrement : float, optional
How much to divide h by on each iteration.
atol, rtol : float, optional
The tolerance parameters, passed to np.isclose, defining the stopping condition.
maxiter : int, optional
Maximum number of iterations to perform.
inverse : bool, optional
Whether to treat as an inverse transformation.
Returns: h : float
The h value at which the solution converges.
res : scalar or tuple
The value of the integral/transformation using the returned h – if a transformation, returns results at K.
N : int
The number of nodes necessary in the final calculation. While each iteration uses N=3.2/h, the returned N checks whether nodes are numerically zero above some threshold.
Notes
This function is not completely general. The function f is assumed to be reasonably smooth and non-oscillatory.