Presentation is loading. Please wait.

Presentation is loading. Please wait.

Numerical Integration Pertemuan 7 Matakuliah: S0262-Analisis Numerik Tahun: 2010.

Similar presentations


Presentation on theme: "Numerical Integration Pertemuan 7 Matakuliah: S0262-Analisis Numerik Tahun: 2010."— Presentation transcript:

1

2 Numerical Integration Pertemuan 7 Matakuliah: S0262-Analisis Numerik Tahun: 2010

3 Material Outline Numerical Integration –Trapezoidal rule –Simpson method

4 4  NUMERICAL INTEGRATION To integrate a function with respect to certain variable in certain interval to yield a numerical value In which:

5 5  NUMERICAL INTEGRATION  Numerical Integration is very important to engineers and scientists. This is because many real life problems contain complicated functions that the analytical solution is not available or extremely hard to be solved.  For such case, the numerical integration seems the only option to find the approximation.  In the following slides, 2 methods will be discussed

6 6  Trapezoidal Rule  The simplest method of all.  In this method, the interval [a-b] in which the numerical integration will be sought is divided into several sub- intervals with the length=h  h= (b-a)/n, n= the number of the sub intervals.  If all sub-intervals is end points marked with a, x 1, x 2, x 3, …, x n-1, b, then the the values of the fuction (integran) f for each point can be written as: f(a), f(x 1 ), f(x 2 ), f(x 3 ),…, f(x n- 1 ), f(b).  The approximation of the Integral J by the Trapezoidal Rule can be written as :

7 7 …….. Y= f(x) Y x a b x1x1 x2x2

8 8  The Error in Trapezoidal Rule: The error in Numerical Integration using Trapezoidal Rule depends on the form of the integrand. If the integrand is a linear function the error produced is zero. It can be said that the error in Trapezoidal Rule is linearly dependent with second derivative of the integrand f. In general the error can be written as: = J a -J where: J is the true value, J a is the numerical approximation of J using Trapezoidal Rule.

9 9  The Error in Trapezoidal Rule: The interval (lower and upper bounds) of the error can be written as: K M 2 s    K M 2 b In which: n= the number of the sub-interval K= (b-a) 3 /(12 n 2 ) M 2 s and M 2 b are the minimum and maximum values of the 2 nd derivative of the integrand f in interval [a-b], respectively.

10 10 Example 1:Use a trapezoidal rule to solve the following definite integral, use the number of sub- intervals  n= 10. Determine the the lower and upper boundary of the error. Solution: f(x)=0,2+25 x – 200 x 2 ; n=10  h=(b-a)/10=0,1 n012345678910 xnxn 00,10,20,30,40,50,60,70,80,91 fnfn 0,20,7-2,8-10,3-21,8-37,3-56,8-80,3-107,8-139,3-174,8 J=-54,3

11 11 Example 1: Continue  The interval of the error Solution: f(x)=0,2+25 x – 200 x 2 ; n=10  h=(b-a)/10=0,1 f”(x)=-400; K= (b-a) 3 /(12 n 2 )=1/(1200)=0,000833 M 2 s = M 2 b =-400  Error=  = -0,3333 verify this answer

12 12  SIMPSON METHOD  Simpson method is one of the methods that widely used because its simplicity and accuracy.  In this method, interval [a, b] has to be evenly divided into n sub- intervals with the length (h) of each sub-interval. The number of the sub-intervals has to be even number  n=2m (m=1,2,3,….)  h= (b-a)/2m.  As in the trapezoidal rule, we named all the end points of the sub- intervals as follow: x 0 =a, x 1, x 2, x 3, …, x n-1, x n=2m =b  In this method, the integrand is replaced by 2 nd order Lagrange polynomial: i.e., a  x  x 2 =a+2h, etc.   xo x2 f(x) dx =  xo x2 L 2 (x) dx  h(f 0 /3+4f 1 /3+f 2 /3)  f k =f(x k )

13 13  The approximation of the integral J dengan by Simpson Method is found by applying 2 nd order Lagrange polynomial in the whole interval and yield the following formula: …….. Y= f(x) Y x a b x1x1 x2x2  SIMPSON METHOD

14 14  Discrepancy (Error) in Simpson Method: Because the integrand was approximated by the 2 nd order Lagrange which is the same as parabolic function, then the integral will produce error=0 if the original integrand is in 2 nd order polynomial. Then the error interval of the following method can be written as: C M 4 s    C M 4 b where: C= (b-a) 5 /(180 n 4 ) M 4 s and M 4 b are the minimum and maximum values of the forth derivative of the integrand f in the interval [a- b].

15 15 Example 1: Use Simpson method to solve the following definite integral numerically. Use the number of the sub-intervals n= 10. Find also the interval of error. Solution: f(x)=0,2+25 x – 200 x 2 ; n=10  h=(b-a)/10=0,1 n012345678910 xnxn 00,10,20,30,40,50,60,70,80,91 fnfn 0,20,7-2,8-10,3-21,8-37,3-56,8-80,3-107,8-139,3-174,8

16 16 Example 1: Cont Solution: n012345678910 xnxn 00,10,20,30,40,50,60,70,80,91 fnfn 0,20,7-2,8-10,3-21,8-37,3-56,8-80,3-107,8-139,3-174,8 The error=0, because the integrand is a 2 nd order polynomial (verify)

17 17 Exercise: Use Simpson method to solve the following definite integral numerically. Use the number of the sub- intervals n= 6. Find also the interval of error. Solution:


Download ppt "Numerical Integration Pertemuan 7 Matakuliah: S0262-Analisis Numerik Tahun: 2010."

Similar presentations


Ads by Google