Methods lecture 2 Classification of Differential Equations, Taylor Series Expansions, and Finite Difference Discretization

Classification of Differential Equations: Ordinary, Partial, Initial Value, and Boundary Value Problems

  • Fundamental Classification by Independent Variables:

    • An ordinary differential equation (ODE) contains exactly one independent variable.
    • A partial differential equation (PDE) contains multiple independent variables (strictly greater than one).
  • Initial Value Problems (IVPs):

    • An initial value problem is defined as a differential system where all boundary/initial conditions are specified at a single point in the independent variable domain.
    • Because all constraints are anchored at a single location, the state of the system at any subsequent point depends strictly on the state at the initial point and intermediate history leading up to that point.
    • The flow of physical information in an IVP is strictly unidirectional, propagating along a forward trajectory.
    • Physical Example: A three-mass vibration system undergoing transverse displacement yy.
      • Governed by a second-order ordinary differential equation in time tt.
      • Requires exactly two initial conditions specified at the base time t=0t = 0.
      • Initial deflection: y(0)=1 mmy(0) = 1\,\text{mm}.
      • Initial velocity / derivative: y′(0)y'(0) or y˙(0)\dot{y}(0), representing the initial slope.
      • Damping behavior is governed by the damping coefficient cc. If c=0c = 0, the system exhibits zero damping, resulting in undamped harmonic vibration represented by a pure cosine response: cos⁡(ωt)\cos(\omega t).
  • Boundary Value Problems (BVPs):

    • A boundary value problem is defined as a differential system where conditions are specified at two or more distinct points of the independent variable domain.
    • Information does not propagate in a single direction; the solution at any interior point depends simultaneously on conditions on both sides of the domain.
    • Physical Example: Steady-state heat conduction across a solid block governed by a second-order ODE where temperature TT is a function of the spatial coordinate xx (T=T(x)T = T(x)).
      • Because the equation is second-order with respect to space, two conditions must be specified at different boundary locations (e.g., at x=0x = 0 and x=Lx = L).
      • If the boundary temperature on the right end is abruptly altered from 500500 degrees to 10001000 degrees, or cooled to 00 degrees, or subjected to heat flux via a parabolic solar collector directing concentrated solar rays onto the boundary, that change propagates inward and impacts the temperature at every single interior point across the entire domain.

Information Propagation: One-Way Versus Two-Way Coordinates

  • One-Way Coordinates:

    • An independent variable along which physical information propagates strictly in one direction is termed a one-way coordinate.
    • Time (tt) serves as the primary physical archetype of a one-way coordinate.
    • The solution state at any future time tt is entirely determined by prior history and the immediate local state; it cannot depend on states at subsequent or future times.
    • Numerical Design Constraint: Numerical algorithms formulated for IVPs must reflect this physical causality by computing approximations using only current and prior states.
  • Two-Way Coordinates:

    • An independent variable along which physical information travels in both directions simultaneously is termed a two-way coordinate.
    • Spatial dimensions (xx, yy, zz) typically function as two-way coordinates.
    • Interior points act as bidirectional receivers where states are governed by upstream and downstream boundary conditions concurrently.
  • Mixed Propagation in Partial Differential Equations:

    • Many physical PDEs exhibit mixed coordinate behaviors.
    • Example: A PDE second-order in space xx and first-order in time tt for field variable u(x,t)u(x, t).
      • Requires specification of an initial field profile across all spatial coordinates at the base time: u(x,0)u(x, 0).
      • Requires two spatial boundary conditions at the domain extremes for all t>0t > 0.
      • Information propagates unidirectionally along the temporal coordinate tt and bidirectionally along the spatial coordinate xx.

