Sei sulla pagina 1di 25

Schedule

Week Date Topic Classification of Topic


1 9 Feb. 2010
Introduction to
Numerical Methods
and Type of Errors
Measuring errors, Binary
representation, Propagation of errors
and Taylor series
2 14 Feb. 2010 Nonlinear
Bisection Method
3 21 Feb. 2010
Newton-Raphson Method
4 28 Feb. 2010 Interpolation
Lagrange Interpolation
5 7 March 2010
Newton's Divided Difference Method
6 14 March 2010
Differentiation Newton's Forward and Backward
Difference
7 21 March 2010 Regression
Least squares
8 28 March 2010
Systems of Linear
Equations
Gaussian Jordan
9 11 April 2010
Gaussian Seidel
10 18 April 2010
Integration Composite Trapezoidal and Simpson
Rules
11 25 April 2010
Ordinary Differential
Equations
Euler's Method
12 2 May 2010
Runge-Kutta 2
nd
and4
th
order Method
2
Trapezoidal Rule of
Integration
3
What is Integration
Integration:
}
=
b
a
dx ) x ( f I
The process of measuring
the area under a function
plotted on a graph.
Where:
f(x) is the integrand
a= lower limit of integration
b= upper limit of integration


f(x)
a b
}
b
a
dx ) x ( f
y
x
4
Method Derived From Geometry
The area under the
curve is a trapezoid.
The integral
trapezoid of Area dx x f
b
a
~
}
) (
) height )( sides parallel of Sum (
2
1
=
( ) ) a b ( ) a ( f ) b ( f + =
2
1
(

+
=
2
) b ( f ) a ( f
) a b (

Figure 2: Geometric Representation
f(x)
a b
}
b
a
dx ) x ( f
1

y
x
f
1
(x)
5
Example 1
The vertical distance covered by a rocket from t=8 to
t=30 seconds is given by:
}
|
.
|

\
|

(

=
30
8
8 9
2100 140000
140000
2000 dt t .
t
ln x
a) Use single segment Trapezoidal rule to find the distance covered.
b) Find the true error, for part (a).
c) Find the absolute relative true error, for part (a).
t
E
a
e
6
Solution
(

+
~
2
) b ( f ) a ( f
) a b ( I a)
8 = a 30 = b
t .
t
ln ) t ( f 8 9
2100 140000
140000
2000
(

=
) ( .
) (
ln ) ( f 8 8 9
8 2100 140000
140000
2000 8
(

=
) ( .
) (
ln ) ( f 30 8 9
30 2100 140000
140000
2000 30
(

=
s / m .27 177 =
s / m .67 901 =
7
Solution (cont)
(

+
=
2
67 901 27 177
8 30
. .
) ( I
m 11868 =
b) The exact value of the above integral is
}
|
.
|

\
|

(

=
30
8
8 9
2100 140000
140000
2000 dt t .
t
ln x
m 11061 =
8
Solution (cont)
Value e Approximat Value True E
t
=
11868 11061 =
m 807 =
c) The absolute relative true error, , would be
t
e
100
11061
11868 11061

= e
t
% .2959 7 =
9
Multiple Segment Trapezoidal Rule

f(x)
a b
y
x
4
a b
a

+
4
2
a b
a

+
4
3
a b
a

+
Figure 3: Multiple (n=4) Segment Trapezoidal Rule
Divide into equal segments
as shown in Figure 3. Then
the width of each segment is:
n
a b
h

=
The integral I is:
}
=
b
a
dx ) x ( f I
} } } }
+
+
+
+
+
+
+ + + + =
b
h ) n ( a
h ) n ( a
h ) n ( a
h a
h a
h a
a
dx ) x ( f dx ) x ( f ... dx ) x ( f dx ) x ( f
1
1
2
2
10
Multiple Segment Trapezoidal Rule
The integral I can be broken into h integrals as:
}
b
a
dx ) x ( f
Applying Trapezoidal rule on each segment gives:
}
b
a
dx ) x ( f
(

)
`

+ + + =

=
1
1
) (
2
) (
2
) (
n
i
ih a f
b f a f
h
11
Example 2
The vertical distance covered by a rocket from to seconds is
given by:
}
|
.
|

\
|

(

=
30
8
8 9
2100 140000
140000
2000 dt t .
t
ln x
a) Use two-segment Trapezoidal rule to find the distance covered.
b) Find the true error, for part (a).
c) Find the absolute relative true error, for part (a).
a
e
t
E
12
Solution
a) The solution using 2-segment Trapezoidal rule is
(

)
`

+ +
+
=

=
1
1
) (
2
) ( ) (
n
i
ih a f
b f a f
h I
2 = n 8 = a 30 = b
2
8 30
=
n
a b
h

=
11 =
13
Solution (cont)
(

)
`

+ +
+
=

=
1 2
1
) (
2
) 30 ( ) 8 (
11
i
ih a f
f f
I
(

+
+
= ) 19 (
2
) 30 ( ) 8 (
11 f
f f
m 11266 =
Then:
14
Solution (cont)
}
|
.
|

\
|

(

=
30
8
8 9
2100 140000
140000
2000 dt t .
t
ln x m 11061 =
b) The exact value of the above integral is
so the true error is
Value e Approximat Value True E
t
=
11266 11061 =
15
Solution (cont)
c) The absolute relative true error, , would be
t
e
100
Value True
Error True
= e
t
100
11061
11266 11061

=
% 8534 . 1 =
16
Solution (cont)
Table 1 gives the values
obtained using multiple
segment Trapezoidal rule
for:
n Value E
t
1 11868 -807 7.296 ---
2 11266 -205 1.853 5.343
3 11153 -91.4 0.8265 1.019
4 11113 -51.5 0.4655 0.3594
5 11094 -33.0 0.2981 0.1669
6 11084 -22.9 0.2070 0.09082
7 11078 -16.8 0.1521 0.05482
8 11074 -12.9 0.1165 0.03560
}
|
.
|

\
|

(

=
30
8
8 9
2100 140000
140000
2000 dt t .
t
ln x
Table 1: Multiple Segment Trapezoidal Rule Values
%
t
e %
a
e
17
The error Bounds in Multiple
Segment Trapezoidal Rule
The error bounds are now obtained by taking the largest value for
Say, and the smallest value, , in the interval of integration by
" f
2
M
c
*
2
M
.
12 12
) (
2
2
3
*
2 2
h
a b
n
a b
k where kM kM

=

= s s c
18
Simpsons 1/3
rd
Rule of
Integration
19
Basis of Simpsons 1/3
rd
Rule
Trapezoidal rule was based on approximating the integrand by a first
order polynomial, and then integrating the polynomial in the interval
of integration.
Simpsons 1/3rd rule is an extension of Trapezoidal rule where the
integrand is approximated by a second order polynomial.
20
] 2 4 [
3
) (
2 1 0
s s s
h
dx x f
b
a
+ + ~
}
Multiple Segment Simpsons 1/3
rd
Rule
such that

=
=

=
=
=
=
+ =
2
2
2
1
1
1
0 0
) (
) (
), ( ) (
n
even i
i
i
n
odd i
i
i
n
x f s
x f s
x f x f s
,
n
a b
h

=
21
Example 3
Use 4-segment Simpsons 1/3rd Rule to approximate the
distance
Use 4-segment Simpsons 1/3rd Rule to approximate the
distance
covered by a rocket from t= 8 to t=30 as given by
}
|
.
|

\
|

(

=
30
8
dt t 8 . 9
t 2100 140000
140000
ln 2000 x
a) Use four segment Simpsons 1/3rd Rule to find the approximate
value of x.
b) Find the true error, for part (a).
c) Find the absolute relative true error, for part (a).
t
E
a
e
22
Solution
| |
4
22
4
8 30
2 4
3
)
2 1 0
=

= + + = h s s s
h
x a
| | ) 30 ( f ) t ( f 2 ) t ( f 4 ) t ( f 4 ) 8 ( f
12
22
2 3 1
+ + + + =
) (
) ( ) (
) 30 ( ) 8 ( ) ( ) (
2 2
3 1 1
4 0 0
t f s
t f t f s
f f t f t f s
=
+ =
+ = + =
23
Solution (cont.)
cont.
| | ) 30 ( f ) 19 ( f 2 ) 5 . 24 ( f 4 ) 5 . 13 ( f 4 ) 8 ( f
6
11
+ + + + =
| | 6740 . 901 ) 7455 . 484 ( 2 ) 0501 . 676 ( 4 ) 2469 . 320 ( 4 2667 . 177
6
11
+ + + + =
m 64 . 11061 =
24
Solution (cont.)
b) In this case, the true error is
64 . 11061 34 . 11061 E
t
=
m 30 . 0 =
c) The absolute relative true error
% 100
34 . 11061
64 . 11061 34 . 11061
t

= e
% 0027 . 0 =
25
Solution (cont.)
Table 1: Values of Simpsons 1/3rd Rule for Example 3 with multiple segments
n Approximate Value E
t
|
t
|
2
4
6
8
10
11065.72
11061.64
11061.40
11061.35
11061.34
4.38
0.30
0.06
0.01
0.00
0.0396%
0.0027%
0.0005%
0.0001%
0.0000%

Potrebbero piacerti anche