Elective Numerical Methods

Numerical MethodsUnit 1010 min read

Applications of Numerical Methods in Engineering: Real-World Systems, ODEs, PDEs, and Optimization

Unit 10 of Numerical Methods explores how numerical techniques solve real engineering problems—from traffic flow optimization (like Kathmandu’s gridlock) to financial modeling (like NEPSE stock predictions) and structural analysis (like earthquake-resistant bridges). Learn to map ODEs/PDEs to engineering scenarios, app

TAKEAWAYS:

  • Numerical methods turn real-world engineering problems (e.g., Ncell’s network load balancing, Daraz’s delivery route optimization) into solvable math models using ODEs, PDEs, and linear algebra.
  • Ordinary Differential Equations (ODEs) model dynamic systems (e.g., heat dissipation in a CPU, Pathao’s rider demand spikes), solved via Euler, RK4, or shooting methods.
  • Partial Differential Equations (PDEs) govern spatial phenomena (e.g., NTC’s power grid voltage drops, NEPSE’s price fluctuations), discretized via finite difference or finite element methods.
  • Eigenvalue problems optimize systems (e.g., Google’s PageRank uses eigenvectors to rank websites; Ncell’s antenna placement maximizes coverage).
  • Error analysis ensures reliability: truncation errors in RK4 vs. round-off errors in floating-point arithmetic (critical for eSewa’s transaction limits).
  • Case studies tie theory to exams: solve a bank loan amortization schedule (ODE), traffic flow at Thapathali (PDE), or NEPSE’s moving average (curve fitting).

1. Why Numerical Methods in Engineering?

Engineering problems are rarely solvable by pencil-and-paper math. Numerical methods provide approximate but practical solutions using computers. For example:

  • eSewa’s transaction limits: Uses root-finding methods (Newton-Raphson) to model fraud detection thresholds.
  • Pathao’s rider allocation: Solves linear systems (Gauss-Seidel) to balance supply-demand in real time.
  • NTC’s power grid: Relies on PDE solvers to predict voltage drops across Kathmandu’s network.

2. Modeling Real Systems with ODEs

Ordinary Differential Equations (ODEs) describe how systems change over time. Key applications:

01P(0) = 500 (initial)P(0.3) ≈ 650 (RK4, h=0.1 min)
Runge-Kutta 4th order (RK4) time-stepping for population growth (h=0.1 min)
1002003004005006007008009001000-50-40-30-20-1010xydP/dt = rP - kP² (Logistic Growth)P(0)=500Equilibrium
Logistic growth of vehicles at Thapathali (r=0.05, k=0.0001)

A. Population Growth (e.g., Kathmandu’s Traffic)

Problem: Predict vehicle count at Thapathali intersection over 1 hour. ODE Model: where:

  • = number of vehicles at time ,
  • = growth rate (vehicles/min),
  • = congestion factor.

Solution via RK4 Method:

# Pseudocode for RK4 (h = 0.1 min)
def rk4(P, t, h):
    k1 = h * (r*P - k*P**2)
    k2 = h * (r*(P + k1/2) - k*(P + k1/2)**2)
    k3 = h * (r*(P + k2/2) - k*(P + k2/2)**2)
    k4 = h * (r*(P + k3) - k*(P + k3)**2)
    return P + (k1 + 2*k2 + 2*k3 + k4)/6

Worked Example: Given vehicles, , , compute :

B. Financial Modeling (e.g., NEPSE Stock Prices)

Problem: Model the price of a stock using the Black-Scholes ODE: Numerical Solution: Finite difference method (exam favorite!). Worked Example: Discretize for , , , :


3. Spatial Problems: PDEs in Engineering

Partial Differential Equations (PDEs) model phenomena across space and time. Examples:

0.10.20.30.40.50.60.70.80.912030405060708090100yInitial temperature u(x,0) = 100°CBoundary condition u(L,t) = 20°Cu(0.5, t) ≈ 60°C (midpoint)x=0 (hot end)x=L (cool end)
CPU cooling: Initial temperature profile (α=0.01 m²/s, Δx=0.1 m)

A. Heat Equation (e.g., CPU Cooling)

PDE: where = temperature at position and time .

1 cm3 cm
Simplified CPU cooling system (PDE spatial domain)

Finite Difference Solution: Worked Example: For a CPU with , , , , :

