ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 30 Numerical Integration & Differentiation
In Summary Newton-Cotes Formulas Replace a complicated function or tabulated data with an approximating function that is easy to integrate
In Summary Also by piecewise approximation
Closed/Open Forms CLOSEDOPEN
Trapezoidal Rule Linear Interpolation
Trapezoidal Rule Multiple Application
xa=x o x1x1 x2x2 …x n-1 b=x n f(x)f(x 0 )f(x 1 )f(x 2 )f(x n-1 )f(x n )
Simpson’s 1/3 Rule Quadratic Interpolation
Simpson’s 3/8 Rule Cubic Interpolation
Gauss Quadrature x1x1 x2x2
General Case Gauss Method calculates pairs of wi, xi for the Integration limits -1,1 For Other Integration Limits Use Transformation
Gauss Quadrature For x g =-1, x=a For x g =1, x=b
Gauss Quadrature
PointsWeighting Factors wi Function Arguments Error 2W0=1.0X0= F (4) ( ) W1=1.0X1= W0= X0= F (6) ( ) W1= X1=0.0 W2= X2=
Gaussian Points PointsWeighting Factors wi Function Arguments Error 4W 0 = X0= F (8) ( ) W 1 = X1= W 2 = X2= W 3 = X3=
Gaussian Quadrature Not a good method if function is not available
Fig 23.1 FORWARD FINITE DIFFERENCE
Fig 23.2 BACKWARD FINITE DIFFERENCE
Fig 23.3 CENTERED FINITE DIFFERENCE
Data with Errors