System Reduction: Converting Higher-Order Equations to First-Order Systems

  • Motivation for System Reduction:

    • Standard numerical solvers and algorithmic integrators are designed exclusively to integrate systems of first-order differential equations.
    • Any single higher-order differential equation of order nn can be systematically recast into an equivalent coupled system of nn first-order differential equations.
  • Transformation Procedure for an nn-th Order ODE:

    • Introduce a set of nn auxiliary state variables representing the function and its successive derivatives up to order n−1n - 1.
    • Demonstration for a Third-Order Equation (n=3n = 3):
      • Define the primary state variable: p(x)p(x).
      • Define the second state variable as the first derivative of pp: q=dpdxq = \frac{dp}{dx}.
      • Differentiate qq with respect to xx to obtain the second derivative: dqdx=d2pdx2\frac{dq}{dx} = \frac{d^2p}{dx^2}.
      • Represent the third derivative d3pdx3\frac{d^3p}{dx^3} by isolating it in terms of pp, qq, and dqdx\frac{dq}{dx}.
      • Linear Algebraic Rearrangement Example: For an equation containing terms such as 7d2pdx2+14dpdx−8p7\frac{d^2p}{dx^2} + 14\frac{dp}{dx} - 8p, moving terms across the equality yields a closed system of three first-order ODEs:
        • dpdx=q\frac{dp}{dx} = q
        • dqdx=r\frac{dq}{dx} = r
        • drdx=f(x,p,q,r)\frac{dr}{dx} = f(x, p, q, r)
    • Multibody Dynamics Example: The mechanical modeling of a basketball trajectory utilizes a system of 66 coupled first-order ODEs, which is fundamentally equivalent to a single 6th6\text{th}-order differential equation collapsed into component state variables.

Mathematical Foundations of Taylor Series and Continuity Requirements

  • Role of Taylor Series in Numerical Analysis:

    • Taylor series expansions provide the foundational theoretical framework for constructing finite difference approximations and discretization schemes for differential operators.
    • Taylor series converts differential operators into algebraic expressions relating discrete nodal values.
  • Continuity and Differentiability Hypotheses:

    • Classical Taylor series expansion relies on the prerequisite that the target function f(x)f(x) is continuous and infinitely differentiable (C∞C^\infty) across the analytical domain.
    • Continuous and Differentiable Example: The sine function sin⁡(x)\sin(x) is defined, continuous, and smoothly differentiable across all x∈Rx \in \mathbb{R}.
    • Continuous but Non-Differentiable Example (Ramp / Triangular Wave):
      • A continuous ramp or saw-tooth wave contains sharp directional changes ("kinks").
      • At each kink, the first derivative dfdx\frac{df}{dx} is undefined because the left-sided limit of the slope does not equal the right-sided limit of the slope:
        • lim⁡x→xk−dfdx≠lim⁡x→xk+dfdx\lim_{x \to x_k^-} \frac{df}{dx} \neq \lim_{x \to x_k^+} \frac{df}{dx}
      • This results in a jump discontinuity in the derivative profile, violating the smooth differentiability requirement.
      • Analytical Remedy: Functions with discontinuous slopes can be approximated using Fourier series expansions, which synthesize non-smooth waveforms into infinite linear combinations of continuous sine and cosine basis functions.
  • Primary Engineering Applications of Taylor Series:

    • Derivation of power series representations for transcendental functions.
    • Formulation of finite difference algebraic approximations for derivatives within differential equations.

Taylor Series Formulation and Truncation Error

  • General Formulation Around an Anchor Point:

    • Let x0x_0 represent an anchor (base) point where the function value and all higher-order derivatives are known.
    • The function value at an arbitrary neighboring target point xx is given by the infinite series:
      • f(x)=f(x0)+f′(x0)(x−x0)+f′′(x0)2!(x−x0)2+f′′′(x0)3!(x−x0)3+⋯+f(n)(x0)n!(x−x0)n+…f(x) = f(x_0) + f'(x_0)(x - x_0) + \frac{f''(x_0)}{2!}(x - x_0)^2 + \frac{f'''(x_0)}{3!}(x - x_0)^3 + \dots + \frac{f^{(n)}(x_0)}{n!}(x - x_0)^n + \dots
  • Power Series Expansion of f(x)=exf(x) = e^x Around x0=0x_0 = 0:

    • Base function value: f(0)=e0=1f(0) = e^0 = 1.
    • Derivatives: f(n)(x)=ex  ⟹  f(n)(0)=e0=1f^{(n)}(x) = e^x \implies f^{(n)}(0) = e^0 = 1 for all integers n≥1n \ge 1.
    • Substituting these derivatives into the Taylor series yields the standard exponential power series:
      • ex=1+x+x22!+x33!+x44!+…e^x = 1 + x + \frac{x^2}{2!} + \frac{x^3}{3!} + \frac{x^4}{4!} + \dots
  • Convergence and Error Mechanics:

    • Approximating e1e^1 (Exact analytical value: e1≈2.7182818…e^1 \approx 2.7182818\dots):
      • One-term approximation: e1≈1e^1 \approx 1 (high percentage truncation error).
      • Two-term approximation: e1≈1+1=2e^1 \approx 1 + 1 = 2.
      • Three-term approximation: e1≈1+1+12=2.5e^1 \approx 1 + 1 + \frac{1}{2} = 2.5.
      • Four-term approximation: e1≈1+1+0.5+16≈2.6667e^1 \approx 1 + 1 + 0.5 + \frac{1}{6} \approx 2.6667.
      • Incorporating successive higher-order terms systematically decreases the percentage error toward machine precision.
    • Effect of Step Size on Truncation Error:
      • Evaluating the series at x=0.1x = 0.1 yields significantly higher accuracy with fewer polynomial terms compared to evaluation at x=1.0x = 1.0.
      • Proximity principle: The closer the target evaluation point xx is to the anchor point x0x_0 (i.e., the smaller the displacement Δx=x−x0\Delta x = x - x_0), the fewer terms are required to achieve a specified error tolerance.
    • Series Truncation: Numerical implementations cannot sum infinite terms. Series are truncated after a designated number of terms (e.g., retaining the first four terms), discarding all higher-order derivatives as the truncation error residue.

