Академический Документы
Профессиональный Документы
Культура Документы
com
The derivation of the method is based on approximating the function to be integrated by a piecewise constant function 2 and integrating that function. The domain is divided into subdomains where and .
In the mid-point integration rule the function by its value at the central point
approximation is illustrated in the following graph. The summation of the area of the rectangles approximates the integral.
For the subdomain , the width is and the height is area of the rectangle approximates the integral over that subdomain: . Hence the total integral can be approximated as follows
, hence the
1 2
www.numerical-methods.com
then
The error in the midpoint rule is found to be approximately proportional to the square of , or in the limit as , using O-notation3. Example In order to demonstrate the method, let us use the mid-point integration rule to find
The exact solution4 to the integral is =1.718282 . The numerical solution to the integral will first be found using five subdomains ( ), and we will then go on to double the number of subdomains in order to illustrate the pattern in the numerical error. An Excel spreadsheet5 is available in order to automate the method. n=5 The domain [0,1] is divided into five subdomains of equal width [0,0.2], [0.2,0.4], [0.4,0.6], [0.6,0.8] and [0.8,1.0]. The mid-points are therefore 0.1, 0.3, 0.5, 0.7 and 0.9. The mi-points and function values are listed in the following table. The mid-point integration rule is equivalent to the summation of the function values in the second column of the table and multiplying the result by the subdomain width: 2.013752707 + 2.459603111) = 1.715421 .
Hence the numerical error is |1.718282-1.715421|=0.003161 (to six decimal places). n=10, 20 Using the spreadsheet with 10 subdomains the result from the method is 1.717566 and the numerical error is 0.000716. Using the spreadsheet with 20 subdomains the result from the method is 1.718103 and the numerical error is 0.000179.