Смекни!
smekni.com

Interpolation, approximation and differential equations solvers (стр. 2 из 4)

In order to determine the best interpolation method for the current case should be constructed the table of deviation between interpolation results and root mean square, if number of interpolations methods increases then value of RMS become closer to the true value.

Linear interpolation Least squares interpolation Lagrange polynomial Cubic spline
Interpolation, approximation and differential equations solvers
Interpolation, approximation and differential equations solvers
Interpolation, approximation and differential equations solvers
Interpolation, approximation and differential equations solvers
Interpolation, approximation and differential equations solvers
Interpolation, approximation and differential equations solvers
Interpolation, approximation and differential equations solvers
Interpolation, approximation and differential equations solvers
Interpolation, approximation and differential equations solvers
Interpolation, approximation and differential equations solvers
Interpolation, approximation and differential equations solvers
Interpolation, approximation and differential equations solvers
Interpolation, approximation and differential equations solvers
Interpolation, approximation and differential equations solvers
Interpolation, approximation and differential equations solvers
Average deviation from the RMS
Interpolation, approximation and differential equations solvers
Interpolation, approximation and differential equations solvers
Interpolation, approximation and differential equations solvers
Interpolation, approximation and differential equations solvers

Table 2. Table of Average deviation between average deviation and interpolation results.

One can see that cubic spline interpolation gives the best results among discussed methods, but it should be noted that sometimes cubic spline gives wrong interpolation, especially near the sudden function change. Also good interpolation results are provided by Linear interpolation method, but actually this method gives average values on each segment between values on it boundaries.

Problem 2

2.1 Problem definition

For the above mentioned data set, if you are asked to give the integration of

Interpolation, approximation and differential equations solvers between two ends
Interpolation, approximation and differential equations solvers and
Interpolation, approximation and differential equations solvers? Please discuss the possibility accuracies of all the numerical integration formulas you have learned in this semester.

2.2 Problem solution

In numerical analysis, numerical integration constitutes a broad family of algorithms for calculating the numerical value of a definite integral.

There are several reasons for carrying out numerical integration. The integrand

Interpolation, approximation and differential equations solvers may be known only at certain points, such as obtained by sampling. Some embedded systems and other computer applications may need numerical integration for this reason.

A formula for the integrand may be known, but it may be difficult or impossible to find an antiderivative which is an elementary function. An example of such an integrand is

Interpolation, approximation and differential equations solvers, the antiderivative of which cannot be written in elementary form.

It may be possible to find an antiderivative symbolically, but it may be easier to compute a numerical approximation than to compute the antiderivative. That may be the case if the antiderivative is given as an infinite series or product, or if its evaluation requires a special function which is not available.

The following methods were described in this semester:

· Rectangular method

· Trapezoidal rule

· Simpson's rule

· Gauss-Legendre method

· Gauss-Chebyshev method

2.2.1 Rectangular method

The most straightforward way to approximate the area under a curve is to divide up the interval along the x-axis between

Interpolation, approximation and differential equations solvers and
Interpolation, approximation and differential equations solvers into a number of smaller intervals, each of the same length. For example, if we divide the interval into
Interpolation, approximation and differential equations solvers subintervals, then the width of each one will be given by:

Interpolation, approximation and differential equations solvers

The approximate area under the curve is then simply the sum of the areas of all the rectangles formed by our subintervals:

Interpolation, approximation and differential equations solvers

The summary approximation error for

Interpolation, approximation and differential equations solvers intervals with width
Interpolation, approximation and differential equations solvers is less than or equal to

Interpolation, approximation and differential equations solvers

Thus it is impossible to calculate maximum of the derivative function, we can estimate integration error like value:

Interpolation, approximation and differential equations solvers

2.2.2 Trapezoidal rule

Trapezoidal rule is a way to approximately calculate the definite integral. The trapezium rule works by approximating the region under the graph of the function

Interpolation, approximation and differential equations solvers by a trapezium and calculating its area. It follows that

Interpolation, approximation and differential equations solvers

To calculate this integral more accurately, one first splits the interval of integration

Interpolation, approximation and differential equations solvers into n smaller subintervals, and then applies the trapezium rule on each of them. One obtains the composite trapezium rule:

Interpolation, approximation and differential equations solvers

The summary approximation error for

Interpolation, approximation and differential equations solvers intervals with width
Interpolation, approximation and differential equations solvers is less than or equal to:

Interpolation, approximation and differential equations solvers

2.2.3 Simpson's rule

Simpson's rule is a method for numerical integration, the numerical approximation of definite integrals. Specifically, it is the following approximation:

Interpolation, approximation and differential equations solvers

If the interval of integration

Interpolation, approximation and differential equations solvers is in some sense "small", then Simpson's rule will provide an adequate approximation to the exact integral. By small, what we really mean is that the function being integrated is relatively smooth over the interval
Interpolation, approximation and differential equations solvers. For such a function, a smooth quadratic interpolant like the one used in Simpson's rule will give good results.

However, it is often the case that the function we are trying to integrate is not smooth over the interval. Typically, this means that either the function is highly oscillatory, or it lacks derivatives at certain points. In these cases, Simpson's rule may give very poor results. One common way of handling this problem is by breaking up the interval

Interpolation, approximation and differential equations solvers into a number of small subintervals. Simpson's rule is then applied to each subinterval, with the results being summed to produce an approximation for the integral over the entire interval. This sort of approach is termed the composite Simpson's rule.

Suppose that the interval

Interpolation, approximation and differential equations solvers is split up in
Interpolation, approximation and differential equations solvers subintervals, with n an even number. Then, the composite Simpson's rule is given by

Interpolation, approximation and differential equations solvers

The error committed by the composite Simpson's rule is bounded (in absolute value) by

Interpolation, approximation and differential equations solvers

2.2.4 Gauss-Legendre method and Gauss-Chebyshev method

Since function values are given in fixed points then just two points Gauss-Legendre method can be applied. If

Interpolation, approximation and differential equations solversis continuous on
Interpolation, approximation and differential equations solvers, then

Interpolation, approximation and differential equations solvers

The Gauss-Legendre rule

Interpolation, approximation and differential equations solversG2( f ) has degree of precision
Interpolation, approximation and differential equations solvers. If
Interpolation, approximation and differential equations solvers, then

Interpolation, approximation and differential equations solvers,

where

Interpolation, approximation and differential equations solvers