Esempio n. 1
0
    private static void bessel_i1_test()

    //****************************************************************************80
    //
    //  Purpose:
    //
    //    BESSEL_I1_TEST tests BESSEL_I1.
    //
    //  Licensing:
    //
    //    This code is distributed under the GNU LGPL license.
    //
    //  Modified:
    //
    //    26 August 2006
    //
    //  Author:
    //
    //    John Burkardt
    //
    {
        double fx = 0;
        double x  = 0;

        Console.WriteLine("");
        Console.WriteLine("BESSEL_I1_TEST:");
        Console.WriteLine("  BESSEL_I1 evaluates the Bessel function of the");
        Console.WriteLine("  first kind and order 1;");
        Console.WriteLine("");
        Console.WriteLine("      X       Exact F       BESSEL_I1(X)");
        Console.WriteLine("");

        int n_data = 0;

        for (;;)
        {
            Bessel.bessel_i1_values(ref n_data, ref x, ref fx);

            if (n_data == 0)
            {
                break;
            }

            double fx2 = Bessel.bessel_i1(x);

            Console.WriteLine("  "
                              + x.ToString(CultureInfo.InvariantCulture).PadLeft(8) + "  "
                              + fx.ToString(CultureInfo.InvariantCulture).PadLeft(16) + "  "
                              + fx2.ToString(CultureInfo.InvariantCulture).PadLeft(16) + "");
        }
    }
Esempio n. 2
0
    public static void bessel_i1_values_test()
    //****************************************************************************80
    //
    //  Purpose:
    //
    //    BESSEL_I1_VALUES_TEST tests BESSEL_I1_VALUES.
    //
    //  Licensing:
    //
    //    This code is distributed under the GNU LGPL license.
    //
    //  Modified:
    //
    //    07 February 2007
    //
    //  Author:
    //
    //    John Burkardt
    //
    {
        double fx = 0;
        double x  = 0;

        Console.WriteLine("");
        Console.WriteLine("BESSEL_I1_VALUES_TEST:");
        Console.WriteLine("  BESSEL_I1_VALUES stores values of ");
        Console.WriteLine("  the Bessel I1 function.");
        Console.WriteLine("");
        Console.WriteLine("      X         I1(X)");
        Console.WriteLine("");
        int n_data = 0;

        for (;;)
        {
            Bessel.bessel_i1_values(ref n_data, ref x, ref fx);
            if (n_data == 0)
            {
                break;
            }

            Console.WriteLine("  "
                              + x.ToString(CultureInfo.InvariantCulture).PadLeft(12) + "  "
                              + fx.ToString(CultureInfo.InvariantCulture).PadLeft(12) + "");
        }
    }