Docsity

Numerical Integration - Tools in Mechanical Engineering - Lecture Slides, Slides of Mechanical Engineering

Partial preview of the text

Download Numerical Integration - Tools in Mechanical Engineering - Lecture Slides and more Slides Mechanical Engineering in PDF only on Docsity!

Numerical Integration

  • In general, a numerical integration is the approximation

of a definite integration by a “weighted” sum of function

values at discretized points within the interval of

integration.

0

where is the weighted factor depending on the integration

schemes used, and ( ) is the function value evaluated at the

given point

b^ N a i^ i i i i i

f x dx w f x

w

f x

x

^ ^ 

Rectangular Rule

x=a (^) x=b

Approximate the integration, , that is the area under the curve by a series of rectangles as shown. The base of each of these rectangles is Dx =(b-a)/n and its height can be expressed as f(xi*) where xi* is the midpoint of each rectangle

 a^ b f^ ( ) x dx

x=x 1 * (^) x=xn*

height=f(x 1 ) height=f(xn)

1 2

1 2

( ) ( *) ( *) .. ( *)

[ ( *) ( *) .. ( *)]

b a n

n

f x dx f x x f x x f x x

x f x f x f x

 D  D  D

 D  

f(x)

x

Simpson’s Rule

Still, the more accurate integration formula can be achieved by approximating the local curve by a higher order function, such as a quadratic polynomial. This leads to the Simpson’s rule and the formula is given as:

1 2 3

2 2 2 1

( ) [ ( ) 4 ( ) 2 ( ) 4 ( ) ..

..2 ( ) 4 ( ) ( )]

b a m m

x f x dx f a f x f x f x

f x (^)  f x (^)  f b

D

It is to be noted that the total number of subdivisions has to be an even number in order for the Simpson’s formula to work properly.

Examples

3

(^2 3 4 2 4 ) 1 1

Integrate ( ) between 1 and 2.

1 1 x dx= | (2 1 ) 3. 4 4 2- Using 4 subdivisions for the numerical integration: x= 0. 4 Rectangular rule:

f x x x x

x

D 

i xi* f(xi*) 1 1.125 1. 2 1.375 2. 3 1.625 4. 4 1.875 6.

(^2 ) 1 [ (1.125) (1.375) (1.625) (1.875)] 0.25(14.9) 3.

x dx  D x ffff  