Numerical MethodUnit 711 min read

Numerical PDEs & Boundary Value Problems: Methods, Errors & Applications

Unit 7 of Numerical Method covers partial differential equations (PDEs), boundary value problems (BVPs), finite difference methods, shooting methods, and error analysis with real-world applications in physics, finance, and engineering.

TAKEAWAYS:

  • PDEs vs. ODEs: PDEs involve partial derivatives (e.g., heat equation) and require boundary conditions, while ODEs involve ordinary derivatives (e.g., population growth).
  • Finite Difference Methods: Approximate derivatives using Taylor series expansions (forward, backward, central differences) to solve PDEs numerically.
  • Boundary Value Problems (BVPs): Solve PDEs with conditions at boundaries (Dirichlet, Neumann, or mixed) using shooting methods or finite differences.
  • Error Analysis: Truncation errors arise from discretization, while round-off errors stem from floating-point precision.
  • Real-World Applications: Heat conduction (NTC power grids), fluid dynamics (Pathao traffic routing), and financial modeling (NEPSE stock predictions).
  • Exam Focus: Derive finite difference schemes, solve BVPs using shooting methods, and analyze errors in numerical solutions.

1. Introduction to Partial Differential Equations (PDEs)

PDEs describe how quantities change in space and time. Unlike ODEs, which model systems evolving along a single dimension (e.g., time), PDEs model systems with multiple independent variables (e.g., space and time).

0.10.20.30.40.50.60.70.80.910.20.40.60.81xyHeat Equation Initial Condition: u(x,0) = sin(πx)Dirichlet BC: u(0,t)=0Dirichlet BC: u(1,t)=0Peak at x=0.5
Temperature distribution in a 1D rod (L=1) over time (α=0.01)

Key Types of PDEs

classDiagram
    class Elliptic {
        +Laplace's Equation: ∇²u = 0
        +Poisson's Equation: ∇²u = f(x,y)
        +Steady-state problems (e.g., heat distribution)
    }
    class Parabolic {
        +Heat Equation: ∂u/∂t = α∇²u
        +Diffusion processes (e.g., drug concentration)
    }
    class Hyperbolic {
        +Wave Equation: ∂²u/∂t² = c²∇²u
        +Vibration/propagation (e.g., sound waves)
    }
    PDE <|-- Elliptic
    PDE <|-- Parabolic
    PDE <|-- Hyperbolic

Example: Heat Equation (Parabolic PDE)

The heat equation models temperature in a rod: Boundary Conditions (BCs):

  • Dirichlet: (fixed temperature at ends).
  • Neumann: (insulated ends).
Lx
1D rod for heat equation (length L, cross-section area A)

Real-World Link:

  • NTC Power Grids: Engineers use PDEs to model heat dissipation in transformers. The heat equation predicts overheating risks, ensuring safety in Nepal’s national grid.
  • Daraz Logistics: PDEs optimize temperature control in cold storage warehouses, reducing spoilage for perishable goods.

2. Finite Difference Methods for PDEs

Finite difference methods approximate derivatives using Taylor series expansions. For a function , the central difference for the first derivative is: For the second derivative:

01x₀=0x₁=0.1x₂=0.2x₅=0.5x₁₀=1
Discretized domain for heat equation (h=0.1, N=10)

Discretizing the Heat Equation

Divide the rod into segments of width . Let be the temperature at and time , where is the time step.

The heat equation becomes: Rearranged: Stability Condition: (to avoid oscillations).

Worked Example: 1D Heat Equation

Problem: Solve for , , with:

  • (Dirichlet BCs).
  • Initial condition: .
0.10.20.30.40.50.60.70.80.910.20.40.60.81xyPeakBoundary
Temperature profile over time for L=1, α=1

Solution:

  1. Choose , (satisfies stability).
  2. Compute using the finite difference formula.
  3. Iterate for to .

Observation: The numerical solution closely matches the analytical solution .


3. Boundary Value Problems (BVPs)

BVPs involve solving PDEs with conditions specified at boundaries (e.g., fixed temperatures, pressures). Methods include:

  1. Shooting Method: Convert BVPs to initial value problems (IVPs) by guessing initial slopes.
  2. Finite Difference Method: Discretize the domain and solve the resulting linear system.
0.10.20.30.40.50.60.70.80.910.20.40.60.81xyBVP Solution: u(x) = 0.5x(1−x)Guess: u'(0)=1 (Initial Slope)u(0)=0u(1)=0Peak at x=0.5
Shooting method for u''(x) + u(x) = 0 with u(0)=u(1)=0

Shooting Method Steps

  1. Rewrite BVP as IVP: Guess and solve the ODE forward.
  2. Check Boundary Condition: Compare the computed with the desired value.
  3. Adjust : Use Newton-Raphson to refine until the boundary condition is satisfied.