Spatial Domain Discretization and Grid Indexing

  • One-Dimensional Discretization Mechanics:

    • A continuous spatial domain of length LL bounded between coordinates x0x_0 and xNx_N is partitioned into discrete sub-intervals.
    • By convention, the domain origin can be defined such that x0=0x_0 = 0.
    • Partitioning the physical interval into NN discrete segments requires exactly N+1N + 1 discrete boundary and interior grid points.
  • Grid Point Numbering and Coordinate Mapping:

    • Grid points are indexed using integer subscripts: x0,x1,x2,…,xi,…,xNx_0, x_1, x_2, \dots, x_i, \dots, x_N.
    • Index ranges: i∈{0,1,2,…,N}i \in \{0, 1, 2, \dots, N\}.
    • In higher-dimensional domains, spatial coordinates utilize distinct spatial indices:
      • ii for the xx-coordinate.
      • jj for the yy-coordinate.
      • kk for the zz-coordinate.
      • nn is typically reserved as a superscript or subscript for the temporal index (tt).
  • Uniform Grid Step Size (hh):

    • On a uniform (equidistant) mesh, the step size hh is constant throughout:
      • h=x1−x0=x2−x1=xi+1−xih = x_1 - x_0 = x_2 - x_1 = x_{i+1} - x_i
    • For a total of NN uniform segments over span xN−x0x_N - x_0:
      • h=xN−x0Nh = \frac{x_N - x_0}{N}
    • The exact physical coordinate of the ii-th node is determined algebraically:
      • xi=x0+i⋅hx_i = x_0 + i \cdot h
      • When x0=0x_0 = 0, this simplifies to xi=i⋅hx_i = i \cdot h.
    • Non-Uniform Grids: Equidistant spacing simplifies algebraic formulations, but non-uniform grids are deployed when localized physical gradients demand localized spatial resolution.
  • Compact Discrete Function Notation:

    • The value of the continuous function f(x)f(x) evaluated at a discrete grid point xix_i is denoted in compact subscript form:
      • f(xi)≡fif(x_i) \equiv f_i
      • f(xi+1)≡fi+1f(x_{i+1}) \equiv f_{i+1}
      • f(xi−1)≡fi−1f(x_{i-1}) \equiv f_{i-1}
      • f(xi+2)≡fi+2f(x_{i+2}) \equiv f_{i+2}
      • f(xi−2)≡fi−2f(x_{i-2}) \equiv f_{i-2}

