ba201 engineering mathematic unit4 - trapezoidal and simpson's rule
Post on 12-Nov-2015
232 Views
Preview:
DESCRIPTION
TRANSCRIPT
-
B3001/UNIT 4/1
Pepared by : Nithya A/P Periasamy Page 1
TRAPEZOIDAL AND SIMPSONS RULE
General Objective : To determine the area of an uninformed plane using
Trapezoidal and Simpsons Rule.
Specific Objectives : On completion of this unit, you should be able to:-
find the area of a plane using the Trapezoidal rule.
find the area of a plane using the Simpsons rule
UNIT 4
OBJECTIVES
-
B3001/UNIT 4/1
Pepared by : Nithya A/P Periasamy Page 2
4.0 INTRODUCTION
Using numerical analysis, function y can be determined for some values of x in an
experiment data or calculation of function. These data can be retrieved from experiments
or calculated from given function. These data are filled in the table form for function
y = f(x) then its is equivalent to the integral of function y = f(x) within x = a and x = b.
X X0 X1 X2 Xn
Y Y0 Y1 Y2 yn
Using x0=a and xn=b the values of x are constant h;
i.e
h=xi+1 xi i = 0,1, n 1
Figure 6.1 shows the values for yi is a function of xi.. Integrating the function of f
between x = a and x = b, you will find the area graph and the x-axis. Geometrically this
area can be estimated from the sum of area from rectangles width h and height yi
(i=0,1,.,n-1) shown in the figure. 6.2
y1 yn-2
y2 y3
yn-1
yn
y0
a=x0 x1 x2 x3 xn-2 xn-1 xn
Fig. 6.1
INPUT
-
B3001/UNIT 4/1
Pepared by : Nithya A/P Periasamy Page 3
Mathematically, we write the equation as
Sum of area = hy0 + hy1 + hy2 + . + hyn-2 + hyn-1
or
Area = h
1
0
n
i
iy
In other words, we have to integrate as
b
a
dxxf )( h
1
0
n
i
iy
This is just a rough estimate and it is best to choose a small value of h
(distance between xn).
y3 y2
y1
Yn-2
Yn-1
y0
a=x0 x1 x2 x3 xn-2 xn-1 xn
Fig 6.2
yn
-
B3001/UNIT 4/1
Pepared by : Nithya A/P Periasamy Page 4
4.1 TRAPEZOIDAL RULE
Using this method, the area under a function curve can be substituted with the
area within limits of adjacent yi. This limit forming a trapezium and its area can be
defined as in figure 4.3 below:.
The area for each trapezium with corresponding heights yi and yi+1 is given as
Area = iyh
(2
+ )1iy ; i = 0,1,2,.n-1
INPUT
y3
x0 x1 x2 x3 xn-2 xn-1 xn
y2 yn-2
yn-1
y0
yn y1
Figure 6.3
-
B3001/UNIT 4/1
Pepared by : Nithya A/P Periasamy Page 5
The sum area of all trapezium between x0 and xn as
Sum area = )(2
)(2
...)(2
)(2
)(2
112322110 nnnn yyh
yyh
yyh
yyh
yyh
= )22......22(2
12210 nnn yyyyyyh
This sum of area can be summarized as
)22.....22(2
)( 12210 b
a
nnn yyyyyyh
dxxf
yi= f(x), x0=a, xn= b and h = xi+1 xi (i=0,1,2,.,n-1)
Example 4.1 :
Using the trapezoidal rule for y = 2x2 we can calculate the values of I
I= 10
0
)( dxxf
For values of )( ii xfy are calculated in the table below:
X 0 2 4 6 8
10
Y 0 8 32 72 128
200
Solutions :
Using the trapezoidal rule,
)22.....22(2
)( 12210 b
a
nnn yyyyyyh
dxxf
for h = 2, then :
I 200)12872328(202
2
= 680.0
This answer is just estimation. Using differentiation, the real value is 2000/3 = 666.7.
-
B3001/UNIT 4/1
Pepared by : Nithya A/P Periasamy Page 6
ACTIVITY 4a
1. Given the differentiation of21
1
x is tan
-1 x. Comparing tan
-1 s with
s
x
dx
0
21
for s = 0.1,0.2,..,2.0. and h = 0.05 (Use Trapezium rule)
2. Calculate s
dxx
1
1 using trapezium rule for s = 2, s = 3, s= 3
s = 4, s = 5 and h = 0.025. Compare your answer with ln s.
-
B3001/UNIT 4/1
Pepared by : Nithya A/P Periasamy Page 7
FEEDBACKS 4a
1 Integrate 1
1
2 x
S Trapezium Rule Tan-1
s
0.1 0.09963 0.09966
0.2 0.19732 0.19739
0.3 0.29135 0.29145
0.4 0.38038 0.38050
0.5 0.46351 0.46364
0.6 0.54028 0.54041
0.7 0.61059 0.61072
0.8 0.67462 0.67474
0.9 0.73270 0.73281
1.0 0.78529 0.78539
1.1 0.83289 0.83298
1.2 0.87597 0.87605
1.3 0.91503 0.91510
1.4 0.95048 0.95054
1.5 0.98273 0.78279
1.6 1.01214 1.01219
1.7 1.03903 1.03907
1.8 1.06366 1.06369
1.9 1.08628 1.08631
2.0 1.10712 1.17014
2 Integrate x
1
S Trapezium rule Ln S
2.0 0.69319 0.69314
3.0 1.09866 1.09861
4.0 1.338634 1.38629
5.0 1.60949 1.60943
-
B3001/UNIT 4/1
Pepared by : Nithya A/P Periasamy Page 8
4.2 SIMPSONS RULE
In the following equation
.....6
)2)(1(
2
)1(0
3
0
2
00
fppp
fpp
fpfy
if you integrate between x0 and x2, you will find
2
0
2
0
x
x
ydphydx
2
0
0
3234
0
223
0
2
0 ...)6
1
6
1
24
1()
4
1
6
1(
2
1
fpppfppfppfh
........0
3
122 0
3
0
2
00 ffffh
and if the first 3 terms are taken, you will find
0
3
003
122
2
0
fffhydx
x
x
=
012010 2(
3
1)(22 ffffffh
= )4( 210 fffh
and in this formula, the first term involved 04 f is ignored as the coefficient of 0
3 f = 0
It can be shown that this term is 04
90f
h and you can expect Simpsons rule to be
more precise than the trapezium rule.
On implementing it, you have to group y in a group of threes. In between a darker
line is marked. On every three points, two marked lines will represent the area
.),........4(3
),4(3
),4(3
654432210 yyyh
yyyh
yyyh
INPUT
-
B3001/UNIT 4/1
Pepared by : Nithya A/P Periasamy Page 9
The sum of area = ),.....4(3
)4(3
)4(3
654432210 fffh
fffh
fffh
= .....)42424(3
543210 ffffffh
This rule can be expanded for all values of x ; each has to consist 2 marked lines (for
every three points). If the number of marked lines is n, the rule will follow.
nx
x
nnnn ffffffffh
ydx
0
)424....424(3
1233210
Example 4.2 :
Integrate y= 2x2 using Simpsons rule if I =
10
0
)( dxxf
Solution :
with h = 1, you have 10 marked lines with 11 points.
Fig 6.4
x0 x1 x2 x3 x4 .
Y4
Y3
Y2
y1 y0
-
B3001/UNIT 4/1
Pepared by : Nithya A/P Periasamy Page 10
X 0 1 2 3 4 5 6 7 8 9
10
Y
0
2
8
18
32
50
72
98
128
162
200
Using Simpson rule, you will have :
200)162(4)128(2)98(4)72(2)50(4)32(2)18(4)8(2)2(403
1I
3
2000I
7.666I
-
B3001/UNIT 4/1
Pepared by : Nithya A/P Periasamy Page 11
ACTIVITY 4b
1. Given the differentiation of21
1
x is tan
-1 x. Comparing tan
-1 s with
s
x
dx
0
21 for s
= 0.1,0.2,..,2.0. and h = 0.05 [Use Simpson rule)
2. Calculate s
dxx
1
1 using Simpsons rule for s = 2, s = 3, s= 3
s = 4, s = 5 and h = 0.025. Compare your answer with ln s.
-
B3001/UNIT 4/1
Pepared by : Nithya A/P Periasamy Page 12
FEEDBACK 4b
1. Integrate 1
1
2 x
S Simpson rule Tan-1
s
0.1 0.09967 0.09966
0.2 0.19740 0.19739
0.3 0.29146 0.29145
0.4 0.38051 0.38050
0.5 0.46365 0.46364
0.6 0.54042 0.54041
0.7 0.61073 0.61072
0.8 0.67474 0.67474
0.9 0.73282 0.73281
1.0 0.78540 0.78539
1.1 0.83298 0.83298
1.2 0.87606 0.87605
1.3 0.91510 0.91510
1.4 095055 0.95054
1.5 0.98279 0.78279
1.6 1.01220 1.01219
1.7 1.03907 1.03907
1.8 1.06370 1.06369
1.9 1.08632 1.08631
2.0 1.10715 1.10714
2. Differentiate x
1
S Simpson rule ln s
2.0 0.69315 0.69314
3.0 1.09861 1.09861
4.0 1.38629 1.38629
5.0 1.60944 1.60943
-
B3001/UNIT 4/1
Pepared by : Nithya A/P Periasamy Page 13
1. Using Simpsons rule, integrate 6
2
.dxy when y=f(x)
2. Calculate dxex
10
0
2
. For x = 10 , the values of integration did not contribute
much , then the answer is best in the form of 2
. Use h = 1, h =0.5 and h = 0.1.
3. Estimate dxx12
0
2 using
a) Trapeziums rule for n = 12
b) Simpsons rule for n = 6
4. Estimate 3
0 31 x
dx using
a) Trapeziums rule for n = 6
b) Simpsons rule for n = 3
SELF ASSESSMENT
-
B3001/UNIT 4/1
Pepared by : Nithya A/P Periasamy Page 14
-
B3001/UNIT 4/1
Pepared by : Nithya A/P Periasamy Page 15
FEEDBACK TO SELF ASSESSMENT
1. 44.3 unit2
2. Intgration for 2xe
h Trapezium rule Simpson rule
1.0 0.886318602 0.836214302
0.5 0.886226926 0.886196367
0.1 0.886226926 0.886226924
3 a) 578
b) 576
4. a) 1.15
b) 1.16
top related