2026 2NM4 Week 8 - Differential Equations: Initial value problems
Overview
The lecture connects numerical integration to initial value problems, showing how truncation error, step size, and accumulated error shape time-stepping methods. It derives two-point Gauss-Legendre quadrature, reviews linear-system and nonlinear least-squares tools, then introduces IVPs, adaptive stepping, Runge-Kutta stages, and Forward Euler, whose global error is first order in the time step.
Key takeaways
- Two-point Gauss-Legendre quadrature uses points at plus and minus 1 divided by the square root of 3, with unit weights, to integrate any cubic exactly on the interval from -1 to 1.
- Romberg integration repeatedly halves the step size and uses Richardson extrapolation to raise formal accuracy, but its error cancellation depends on a regular error expansion and becomes unreliable near floating-point precision.
- A differential equation is linear when the unknown and its derivatives appear only to the first power and are not multiplied by one another; coefficients may depend on the independent variable without breaking linearity.
- Second-order initial value problems generally require two initial conditions, such as position and velocity, while Dirichlet and Neumann data specify function values and derivatives respectively.
- Forward Euler is a first-order global-accuracy method: reducing its time step improves accuracy but increases the number of accumulated steps.
- Time-step selection must match the fastest physical scale that matters to the simulation, and adaptive stepping helps manage problems whose relevant time scales change during a run.
Chapters
- Newton-Cotes rules fit polynomials over panels: Riemann sums use constants, the trapezoid rule uses lines, and Simpson's rule uses quadratics.
- Simpson's 1/3 rule combines two panels; the 3/8 rule handles three panels, useful when an interval has an odd number of panels.
- For the trapezoid rule, panel error is order h cubed while total error over a fixed interval is order h squared because the number of panels grows as h shrinks.
- Richardson extrapolation compares approximations made with step sizes h and h/2, then combines them to cancel the leading error term.
- For the trapezoid rule, the total error is modeled as proportional to h squared, so multiplying the refined estimate by four before subtracting cancels that term.
- Under the assumed error expansion, the combined approximation improves from second-order to fourth-order accuracy without simply repeating the same calculation.
- Romberg integration repeatedly halves the step size and applies Richardson extrapolation to successive trapezoid-rule estimates.
- Each extrapolation level raises the formal order by two, producing a triangular table of increasingly refined estimates.
- Halving steps can reuse earlier function evaluations, but the extrapolation depends on a sufficiently regular error expansion; the lecture cautions that the method can mislead on irregular or noisy functions.
- The cancellation argument assumes the leading error coefficient changes little across the integration interval.
- If the function has substantial curvature variation or high-frequency noise, the error terms may not cancel as expected.
- The lecture contrasts Romberg's extrapolation with practical quadrature routines that choose among Simpson's, quadratic, and cubic rules based on local data.
- A sine integral with a known exact value of 2 illustrates how Romberg estimates improve as the number of intervals grows.
- The demonstrated table reaches errors near 1e-16, where floating-point roundoff makes further reported digits unreliable.
- The lecture advises treating apparent zero error at machine precision as a limit of numerical representation, not proof of an exact result.
- Unlike Newton-Cotes rules, which use fixed, typically evenly spaced data points, Gaussian quadrature chooses special evaluation points and weights.
- The goal is maximal polynomial exactness for a given number of function evaluations.
- The standard derivation begins on the symmetric interval from -1 to 1, which simplifies the behavior of even and odd powers.
- For an integral over -1 to 1, the proposed two-point rule has four unknowns: two weights and two evaluation points.
- Requiring exact integration of the monomials 1, x, x squared, and x cubed produces four equations for those unknowns.
- The resulting weights are both 1, and the Gauss points are minus and plus 1 divided by the square root of 3.
- Two-point Gauss-Legendre quadrature integrates every polynomial through degree three exactly using only two function evaluations.
- Because a cubic is a weighted sum of 1, x, x squared, and x cubed, exactness for those monomials guarantees exactness for any cubic.
- Symbolic tools such as SymPy can verify integrals, while numerical outputs near floating-point precision should be read as effectively zero rather than exact.
- A linear change of variables maps an arbitrary interval from a to b onto the Gauss-Legendre reference interval from -1 to 1.
- The transformed integral includes the corresponding change-of-variable factor, after which the standard Gauss points and weights apply.
- This reference-domain approach is also used in finite element software such as COMSOL.
- Three-point and higher Gauss rules use additional points and nontrivial weights, which are commonly tabulated or generated algorithmically.
- Unlike Newton-Cotes error estimates, Gauss quadrature error is characterized through higher derivatives rather than an explicit step-size power; a cubic has zero fourth derivative.
- Multidimensional integration can be decomposed by coordinate, and finite element methods map quadrilateral or triangular elements to reference domains for quadrature.
- Double integrals can be evaluated by integrating along one coordinate and then another, allowing one-dimensional Gaussian rules to extend to multiple dimensions.
- Finite element calculations transform physical elements into standard reference elements before applying quadrature.
- The lecture links the order of a finite element to its Gauss-point integration and notes that triangular elements use barycentric coordinates.
- Dense LU factorization costs order n cubed, while forward and back substitution after factorization cost order n squared.
- For curve fitting, nonlinear least-squares methods can lead to pseudoinverse calculations; practical implementations often use singular value decomposition for numerical robustness.
- SVD has its own computational cost, so the lecture emphasizes understanding the purpose and scaling of algorithms rather than memorizing intricate complexity expressions.
- A matrix containing many zeros does not automatically make a dense solver faster; the solver must receive a sparse representation to skip zero operations.
- Sparse storage formats encode only nonzero entries, and libraries such as NumPy and SciPy should not be assumed to infer sparsity from an ordinary dense array.
- For banded matrices, solve cost depends on both the number of unknowns and bandwidth; finite-difference discretizations often produce this structure.
- Preconditioners transform a linear system into a form that is easier for an iterative solver to handle, without claiming to solve the original system exactly by themselves.
- The lecture uses local subproblems as an analogy: approximate pieces are assembled and iteratively reconciled into a better global solution.
- Diagonal dominance, sparsity, and eigenvalue behavior can affect how effectively a preconditioner improves convergence.
- Golden-section search chooses its interior point so either branch reduces the bracket by the same ratio.
- That self-similarity lets the method reuse a function evaluation while narrowing the search interval regardless of which side contains the optimum.
- Iteration continues until the bracket is sufficiently small for the chosen tolerance.
- Big O focuses on the term that dominates as problem size tends to infinity, ignoring constant multipliers and lower-order terms.
- In numerical error analysis, powers of the step size h describe how truncation error changes as the discretization is refined.
- Taylor expansion connects the two uses: after a method captures its lower-order terms, the first neglected power of h dominates the error for sufficiently small steps.
- Gauss-Newton minimizes the sum of squared residuals and approximates the Hessian using the residual Jacobian product J-transpose-J.
- The approximation works best near a solution, where the residual vector is small and the omitted second-derivative terms matter less.
- Levenberg-Marquardt adds lambda times the identity matrix: small lambda approaches Gauss-Newton, while large lambda makes the update resemble gradient descent.
- An ordinary differential equation relates an unknown function to derivatives with respect to one independent variable; first- and second-order equations involve different highest derivatives.
- Linearity is preserved when the unknown function and its derivatives appear only linearly, even when their coefficients depend on the independent variable.
- Terms such as y squared, y times dy/dx, or sine of y make an equation nonlinear.
- An equation remains linear when its coefficients depend only on the independent variable, such as time or position.
- A forcing term that depends on the independent coordinate makes a linear equation inhomogeneous, but does not make it nonlinear.
- Finite-difference approximations to derivatives are linear combinations of unknown grid values, enabling linear-system methods for linear differential equations.
- An initial value problem specifies the function or its derivatives at one point, commonly the starting time for a time-stepping calculation.
- A Dirichlet condition fixes the function value, while a Neumann condition fixes a derivative such as the initial velocity.
- A Robin condition combines function and derivative information in one relation; a second-order equation generally needs two independent conditions.
- A boundary-value problem supplies information at multiple boundaries, unlike an initial-value problem that starts from data at one point.
- Elliptic PDEs commonly describe steady states, while parabolic PDEs are typically first order in time and second order in space and model diffusion.
- Hyperbolic PDEs describe wave-like behavior; the lecture contrasts their time-reversible wave propagation with the information loss associated with diffusion.
- A second-order equation such as a motion equation needs two independent initial conditions, typically position and velocity.
- Each time step uses the previous numerical state, so local errors can propagate and accumulate into global error over a long simulation.
- Time integrators are numerical integration methods applied successively along a solution trajectory.
- The time step must resolve the physical behavior of interest: a metal impact may involve fast elastic waves even when the desired output is only rebound height.
- Adaptive time stepping changes the step size as the problem moves between slow and fast dynamics, avoiding manual adjustment throughout a simulation.
- Storing every historical state can consume substantial memory; COMSOL-style solvers may retain only a few recent states for methods such as backward differentiation formulas and write older output to disk.
- Local error belongs to one time step, while global error accumulates across the full integration, paralleling panel and total error in numerical quadrature.
- Stability concerns how errors propagate; stiff problems may require methods that prevent numerical perturbations from growing uncontrollably.
- Single-step methods use the current state, while multistep methods retain prior states; Runge-Kutta methods use multiple internal stages without retaining a history of previous time steps.
- Runge-Kutta methods estimate intermediate slopes, called stages, then combine them to improve the next state.
- The stage calculations approximate higher-order Taylor-series contributions without explicitly calculating every higher derivative.
- Runge-Kutta methods include explicit and implicit variants, and adaptive solvers can use estimated local error to guide step-size changes.
- An explicit solver calculates the next state directly from known values, unlike an implicit solver that solves for a state consistent with an equation involving the new time step.
- For an ODE written as dy/dt = f(t,y), the function used by a time integrator is the isolated derivative's right-hand side.
- For dy/dt = y, the integrator uses f(t,y) = y, not the rearranged residual y - dy/dt.
- Forward Euler updates y at the next time step using the current value plus h times the current slope, equivalent to a left-endpoint Riemann approximation.
- Its local error is order h squared and its accumulated global error is order h, so reducing h improves accuracy at the cost of more steps.
- For the example dy/dt = 4e^(0.8t) - 0.5y, the equation is first-order, linear, and inhomogeneous because y appears linearly and the forcing depends on time.
Transcript excerpt
0:00 Cool. Numerical integration. We did a whole bunch of them. Uh, let's see. They were in general types of Newton-Cotes integration formulae. What that meant is that we had our total our total integral that we wanted to integrate all over. We divided those into panels and then we fit different order polynomials. Zeroth order polynomial is a constant. That was our left and right Riemann sums, midpoint Riemann. First order polynomial is a line. That's our trapezoid. Second order is our quad. That's our Simpson's. Uh, what is it? One third rule is the quad and uh 3/8 rule is the cubic. We needed to combine those two because if you're
0:48 doing quads, you've combined two panels. But if you have an odd number of panels, therefore you you kind of like stack mostly uh quads and then you throw on a cubic at the end. What we found with that was that each panel had an integration uncertainty, but the total integral had one less order of convergence on top of that. So each panel had like order h cubed, for example, but because you're stacking this panel and this panel and this panel and this panel, the number of panels there is proportional to your step size for the same total interval. Therefore order h cubed on each panel becomes order h squared overall. Okay? This is going to become critical as soon as we talk about uh differential equations and initial
1:39 value problems because this is where initial value problems are going to be time integrators. That's what they're called. All this integration is going to be like haunting your dreams for the next few weeks. Telling you right now. Uh, let's see. Okay. That was Simpson's rule. We got through that one. The way that Newton-Cotes works
This is the start of the transcript. Save this video free for the whole transcript, searchable and time-coded.
In this course
Related notes
Summary, takeaways, and chapters were generated by AI from the video's transcript and may contain errors. The video belongs to its creator, Numerical Methods for Engineering.