Beispiel #1
0
def check_HankelTransform(s, funcanddoc, funcanddoc_, args, order, m, ng, ng0,
                          shanks_ind):
    """check if a HankelTransform gives it's analytical solution

    Parameters
    ----------
    s : float
        transform variable
    func, funcdoc: function and functions doc
        function to transform
    func_, func_doc : function and functin doc
        analytical transform of `func`
    other: see HankelTransform
    """
    (func, funcdoc) = funcanddoc
    (func_, func_doc) = funcanddoc_
    if func == hankel3:
        points = args[0] / jn_zeros(0, 70)
        atol = 1e-4
    else:
        points = None
        atol = 1e-5

    h = HankelTransform(func, args, order, m, points, ng, ng0, shanks_ind)
    assert_allclose(h(s)[0], func_(s, *args), atol=atol)
Beispiel #2
0
 def hankel(self, f, tvar, args, **opt):
     ht = HankelTransform(f, args, **opt)
     val, err = ht(tvar)
     return val, err
Beispiel #3
0
 def test_a_b_integration_limits_f_is_x(self):
     """Integrate(r*J(0, 0.5*r)*r, {r, 0.2, 2})"""
     #wolfram alpha : Integrate[BesselJ[0,x*0.5]*x^2, {x, 1.3 ,2}]
     assert_allclose(HankelTransform(self.x, order=0)(0.5, a=1.3, b=2.0)[0],
                     1.59735,
                     atol=1e-5)