B. Traffic Flow (e.g., Kathmandu Gridlock)

PDE Model (LWR Model): where = vehicle density, = speed.

Numerical Solution: Godunov’s method (exam tip: compare with Euler’s method). Real-World Tie:

  • Problem: Simulate traffic at Thapathali-Chabahil during peak hours.
  • Data: vehicles/km, km/h.
  • Result: Predict bottlenecks to optimize signal timings.

4. Linear Algebra in Engineering

A. Circuit Analysis (e.g., NTC Power Grid)

Problem: Solve for currents in a 3-node circuit using Gauss-Seidel. Equations: Gauss-Seidel Iteration: Convergence:

B. Eigenvalues in Structural Engineering

Problem: Find natural frequencies of a bridge modeled as a matrix: Power Method:

  1. Start with .
  2. Iterate: .
  3. Largest eigenvalue .

Result:


5. Curve Fitting and Optimization

11.522.533.544.55200022002400260028003000Polynomial fit (NEPSE prices)Day 1Day 5Predicted
NEPSE stock price trend (Rs.)

A. NEPSE Stock Prediction (Polynomial Fit)

Data: Closing prices over 5 days:

Day Price (Rs.)
1 2000
2 2050
3 2120
4 2200
5 2300

Lagrange Interpolation: Prediction for Day 6:

B. Optimization: Daraz Delivery Routes

Problem: Minimize delivery time for 3 orders using linear programming. Constraints: Solution via Simplex Method:

flowchart LR
    A["Initial Tableau"] --> B["Pivot on (10,2)"] --> C["Optimal: x₁=4, x₂=2"]
    C --> D["Total time = 2*4 + 2 = 10 units"]

6. Error Analysis in Engineering

Sources of Error:

Type Cause Example
Truncation Approximating infinite series RK4’s local error
Round-off Floating-point precision = 2.0
Modeling Simplifying assumptions Ignoring air resistance in ODE

Worked Example: Compute using Simpson’s Rule with :


In the Real World

  1. eSewa’s Fraud Detection:

    • Idea: Root-finding (Newton-Raphson) identifies anomalous transaction patterns.
    • How: Solves to flag .
  2. Pathao’s Rider Allocation:

    • Idea: Linear systems (Gauss-Seidel) balances riders across zones.
    • How: Solves where = demand matrix, = rider counts.
  3. NTC’s Power Grid:

    • Idea: PDEs (finite difference) predicts voltage drops.
    • How: Solves over Kathmandu’s grid to optimize transformer placement.
  4. NEPSE’s Moving Averages:

    • Idea: Curve fitting (least squares) smooths stock data.
    • How: Fits to 30-day prices to predict trends.

Exam Tip

  1. Always show iterations: For Gauss-Seidel or RK4, write out at least 2 iterations (examiners deduct marks for skipping steps).
  2. Link to real systems: In part (a), solve a circuit or traffic flow; in part (b), optimize a delivery route or stock prediction.
  3. Error analysis is key: For numerical integration, state the error formula (e.g., Simpson’s ).
  4. PDEs: Use finite difference stencils (e.g., 5-point Laplacian) and label boundary conditions clearly.
  5. Eigenvalues: For the power method, show the Rayleigh quotient .

Pro Tip: Memorize these exam-friendly mappings:

Engineering Problem Numerical Method Exam Technique
Loan amortization ODE (Euler/RK4) Solve
Traffic simulation PDE (LWR model) Finite difference + Godunov
Stock prediction Curve fitting (Lagrange) Interpolate + extrapolate
Circuit analysis Linear systems (Gauss-Seidel) Iterate until convergence
Bridge vibrations Eigenvalue problem Power method + Rayleigh quotient

In the real world

  • eSewa’s fraud detection uses Newton-Raphson root-finding to flag transactions where the error between predicted and actual spending exceeds a threshold (e.g., Rs. 5000 deviation triggers a manual review).
  • Pathao’s rider allocation solves linear systems (Gauss-Seidel) in real-time to match supply (riders) with demand (orders) across Kathmandu’s 15 zones, reducing wait times by 30%.
  • NTC’s power grid employs finite difference PDE solvers to simulate voltage drops across 220kV transmission lines, preventing blackouts during peak demand (e.g., monsoon season).

Based on the PU BE Computer (PU) syllabus for Numerical Methods, unit 10.

Discussion

Loading…