© 2001 by CRC Press LLC
Since the points are numbered in increasing order from P
R
through P
B
and P
L
,
it is then clear that X
i + 1
is always less than X
i
. A
B
thus carries a minus sign.
Based on the above discussion, the area enclosed by contour C
1
can therefore
be calculated by
adding
A
T
and A
B
if the numbering of the points selected on the
contour follows a
clockwise
direction. Let the total number of points selected around
the contour C
1
be denoted as K, then K = N + (M–2) because P
R
and P
L
are re-used
in consideration of the bottom branch. Hence, the area enclosed in C
1
is:
(4)
where the Nth point has coordinates (X
N
,Y
N
) = (X
R
,Y
R
) and the first and last points
have coordinates (X
1
,Y
1
) = (X
K + 1
,Y
K + 1
) = (X
L
,Y
L
). And it should be evident that
in case of a cut-out, such as the contour C
2
shown in Figure 1(B), the subtraction
of the area enclosed by the cut-out can be replaced by an addition of the value of
the area when it is calculated by using Equation 4 but the numbering of the points
on contour C
3
is ordered in
counterclockwise
sense.
5.2 PROGRAM NUINTGRA — NUMERICAL INTEGRATION BY
APPLICATION OF THE TRAPEZOIDAL AND SIMPSON RULES
Program
NuIntGra
is designed for the need of performing numerical integration
by use of either trapezoidal rule or Simpson’s rule. These two rules will be explained
later. First, let us discuss why we need numerical integration.
Figure 3 shows a number of commonly encountered cross-sectional shapes in
engineering and scientific applications. The interactive computer program
NuIntGra
has an option of allowing keyboard input of the coordinates of the vertices of the
cross section and then carrying out the area computation of cross-sectional area
based on Equation 4.
The following gives some detailed printout of the results for the cross sections
shown in Figure 3. It is important to point out that the points on the contours describing
the cross-sectional shapes should be numbered as indicated in Figure 3, namely, clock-
wise around the outer boundary and counterclockwise around the inner boundary
.
AA A YY X X
TB
ii
i
K
ii
=+= +
()
−
()
+
=
+
∑
1
1
1
2