Civil Engineering Reference
In-Depth Information
y=f(x)
y 4
y n-1
y 3
y n
y n+1
y 2
y 1
A 1
A 2
A 3
A n-1
A n
x
x=a
x i
x=b
∆x
∆x
∆x
∆x
∆x
Figure 3.1. Trapezoidal rule.
b
= () =++++
Af xdxAAA A
1
2
3
n
a
b
x
(
)
= () =
Af xdx
y
++++ +
22 2
y
y
yy
1
2
3
n
n
+
1
2
a
x
n
A
=
y
+
2
y
+
y
1
i
n
+
1
2
i
=
2
Example 3.1
Trapezoidal rule
Determine the area under the curve from 0 to p for y=sin ( x ) using the
trapezoidal rule with 2 and 4 strips.
2
x
n
A
=
y
+
2
y
+
y
1
i
n
+
1
i
=
2
Two strips are shown in Table 3.1:
Table 3.1. Example 3.1 Trapezoidal rule
p
x
0
p/2
x
0
1.5708
3.1416
y=sin(x)
0
1
1.23E-16
p p
4 0210 2
(
) ==
A =+ () +
1 5708
.
 
Search WWH ::




Custom Search