To compute the following Gaussian integral using the Gauss-Chebyshev method:
The delegate function is simply (1 - x2)2, since the weighting function
w(x) = 1 / √1 - x2 for
the Gauss-Chebyshev integration.
Running this example creates the results shown above. The exact result of this integral is equal to 3π / 8. The result for
n = 2 already gives the exact result, which is expected because the function (1 - x2)2
is a polynomial of degree four, meaning the Gauss-Chebyshev integration is exact with three nodes.
Testing the Gauss-Chebyshev Integration Method
In order to test the Gauss-Hermite method as defined above, a new TestGaussHermite()
static method has been added and executed. Supporting code and methods are not shown.
►
|
static void TestGaussChebyshev();
{
ListBox1.Items.Clear();
ListBox2.Items.Clear();
double result;
for (int n = 1; n < t1; n++)
(
result = Integration.GaussChebyshev(f5, n);
ListBox1.Items.Add(" " + n + );
ListBox2.Items.Add(" " + result);
)
}
|
|