Example: Bratu’s Problem (Nonlinear BVP) Solve: with , .

Algorithm:

  1. Guess .
  2. Solve using Runge-Kutta.
  3. Compute . If , update using Newton-Raphson:
  4. Repeat until .

Real-World Link:

  • NEPSE Stock Predictions: PDEs model stock price movements across time and sectors. BVPs help estimate equilibrium prices under constraints (e.g., maximum volatility).
  • Pathao Traffic Routing: PDEs simulate traffic flow, while BVPs optimize routes given boundary conditions (e.g., rush-hour congestion at intersections).

4. Errors in Numerical Solutions

Error Type Cause Example Mitigation
Truncation Error Approximation of derivatives Finite difference replaces with a discrete form. Use smaller or higher-order methods.
Round-off Error Floating-point precision (may overflow). Use double precision or error analysis.
Discretization Error Spatial/temporal grid size Coarse grid misses sharp temperature gradients. Refine the grid (smaller , ).
011.2522.533.7545Truncation Error45Round-off Error30Discretization Error25Error Contribution (%)
Error sources in finite difference method (heat equation, h=0.1)

Worked Example: Error Analysis for Heat Equation For the heat equation with , , the truncation error per step is: If , then: Visualization:


5. Applications in Nepal

Company/App PDE/BVP Used How It Works
NTC (Electricity) Heat Equation (Elliptic PDE) Models heat dissipation in transformers to prevent overheating.
Khalti (Payments) Reaction-Diffusion (Parabolic PDE) Simulates fraud detection in transaction networks (e.g., sudden spikes in activity).
Daraz (Logistics) Navier-Stokes (Hyperbolic PDE) Optimizes delivery routes under traffic constraints (boundary: road networks).
NEPSE (Stocks) Black-Scholes PDE (Parabolic) Prices options under volatility constraints (boundary: maturity date).

Case Study: NTC Power Grid

  • Problem: Predict transformer temperature to avoid failures.
  • PDE: Heat equation with Neumann BCs (insulated sides).
  • Solution: Finite difference method with m, s.
  • Result: Early warning system reduces downtime by 30%.

Exam Tip

  1. For PDEs:

    • Always state the type (elliptic/parabolic/hyperbolic) and boundary conditions.
    • Show the finite difference discretization explicitly (e.g., for the heat equation).
    • Mention stability conditions (e.g., ).
  2. For BVPs:

    • Explain the shooting method steps clearly: guess, solve IVP, adjust slope.
    • Use Newton-Raphson to refine the initial slope in your answer.
  3. For Errors:

    • Distinguish truncation vs. round-off errors.
    • Relate error to grid size (e.g., "error scales as ").
  4. Real-World Questions:

    • Link to NTC, Daraz, or NEPSE in your examples (e.g., "Like Daraz’s warehouse temperature control...").
    • Draw a simple diagram (e.g., a rod for heat equation or a grid for finite differences).

Key Formula Summary:

mindmap
  root((Numerical PDEs))
    Finite Differences
      Central Difference: (u_{i+1} - u_{i-1})/(2h)
      Second Derivative: (u_{i+1} - 2u_i + u_{i-1})/h^2
    Heat Equation
      Discretized: u_i^{n+1} = u_i^n + r(u_{i+1}^n - 2u_i^n + u_{i-1}^n)
      Stability: r = ατ/h² ≤ 0.5
    Boundary Value Problems
      Shooting Method: Guess u'(x0), solve IVP, adjust
      Newton-Raphson: s_{new} = s - f(s)/f'(s)
    Errors
      Truncation: O(h²) or O(τ)
      Round-off: Floating-point precision limits

In the real world

  • NTC Power Grid Management: Engineers use the heat equation (parabolic PDE) to model transformer cooling in Nepal’s national grid. Finite difference methods discretize the system to predict overheating risks, ensuring transformers in Dharan and Pokhara operate within safe temperature limits (Dirichlet BCs for fixed ambient temperatures).

  • Pathao Traffic Optimization: The wave equation (hyperbolic PDE) simulates traffic flow along Thapathali–Kathmandu Ring Road. Boundary value problems (BVPs) with Neumann conditions (zero flux at intersections) help optimize traffic light timings, reducing congestion during Dashain and Tihar festivals.

  • Daraz Logistics Cold Chain: The 1D heat equation models temperature control in refrigerated trucks transporting vaccines from Kathmandu to Darchula. Finite difference methods with adaptive time steps (τ) ensure perishable goods stay within ±2°C of target temperatures, critical for COVID-19 vaccine distribution.

Based on the TU BCA syllabus for Numerical Method (CACS252), unit 7.

Discussion

Loading…