using Complex = System.Numerics.Complex; namespace IStation.Numerics { /// /// This partial implementation of the SpecialFunctions class contains all methods related to the Bessel functions. /// public static partial class SpecialFunctions { /// /// Returns the Bessel function of the first kind. /// BesselJ(n, z) is a solution to the Bessel differential equation. /// /// The order of the Bessel function. /// The value to compute the Bessel function of. /// The Bessel function of the first kind. public static Complex BesselJ(double n, Complex z) { return Amos.Cbesj(n, z); } /// /// Returns the exponentially scaled Bessel function of the first kind. /// ScaledBesselJ(n, z) is given by Exp(-Abs(z.Imaginary)) * BesselJ(n, z). /// /// The order of the Bessel function. /// The value to compute the Bessel function of. /// The exponentially scaled Bessel function of the first kind. public static Complex BesselJScaled(double n, Complex z) { return Amos.ScaledCbesj(n, z); } /// /// Returns the Bessel function of the first kind. /// BesselJ(n, z) is a solution to the Bessel differential equation. /// /// The order of the Bessel function. /// The value to compute the Bessel function of. /// The Bessel function of the first kind. public static double BesselJ(double n, double z) { return Amos.Cbesj(n, z); } /// /// Returns the exponentially scaled Bessel function of the first kind. /// ScaledBesselJ(n, z) is given by Exp(-Abs(z.Imaginary)) * BesselJ(n, z). /// /// The order of the Bessel function. /// The value to compute the Bessel function of. /// The exponentially scaled Bessel function of the first kind. public static double BesselJScaled(double n, double z) { return Amos.ScaledCbesj(n, z); } /// /// Returns the Bessel function of the second kind. /// BesselY(n, z) is a solution to the Bessel differential equation. /// /// The order of the Bessel function. /// The value to compute the Bessel function of. /// The Bessel function of the second kind. public static Complex BesselY(double n, Complex z) { return Amos.Cbesy(n, z); } /// /// Returns the exponentially scaled Bessel function of the second kind. /// ScaledBesselY(n, z) is given by Exp(-Abs(z.Imaginary)) * Y(n, z). /// /// The order of the Bessel function. /// The value to compute the Bessel function of. /// The exponentially scaled Bessel function of the second kind. public static Complex BesselYScaled(double n, Complex z) { return Amos.ScaledCbesy(n, z); } /// /// Returns the Bessel function of the second kind. /// BesselY(n, z) is a solution to the Bessel differential equation. /// /// The order of the Bessel function. /// The value to compute the Bessel function of. /// The Bessel function of the second kind. public static double BesselY(double n, double z) { return Amos.Cbesy(n, z); } /// /// Returns the exponentially scaled Bessel function of the second kind. /// ScaledBesselY(n, z) is given by Exp(-Abs(z.Imaginary)) * BesselY(n, z). /// /// The order of the Bessel function. /// The value to compute the Bessel function of. /// The exponentially scaled Bessel function of the second kind. public static double BesselYScaled(double n, double z) { return Amos.ScaledCbesy(n, z); } /// /// Returns the modified Bessel function of the first kind. /// BesselI(n, z) is a solution to the modified Bessel differential equation. /// /// The order of the modified Bessel function. /// The value to compute the modified Bessel function of. /// The modified Bessel function of the first kind. public static Complex BesselI(double n, Complex z) { return Amos.Cbesi(n, z); } /// /// Returns the exponentially scaled modified Bessel function of the first kind. /// ScaledBesselI(n, z) is given by Exp(-Abs(z.Real)) * BesselI(n, z). /// /// The order of the modified Bessel function. /// The value to compute the modified Bessel function of. /// The exponentially scaled modified Bessel function of the first kind. public static Complex BesselIScaled(double n, Complex z) { return Amos.ScaledCbesi(n, z); } /// /// Returns the modified Bessel function of the first kind. /// BesselI(n, z) is a solution to the modified Bessel differential equation. /// /// The order of the modified Bessel function. /// The value to compute the modified Bessel function of. /// The modified Bessel function of the first kind. public static double BesselI(double n, double z) { return BesselI(n, new Complex(z, 0)).Real; } /// /// Returns the exponentially scaled modified Bessel function of the first kind. /// ScaledBesselI(n, z) is given by Exp(-Abs(z.Real)) * BesselI(n, z). /// /// The order of the modified Bessel function. /// The value to compute the modified Bessel function of. /// The exponentially scaled modified Bessel function of the first kind. public static double BesselIScaled(double n, double z) { return Amos.ScaledCbesi(n, z); } /// /// Returns the modified Bessel function of the second kind. /// BesselK(n, z) is a solution to the modified Bessel differential equation. /// /// The order of the modified Bessel function. /// The value to compute the modified Bessel function of. /// The modified Bessel function of the second kind. public static Complex BesselK(double n, Complex z) { return Amos.Cbesk(n, z); } /// /// Returns the exponentially scaled modified Bessel function of the second kind. /// ScaledBesselK(n, z) is given by Exp(z) * BesselK(n, z). /// /// The order of the modified Bessel function. /// The value to compute the modified Bessel function of. /// The exponentially scaled modified Bessel function of the second kind. public static Complex BesselKScaled(double n, Complex z) { return Amos.ScaledCbesk(n, z); } /// /// Returns the modified Bessel function of the second kind. /// BesselK(n, z) is a solution to the modified Bessel differential equation. /// /// The order of the modified Bessel function. /// The value to compute the modified Bessel function of. /// The modified Bessel function of the second kind. public static double BesselK(double n, double z) { return Amos.Cbesk(n, z); } /// /// Returns the exponentially scaled modified Bessel function of the second kind. /// ScaledBesselK(n, z) is given by Exp(z) * BesselK(n, z). /// /// The order of the modified Bessel function. /// The value to compute the modified Bessel function of. /// The exponentially scaled modified Bessel function of the second kind. public static double BesselKScaled(double n, double z) { return Amos.ScaledCbesk(n, z); } } }