Professional Documents
Culture Documents
Chapter 07.06
Integrating Discrete Functions
What is integration?
Integration is the process of measuring the area under a function plotted on a graph. Why
would we want to do so? Among the most common examples are finding the velocity of a body
from acceleration functions, and displacement of a body from velocity data. Throughout the
engineering fields, there are (what sometimes seems like) countless applications for integral
calculus. Sometimes, the evaluation of expressions involving these integrals can become
daunting, if not indeterminate. For this reason, a wide variety of numerical methods have been
developed to simplify the integral. Here, we will discuss the use of numerical integration with
discrete data points, which can involve unequal segments.
s m/s
INTEGRATING DISCRETE FUNCTIONS 07.06.2
0 0
10 227.04
15 362.78
20 517.35
22.5 602.97
30 901.67
Figure 1: Velocity vs. time data for the rocket example
Determine the distance, s, covered by the rocket from t = 11 to t = 16 using the velocity data
provided and any applicable numerical technique.
Solution
Method 1: Average Velocity Method
The velocity of the rocket is not provided at t = 11 and t = 16, so we will have to use the interval
that includes [11, 16] to find the average velocity of the rocket within that range. In this case, the
interval [10, 20] will suffice.
v(10) = 227.04
v(15) = 362.78
v(20) = 517.35
v (10) + v (15) + v ( 20)
Average Velocity =
3
227.04 + 362.78 + 517.35
=
3
= 369.06 m / s
Since s = vΔt , we get
s = (369.06)(16 − 11) = 1845.3 m
and applying the trapezoidal rule over each of the above integrals gives
15 − 10 20 − 15
20
and applying the trapezoidal rule over each of the above integrals gives
15 − 11 16 − 15
16
15 − 11 16 − 15
16
∫ v(t )dt = =
11
2
( v(11) + 362.78) +
2
(362.78 + v (16))
15 − 11 16 − 15
= ( 254.19 + 362.78) + (362.78 + 393.69)
2 2
= 1612.2 m
Method 3: Polynomial Interpolation to find velocity profile
Because we are finding the area under the curve from [10, 20], we must use three points, t = 10,
t = 15, and t = 20, to fit a quadratic through the data. Using polynomial interpolation, our
resulting velocity function is (refer to notes on direct method of interpolation)
v(t ) = 12.001 + 17.740t + 0.37637t 2 , 10 ≤ t ≤ 20.
INTEGRATING DISCRETE FUNCTIONS 07.06.4
Now, we simply take the integral of the quadratic within our limits, giving us
11
16
⎡ 17.740t 2 0.37637t 3 ⎤
= ⎢12.001t + + ⎥
⎣ 2 3 ⎦ 11
= 12.001(16 − 11) +
17.740 2
2
(
16 − 112 +
0.37637 3
3
16 − 113 ) ( )
= 1604.3 m
∫ (0.8888t ) ( )
15 16
≈ 2
+ 4.928t + 88.88 dt + ∫ − 0.1356t 2 + 35.66t − 141.61 dt
11 15
15 16
⎡ 0.8888t 3 4.928t 2 ⎤ ⎡ − 0.1356t 3 35.66t 2 ⎤
=⎢ + + 88.88t ⎥ + ⎢ + − 141.61t ⎥
⎣ 3 2 ⎦ 11 ⎣ 3 2 ⎦ 15
=
0.8888 3
3
(
15 − 113 + )
4.928 2
2
(
15 − 112 + 88.88(15 − 11) )
− 0.1356 3
+
3
(
16 − 15 3 +
35.66 2
2
) (
16 − 15 2 − 141.61(16 − 15) )
= 1595.9 m
Example 2
INTEGRATING DISCRETE FUNCTIONS 07.06.5
What is the absolute relative true error for each of the above four methods if the above data in
Table 1 was actually obtained from the velocity profile of
⎛ ⎡ 140000 ⎤ ⎞
v (t ) = ⎜ 2000 ln ⎢ ⎥ − 9.8t ⎟ , where v is given in m/s and t in s.
⎝ ⎣140000 − 2100t ⎦ ⎠
Solution
The distance covered between t=11 and t=16 is
⎛ ⎡ ⎤ ⎞
16
140000
s = ∫ ⎜⎜ 2000 ln ⎢ ⎥ − 9.8t ⎟⎟dt
11 ⎝ ⎣140000 − 2100t ⎦ ⎠
= 1604.9 m
Method 1:
The approximate value obtained using average velocity method was 1845.3 m, hence, the
absolute relative true error, ∈t , is
1604.9 − 1845.3
∈t = × 100%
1604.9
= 14.979%
Method 2:
The approximate value obtained using the trapezoidal rule was 1604.9 m, hence, the absolute
relative true error, ∈t , is
1604.9 − 1612.2
∈t = × 100%
1604.9
= 0.455%
Method 3:
The approximate value obtained using the direct polynomial was 1604.3 m, hence, the absolute
relative true error, ∈t , is
1604.9 − 1604.3
∈t = × 100%
1604.9
= 0.037%
Method 4:
The approximate value obtained using the spline interpolation was 1595.9m, hence, the absolute
relative true error, ∈t , is
1604.9 − 1595.9
∈t = × 100%
1604.9
= 0.561%
INTEGRATING DISCRETE FUNCTIONS 07.06.6
Method Value ∈t
Appendix
Trapezoidal Rule for Discrete Functions with Unequal Segments
f ( x1 ) + f ( x 2 ) f ( x 2 ) + f ( x3 ) f ( x n −1 ) + f (x n )
≅ ( x 2 − x1 ) + ( x3 − x2 ) + ....... + ( x n − x n −1 )
2 2 2
This approach uses the trapezoidal rule in the intervals [x1 , x 2 ] , [x 2 , x3 ], ….., [x n −1 , x n ] and then
adds the obtained values.
INTEGRATING DISCRETE FUNCTIONS 07.06.7
Example
The upward velocity of a rocket is given as a function of time in Table 2.
s m/s
0 0
10 227.04
15 362.78
20 517.35
22.5 602.97
30 901.67