2.6 Numerical Methods: Linear Systems, Interpolation, Curve Fitting, and ODE Solvers
Key Takeaways
Gaussian elimination reduces a linear system to upper-triangular form and then solves it by back substitution.
Gauss-Seidel iteration converges reliably when the coefficient matrix is diagonally dominant.
A Lagrange or Newton polynomial through n + 1 data points has degree at most n and reproduces every point exactly.
The central difference [f(x+h) − f(x−h)]/(2h) has error of order h², better than the order-h forward difference.
The classical fourth-order Runge-Kutta method has global error of order h⁴, while Euler's method is only first order.
2.6 Numerical Methods: Linear Systems, Interpolation, Curve Fitting, and ODE Solvers
The AMSTHC TOS area "Numerical Methods for Engineers" has five competencies:
- Recall linear algebra and the physical meaning of derivatives and integrals.
- Solve systems of linear equations.
- Use curve fitting and interpolation.
- Apply numerical differentiation and integration.
- Evaluate ordinary differential equations and boundary-value problems.
Root finding and Simpson's rules are in Section 2.4. This section covers the rest. Most items can be done on an allowed scientific calculator, many of which solve 2×2 and 3×3 systems directly. You must still know the method behind the answer.
Matrix Essentials
| Operation | Rule |
|---|---|
| Product | Defined when columns of = rows of ; |
| Determinant (2×2) | |
| Inverse (2×2) | |
| Singular matrix | : no unique solution |
| Transpose |
A 3×3 determinant is found by cofactor expansion or by the diagonal rule (Sarrus).
Solving Simultaneous Linear Equations
Cramer's rule. For , , where is with column replaced by . It is practical for 2 or 3 unknowns.
Gaussian elimination. Use row operations to make the matrix upper-triangular, then back-substitute. Partial pivoting, which swaps rows to put the largest coefficient on the diagonal, reduces round-off error.
Example. Solve , , .
- Eliminate : R2 − ½R1 gives . R3 − 1.5R1 gives .
- Eliminate : R3 + 0.2R2 gives , so .
- Back-substitute: , and .
Check in equation 3: .
Iterative methods. Jacobi updates every unknown from the previous iteration's values. Gauss-Seidel uses each new value as soon as it is available, so it usually converges faster. Both converge when the matrix is diagonally dominant, meaning each diagonal coefficient exceeds the sum of the other coefficients in its row. Large structural stiffness and pipe-network systems are solved this way.
Interpolation
Lagrange form through :
Newton divided differences build the same polynomial incrementally:
The benefit is that adding a new data point only adds one more term.
Example. A rating curve gives , and at stages , and . Estimate at .
- Divided differences: , , .
- .
- Linear interpolation between the last two points would give , so the curvature matters.
Caution
High-degree polynomials through many equally spaced points can oscillate wildly near the ends (Runge's phenomenon). Use piecewise or spline interpolation for long data sets.
Curve Fitting by Least Squares
When data contain scatter, fit a curve that minimizes the sum of squared vertical errors rather than passing through every point. The straight-line case, with slope and intercept formulas, correlation and , is treated in Section 3.2.
Nonlinear relationships are often linearized:
| Model | Transform | Linear form |
|---|---|---|
| take | ||
| take of both sides | ||
| let |
Fit a line to the transformed data, then convert back.
Numerical Differentiation
| Formula | Expression | Error order |
|---|---|---|
| Forward difference | ||
| Backward difference | ||
| Central difference | ||
| Second derivative (central) |
Example. Water-surface elevations of , and are read at , and . The central-difference slope at is .
Reducing lowers truncation error, but very small magnifies round-off error.
Numerical Solution of Ordinary Differential Equations
For with and step :
| Method | Update | Global error |
|---|---|---|
| Euler | ||
| Heun (improved Euler) | predictor ; | |
| Runge-Kutta 4 |
The RK4 slopes are:
Example. For with and :
- Euler gives .
- Heun: the predictor is , and . So .
- The exact solution gives . Heun is much closer than Euler.
Boundary-value problems. These specify conditions at two ends, like a beam's deflection at both supports. There are two common approaches:
- The shooting method guesses the missing initial slope, integrates, and adjusts the guess until the far-end condition is met.
- The finite-difference method replaces derivatives with difference formulas at interior nodes, producing a system of linear equations.
For y' = x + y with y(0) = 1, what does one step of Euler's method with h = 0.2 give for y(0.2)?
1.240
1.400
1.200
1.243
Which iterative method for solving simultaneous linear equations immediately uses each newly computed unknown within the same iteration?
Jacobi iteration
Cramer's rule
Gauss-Seidel iteration
Newton divided differences
A function is tabulated as f(1.9) = 6.859, f(2.0) = 8.000 and f(2.1) = 9.261. What is the central-difference estimate of f'(2.0)?
11.41
12.61
13.80
12.01
Sections you finish are checked off in the contents.