Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 7 Numerical Differentiation and Integration

Similar presentations


Presentation on theme: "Chapter 7 Numerical Differentiation and Integration"— Presentation transcript:

1

2 Chapter 7 Numerical Differentiation and Integration

3 INTRODUCTION DIFFERENTIATION USING DIFFERENCE OPREATORS DIFFERENTIATION USING INTERPOLATION RICHARDSON’S EXTRAPOLATION METHOD NUMERICAL INTEGRATION

4 NEWTON-COTES INTEGRATION FORMULAE
THE TRAPEZOIDAL RULE ( COMPOSITE FORM ) SIMPSON’S RULES ROMBERG’S INTEGRATION DOUBLE INTEGRATION

5 Basic Issues in Integration
What does an integral represent? = AREA = VOLUME

6 Basic definition of an integral::
= = sum of Height x Width

7 Objective: Evaluate I = without doing calculation analytically. When would we want to do this?

8 NUMERICAL INTEGRATION
Consider the definite integral

9 where f (x) is known either explicitly or is given as a table of values corresponding to some values of x, whether equispaced or not. Integration of such functions can be carried out using numerical techniques.

10 yn-1 y3 y2 y1 y0 yn xn = b xn-1 x3 x2 x1 x0 = a X O Y (x2, y2) (x1, y1) (x0, y0) y = f(x)

11 This area is approximated by the trapezium formed by replacing the curve with its secant line drawn between the end points (x0, y0) and (x1, y1).

12

13 Then, if n = 2, the integration takes the form

14 This is known as Simpson’s 1/3 rule
This is known as Simpson’s 1/3 rule. Geometrically, this equation represents the area between the curve y = f (x), the x-axis and the ordinates at x = x0 and x2 after replacing the arc of the curve between (x0, y0) and (x2, y2) by an arc of a quadratic polynomial as in the figure

15 xn = b xn-1 x3 x2 x1 x0 = a X O Y (x2, y2) (x0, y0) y2 y1 y0 y = f(x)

16 Thus Simpson’s 1/3 rule is based on fitting three points with a quadratic.
Similarly, for n = 3, the integration is found to be

17

18 This is known as Simpson’s 3/8 rule, which is based on fitting four points by a cubic. Still higher order Newton-Cotes integration formulae can be derived for large values of n.

19 But for all practical purposes,
Simpson’s 1/3 rule is found to be sufficiently accurate.

20 The Trapezoidal Rule (Composite Form) The Newton-Cotes formula is
based on approximating y = f (x) between (x0, y0) and (x1, y1)

21 by a straight line, thus forming a trapezium, is called trapezoidal rule. In order to evaluate the definite integral

22 we divide the interval [a, b] into n sub-intervals, each of size h = (b – a)/n and denote the sub-intervals by [x0, x1], [x1, x2], …, [xn-1, xn], such that x0 = a and xn = b and xk = x0 + kh, k = 1, 2, …, n – 1.

23 Thus, we can write the above definite integral as a sum. Therefore,

24 The area under the curve in each sub-interval is approximated by a trapezium. The integral I, which represents an area between the curve y = f (x), the x-axis and the ordinates at x = x0

25 and x = xn is obtained by adding all the trapezoidal areas in each sub-interval.
Now, using the trapezoidal rule into equation:

26 we get

27

28 where xk-1< ξ < xk, for k = 1, 2, …, n – 1.
Thus, we arrive at the result

29 where the error term En is given by

30 Equation represents the trapezoidal rule over [x0, xn], which is also called the composite form of the trapezoidal rule.

31 The error term given by Equation:

32 is called the global error.
However, if we assume that is continuous over [x0, xn] then there exists some ξ in [x0, xn] such that xn = x0 + nh and

33 Then the global error can be conveniently written as O(h2).

34 Simpson’s Rules (Composite Forms) In deriving equation. ,

35 the Simpson’s 1/3 rule, we have
used two sub-intervals of equal width. In order to get a composite formula, we shall divide the interval of integration [a, b] Into an even number of sub- intervals say 2N,

36 each of width (b – a)/2N, thereby we have
x0 = a, x1, …, x2N = b and xk =x0 +kh, k = 1,2, … (2N – 1). Thus, the definite integral I can be written as

37

38 Applying Simpson’s 1/3 rule as in equation

39 to each of the integrals on the right-hand side of the above equation, we obtain

40

41 That is,

42 This formula is called composite Simpson’s 1/3 rule
This formula is called composite Simpson’s 1/3 rule. The error term E, which is also called global error, is given by

43 for some ξ in [x0, x2N]. Thus, in Simpson’s 1/3 rule, the global error is of O(h2).
Similarly in deriving composite Simpson’s 3/8 rule, we divide the interval of integration into n sub-intervals, where n is divisible by 3,

44 and applying the integration
formula

45 to each of the integral given below

46 we obtain the composite form of Simpson’s 3/8 rule as

47 with the global error E given by

48 It may be noted that the global error in Simpson’s 1/3 and 3/8 rules are of the same order. However, if we consider the magnitudes of the error terms, we notice that Simpson’s 1/3 rule is superior to Simpson’s 3/8 rule. For illustration, we consider few examples.

49 Example Find the approximate value of using (i) trapezoidal rule

50 (ii) Simpson’s 1/3 rule by dividing the range of integration into six equal parts. Calculate the percentage error from its true value in both the cases.

51 Solution We shall at first divide the range of integration into six equal parts so that each part is of width and write down the table of values:

52 x y = sin x π/ π/ π/ 2π/ 5π/ π

53 Applying trapezoidal rule, we have

54 Here, h, the width of the interval is π /6. Therefore,

55 Applying Simpson’s 1/3 rule
We have

56

57 But the actual value of the integral is
Hence, in the case of trapezoidal rule

58 The percentage of error
While in the case of Simpson’s rule the percentage error is (sign ignored)

59


Download ppt "Chapter 7 Numerical Differentiation and Integration"

Similar presentations


Ads by Google