SlideShare une entreprise Scribd logo
1  sur  94
NUMERICAL DIFFERENTIATION AND INTEGRATION
ENGR 351
Numerical Methods for Engineers
Southern Illinois University Carbondale
College of Engineering
Dr. L.R. Chevalier
Dr. B.A. DeVantier
Copyright © 2003 by Lizette R. Chevalier
Permission is granted to students at Southern Illinois University at Carbondale
to make one copy of this material for use in the class ENGR 351, Numerical
Methods for Engineers. No other permission is granted.
All other rights are reserved. No part of this publication may be reproduced,
stored in a retrieval system, or transmitted, in any form or by any means,
electronic, mechanical, photocopying, recording, or otherwise, without
the prior written permission of the copyright owner.
Specific Study Objectives
• Understand the derivation of the
Newton-Cotes formulas
• Recognize that the trapezoidal and
Simpson’s 1/3 and 3/8 rules represent
the areas of 1st, 2nd, and 3rd order
polynomials
• Be able to choose the “best” among
these formulas for any particular
problem
Specific Study Objectives
• Recognize the difference between open
and closed integration formulas
• Understand the theoretical basis of
Richardson extrapolation and how it is
applied in the Romberg integration
algorithm and for numerical
differentiation
Specific Study Objectives
• Recognize why both Romberg integration and
Gauss quadrature have utility when
integrating equations (as opposed to tabular
or discrete data).
• Understand basic finite difference
approximations
• Understand the application of high-accuracy
numerical-differentiation.
• Recognize data error on the processes of
integration and differentiation.
Numerical Differentiation and
Integration
• Calculus is the mathematics of change.
• Engineers must continuously deal with
systems and processes that change, making
calculus an essential tool of our profession.
• At the heart of calculus are the related
mathematical concepts of differentiation and
integration.
Differentiation
• Dictionary definition of differentiate - “to mark
off by differences, distinguish; ..to perceive
the difference in or between”
• Mathematical definition of derivative - rate of
change of a dependent variable with respect
to an independent variable
( ) ( )
x
xfxxf
x
y ii
∆
−∆+
=
∆
∆
( ) ( )∆
∆
∆
∆
y
x
f x x f x
x
i i
=
+ −
( )f xi
( )f x xi + ∆
∆y
∆x
f(x)
x
Integration
• The inverse process of differentiation
• Dictionary definition of integrate - “to bring
together, as parts, into a whole; to unite; to
indicate the total amount”
• Mathematically, it is the total value or
summation of f(x)dx over a range of x. In fact
the integration symbol is actually a stylized
capital S intended to signify the connection
between integration and summation.
f(x)
x
( )I f x dx
a
b
= ∫
Mathematical Background
d
dx
x
d
dx
e
d
dx
x
d
dx
a
d
dx
x
d
dx
x
d
dx
x
if u and v are functions of x
d
dx
u
d
dx
uv
x
x
n
n
sin ? ?
cos ? ?
tan ? ?
ln ?
? ( ) ?
= =
= =
= =
=
= =
udv
u du
a dx
dx
x
e dx
n
bx
ax
=
=
=
=
=
∫
∫
∫
∫
∫
?
?
?
?
?
Mathematical Background
Overview
• Newton-Cotes Integration Formulas
• Trapezoidal rule
• Simpson’s Rules
• Unequal Segments
• Open Integration
• Integration of Equations
• Romberg Integration
• Gauss Quadrature
• Improper Integrals
Overview
• Numerical Differentiation
• High accuracy formulas
• Richardson’s extrapolation
• Unequal spaced data
• Uncertain data
• Applied problems
Newton-Cotes Integration
• Common numerical integration scheme
• Based on the strategy of replacing a complicated
function or tabulated data with some approximating
function that is easy to integrate
( ) ( )
( )
I f x dx f x dx
f x a a x a x
a
b
n
a
b
n n
n
= ≅
= + + +
∫ ∫
0 1 ....
Newton-Cotes Integration
• Common numerical integration scheme
• Based on the strategy of replacing a complicated
function or tabulated data with some approximating
function that is easy to integrate
( ) ( )
( )
I f x dx f x dx
f x a a x a x
a
b
n
a
b
n n
n
= ≅
= + + +
∫ ∫
0 1 .... fn(x) is an nth order
polynomial
0
1
2
3
4
5
0 5 10
x
f(x)
0
1
2
3
4
5
0 5 10
x
f(x)
The approximation of an integral by the area under
- a first order polynomial
- a second order polynomial
We can also approximated the integral by using a
series of polynomials applied piece wise.
0
1
2
3
4
5
0 5 10
x
f(x)
0
1
2
3
4
5
0 5 10
x
f(x)
The approximation of an integral by the area under
- a first order polynomial
- a second order polynomial
0
1
2
3
4
5
0 1 2 3 4 5 6 7 8 9 10
x
f(x)
An approximation of an integral by the area under
straight line segments.
0
1
2
3
4
5
0 1 2 3 4 5 6 7 8 9 10
x
f(x)
An approximation of an integral by the area under
straight line segments.
Newton-Cotes Formulas
• Closed form - data is at the beginning and
end of the limits of integration
• Open form - integration limits extend
beyond the range of data.
0
1
2
3
4
5
0 1 2 3 4 5 6 7 8 9 10
x
f(x)
0
1
2
3
4
5
0 1 2 3 4 5 6 7 8 9 10
x
f(x)
Trapezoidal Rule
• First of the Newton-Cotes closed
integration formulas
• Corresponds to the case where the
polynomial is a first order
( ) ( )
( )
I f x dx f x dx
f x a a x
a
b
a
b
n
= ≅
= +
∫ ∫ 1
0 1
( ) ( )
( )
I f x dx f x dx
f x a a x
a
b
a
b
n
= ≅
= +
∫ ∫ 1
0 1
A straight line can be represented as:
( ) ( )
( ) ( )
( )f x f a
f b f a
b a
x a1 = +
−
−
−
Trapezoidal Rule
( ) ( )
( )
( ) ( )
( )
I f x dx f x dx
f a
f b f a
b a
x a dx
a
b
a
b
a
b
= ≅
= +
−
−
−
∫ ∫
∫
1
Integrate this equation. Results in the
trape zo idalrule .
( )
( ) ( )I b a
f a f b
≅ −
+
2
Trapezoidal Rule
( ) ( ) ( )
2
bfaf
abI
+
−≅
Recall the formula for computing the area of a
trapezoid:
height x (average of the bases)
height
base
base
Trapezoidal Rule
The concept is the same but the trapezoid
is on its side.
height
base
base
widthheight
height
( ) ( ) ( )
2
bfaf
abI
+
−≅
Trapezoidal Rule
Error of the Trapezoidal Rule
( )( )E f b a
where a b
t = − −
< <
1
12
3
'' ξ
ξ
This indicates that is the function being integrated is linear, the
trapezoidal rule will be exact.
Otherwise, for section with second and higher order derivatives (that is
with curvature) error can occur.
A reasonable estimate of x is the average value of b and a
Multiple Application of the
Trapezoidal Rule
• Improve the accuracy by dividing the integration
interval into a number of smaller segments
• Apply the method to each segment
• Resulting equations are called multiple-application or
composite integration formulas
( ) ( ) ( ) ( ) ( ) ( )
I f x dx f x dx f x dx
I h
f x f x
h
f x f x
h
f x f x
x
x
x
x
x
x
n n
n
n
= + + +
≅
+
+
+
+
+
∫ ∫ ∫
−
−
( ) ( ) ( )
0
1
1
2
1
0 1 1 2 1
2 2 2


where there are n+ 1 equally spaced base points.
Multiple Application of the
Trapezoidal Rule
( ) ( ) ( ) ( ) ( ) ( )
( )
( ) ( ) ( )
I f x dx f x dx f x dx
I h
f x f x
h
f x f x
h
f x f x
I b a
f x f x f x
n
x
x
x
x
x
x
n n
i n
i
n
n
n
= + + +
≅
+
+
+
+
+
≅ −
+ +
∫ ∫ ∫
∑
−
−
=
−
( ) ( ) ( )
0
1
1
2
1
0 1 1 2 1
0
1
1
2 2 2
2
2


