UNIHIVE

Study Hub UNIPORT ENG 303

ENG 303 · Engineering Mathematics V (Numerical Methods and Computer Application)

Boundary-value problems and finite differences for PDEs

The shooting method, finite differences for two-point BVPs, and explicit and implicit schemes for the heat equation, with stability.

Our notes

2 min read

Boundary-value problems

Conditions are given at two ends: deflection of a beam fixed at both ends, temperature in a fin, flow between plates.

  • Shooting method: guess the missing initial slope, solve as an initial-value problem (RK4), see how far you miss the far boundary, and correct the slope (by secant iteration) until you hit it.
  • Finite differences: replace derivatives at grid points with difference formulas and solve the resulting linear system.

Finite-difference BVP example

y″ = 6x, y(0) = 0, y(1) = 1 (exact solution y = x³). Take h = 0.5, one interior point x₁ = 0.5:
(y₀ − 2y₁ + y₂)/h² = 6x₁ → (0 − 2y₁ + 1)/0.25 = 3 → −2y₁ + 1 = 0.75 → y₁ = 0.125, exactly 0.5³ (the central formula is exact for cubics, since y⁗ = 0). With more points the equations form a tridiagonal system, solved quickly by the Thomas algorithm.

The heat equation

uₜ = α uₓₓ (temperature along a rod). Grid spacing Δx in space and Δt in time; write uᵢⁿ for the value at node i and time level n, and r = αΔt/Δx².
Explicit (FTCS) scheme: uᵢⁿ⁺¹ = uᵢⁿ + r(uᵢ₋₁ⁿ − 2uᵢⁿ + uᵢ₊₁ⁿ). Simple, but stable only if r ≤ 1/2.
Worked example. α = 1, rod 0 ≤ x ≤ 1 with ends held at 0, u(x, 0) = sin(πx), Δx = 0.25, r = 0.25 (Δt = 0.015625). Initial nodes: 0, 0.7071, 1, 0.7071, 0.

  • Middle node: 1 + 0.25(0.7071 − 2 + 0.7071) = 0.8536.
  • Node x = 0.25: 0.7071 + 0.25(0 − 1.4142 + 1) = 0.6036.

Exact middle value e^(−π²t) = e^(−0.154213) = 0.8571: close for such a coarse grid. With r = 0.6 the solution would soon oscillate and grow.

Implicit schemes

Backward Euler and Crank-Nicolson (average of explicit and implicit) are stable for any r; each step needs a tridiagonal solve. Crank-Nicolson is second order in time and space.

Other PDEs

  • Laplace's equation uₓₓ + u_yy = 0 (steady temperature, seepage under a dam): on a square grid each interior value equals the average of its four neighbours; solve by Gauss-Seidel or SOR.
  • Wave equation uₜₜ = c²uₓₓ: explicit scheme stable if cΔt/Δx ≤ 1 (the CFL condition).

Exams usually ask: set up and solve a small finite-difference BVP; describe the shooting method; carry out explicit heat-equation steps; state and explain the stability condition r ≤ 1/2; write the five-point Laplace formula.

Common mistake: choosing Δt and Δx independently in the explicit heat scheme. Check r = αΔt/Δx² first: halving Δx means quartering Δt.

Written by the UniHive team in our own words. Spotted a mistake? Tell us on WhatsApp.

Read

Watch

We link to free material and never copy it. Every link was opened by our team before it went up; video data is a rough guide at 360p.

All ENG 303 topics

Report

Sign in to report this. It is free.

Is this your work (a lecturer, author or publisher)? Ask us to take it down.