/// <summary> /// Modified Bessel function of the first kind, I(v, z). /// <p/> /// If expScaled is true, returns Exp(-Abs(x)) * I(v, z) where x = z.Real. /// </summary> /// <param name="v">The order of the Bessel function</param> /// <param name="z">The value to compute the Bessel function of.</param> /// <param name="expScaled">If true, returns exponentially-scaled Bessel function</param> /// <returns></returns> public static double BesselI(double v, double z, bool expScaled = false) { if (expScaled) { return(Amos.ScaledCbesi(v, z)); } else { return(BesselI(v, new Complex(z, 0), expScaled).Real); } }
/// <summary> /// Returns the exponentially scaled modified Bessel function of the first kind. /// <para>ScaledBesselI(n, z) is given by Exp(-Abs(z.Real)) * BesselI(n, z).</para> /// </summary> /// <param name="n">The order of the modified Bessel function.</param> /// <param name="z">The value to compute the modified Bessel function of.</param> /// <returns>The exponentially scaled modified Bessel function of the first kind.</returns> public static double BesselIScaled(double n, double z) { return(Amos.ScaledCbesi(n, z)); }
/// <summary> /// Returns the exponentially scaled modified Bessel function of the first kind. /// <para>ScaledBesselI(n, z) is given by Exp(-Abs(z.Real)) * BesselI(n, z).</para> /// </summary> /// <param name="n">The order of the modified Bessel function.</param> /// <param name="z">The value to compute the modified Bessel function of.</param> /// <returns>The exponentially scaled modified Bessel function of the first kind.</returns> public static Complex BesselIScaled(double n, Complex z) { return(Amos.ScaledCbesi(n, z)); }
/// <summary> /// Modified Bessel function of the first kind, I(v, z). /// <p/> /// If expScaled is true, returns Exp(-Abs(x)) * I(v, z) where x = z.Real. /// </summary> /// <param name="v">The order of the Bessel function</param> /// <param name="z">The value to compute the Bessel function of.</param> /// <param name="expScaled">If true, returns exponentially-scaled Bessel function</param> /// <returns></returns> public static Complex BesselI(double v, Complex z, bool expScaled = false) { return((expScaled) ? Amos.ScaledCbesi(v, z) : Amos.Cbesi(v, z)); }