We can group terms to express a general form
}
}
width average height
Multiple Application of the
Trapezoidal Rule
( )
( ) ( ) ( )
I b a
f x f x f x
n
i n
i
n
≅ −
+ +
=
−
∑0
1
1
2
2
}
}width average height
The average height represents a weighted average
of the function values
Note that the interior points are given twice the weight
of the two end points
( )
E
b a
n
fa = −
−
3
2
12
''
Multiple Application of the
Trapezoidal Rule
Example
Evaluate the following integral using the trapezoidal rule
and h = 0.1
( )
( ) ( ) ( )
I b a
f x f x f x
n
i n
i
n
≅ −
+ +
=
−
∑0
1
1
2
2
I e dxx
= ∫
2
1
1 6.
h
b a
n
=
−
0
5
10
15
20
25
30
0 0.3 0.6 0.9 1.2 1.5 1.8
x
f(x)
Simpson’s 1/3 Rule
• Corresponds to the case where the
function is a second order polynomial
( ) ( )
( )
I f x dx f x dx
f x a a x a x
a
b
a
b
n
= ≅
= + +
∫ ∫ 2
0 1 2
2
Simpson’s 1/3 Rule
• Designate a and b as x0 and x2, and
estimate f2(x) as a second order
Lagrange polynomial
( ) ( )
( )( )
( )( )
( )
I f x dx f x dx
x x x x
x x x x
f x dx
a
b
a
b
x
x
= ≅
=
− −
− −
+






∫ ∫
∫
2
1 2
0 1 0 2
0
0
2
.......
Simpson’s 1/3 Rule
• After integration and algebraic
manipulation, we get the following
equations
( ) ( ) ( )[ ]
( )
( ) ( ) ( )
I
h
f x f x f x
b a
f x f x f x
≅ + +
≅ −
+ +
3
4
4
6
0 1 2
0 1 2
}
}
width average height
Error
( )( )E f b a
where a b
t = − −
< <
1
12
3
'' ξ
ξ
Single application of Trapezoidal Rule.
Single application of Simpson’s 1/3 Rule
( )( )E f b at = − −
1
2880
4 5( )
ξ
Multiple Application of Simpson’s
1/3 Rule
( )
( ) ( ) ( ) ( )
( ) ( )
I f x dx f x dx f x dx
I b a
f x f x f x f x
n
E
b a
n
f
x
x
x
x
x
x
i j n
j
n
i
n
a
n
n
= + + +
≅ −
+ + +
= −
−
∫ ∫ ∫
∑∑
−
=
−
=
−
( ) ( ) ( )
, , .., , ..
0
1
1
2
1
0
2 4 6
2
1 3 5
1
5
4
4
4 2
3
180

( )
( ) ( ) ( ) ( )
I b a
f x f x f x f x
n
i j n
j
n
i
n
≅ −
+ + +
=
−
=
−
∑∑0
2 4 6
2
1 3 5
1
4 2
3
, , .., , ..
The odd points represent the middle term for each
application. Hence carry the weight 4.
The even points are common to adjacent
applications and are counted twice.
f(x)
x
i=1 (odd)
weight of 4
i=2 (even)
weight of 2
Simpson’s 3/8 Rule
• Corresponds to the case where the
function is a third order polynomial
( ) ( )
( )
( ) ( ) ( ) ( )[ ]3210
3
3
2
210
3
33
8
3
xfxfxfxf
h
I
xaxaxaaxf
dxxfdxxfI
n
b
a
b
a
+++≅
+++=
≅= ∫∫
Integration of Unequal
Segments
• Experimental and field study data is often
unevenly spaced
• In previous equations we grouped the term
(i.e. hi) which represented segment width.
( )
( ) ( ) ( )
( ) ( ) ( ) ( ) ( ) ( )
I b a
f x f x f x
n
I h
f x f x
h
f x f x
h
f x f x
i n
i
n
n n
≅ −
+ +
≅
+
+
+
+
+
=
−
−
∑0
1
1
0 1 1 2 1
2
2
2 2 2

Integration of Unequal
Segments
• We should also consider alternately using
higher order equations if we can find data in
consecutively even segments
trapezoidal
rule
Integration of Unequal
Segments
trapezoidal
rule
1/3
rule
• We should also consider alternately using
higher order equations if we can find data in
consecutively even segments
Integration of Unequal
Segments
trapezoidal
rule
1/3
rule
3/8
rule
• We should also consider alternately using
higher order equations if we can find data in
consecutively even segments
Integration of Unequal
Segments
trapezoidal
rule
1/3
rule
3/8
rule
trapezoidal
rule
• We should also consider alternately using
higher order equations if we can find data in
consecutively even segments
Example
Integrate the following using the trapezoidal rule, Simpson’s
1/3 Rule, a multiple application of the trapezoidal rule with
n=2 and Simpson’s 3/8 Rule. Compare results with the
analytical solution.
xe dxx2
0
4
∫
0
2000
4000
6000
8000
10000
12000
14000
0 1 2 3 4
x
f(x)
Integration of Equations
• Integration of analytical as opposed to
tabular functions
• Romberg Integration
• Richardson’s Extrapolation
• Romberg Integration Algorithm
• Gauss Quadrature
• Improper Integrals
Richardson’s Extrapolation
• Use two estimates of an integral to compute a third
more accurate approximation
• The estimate and error associated with a multiple
application trapezoidal rule can be represented
generally as:
• I = I(h) + E(h)
• where I is the exact value of the integral
• I(h) is the approximation from an n-segment
application
• E(h) is the truncation error
• h is the step size (b-a)/n
Make two separate estimates using step sizes
of h1 and h2 .
I(h1) + E(h1) = I(h2) + E(h2)
Recall the error of the multiple-application of the trapezoidal
rule
E
b a
h f= −
−
12
2
''
Assume that is constant regardless of the step sizef ''
( )
( )
E h
E h
h
h
1
2
1
2
2
2
≅
( )
( )
( ) ( )
E h
E h
h
h
E h E h
h
h
1
2
1
2
2
2
1 2
1
2
2
≅
≅






Substitute into previous equation:
I(h1) + E(h1) = I(h2) + E(h2)
( )
( ) ( )
E h
I h I h
h
h
2
1 2
1
2
2
1
=
−
−






Thus we have developed an estimate of the truncation
error in terms of the integral estimates and their step
sizes. This estimate can then be substituted into:
I = I(h2) + E(h2)
to yield an improved estimate of the integral:
( ) ( ) ( )[ ]I I h
h
h
I h I h≅ +


 

 −










−2
1
2
2 2 1
1
1
( )
( ) ( )
E h
I h I h
h
h
2
1 2
1
2
2
1
=
−
−






( ) ( ) ( )[ ]I I h
h
h
I h I h≅ +


 

 −










−2
1
2
2 2 1
1
1
What is the equation for the special case
where the interval is halved?
i.e. h2 = h1 / 2
( ) ( ) ( )[ ]
( ) ( )
h
h
h
h
I I h I h I h
collecting terms
I I h I h
1
2
2
2
2 2 2 1
2 1
2
2
1
2 1
4
3
1
3


 

 = 

 

 =
≅ +
−



 −
≅ −
Example
Use Richardson’s extrapolation to evaluate:
xe dxx2
0
4
∫
0
2000
4000
6000
8000
10000
12000
14000
0 1 2 3 4
x
f(x)
( ) ( )
( ) ( )
( ) ( )
I I h I h
I I h I h
I I h I h
I
I I
m l
m l
j k
k
j k j k
k
≅ −
≅ −
≅ −
≅
−
−
−
+ − −
−
4
3
1
3
16
15
1
15
64
63
1
63
4
4 1
2 1
1
1 1 1
1,
, ,
We can continue to improve the estimate by successive
halving of the step size to yield a general formula:
k = 2; j = 1
Romberg Integration
Note:
the subscripts
m and lrefer to
m o re and le ss
accurate estimates
Gauss Quadrature
f(x)
x
f(x)
x
Extend the area
under the straight
line
Method of Undetermined
Coefficients
Recall the trapezoidal rule
( )
( ) ( )
I b a
f a f b
≅ −
+
2
This can also be expressed as
( ) ( )I c f a c f b≅ +0 1
where the c’s are constant
Before analyzing
this method,
answer this
question.
What are two
functions that
should be evaluated
exactly
by the trapezoidal
rule?
The two cases that should be evaluated exactly
by the trapezoidal rule: 1) y = constant
2) a straight line
f(x)
x
y = 1
(b-a)/2-(b-a)/2
f(x)
x
y = x
(b-a)/2
-(b-a)/2
Thus, the following equalities should hold.
( ) ( )
( )
( )
( )
( )
I c f a c f b
c c dx
c
b a
c
b a
xdx
b a
b a
b a
b a
≅ +
+ ≅
−
−




 +
−




 ≅
