Current location - Training Enrollment Network - Mathematics courses - Design of Compound Simpson Quadrature Formula (C Language)
Design of Compound Simpson Quadrature Formula (C Language)
The cumulative term of NWETON-COTES formula shows that the larger the quadrature node n is, the higher the accuracy of the corresponding quadrature formula is. However, because the numerical value of NWETON-COTES formula is unstable at n>8, the calculation accuracy cannot be improved by increasing the number of quadrature nodes. In practice, the quadrature interval [a, b] is often divided into several cells, and then the definite integral between cells is calculated by Nweton—Cotes formula with numerical stability, and finally the calculation results between all cells are added as the approximation of the original integral. The quadrature formula constructed by this method is called compound quadrature formula. The compound quadrature formula has the characteristics of simple calculation and can arbitrarily approximate the definite integral value, which is generally impossible for Nweton—Cotes formula. The commonly used compound quadrature formulas are compound trapezoid formula and compound Simpson formula.

① Compound trapezoidal formula

Take equidistant nodes xk = a+KH, h = (b-a)/n, k = 0, 1, ..., n and divide the integral interval [a, b]n equally, with [xk, xk+1] k = 0,65438+between each cell.

Quadrature formula

(15) is a formula called compound trapezoid.

Usually the right end of the symbol (15) is

It is called the t-value. because

Therefore, the cumulative term of the compound trapezoidal formula is

If | f "(x) |≤ m2, because A and B are finite numbers, if the calculation accuracy ξ is given, it is given by (16), so.

That is, as long as h satisfies (17) and n=(b-a)/h, we can use the compound quadrature formula (15) to find the approximate value of definite integral with the calculation error less than ξ.

② Compound Simpson formula

Take equidistant nodes xk = a+KH, h = (b-a)/n, k = 0, 1, ... n on [a, b] n, and use Simpson on [xk, xk+ 1] between each cell.

Where xk+ 1/2 = xk+h/2, the following compound Simpson formula is obtained:

Using the cumulative term of Simpson formula, we can get the cumulative term of compound Simpson formula, as shown below:

It can be seen from finding the cumulative term of the compound Simpson formula that the compound Simpson formula is superior to the compound trapezoidal formula, but the former has a large amount of calculation. The compound Simpson formula is also called the compound parabola formula.

Other types of compound quadrature formulas, such as compound Cotes formula, can be constructed by the above method. In fact, the compound quadrature formula is essentially obtained by replacing the integrand function f(x) with piecewise interpolation function at the quadrature node, so it is classified as an interpolation quadrature formula, such as the compound trapezoidal formula with piecewise interpolation function instead of f(x) and the compound Simpson formula with piecewise quadratic interpolation function instead of f(x).