6.2 Interpolation, Numerical Integration & Numerical Solution of ODEs
Key Takeaways
The trapezoidal rule integrates with error of order h², while Simpson's 1/3 rule reaches order h⁴ and integrates cubics exactly despite fitting parabolas.
Simpson's 1/3 rule requires an even number of intervals; Simpson's 3/8 rule requires a multiple of three.
Lagrange and Newton divided-difference interpolation through the same n + 1 points produce the identical unique polynomial of degree ≤ n, only in different algebraic form.
Euler's method has global error of order h and is only conditionally stable; fourth-order Runge-Kutta reaches global error of order h⁴ using four slope evaluations per step.
Numerical differentiation amplifies noise: the central difference [f(x+h) − f(x−h)]/2h is second-order accurate and preferred over one-sided differences.
6.2 Interpolation, Numerical Integration & Numerical Solution of ODEs
The second half of the PRC Enhanced TOS topic Numerical Methods & Analysis deals with data that arrives as a table rather than a formula, and with differential equations that have no closed-form solution. Electrical engineers meet both daily: conductor ampacity tables that need interpolation, measured load curves that need integration into energy, and transient-stability swing equations that need step-by-step solution.
1. Interpolation
Linear Interpolation
The workhorse for reading between two rows of a PEC or manufacturer's table:
Lagrange Interpolating Polynomial
For data points, the unique polynomial of degree through them is
Newton's Divided-Difference Form
with divided differences built recursively as
Examinable fact: Lagrange and Newton forms give the same polynomial through the same points — the interpolating polynomial of degree through distinct points is unique. Newton's form is preferred in practice because adding a new data point only appends one term instead of rebuilding everything.
Interpolation vs. extrapolation: estimating inside the data range is interpolation and is comparatively safe; going outside it is extrapolation, and high-degree polynomials diverge violently there (Runge's phenomenon). Spline interpolation, which fits low-degree polynomials piecewise with matched slopes and curvatures, avoids this oscillation.
2. Finite Differences & Numerical Differentiation
| Scheme | Formula | Truncation error |
|---|---|---|
| Forward difference | ||
| Backward difference | ||
| Central difference | ||
| Second derivative |
The central difference is second-order accurate at the same cost as the one-sided forms, so it is the default. Be aware that numerical differentiation amplifies measurement noise (the subtraction of nearly equal numbers is divided by a small ), which is why differentiating a noisy current signal is far less reliable than integrating it.
3. Numerical Integration
With :
Trapezoidal Rule
Simpson's 1/3 Rule — must be even
The coefficient pattern is . Although it fits parabolas, Simpson's 1/3 rule integrates cubics exactly — a favourite examination fact.
Simpson's 3/8 Rule — must be a multiple of three
| Rule | Fits | Interval requirement | Error order | Exact for polynomials up to degree |
|---|---|---|---|---|
| Trapezoidal | Straight lines | any | 1 | |
| Simpson's 1/3 | Parabolas | even | 3 | |
| Simpson's 3/8 | Cubics | multiple of 3 | 3 |
4. Numerical Solution of Ordinary Differential Equations
For with :
Euler's Method
Simple, but only first-order accurate and conditionally stable — halving only halves the error while doubling the work.
Heun's Method (Improved Euler, RK2)
Fourth-Order Runge-Kutta (RK4)
RK4 costs four function evaluations per step but delivers fourth-order accuracy, which is why it is the standard integrator for the transient-stability swing equation and for machine dynamic models.
Solved Board Exam Examples
Example 1: Simpson's 1/3 Rule on a Load Curve
A feeder demand is recorded every 2 hours over an 8-hour shift: 4.0, 5.2, 6.8, 6.0 and 4.4 MW. Estimate the energy delivered.
Solution. Here h and intervals — even, so Simpson's 1/3 rule applies:
The trapezoidal rule on the same data gives 44.40 MWh — close here, but with error of order rather than .
Example 2: One RK4 Step on an RL Transient
For with , take one RK4 step of s.
Solution.
The exact solution is , giving A — RK4 is correct to five decimal places in a single step, while plain Euler would have returned 1.0000 A, an error of 10%.
Example 3: Lagrange Interpolation of Conductor Ampacity
Ampacity is tabulated as 115 A at 30 °C, 103 A at 40 °C and 89 A at 50 °C. Estimate the ampacity at 35 °C using a second-degree Lagrange polynomial.
Solution. With and :
Simple linear interpolation between the first two rows would give 109.0 A; the quadratic form captures the slight curvature of the derating curve. Note that the coefficients sum to exactly 1.000, a useful arithmetic check.
A set of measurements is to be integrated using Simpson's 1/3 rule. What restriction applies to the number of intervals?
The number of intervals must be a multiple of three
There is no restriction on the number of intervals
The number of intervals must be odd
The number of intervals must be even
Although Simpson's 1/3 rule fits parabolic arcs through the data, up to what polynomial degree does it integrate exactly?
Degree 1
Degree 2
Degree 4
Degree 3
Compared with Euler's method at the same step size, what does the fourth-order Runge-Kutta method require and deliver?
Four function evaluations per step and global error of order h⁴
Two function evaluations per step and global error of order h²
One function evaluation per step and global error of order h⁴
Four function evaluations per step and global error of order h²
Sections you finish are checked off in the contents.