−
−
−
−
−
−
∫
∫
0 1
0 1
2
2
0 1
2
2
1
2 2
FOR y=1
since f(a) = f(b) =1
FOR y =x
since f(a) = x =-(b-a)/2
and
f(b) = x =(b-a)/2
Evaluating both integrals
c c b a
c
b a
c
b
0 1
0 1
2
1
2
0
+ = −
−
−
+
−
=
For y = 1
For y = x
Now we have two equations and two unknowns, c0 and c1.
Solving simultaneously, we get :
c0 = c1 = (b-a)/2
Substitute this back into:
( ) ( )I c f a c f b≅ +0 1
( )
( ) ( )
I b a
f a f b
≅ −
+
2
We get the equivalent of the trapezoidal rule.
DERIVATION OF THE TWO-POINT
GAUSS-LEGENDRE FORMULA
( ) ( )I c f x c f x≅ +0 0 1 1
Lets raise the level of sophistication by:
- considering two points between -1 and 1
- i.e. “open integration”
f(x)
x-1 x0 x1 1
Previously ,we assumed that the equation
fit the integrals of a constant and linear function.
Extend the reasoning by assuming that it also
fits the integral of a parabolic and a cubic
function.
( ) ( )
( ) ( )
( ) ( )
( ) ( )
c f x c f x dx
c f x c f x xdx
c f x c f x x dx
c f x c f x x dx
0 0 1 1
1
1
0 0 1 1
1
1
0 0 1 1
2
1
1
0 0 1 1
3
1
1
1 2
0
2 3
0
+ = =
+ = =
+ = =
+ = =
−
−
−
−
∫
∫
∫
∫
/
We now have four
equations and four
unknowns
c0 c1 x0 and x1
What equations are
you solving?
( ) ( ) ( ) ( )
( ) ( )
( ) ( )
( ) ( )
c f x c f x dx c c
c f x c f x xdx c x c x
c f x c f x x dx c x c x
c f x c f x x dx c x c x
0 0 1 1
1
1
0 1
0 0 1 1
1
1
0 0 1 1
0 0 1 1
2
1
1
0 0
2
1 1
2
0 0 1 1
3
1
1
0 0
3
1 1
3
1 2 1 1 2
0 0
2 3 2 3
0 0
+ = = + =
+ = = + =
+ = = + =
+ = = + =
−
−
−
−
∫
∫
∫
∫
`
/ /
Solve these equations simultaneously
f(xi) is either 1, xi, xi
2
or xi
3
c c
x
x
I f f
0 1
0
1
1
1
3
1
3
1
3
1
3
= =
=
−
=
≅
−




 +






This results in the following
The interesting result is that the integral can be
estimated by the simple addition of the function values
at −1
3
1
3
and
A simple change in variables can be use to translate
other limits.
Assume that the new variable xd is related to the
original variable x in a linear fashion.
x = a0 + a1xd
Let the lower limit x = a correspond to xd = -1 and the
upper limit x=b correspond to xd=1
a = a0 + a1(-1) b = a0 + a1(1)
What if we aren’t integrating from –1 to 1?
a = a0 + a1(-1) b = a0 + a1(1)
SOLVE THESE EQUATIONS
SIMULTANEOUSLY
a
b a
a
b a
0 1
2 2
=
+
=
−
( ) ( )x a a x
b a b a x
d
d
= + =
+ + −
0 1
2
substitute
( ) ( )x a a x
b a b a x
dx
b a
dx
d
d
d
= + =
+ + −
=
−
0 1
2
2
These equations are substituted for x and dx
respectively.
Let’s do an example to appreciate the theory
behind this numerical method.
Example
Estimate the following using two-point Gauss Legendre:
xe dxx2
0
4
∫
0
2000
4000
6000
8000
10000
12000
14000
0 1 2 3 4
x
f(x)
Higher-Point Formulas
( ) ( ) ( )I c f x c f x c f xn n≅ + + + − −0 0 1 1 1 1
For two point, we determined that c0 = c1= 1
For three point:
c0 = 0.556 x0=-0.775
c1= 0.889 x1=0.0
c2= 0.556 x2=0.775
Higher-Point Formulas
Your text goes on to provide additional weighting
factors (ci’s) and function arguments (xi’s)
in Table 8.5 p. 593
Numerical Differentiation
• Forward finite divided difference
• Backward finite divided difference
• Center finite divided difference
• All based on the Taylor Series
( ) ( ) ( )
( )
.........
!2
''
' 2
1 +++=+ h
xf
hxfxfxf i
iii
Forward Finite Difference
( ) ( ) ( )
( )
( )
( ) ( )
( )
( )
( ) ( ) ( ) ( )21
1
2
1
2
''
'
'
.........
!2
''
'
hOh
xf
h
xfxf
xf
hO
h
xfxf
xf
h
xf
hxfxfxf
iii
i
ii
i
i
iii
+−
−
=
+
−
=
+++=
+
+
+
Forward Divided Difference
( )
( ) ( )
( ) ( )f x
f x f x
x x
O x x
f
h
O hi
i i
i i
i i
i
' =
−
−
+ − = ++
+
+
1
1
1
∆
f(x)
x
(xi, yi)
What is derivative at this
point?
Forward Divided Difference
( )
( ) ( )
( ) ( )f x
f x f x
x x
O x x
f
h
O hi
i i
i i
i i
i
' =
−
−
+ − = ++
+
+
1
1
1
∆
f(x)
x
(xi, yi)
(x i+1,y i+1)
Determine a second point
base on Dx (h)
Forward Divided Difference
( )
( ) ( )
( ) ( )f x
f x f x
x x
O x x
f
h
O hi
i i
i i
i i
i
' =
−
−
+ − = ++
+
+
1
1
1
∆
f(x)
x
(xi, yi)
(x i+1,y i+1)
estimateHow does
this compare
to the actual
first derivative
at xi?
Forward Divided Difference
( )
( ) ( )
( ) ( )f x
f x f x
x x
O x x
f
h
O hi
i i
i i
i i
i
' =
−
−
+ − = ++
+
+
1
1
1
∆
f(x)
x
(xi, yi)
(x i+1,y i+1)
estimate
actual
( ) ( )f x
f
h
O hi
i
' = +
∆
first forward divided difference
Error is proportional to
the step size
O(h2
) error is proportional to the square of the step size
O(h3
) error is proportional to the cube of the step size
Forward Divided Difference
f(x)
x
estimate
actual
(xi,yi)
(xi-1,yi-1)
( ) ( ) ( )
( )
( ) ( ) ( )
( )
( )
( ) ( )
f x f x f x h
f x
h
f x f x f x h
f x
h
f x
f x f x
h
f
h
i i i
i
i i i
i
i
i i i
+
−
−
= + + +
= − + +
=
−
=
∇
1
2
1
2
1
2
2
'
''
!
......
'
''
!
.....
'
Backward Difference Approximation of the
First Derivative
Expand the Taylor series backwards
The error is still O(h)
Centered Difference Approximation of the
First Derivative
Subtract backward difference approximation
from forward Taylor series expansion
( ) ( ) ( )
( )
( )
( ) ( )
( ) ( ) ( )
( )
( )
( ) ( )
( )211
2
11
1
1
2
1
2
'
6
'''
'2
'
....
!2
''
'
hO
h
xfxf
xf
h
xf
hxfxfxf
xx
xfxf
xf
h
xf
hxfxfxf
ii
i
i
iii
ii
ii
i
i
iii
−
−
=
+++=
−
−
=
+++=
−+
−−
+
+
+

f(x)
x
estimate
actual
(xi,yi)
(xi-1,yi-1)
(xi+1,yi+1)
( )
( ) ( ) ( )211
2
' hO
h
xfxf
xf ii
i −
−
= −+
f(x)
x
f(x)
x
f(x)
x
f(x)
x
true derivative
forward
finite divided
difference approx.
backward
finite divided
difference approx.
centered
finite divided
difference approx.
Numerical Differentiation
• You should be familiar with the following
Tables in your text
• Table 7.1: Common Finite Difference
Formulas
• Table 7.2: Higher order finite difference
formulas
Richardson Extrapolation
• Two ways to improve derivative
estimates
¤ decrease step size
¤ use a higher order formula that employs
more points
• Third approach, based on Richardson
extrapolation, uses two derivatives
estimates to compute a third, more
accurate approximation
Richardson Extrapolation
( ) ( ) ( )[ ]
( ) ( )
( ) ( )
I I h
h
h
I h I h
Special case where h
h
I I h I h
In a similar fashion
D D h D h
≅ +


 

 −
−
=
≅ −
≅ −
2
1
2
2 2 1
2
1
2 1
2 1
1
1
2
4
3
1
3
4
3
1
3
For a centered difference
approximation with
O(h2
) the application of
this formula will yield
a new derivative estimate
of O(h4
)
Example
Given the following function, use Richardson’s
extrapolation to determine the derivative at 0.5.
f(x) = -0.1x4
- 0.15x3
- 0.5x2
- 0.25x +1.2
Note:
f(0) = 1.2
f(0.25) =1.1035
f(0.75) = 0.636
f(1) = 0.2
Derivatives of Unequally
Spaced Data
• Common in data from experiments or field studies
• Fit a second order Lagrange interpolating polynomial
to each set of three adjacent points, since this
polynomial does not require that the points be equi-
spaced
• Differentiate analytically
( ) ( )
( )( )
( )
( )( )
( )
( )( )
f x f x
x x x
x x x x
f x
x x x
x x x x
f x
x x x
x x x x
i
i i
i i i i
i
i i
i i i i
i
i i
i i i i
' =
− −
− −
+
− −
− −
+
− −
− −
−
+
− − +
− +
− +
+
−
+ + −
1
1
1 1 1
1 1
1 1
1
1
1 1 1
2 2
2
Derivative and Integral
Estimates for Data with Errors
• In addition to unequal spacing, the other
problem related to differentiating empirical data
is measurement error
• Differentiation amplifies error
• Integration tends to be more forgiving
• Primary approach for determining derivatives
of imprecise data is to use least squares
regression to fit a smooth, differentiable
function to the data
• In absence of other information, a lower order
polynomial regression is a good first choice
0
5 0
1 00
1 5 0
200
25 0
0 5 1 0 1 5
t
y
0
1 0
20
30
0 1 0
t
dy/dt
0
5 0
1 00
1 5 0
200
25 0
0 5 1 0 1 5
t
y
0
1 0
20
30
40
0 1 0
t
dy/dt
Specific Study Objectives
• Understand the derivation of the
Newton-Cotes formulas
• Recognize that the trapezoidal and
Simpson’s 1/3 and 3/8 rules represent
the areas of 1st, 2nd, and 3rd order
polynomials
• Be able to choose the “best” among
these formulas for any particular
problem
Specific Study Objectives
• Recognize the difference between open
and closed integration formulas
• Understand the theoretical basis of
Richardson extrapolation and how it is
applied in the Romberg integration
algorithm and for numerical
differentiation
Specific Study Objectives
• Recognize why both Romberg
integration and Gauss quadrature have
utility when integrating equations (as
opposed to tabular or discrete data).
• Understand the application of high-
accuracy numerical-differentiation.
• Recognize data error on the processes
of integration and differentiation.
…..end of lecture

Contenu connexe

Tendances

Partial Differential Equation - Notes
Partial Differential Equation - NotesPartial Differential Equation - Notes
Partial Differential Equation - NotesDr. Nirav Vyas
 
Gaussian Quadrature Formula
Gaussian Quadrature FormulaGaussian Quadrature Formula
Gaussian Quadrature FormulaDhaval Shukla
 
Ordinary differential equation
Ordinary differential equationOrdinary differential equation
Ordinary differential equationJUGAL BORAH
 
Multiple Choice Questions - Numerical Methods
Multiple Choice Questions - Numerical MethodsMultiple Choice Questions - Numerical Methods
Multiple Choice Questions - Numerical MethodsMeenakshisundaram N
 
Presentation on Matlab pde toolbox
Presentation on Matlab pde toolboxPresentation on Matlab pde toolbox
Presentation on Matlab pde toolboxSolaman Badsha
 
Fixed point iteration
Fixed point iterationFixed point iteration
Fixed point iterationIsaac Yowetu
 
Partial differential equations
Partial differential equationsPartial differential equations
Partial differential equationsaman1894
 
first order ode with its application
 first order ode with its application first order ode with its application
first order ode with its applicationKrishna Peshivadiya
 
introduction to differential equations
introduction to differential equationsintroduction to differential equations
introduction to differential equationsEmdadul Haque Milon
 
Presentation on Numerical Method (Trapezoidal Method)
Presentation on Numerical Method (Trapezoidal Method)Presentation on Numerical Method (Trapezoidal Method)
Presentation on Numerical Method (Trapezoidal Method)Syed Ahmed Zaki
 
Partial Differential Equations, 3 simple examples
Partial Differential Equations, 3 simple examplesPartial Differential Equations, 3 simple examples
Partial Differential Equations, 3 simple examplesEnrique Valderrama
 
numerical differentiation&integration
numerical differentiation&integrationnumerical differentiation&integration
numerical differentiation&integration8laddu8
 
Gauss Forward And Backward Central Difference Interpolation Formula
 Gauss Forward And Backward Central Difference Interpolation Formula  Gauss Forward And Backward Central Difference Interpolation Formula
Gauss Forward And Backward Central Difference Interpolation Formula Deep Dalsania
 
Numerical integration
Numerical integrationNumerical integration
Numerical integrationTarun Gehlot
 
ORDINARY DIFFERENTIAL EQUATION
ORDINARY DIFFERENTIAL EQUATION ORDINARY DIFFERENTIAL EQUATION
ORDINARY DIFFERENTIAL EQUATION LANKESH S S
 

Tendances (20)

Partial Differential Equation - Notes
Partial Differential Equation - NotesPartial Differential Equation - Notes
Partial Differential Equation - Notes
 
Gaussian Quadrature Formula
Gaussian Quadrature FormulaGaussian Quadrature Formula
Gaussian Quadrature Formula
 
Ordinary differential equation
Ordinary differential equationOrdinary differential equation
Ordinary differential equation
 
Multiple Choice Questions - Numerical Methods
Multiple Choice Questions - Numerical MethodsMultiple Choice Questions - Numerical Methods
Multiple Choice Questions - Numerical Methods
 
Bisection method
Bisection methodBisection method
Bisection method
 
Presentation on Matlab pde toolbox
Presentation on Matlab pde toolboxPresentation on Matlab pde toolbox
Presentation on Matlab pde toolbox
 
Trapezoidal rule
Trapezoidal rule Trapezoidal rule
Trapezoidal rule
 
Fixed point iteration
Fixed point iterationFixed point iteration
Fixed point iteration
 
Partial differential equations
Partial differential equationsPartial differential equations
Partial differential equations
 
first order ode with its application
 first order ode with its application first order ode with its application
first order ode with its application
 
introduction to differential equations
introduction to differential equationsintroduction to differential equations
introduction to differential equations
 
Presentation on Numerical Method (Trapezoidal Method)
Presentation on Numerical Method (Trapezoidal Method)Presentation on Numerical Method (Trapezoidal Method)
Presentation on Numerical Method (Trapezoidal Method)
 
Interpolation
InterpolationInterpolation
Interpolation
 
Partial Differential Equations, 3 simple examples
Partial Differential Equations, 3 simple examplesPartial Differential Equations, 3 simple examples
Partial Differential Equations, 3 simple examples
 
Lecture 1
Lecture 1Lecture 1
Lecture 1
 
numerical differentiation&integration
numerical differentiation&integrationnumerical differentiation&integration
numerical differentiation&integration
 
Gauss Forward And Backward Central Difference Interpolation Formula
 Gauss Forward And Backward Central Difference Interpolation Formula  Gauss Forward And Backward Central Difference Interpolation Formula
Gauss Forward And Backward Central Difference Interpolation Formula
 
newton raphson method
newton raphson methodnewton raphson method
newton raphson method
 
Numerical integration
Numerical integrationNumerical integration
Numerical integration
 
ORDINARY DIFFERENTIAL EQUATION
ORDINARY DIFFERENTIAL EQUATION ORDINARY DIFFERENTIAL EQUATION
ORDINARY DIFFERENTIAL EQUATION
 

En vedette

8.7 numerical integration
8.7 numerical integration8.7 numerical integration
8.7 numerical integrationdicosmo178
 
Gaussian Integration
Gaussian IntegrationGaussian Integration
Gaussian IntegrationReza Rahimi
 
Newton cotes integration method
Newton cotes integration  methodNewton cotes integration  method
Newton cotes integration methodshashikant pabari
 
Applied numerical methods lec11
Applied numerical methods lec11Applied numerical methods lec11
Applied numerical methods lec11Yasser Ahmed
 
09 numerical differentiation
09 numerical differentiation09 numerical differentiation
09 numerical differentiationMohammad Tawfik
 
C.v.n.m (m.e. 130990119004-06)
C.v.n.m (m.e. 130990119004-06)C.v.n.m (m.e. 130990119004-06)
C.v.n.m (m.e. 130990119004-06)parth98796
 
Multiple sagement trapezoidal rule
Multiple sagement trapezoidal ruleMultiple sagement trapezoidal rule
Multiple sagement trapezoidal ruleTanmoy Debnath
 
MAT210/Integration/Basic 2013-14
MAT210/Integration/Basic 2013-14MAT210/Integration/Basic 2013-14
MAT210/Integration/Basic 2013-14John Ham
 
25285 mws gen_int_ppt_trapcontinuous
25285 mws gen_int_ppt_trapcontinuous25285 mws gen_int_ppt_trapcontinuous
25285 mws gen_int_ppt_trapcontinuousJyoti Parange
 
Applied numerical methods lec10
Applied numerical methods lec10Applied numerical methods lec10
Applied numerical methods lec10Yasser Ahmed
 
Engineering Mathematics-IV_B.Tech_Semester-IV_Unit-V
Engineering Mathematics-IV_B.Tech_Semester-IV_Unit-VEngineering Mathematics-IV_B.Tech_Semester-IV_Unit-V
Engineering Mathematics-IV_B.Tech_Semester-IV_Unit-VRai University
 
Newton raphson
Newton raphsonNewton raphson
Newton raphsonbaxter89
 

En vedette (20)

Es272 ch6
Es272 ch6Es272 ch6
Es272 ch6
 
Romberg’s method
Romberg’s methodRomberg’s method
Romberg’s method
 
8.7 numerical integration
8.7 numerical integration8.7 numerical integration
8.7 numerical integration
 
Gaussian Integration
Gaussian IntegrationGaussian Integration
Gaussian Integration
 
Newton cotes integration method
Newton cotes integration  methodNewton cotes integration  method
Newton cotes integration method
 
03 open methods
03 open methods03 open methods
03 open methods
 
Applied numerical methods lec11
Applied numerical methods lec11Applied numerical methods lec11
Applied numerical methods lec11
 
09 numerical differentiation
09 numerical differentiation09 numerical differentiation
09 numerical differentiation
 
Romberg
RombergRomberg
Romberg
 
C.v.n.m (m.e. 130990119004-06)
C.v.n.m (m.e. 130990119004-06)C.v.n.m (m.e. 130990119004-06)
C.v.n.m (m.e. 130990119004-06)
 
Multiple sagement trapezoidal rule
Multiple sagement trapezoidal ruleMultiple sagement trapezoidal rule
Multiple sagement trapezoidal rule
 
MAT210/Integration/Basic 2013-14
MAT210/Integration/Basic 2013-14MAT210/Integration/Basic 2013-14
MAT210/Integration/Basic 2013-14
 
[4] num integration
[4] num integration[4] num integration
[4] num integration
 
25285 mws gen_int_ppt_trapcontinuous
25285 mws gen_int_ppt_trapcontinuous25285 mws gen_int_ppt_trapcontinuous
25285 mws gen_int_ppt_trapcontinuous
 
Applied numerical methods lec10
Applied numerical methods lec10Applied numerical methods lec10
Applied numerical methods lec10
 
Trapezoidal rule
Trapezoidal ruleTrapezoidal rule
Trapezoidal rule
 
Integration
IntegrationIntegration
Integration
 
Engineering Mathematics-IV_B.Tech_Semester-IV_Unit-V
Engineering Mathematics-IV_B.Tech_Semester-IV_Unit-VEngineering Mathematics-IV_B.Tech_Semester-IV_Unit-V
Engineering Mathematics-IV_B.Tech_Semester-IV_Unit-V
 
weddle's rule
weddle's ruleweddle's rule
weddle's rule
 
Newton raphson
Newton raphsonNewton raphson
Newton raphson
 

Similaire à 1519 differentiation-integration-02

Similaire à 1519 differentiation-integration-02 (20)

The integral
The integralThe integral
The integral
 
Mac2311 study guide-tcm6-49721
Mac2311 study guide-tcm6-49721Mac2311 study guide-tcm6-49721
Mac2311 study guide-tcm6-49721
 
AppsDiff3c.pdf
AppsDiff3c.pdfAppsDiff3c.pdf
AppsDiff3c.pdf
 
AP Calculus Project
AP Calculus ProjectAP Calculus Project
AP Calculus Project
 
The Fundamental theorem of calculus
The Fundamental theorem of calculus The Fundamental theorem of calculus
The Fundamental theorem of calculus
 
Unit4
Unit4Unit4
Unit4
 
Evaluating definite integrals
Evaluating definite integralsEvaluating definite integrals
Evaluating definite integrals
 
Introduction to comp.physics ch 3.pdf
Introduction to comp.physics ch 3.pdfIntroduction to comp.physics ch 3.pdf
Introduction to comp.physics ch 3.pdf
 
Limit and continuity
Limit and continuityLimit and continuity
Limit and continuity
 
MATH225Final
MATH225FinalMATH225Final
MATH225Final
 
IVR - Chapter 1 - Introduction
IVR - Chapter 1 - IntroductionIVR - Chapter 1 - Introduction
IVR - Chapter 1 - Introduction
 
Lecture co3 math21-1
Lecture co3 math21-1Lecture co3 math21-1
Lecture co3 math21-1
 
Project in Calcu
Project in CalcuProject in Calcu
Project in Calcu
 
Integral Calculus Anti Derivatives reviewer
Integral Calculus Anti Derivatives reviewerIntegral Calculus Anti Derivatives reviewer
Integral Calculus Anti Derivatives reviewer
 
1531 fourier series- integrals and trans
1531 fourier series- integrals and trans1531 fourier series- integrals and trans
1531 fourier series- integrals and trans
 
Goldie chapter 4 function
Goldie chapter 4 functionGoldie chapter 4 function
Goldie chapter 4 function
 
Note introductions of functions
Note introductions of functionsNote introductions of functions
Note introductions of functions
 
Introduction to functions
Introduction to functionsIntroduction to functions
Introduction to functions
 
Introduction to Functions
Introduction to FunctionsIntroduction to Functions
Introduction to Functions
 
Quadrature
QuadratureQuadrature
Quadrature
 

Plus de Dr Fereidoun Dejahang

27 j20 my news punch -dr f dejahang 27-01-2020
27 j20 my news punch -dr f dejahang  27-01-202027 j20 my news punch -dr f dejahang  27-01-2020
27 j20 my news punch -dr f dejahang 27-01-2020Dr Fereidoun Dejahang
 
028 fast-tracking projects &amp; cost overrun
028 fast-tracking projects &amp; cost overrun028 fast-tracking projects &amp; cost overrun
028 fast-tracking projects &amp; cost overrunDr Fereidoun Dejahang
 
026 fast react-productivity improvement
026 fast react-productivity improvement026 fast react-productivity improvement
026 fast react-productivity improvementDr Fereidoun Dejahang
 
022 b construction productivity-write
022 b construction productivity-write022 b construction productivity-write
022 b construction productivity-writeDr Fereidoun Dejahang
 
016 communication in construction sector
016 communication in construction sector016 communication in construction sector
016 communication in construction sectorDr Fereidoun Dejahang
 
014 changes-cost overrun measurement
014 changes-cost overrun measurement014 changes-cost overrun measurement
014 changes-cost overrun measurementDr Fereidoun Dejahang
 
013 changes in construction projects
013 changes in construction projects013 changes in construction projects
013 changes in construction projectsDr Fereidoun Dejahang
 

Plus de Dr Fereidoun Dejahang (20)

27 j20 my news punch -dr f dejahang 27-01-2020
27 j20 my news punch -dr f dejahang  27-01-202027 j20 my news punch -dr f dejahang  27-01-2020
27 j20 my news punch -dr f dejahang 27-01-2020
 
28 dej my news punch rev 28-12-2019
28 dej my news punch rev 28-12-201928 dej my news punch rev 28-12-2019
28 dej my news punch rev 28-12-2019
 
16 fd my news punch rev 16-12-2019
16 fd my news punch rev 16-12-201916 fd my news punch rev 16-12-2019
16 fd my news punch rev 16-12-2019
 
029 fast-tracking projects
029 fast-tracking projects029 fast-tracking projects
029 fast-tracking projects
 
028 fast-tracking projects &amp; cost overrun
028 fast-tracking projects &amp; cost overrun028 fast-tracking projects &amp; cost overrun
028 fast-tracking projects &amp; cost overrun
 
027 fast-tracked projects-materials
027 fast-tracked projects-materials027 fast-tracked projects-materials
027 fast-tracked projects-materials
 
026 fast react-productivity improvement
026 fast react-productivity improvement026 fast react-productivity improvement
026 fast react-productivity improvement
 
025 enterprise resources management
025 enterprise resources management025 enterprise resources management
025 enterprise resources management
 
022 b construction productivity-write
022 b construction productivity-write022 b construction productivity-write
022 b construction productivity-write
 
022 a construction productivity (2)
022 a construction productivity (2)022 a construction productivity (2)
022 a construction productivity (2)
 
021 construction productivity (1)
021 construction productivity (1)021 construction productivity (1)
021 construction productivity (1)
 
019 competencies-managers
019 competencies-managers019 competencies-managers
019 competencies-managers
 
018 company productivity
018 company productivity018 company productivity
018 company productivity
 
017 communication
017 communication017 communication
017 communication
 
016 communication in construction sector
016 communication in construction sector016 communication in construction sector
016 communication in construction sector
 
015 changes-process model
015 changes-process model015 changes-process model
015 changes-process model
 
014 changes-cost overrun measurement
014 changes-cost overrun measurement014 changes-cost overrun measurement
014 changes-cost overrun measurement
 
013 changes in construction projects
013 changes in construction projects013 changes in construction projects
013 changes in construction projects
 
012 bussiness planning process
012 bussiness planning process012 bussiness planning process
012 bussiness planning process
 
011 business performance management
011 business performance management011 business performance management
011 business performance management
 

Dernier

Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxHumphrey A Beña
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxCulture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxPoojaSen20
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSJoshuaGantuangco2
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptxmary850239
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Celine George
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...Nguyen Thanh Tu Collection
 
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptxAUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptxiammrhaywood
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Seán Kennedy
 
FILIPINO PSYCHology sikolohiyang pilipino
FILIPINO PSYCHology sikolohiyang pilipinoFILIPINO PSYCHology sikolohiyang pilipino
FILIPINO PSYCHology sikolohiyang pilipinojohnmickonozaleda
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parentsnavabharathschool99
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17Celine George
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)lakshayb543
 

Dernier (20)

Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptxYOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
 
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptxLEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxCulture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
 
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptxAUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...
 
FILIPINO PSYCHology sikolohiyang pilipino
FILIPINO PSYCHology sikolohiyang pilipinoFILIPINO PSYCHology sikolohiyang pilipino
FILIPINO PSYCHology sikolohiyang pilipino
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parents
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
 

1519 differentiation-integration-02

  • 1. NUMERICAL DIFFERENTIATION AND INTEGRATION ENGR 351 Numerical Methods for Engineers Southern Illinois University Carbondale College of Engineering Dr. L.R. Chevalier Dr. B.A. DeVantier
  • 2. Copyright © 2003 by Lizette R. Chevalier Permission is granted to students at Southern Illinois University at Carbondale to make one copy of this material for use in the class ENGR 351, Numerical Methods for Engineers. No other permission is granted. All other rights are reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, photocopying, recording, or otherwise, without the prior written permission of the copyright owner.
  • 3.
  • 4. Specific Study Objectives • Understand the derivation of the Newton-Cotes formulas • Recognize that the trapezoidal and Simpson’s 1/3 and 3/8 rules represent the areas of 1st, 2nd, and 3rd order polynomials • Be able to choose the “best” among these formulas for any particular problem
  • 5. Specific Study Objectives • Recognize the difference between open and closed integration formulas • Understand the theoretical basis of Richardson extrapolation and how it is applied in the Romberg integration algorithm and for numerical differentiation
  • 6. Specific Study Objectives • Recognize why both Romberg integration and Gauss quadrature have utility when integrating equations (as opposed to tabular or discrete data). • Understand basic finite difference approximations • Understand the application of high-accuracy numerical-differentiation. • Recognize data error on the processes of integration and differentiation.
  • 7. Numerical Differentiation and Integration • Calculus is the mathematics of change. • Engineers must continuously deal with systems and processes that change, making calculus an essential tool of our profession. • At the heart of calculus are the related mathematical concepts of differentiation and integration.
  • 8. Differentiation • Dictionary definition of differentiate - “to mark off by differences, distinguish; ..to perceive the difference in or between” • Mathematical definition of derivative - rate of change of a dependent variable with respect to an independent variable ( ) ( ) x xfxxf x y ii ∆ −∆+ = ∆ ∆
  • 9. ( ) ( )∆ ∆ ∆ ∆ y x f x x f x x i i = + − ( )f xi ( )f x xi + ∆ ∆y ∆x f(x) x
  • 10. Integration • The inverse process of differentiation • Dictionary definition of integrate - “to bring together, as parts, into a whole; to unite; to indicate the total amount” • Mathematically, it is the total value or summation of f(x)dx over a range of x. In fact the integration symbol is actually a stylized capital S intended to signify the connection between integration and summation.
  • 11. f(x) x ( )I f x dx a b = ∫
  • 12. Mathematical Background d dx x d dx e d dx x d dx a d dx x d dx x d dx x if u and v are functions of x d dx u d dx uv x x n n sin ? ? cos ? ? tan ? ? ln ? ? ( ) ? = = = = = = = = =
  • 13. udv u du a dx dx x e dx n bx ax = = = = = ∫ ∫ ∫ ∫ ∫ ? ? ? ? ? Mathematical Background
  • 14. Overview • Newton-Cotes Integration Formulas • Trapezoidal rule • Simpson’s Rules • Unequal Segments • Open Integration • Integration of Equations • Romberg Integration • Gauss Quadrature • Improper Integrals
  • 15. Overview • Numerical Differentiation • High accuracy formulas • Richardson’s extrapolation • Unequal spaced data • Uncertain data • Applied problems
  • 16. Newton-Cotes Integration • Common numerical integration scheme • Based on the strategy of replacing a complicated function or tabulated data with some approximating function that is easy to integrate ( ) ( ) ( ) I f x dx f x dx f x a a x a x a b n a b n n n = ≅ = + + + ∫ ∫ 0 1 ....
  • 17. Newton-Cotes Integration • Common numerical integration scheme • Based on the strategy of replacing a complicated function or tabulated data with some approximating function that is easy to integrate ( ) ( ) ( ) I f x dx f x dx f x a a x a x a b n a b n n n = ≅ = + + + ∫ ∫ 0 1 .... fn(x) is an nth order polynomial
  • 18. 0 1 2 3 4 5 0 5 10 x f(x) 0 1 2 3 4 5 0 5 10 x f(x) The approximation of an integral by the area under - a first order polynomial - a second order polynomial
  • 19. We can also approximated the integral by using a series of polynomials applied piece wise. 0 1 2 3 4 5 0 5 10 x f(x) 0 1 2 3 4 5 0 5 10 x f(x) The approximation of an integral by the area under - a first order polynomial - a second order polynomial
  • 20. 0 1 2 3 4 5 0 1 2 3 4 5 6 7 8 9 10 x f(x) An approximation of an integral by the area under straight line segments.
  • 21. 0 1 2 3 4 5 0 1 2 3 4 5 6 7 8 9 10 x f(x) An approximation of an integral by the area under straight line segments.
  • 22. Newton-Cotes Formulas • Closed form - data is at the beginning and end of the limits of integration • Open form - integration limits extend beyond the range of data. 0 1 2 3 4 5 0 1 2 3 4 5 6 7 8 9 10 x f(x) 0 1 2 3 4 5 0 1 2 3 4 5 6 7 8 9 10 x f(x)
  • 23. Trapezoidal Rule • First of the Newton-Cotes closed integration formulas • Corresponds to the case where the polynomial is a first order ( ) ( ) ( ) I f x dx f x dx f x a a x a b a b n = ≅ = + ∫ ∫ 1 0 1
  • 24. ( ) ( ) ( ) I f x dx f x dx f x a a x a b a b n = ≅ = + ∫ ∫ 1 0 1 A straight line can be represented as: ( ) ( ) ( ) ( ) ( )f x f a f b f a b a x a1 = + − − − Trapezoidal Rule
  • 25. ( ) ( ) ( ) ( ) ( ) ( ) I f x dx f x dx f a f b f a b a x a dx a b a b a b = ≅ = + − − − ∫ ∫ ∫ 1 Integrate this equation. Results in the trape zo idalrule . ( ) ( ) ( )I b a f a f b ≅ − + 2 Trapezoidal Rule
  • 26. ( ) ( ) ( ) 2 bfaf abI + −≅ Recall the formula for computing the area of a trapezoid: height x (average of the bases) height base base Trapezoidal Rule
  • 27. The concept is the same but the trapezoid is on its side. height base base widthheight height ( ) ( ) ( ) 2 bfaf abI + −≅ Trapezoidal Rule
  • 28. Error of the Trapezoidal Rule ( )( )E f b a where a b t = − − < < 1 12 3 '' ξ ξ This indicates that is the function being integrated is linear, the trapezoidal rule will be exact. Otherwise, for section with second and higher order derivatives (that is with curvature) error can occur. A reasonable estimate of x is the average value of b and a
  • 29. Multiple Application of the Trapezoidal Rule • Improve the accuracy by dividing the integration interval into a number of smaller segments • Apply the method to each segment • Resulting equations are called multiple-application or composite integration formulas
  • 30. ( ) ( ) ( ) ( ) ( ) ( ) I f x dx f x dx f x dx I h f x f x h f x f x h f x f x x x x x x x n n n n = + + + ≅ + + + + + ∫ ∫ ∫ − − ( ) ( ) ( ) 0 1 1 2 1 0 1 1 2 1 2 2 2   where there are n+ 1 equally spaced base points. Multiple Application of the Trapezoidal Rule
  • 31. ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) I f x dx f x dx f x dx I h f x f x h f x f x h f x f x I b a f x f x f x n x x x x x x n n i n i n n n = + + + ≅ + + + + + ≅ − + + ∫ ∫ ∫ ∑ − − = − ( ) ( ) ( ) 0 1 1 2 1 0 1 1 2 1 0 1 1 2 2 2 2 2   We can group terms to express a general form } } width average height Multiple Application of the Trapezoidal Rule
  • 32. ( ) ( ) ( ) ( ) I b a f x f x f x n i n i n ≅ − + + = − ∑0 1 1 2 2 } }width average height The average height represents a weighted average of the function values Note that the interior points are given twice the weight of the two end points ( ) E b a n fa = − − 3 2 12 '' Multiple Application of the Trapezoidal Rule
  • 33. Example Evaluate the following integral using the trapezoidal rule and h = 0.1 ( ) ( ) ( ) ( ) I b a f x f x f x n i n i n ≅ − + + = − ∑0 1 1 2 2 I e dxx = ∫ 2 1 1 6. h b a n = − 0 5 10 15 20 25 30 0 0.3 0.6 0.9 1.2 1.5 1.8 x f(x)
  • 34. Simpson’s 1/3 Rule • Corresponds to the case where the function is a second order polynomial ( ) ( ) ( ) I f x dx f x dx f x a a x a x a b a b n = ≅ = + + ∫ ∫ 2 0 1 2 2
  • 35. Simpson’s 1/3 Rule • Designate a and b as x0 and x2, and estimate f2(x) as a second order Lagrange polynomial ( ) ( ) ( )( ) ( )( ) ( ) I f x dx f x dx x x x x x x x x f x dx a b a b x x = ≅ = − − − − +       ∫ ∫ ∫ 2 1 2 0 1 0 2 0 0 2 .......
  • 36. Simpson’s 1/3 Rule • After integration and algebraic manipulation, we get the following equations ( ) ( ) ( )[ ] ( ) ( ) ( ) ( ) I h f x f x f x b a f x f x f x ≅ + + ≅ − + + 3 4 4 6 0 1 2 0 1 2 } } width average height
  • 37. Error ( )( )E f b a where a b t = − − < < 1 12 3 '' ξ ξ Single application of Trapezoidal Rule. Single application of Simpson’s 1/3 Rule ( )( )E f b at = − − 1 2880 4 5( ) ξ
  • 38. Multiple Application of Simpson’s 1/3 Rule ( ) ( ) ( ) ( ) ( ) ( ) ( ) I f x dx f x dx f x dx I b a f x f x f x f x n E b a n f x x x x x x i j n j n i n a n n = + + + ≅ − + + + = − − ∫ ∫ ∫ ∑∑ − = − = − ( ) ( ) ( ) , , .., , .. 0 1 1 2 1 0 2 4 6 2 1 3 5 1 5 4 4 4 2 3 180 
  • 39. ( ) ( ) ( ) ( ) ( ) I b a f x f x f x f x n i j n j n i n ≅ − + + + = − = − ∑∑0 2 4 6 2 1 3 5 1 4 2 3 , , .., , .. The odd points represent the middle term for each application. Hence carry the weight 4. The even points are common to adjacent applications and are counted twice. f(x) x i=1 (odd) weight of 4 i=2 (even) weight of 2
  • 40. Simpson’s 3/8 Rule • Corresponds to the case where the function is a third order polynomial ( ) ( ) ( ) ( ) ( ) ( ) ( )[ ]3210 3 3 2 210 3 33 8 3 xfxfxfxf h I xaxaxaaxf dxxfdxxfI n b a b a +++≅ +++= ≅= ∫∫
  • 41. Integration of Unequal Segments • Experimental and field study data is often unevenly spaced • In previous equations we grouped the term (i.e. hi) which represented segment width. ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) I b a f x f x f x n I h f x f x h f x f x h f x f x i n i n n n ≅ − + + ≅ + + + + + = − − ∑0 1 1 0 1 1 2 1 2 2 2 2 2 
  • 42. Integration of Unequal Segments • We should also consider alternately using higher order equations if we can find data in consecutively even segments trapezoidal rule
  • 43. Integration of Unequal Segments trapezoidal rule 1/3 rule • We should also consider alternately using higher order equations if we can find data in consecutively even segments
  • 44. Integration of Unequal Segments trapezoidal rule 1/3 rule 3/8 rule • We should also consider alternately using higher order equations if we can find data in consecutively even segments
  • 45. Integration of Unequal Segments trapezoidal rule 1/3 rule 3/8 rule trapezoidal rule • We should also consider alternately using higher order equations if we can find data in consecutively even segments
  • 46. Example Integrate the following using the trapezoidal rule, Simpson’s 1/3 Rule, a multiple application of the trapezoidal rule with n=2 and Simpson’s 3/8 Rule. Compare results with the analytical solution. xe dxx2 0 4 ∫ 0 2000 4000 6000 8000 10000 12000 14000 0 1 2 3 4 x f(x)
  • 47. Integration of Equations • Integration of analytical as opposed to tabular functions • Romberg Integration • Richardson’s Extrapolation • Romberg Integration Algorithm • Gauss Quadrature • Improper Integrals
  • 48. Richardson’s Extrapolation • Use two estimates of an integral to compute a third more accurate approximation • The estimate and error associated with a multiple application trapezoidal rule can be represented generally as: • I = I(h) + E(h) • where I is the exact value of the integral • I(h) is the approximation from an n-segment application • E(h) is the truncation error • h is the step size (b-a)/n
  • 49. Make two separate estimates using step sizes of h1 and h2 . I(h1) + E(h1) = I(h2) + E(h2) Recall the error of the multiple-application of the trapezoidal rule E b a h f= − − 12 2 '' Assume that is constant regardless of the step sizef '' ( ) ( ) E h E h h h 1 2 1 2 2 2 ≅
  • 50. ( ) ( ) ( ) ( ) E h E h h h E h E h h h 1 2 1 2 2 2 1 2 1 2 2 ≅ ≅       Substitute into previous equation: I(h1) + E(h1) = I(h2) + E(h2) ( ) ( ) ( ) E h I h I h h h 2 1 2 1 2 2 1 = − −      
  • 51. Thus we have developed an estimate of the truncation error in terms of the integral estimates and their step sizes. This estimate can then be substituted into: I = I(h2) + E(h2) to yield an improved estimate of the integral: ( ) ( ) ( )[ ]I I h h h I h I h≅ +       −           −2 1 2 2 2 1 1 1 ( ) ( ) ( ) E h I h I h h h 2 1 2 1 2 2 1 = − −      
  • 52. ( ) ( ) ( )[ ]I I h h h I h I h≅ +       −           −2 1 2 2 2 1 1 1 What is the equation for the special case where the interval is halved? i.e. h2 = h1 / 2
  • 53. ( ) ( ) ( )[ ] ( ) ( ) h h h h I I h I h I h collecting terms I I h I h 1 2 2 2 2 2 2 1 2 1 2 2 1 2 1 4 3 1 3       =       = ≅ + −     − ≅ −
  • 54. Example Use Richardson’s extrapolation to evaluate: xe dxx2 0 4 ∫ 0 2000 4000 6000 8000 10000 12000 14000 0 1 2 3 4 x f(x)
  • 55. ( ) ( ) ( ) ( ) ( ) ( ) I I h I h I I h I h I I h I h I I I m l m l j k k j k j k k ≅ − ≅ − ≅ − ≅ − − − + − − − 4 3 1 3 16 15 1 15 64 63 1 63 4 4 1 2 1 1 1 1 1 1, , , We can continue to improve the estimate by successive halving of the step size to yield a general formula: k = 2; j = 1 Romberg Integration Note: the subscripts m and lrefer to m o re and le ss accurate estimates
  • 56. Gauss Quadrature f(x) x f(x) x Extend the area under the straight line
  • 57. Method of Undetermined Coefficients Recall the trapezoidal rule ( ) ( ) ( ) I b a f a f b ≅ − + 2 This can also be expressed as ( ) ( )I c f a c f b≅ +0 1 where the c’s are constant Before analyzing this method, answer this question. What are two functions that should be evaluated exactly by the trapezoidal rule?
  • 58. The two cases that should be evaluated exactly by the trapezoidal rule: 1) y = constant 2) a straight line f(x) x y = 1 (b-a)/2-(b-a)/2 f(x) x y = x (b-a)/2 -(b-a)/2
  • 59. Thus, the following equalities should hold. ( ) ( ) ( ) ( ) ( ) ( ) I c f a c f b c c dx c b a c b a xdx b a b a b a b a ≅ + + ≅ − −      + −      ≅ − − − − − − ∫ ∫ 0 1 0 1 2 2 0 1 2 2 1 2 2 FOR y=1 since f(a) = f(b) =1 FOR y =x since f(a) = x =-(b-a)/2 and f(b) = x =(b-a)/2
  • 60. Evaluating both integrals c c b a c b a c b 0 1 0 1 2 1 2 0 + = − − − + − = For y = 1 For y = x Now we have two equations and two unknowns, c0 and c1. Solving simultaneously, we get : c0 = c1 = (b-a)/2 Substitute this back into: ( ) ( )I c f a c f b≅ +0 1
  • 61. ( ) ( ) ( ) I b a f a f b ≅ − + 2 We get the equivalent of the trapezoidal rule. DERIVATION OF THE TWO-POINT GAUSS-LEGENDRE FORMULA ( ) ( )I c f x c f x≅ +0 0 1 1 Lets raise the level of sophistication by: - considering two points between -1 and 1 - i.e. “open integration”
  • 62. f(x) x-1 x0 x1 1 Previously ,we assumed that the equation fit the integrals of a constant and linear function. Extend the reasoning by assuming that it also fits the integral of a parabolic and a cubic function.
  • 63. ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) c f x c f x dx c f x c f x xdx c f x c f x x dx c f x c f x x dx 0 0 1 1 1 1 0 0 1 1 1 1 0 0 1 1 2 1 1 0 0 1 1 3 1 1 1 2 0 2 3 0 + = = + = = + = = + = = − − − − ∫ ∫ ∫ ∫ / We now have four equations and four unknowns c0 c1 x0 and x1 What equations are you solving?
  • 64. ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) c f x c f x dx c c c f x c f x xdx c x c x c f x c f x x dx c x c x c f x c f x x dx c x c x 0 0 1 1 1 1 0 1 0 0 1 1 1 1 0 0 1 1 0 0 1 1 2 1 1 0 0 2 1 1 2 0 0 1 1 3 1 1 0 0 3 1 1 3 1 2 1 1 2 0 0 2 3 2 3 0 0 + = = + = + = = + = + = = + = + = = + = − − − − ∫ ∫ ∫ ∫ ` / / Solve these equations simultaneously f(xi) is either 1, xi, xi 2 or xi 3
  • 65. c c x x I f f 0 1 0 1 1 1 3 1 3 1 3 1 3 = = = − = ≅ −      +       This results in the following The interesting result is that the integral can be estimated by the simple addition of the function values at −1 3 1 3 and
  • 66. A simple change in variables can be use to translate other limits. Assume that the new variable xd is related to the original variable x in a linear fashion. x = a0 + a1xd Let the lower limit x = a correspond to xd = -1 and the upper limit x=b correspond to xd=1 a = a0 + a1(-1) b = a0 + a1(1) What if we aren’t integrating from –1 to 1?
  • 67. a = a0 + a1(-1) b = a0 + a1(1) SOLVE THESE EQUATIONS SIMULTANEOUSLY a b a a b a 0 1 2 2 = + = − ( ) ( )x a a x b a b a x d d = + = + + − 0 1 2 substitute
  • 68. ( ) ( )x a a x b a b a x dx b a dx d d d = + = + + − = − 0 1 2 2 These equations are substituted for x and dx respectively. Let’s do an example to appreciate the theory behind this numerical method.
  • 69. Example Estimate the following using two-point Gauss Legendre: xe dxx2 0 4 ∫ 0 2000 4000 6000 8000 10000 12000 14000 0 1 2 3 4 x f(x)
  • 70. Higher-Point Formulas ( ) ( ) ( )I c f x c f x c f xn n≅ + + + − −0 0 1 1 1 1 For two point, we determined that c0 = c1= 1 For three point: c0 = 0.556 x0=-0.775 c1= 0.889 x1=0.0 c2= 0.556 x2=0.775
  • 71. Higher-Point Formulas Your text goes on to provide additional weighting factors (ci’s) and function arguments (xi’s) in Table 8.5 p. 593
  • 72. Numerical Differentiation • Forward finite divided difference • Backward finite divided difference • Center finite divided difference • All based on the Taylor Series ( ) ( ) ( ) ( ) ......... !2 '' ' 2 1 +++=+ h xf hxfxfxf i iii
  • 73. Forward Finite Difference ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( )21 1 2 1 2 '' ' ' ......... !2 '' ' hOh xf h xfxf xf hO h xfxf xf h xf hxfxfxf iii i ii i i iii +− − = + − = +++= + + +
  • 74. Forward Divided Difference ( ) ( ) ( ) ( ) ( )f x f x f x x x O x x f h O hi i i i i i i i ' = − − + − = ++ + + 1 1 1 ∆ f(x) x (xi, yi) What is derivative at this point?
  • 75. Forward Divided Difference ( ) ( ) ( ) ( ) ( )f x f x f x x x O x x f h O hi i i i i i i i ' = − − + − = ++ + + 1 1 1 ∆ f(x) x (xi, yi) (x i+1,y i+1) Determine a second point base on Dx (h)
  • 76. Forward Divided Difference ( ) ( ) ( ) ( ) ( )f x f x f x x x O x x f h O hi i i i i i i i ' = − − + − = ++ + + 1 1 1 ∆ f(x) x (xi, yi) (x i+1,y i+1) estimateHow does this compare to the actual first derivative at xi?
  • 77. Forward Divided Difference ( ) ( ) ( ) ( ) ( )f x f x f x x x O x x f h O hi i i i i i i i ' = − − + − = ++ + + 1 1 1 ∆ f(x) x (xi, yi) (x i+1,y i+1) estimate actual
  • 78. ( ) ( )f x f h O hi i ' = + ∆ first forward divided difference Error is proportional to the step size O(h2 ) error is proportional to the square of the step size O(h3 ) error is proportional to the cube of the step size Forward Divided Difference
  • 80. ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) f x f x f x h f x h f x f x f x h f x h f x f x f x h f h i i i i i i i i i i i i + − − = + + + = − + + = − = ∇ 1 2 1 2 1 2 2 ' '' ! ...... ' '' ! ..... ' Backward Difference Approximation of the First Derivative Expand the Taylor series backwards The error is still O(h)
  • 81. Centered Difference Approximation of the First Derivative Subtract backward difference approximation from forward Taylor series expansion ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( )211 2 11 1 1 2 1 2 ' 6 ''' '2 ' .... !2 '' ' hO h xfxf xf h xf hxfxfxf xx xfxf xf h xf hxfxfxf ii i i iii ii ii i i iii − − = +++= − − = +++= −+ −− + + + 
  • 82. f(x) x estimate actual (xi,yi) (xi-1,yi-1) (xi+1,yi+1) ( ) ( ) ( ) ( )211 2 ' hO h xfxf xf ii i − − = −+
  • 83. f(x) x f(x) x f(x) x f(x) x true derivative forward finite divided difference approx. backward finite divided difference approx. centered finite divided difference approx.
  • 84. Numerical Differentiation • You should be familiar with the following Tables in your text • Table 7.1: Common Finite Difference Formulas • Table 7.2: Higher order finite difference formulas
  • 85. Richardson Extrapolation • Two ways to improve derivative estimates ¤ decrease step size ¤ use a higher order formula that employs more points • Third approach, based on Richardson extrapolation, uses two derivatives estimates to compute a third, more accurate approximation
  • 86. Richardson Extrapolation ( ) ( ) ( )[ ] ( ) ( ) ( ) ( ) I I h h h I h I h Special case where h h I I h I h In a similar fashion D D h D h ≅ +       − − = ≅ − ≅ − 2 1 2 2 2 1 2 1 2 1 2 1 1 1 2 4 3 1 3 4 3 1 3 For a centered difference approximation with O(h2 ) the application of this formula will yield a new derivative estimate of O(h4 )
  • 87. Example Given the following function, use Richardson’s extrapolation to determine the derivative at 0.5. f(x) = -0.1x4 - 0.15x3 - 0.5x2 - 0.25x +1.2 Note: f(0) = 1.2 f(0.25) =1.1035 f(0.75) = 0.636 f(1) = 0.2
  • 88. Derivatives of Unequally Spaced Data • Common in data from experiments or field studies • Fit a second order Lagrange interpolating polynomial to each set of three adjacent points, since this polynomial does not require that the points be equi- spaced • Differentiate analytically ( ) ( ) ( )( ) ( ) ( )( ) ( ) ( )( ) f x f x x x x x x x x f x x x x x x x x f x x x x x x x x i i i i i i i i i i i i i i i i i i i i i ' = − − − − + − − − − + − − − − − + − − + − + − + + − + + − 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2
  • 89. Derivative and Integral Estimates for Data with Errors • In addition to unequal spacing, the other problem related to differentiating empirical data is measurement error • Differentiation amplifies error • Integration tends to be more forgiving • Primary approach for determining derivatives of imprecise data is to use least squares regression to fit a smooth, differentiable function to the data • In absence of other information, a lower order polynomial regression is a good first choice
  • 90. 0 5 0 1 00 1 5 0 200 25 0 0 5 1 0 1 5 t y 0 1 0 20 30 0 1 0 t dy/dt 0 5 0 1 00 1 5 0 200 25 0 0 5 1 0 1 5 t y 0 1 0 20 30 40 0 1 0 t dy/dt
  • 91. Specific Study Objectives • Understand the derivation of the Newton-Cotes formulas • Recognize that the trapezoidal and Simpson’s 1/3 and 3/8 rules represent the areas of 1st, 2nd, and 3rd order polynomials • Be able to choose the “best” among these formulas for any particular problem
  • 92. Specific Study Objectives • Recognize the difference between open and closed integration formulas • Understand the theoretical basis of Richardson extrapolation and how it is applied in the Romberg integration algorithm and for numerical differentiation
  • 93. Specific Study Objectives • Recognize why both Romberg integration and Gauss quadrature have utility when integrating equations (as opposed to tabular or discrete data). • Understand the application of high- accuracy numerical-differentiation. • Recognize data error on the processes of integration and differentiation.