Discrete Grid Taylor Series Expansions

  • Forward Taylor Series Expansion (xi+1x_{i+1} about xix_i):

    • Anchor point: xix_i.
    • Target forward point: xi+1=xi+hx_{i+1} = x_i + h.
    • Displacement: xi+1−xi=hx_{i+1} - x_i = h.
    • Expansion:
      • fi+1=fi+hfi′+h22!fi′′+h33!fi′′′+h44!fi(4)+…f_{i+1} = f_i + h f'_i + \frac{h^2}{2!} f''_i + \frac{h^3}{3!} f'''_i + \frac{h^4}{4!} f^{(4)}_i + \dots
  • Backward Taylor Series Expansion (xi−1x_{i-1} about xix_i):

    • Anchor point: xix_i.
    • Target backward point: xi−1=xi−hx_{i-1} = x_i - h.
    • Displacement: xi−1−xi=−hx_{i-1} - x_i = -h.
    • Because odd powers of −h-h produce negative signs and even powers produce positive signs, the series alternates:
      • fi−1=fi−hfi′+h22!fi′′−h33!fi′′′+h44!fi(4)−…f_{i-1} = f_i - h f'_i + \frac{h^2}{2!} f''_i - \frac{h^3}{3!} f'''_i + \frac{h^4}{4!} f^{(4)}_i - \dots
  • Extended Forward and Backward Multi-Step Expansions:

    • Double-step forward (xi+2x_{i+2} about xix_i):
      • Target point: xi+2=xi+2hx_{i+2} = x_i + 2h.
      • Displacement: xi+2−xi=2hx_{i+2} - x_i = 2h.
      • Expansion:
        • fi+2=fi+2hfi′+(2h)22!fi′′+(2h)33!fi′′′+…f_{i+2} = f_i + 2h f'_i + \frac{(2h)^2}{2!} f''_i + \frac{(2h)^3}{3!} f'''_i + \dots
        • fi+2=fi+2hfi′+2h2fi′′+4h33fi′′′+…f_{i+2} = f_i + 2h f'_i + 2h^2 f''_i + \frac{4h^3}{3} f'''_i + \dots
    • Double-step backward (xi−2x_{i-2} about xix_i):
      • Target point: xi−2=xi−2hx_{i-2} = x_i - 2h.
      • Displacement: xi−2−xi=−2hx_{i-2} - x_i = -2h.
      • Expansion:
        • fi−2=fi−2hfi′+(−2h)22!fi′′+(−2h)33!fi′′′+…f_{i-2} = f_i - 2h f'_i + \frac{(-2h)^2}{2!} f''_i + \frac{(-2h)^3}{3!} f'''_i + \dots
        • fi−2=fi−2hfi′+2h2fi′′−4h33fi′′′+…f_{i-2} = f_i - 2h f'_i + 2h^2 f''_i - \frac{4h^3}{3} f'''_i + \dots

Finite Difference Approximations of Derivatives

  • Algorithmic Objective:

    • To replace continuous derivative operators (fi′f'_i, fi′′f''_i, etc.) with algebraic expressions involving only the discrete function values (fif_i, fi+1f_{i+1}, fi−1f_{i-1}, etc.), eliminating higher-order analytical derivatives from the computational scheme.
  • Derivation of the First-Order Forward Difference Formula:

    • Truncate the forward Taylor series expansion after the linear derivative term:
      • fi+1=fi+hfi′+O(h2)f_{i+1} = f_i + h f'_i + \mathcal{O}(h^2)
    • Isolate the derivative term fi′f'_i:
      • hfi′=fi+1−fi−O(h2)h f'_i = f_{i+1} - f_i - \mathcal{O}(h^2)
    • Divide through by the grid step size hh:
      • fi′=fi+1−fih+O(h)f'_i = \frac{f_{i+1} - f_i}{h} + \mathcal{O}(h)
    • The leading truncation error term is proportional to the first power of hh, classifying this as a first-order accurate forward difference approximation.
  • Geometric and Physical Interpretation:

    • The continuous derivative f′(xi)f'(x_i) represents the exact tangent slope to the function curve at coordinate xix_i.
    • The finite difference quotient fi+1−fih\frac{f_{i+1} - f_i}{h} represents the slope of the secant line intersecting the two discrete coordinate points (xi,fi)(x_i, f_i) and (xi+1,fi+1)(x_{i+1}, f_{i+1}).
    • Secant slope formula corresponds directly to the "rise over run" formulation:
      • Rise=fi+1−fi\text{Rise} = f_{i+1} - f_i
      • Run=xi+1−xi=h\text{Run} = x_{i+1} - x_i = h
      • Secant Slope=RiseRun=fi+1−fih\text{Secant Slope} = \frac{\text{Rise}}{\text{Run}} = \frac{f_{i+1} - f_i}{h}
  • Impact of Stencil Width on Approximation Accuracy:

    • Using a two-point stencil (xix_i, xi+1x_{i+1}) yields a basic first-order estimate.
    • Incorporating additional information—such as two points on either side (a four-point stencil) or symmetric three-point and five-point stencils—cancels lower-order error terms in the Taylor expansions, yielding higher-order accurate algebraic formulas for the derivative.