Trapezoidal, Simpson's, and Midpoint integration formulas

Linear electrical circuits can be easily miniaturized if they do not include
inductors, which are relatively large and bulky. Here we consider
a simple resistor-capacitor (RC) one-port network driven by the same
current source as in Lecture 3.1.
When a current *I = I(t)* is applied to the input port,
the voltage *V = V(t)* develops across the port terminals.
The voltage output *V(t)* at the time instance *t = T*
can be determined as a sum of the voltage drop across the resistor
(which is *R I(T)* from the Ohm's law)
and of the voltage drop across the capacitor (which is *V _{0} +
S_{T}[I(t)]/C*, where

V(T) = R I(T) + V_{0} + S_{T}[I(t)] / C.

Thus, the integral *S _{T}[I(t)* must be
estimated numerically from the given data set (

Consider a linear piecewise interpolation between the data values
(*t _{k},I_{k}*) for

S_{h}[I(t)] = 0.5 h (I_{0} + I_{1})

Summating areas of all *n* trapezoids between *t = 0* and *t = T*,
we obtain the **composite trapezoidal rule** for numerical integration:

S_{T}[I(t)] = 0.5 h (I_{0} + 2I_{1} + 2I_{2} + ...
+ 2I_{n-1} + I_{n})

The truncation error of the composite trapezoidal rule has the order of
*O(h ^{2})*, where the coefficient is proportional to the
length of the interval, i.e. to

Consider a quadratic interpolation between three points:
(*t _{0},I_{0}*), (

P_{2}(t) = I_{0} + f[t_{0},t_{1}] (t - t_{0})
+ f[t_{0},t_{1},t_{2}] (t - t_{0})(t - t_{1}),

where *f[t _{0},t_{1}]* and

S_{2h}[I(t)] = h (I_{0} + 4I_{1} + I_{2}) / 3

If the whole interval *T* is divided into even number *n*
of equally spaced subintervals, then the piecewise quadratic interpolation can be
applied to each two adjacent subintervals. Notice that such a piecewise
interpolation is not a quadratic spline since the quadratic interpolating
polynomials *P _{2}(t)* are not matched at different subintervals.
Summating integrals of all

S_{T}[I(t)] = h (I_{0} + 4I_{1} + 2I_{2} +
4I_{3} + 2I_{4} + ... + 2I_{n-2} + 4I_{n-1}
+ I_{n}) / 3

The truncation error of the composite Simpson's rule has the order of
*O(h ^{4})*, where the coefficient is proportional to the
length of the interval, i.e. to

If the function *I = I(t)* has a singularity at the end of the interval,
i.e. either at *t = 0* or at *t = T* or at both, the trapezoidal
or Simpson's integration formulas for *S _{T}[I(t)]* are
not useful, since the data values

S_{2h}[I(t)] = 2 h I_{1}

Replacing the function *I(t)* by a piecewise constant interpolation
and summating areas of all *n/2* rectangles between *t = 0* and *t = T*,
we obtain the **composite midpoint rule** for numerical integration:

S_{T}[I(t)] = 2 h (I_{1} + I_{3} + I_{5} + ...
+ I_{n-3} + I_{n-1})

The truncation error of the composite trapezoidal rule has the order of
*O(h ^{2})*, where the coefficient is proportional to the
length of the interval, i.e. to

- Errors of numerical integration
- Presents graphs of numerical integration for the current
*I(t)*