def bessel_k(self, o, nup, fp): nu, f = o.ufl_operands if not (nup is None or isinstance(nup, Zero)): error("Differentiation of bessel function w.r.t. nu is not supported.") if isinstance(nu, Zero): op = -bessel_K(1, f) else: op = -0.5 * (bessel_K(nu-1, f) + bessel_K(nu+1, f)) return op * fp
def bessel_k(self, o, nup, fp): nu, f = o.ufl_operands if not (nup is None or isinstance(nup, Zero)): error("Differentiation of bessel function w.r.t. nu is not supported.") if isinstance(nu, Zero): op = -bessel_K(1, f) else: op = -0.5 * (bessel_K(nu - 1, f) + bessel_K(nu + 1, f)) return op * fp
def bessel_k(self, o, nu, x): nu, dummy = nu if not (dummy is None or isinstance(dummy, Zero)): error("Differentiation of bessel function w.r.t. nu is not supported.") f, fp = x o = self.reuse_if_possible(o, nu, f) if nu == 0: op = -bessel_K(1, f) else: op = -0.5 * (bessel_K(nu-1, f) + bessel_K(nu+1, f)) return (o, op*fp)
def bessel_k(self, o, nu, x): nu, dummy = nu if not (dummy is None or isinstance(dummy, Zero)): error( "Differentiation of bessel function w.r.t. nu is not supported." ) f, fp = x o = self.reuse_if_possible(o, nu, f) if nu == 0: op = -bessel_K(1, f) else: op = -0.5 * (bessel_K(nu - 1, f) + bessel_K(nu + 1, f)) return (o, op * fp)