Page 106 -
P. 106
the area of the trapezoid with vertices having the following coordinates: (x(k),
0); (x(k + 1), 0); (x(k + 1), y(k + 1)); (x(k), y(k)); giving for this trapezoid area
the value:
1 [ (xk + 1) xk− ( )][ (y k + 1) y+ ( )]k = ∆ x [ (yk + 1) yk+
2 2 ( )]
thus leading to the following iterative expression for the Trapezoid integrator:
∆ x
Ik( + 1 ) = Ik( ) + [ yk( + 1 ) + yk( )]
T T
2
The initial condition is: I (1) = 0.
T
a. Evaluate the integrals of Pbs. 4.25 through 4.29 using the Trapezoid
rule.
b. Compare for the same values of ∆x, the accuracy of the Trapezoid
rule with that of the midpoint rule.
c. Give a geometrical interpretation for the difference in accuracy
obtained using the two integration schemes.
NOTE MATLAB has a built-in command for evaluating the integral by the
Trapezoid rule. If the sequence of the sampling points and of the function val-
ues are given, trapz(x,y) gives the desired result.
4.5 A Better Numerical Differentiator
In Section 4.2, for the numerical differentiator, we used the simple expression:
dk() = 1 ( yk( ) − yk( − 1 )) (4.8)
∆ x
Our goal in this section is to find a more accurate expression for the differen-
tiator. We shall use the difference equation for the Trapezoid rule to derive
this improved differentiator, which we shall denote by D(k).
The derivation of the difference equation for D(k) hinges on the basic obser-
vation that differentiating the integral of a function gives back the original
function. We say that the numerical differentiator is the inverse of the numer-
ical integrator. We shall use the convolution-summation representation of the
solution of a difference equation to find the iterative expression for D(k).
Denoting the weighting sequence representations of the identity operation,
the numerical integrator, and the numerical differentiator by {w}, {w }, and
1
© 2001 by CRC Press LLC