PadhaikoAll subjects

Solution of Partial Differential Equations

Numerical Methods (ENSH 252)

Open in the Padhaiko app

6.1 Introduction and classification

A partial differential equation (PDE) relates an unknown multivariable function (or ) and its partial derivatives. In engineering applications, the most important class is the general second-order linear PDE in two independent variables:

where may be constants or functions of . Just like conic sections, the equation is classified at any point by the sign of its discriminant :

Classification of Second-Order Linear PDEs (Discriminant B^2 - 4AC)
TypeDiscriminant ConditionPrototype EquationPhysical Meaning & Boundary/Initial Data
EllipticLaplace:
Poisson:
Steady-state temperature, electrostatics, potential flow (Boundary Value Problem on closed domain)
Parabolic1D Heat: Transient heat conduction, diffusion (Initial + Boundary Value Problem)
Hyperbolic1D Wave: Vibrating strings, wave propagation (2 Initial conditions + Boundary conditions)

6.2 Finite difference approximations of partial derivatives

Consider a uniform rectangular grid in the -plane with spacings and , where , , and . Expanding and via Taylor's theorem gives the standard finite-difference quotients:

Definition

Finite Difference Approximations of Partial Derivatives

  1. First Partial Derivatives:
    • Forward difference ():
  1. Second Partial Derivatives (Central, and ):

6.3 Solution of elliptic equations

6.3.1 Laplace equation

On a square mesh (), substituting the central differences into Laplace's equation yields:

Definition

Standard and Diagonal 5-Point Formulas

  1. Standard Five-Point Formula: Every interior value is the arithmetic mean of its four orthogonal neighbors (East, West, North, South):
  1. Diagonal Five-Point Formula (rotated ; useful for computing initial estimates at grid centers from corner boundaries):

Writing the standard 5-point formula at all interior grid points creates a sparse linear system, solved either directly (for small grids) or iteratively using Liebmann's method (Gauss–Seidel iteration on the grid, immediately substituting newly updated neighbors):

6.3.2 Poisson’s equation

For Poisson's equation on a square mesh ():

Rearranging gives the 5-point stencil for Poisson's equation:

or equivalently in iterative form:


6.4 Solution of parabolic and hyperbolic equations

6.4.1 One-dimensional heat equation: Bendre-Schmidt method, Crank-Nicolson method

Consider the 1D unsteady heat conduction equation:

with spatial step , time step , grid notation , and the dimensionless mesh ratio:

Explicit Scheme and Bendre–Schmidt Method

Using a forward difference in time () and central difference in space ():

Definition

Bendre–Schmidt Explicit Formula

The explicit scheme is numerically stable only when . Choosing the special step ratio (so ) eliminates the center term and yields the Bendre–Schmidt (Bender–Schmidt) recurrence:

Crank–Nicolson Implicit Method

To remove the severe step-size restriction and achieve second-order accuracy in both space and time (), the Crank–Nicolson method averages the central spatial second difference across time levels and :

Definition

Crank–Nicolson Implicit Scheme

Rearranging with gives a tridiagonal linear system at each time step:

6.4.2 Solution of wave equation

Consider the 1D wave equation for a vibrating string:

Replacing both second derivatives with central differences and letting (the Courant number):

Definition

Explicit Finite-Difference Scheme for the 1D Wave Equation

  1. General time-stepping formula ():

The scheme is stable for (CFL condition). When (), it simplifies to the exact characteristic recurrence:

  1. Starting step (): Using central difference to eliminate the ghost value :

(When and , this reduces to .)


Worked Out Examples

Example 6.1

6.1

Solve Laplace's equation on the square region with grid spacing and boundary conditions:

Labeling the four interior grid points: Let , , , and .

2x2 Interior Grid with Boundary ValuesText
        100     100
    +----+-------+----+
50  |   u1  ---  u2   | 150
    |    |       |    |
50  |   u3  ---  u4   | 150
    +----+-------+----+
         0       0

Applying the standard 5-point formula at each interior node: Using :

Solving the linear system: Adding the first and fourth equations gives . Adding the second and third equations gives , which implies . Moreover, subtracting equation 4 from equation 1 gives . Hence:

Substituting into the second and third equations:

Answer:

The steady-state interior grid values are , , , and .

Example 6.2

6.2

Solve the 1D heat equation () subject to and , taking :

  1. Using the Bendre–Schmidt method (, ) up to .
  2. Using the Crank–Nicolson method (, ) for time step ().

Evaluating the initial profile at :

Part 1 — Bendre–Schmidt method (): Using with :

  • At ():
  • At ():

Part 2 — Crank–Nicolson method (): With , the Crank–Nicolson equations are :

By symmetry, . From the first equation, . Substituting into the second:

Answer:

At ():

  • Bendre–Schmidt ():
  • Crank–Nicolson ():
Example 6.3

6.3

Solve the 1D wave equation () for with boundary conditions and initial conditions , . Take and , and compute the solution up to .

Checking and tabulating (): Here . At :

Computing time level () and ():

  • At : Since and , the starting formula gives :
  • At : Using :

(Physically, at half the fundamental half-period , the symmetric string passes instantaneously through the horizontal equilibrium position.)

Answer:

The displacements at are:

  • :
  • :

Exercises

Exercise — Solution of Partial Differential Equations

Question 1

Classify each of the following second-order PDEs as elliptic, parabolic, or hyperbolic:

  1. ()

Also compare the Bendre–Schmidt and Crank–Nicolson methods for the 1D heat equation in terms of stability and accuracy.

Classifying using :

  1. Parabolic.
  2. Elliptic.
  3. (for ) Hyperbolic.

Comparing Bendre–Schmidt and Crank–Nicolson:

  • Bendre–Schmidt is an explicit scheme () that requires (conditionally stable only for ), forcing tiny time steps when is small.
  • Crank–Nicolson is an implicit scheme () that is unconditionally stable for any , at the cost of solving a tridiagonal linear system at each time step.
Answer:
  1. Parabolic, 2. Elliptic, 3. Hyperbolic. Bendre–Schmidt is explicit and conditionally stable (, fixed at ), whereas Crank–Nicolson is implicit, second-order accurate in time and space, and unconditionally stable for all .
Question 2

Solve Poisson's equation over the square with and on all four boundaries.

Setting up the 5-point Poisson equations at the four interior points: Let , , , and . With and , the equation gives:

  • At :
  • At :
  • At :
  • At :

Solving the linear system: By symmetry across the diagonal , . Then the second and third equations become:

Substituting into :

Hence , , and .

Answer:

The interior nodal values are , , , and .

Question 3

Apply iterations of Liebmann's (Gauss–Seidel) method to solve Laplace's equation on a grid ( interior nodes ) starting from initial guess , given boundary values:

Writing Liebmann's update equations in row-by-row order ():

Performing two Liebmann iterations:

  • First iteration ():
  • Second iteration ():
Answer:

After Liebmann iterations, , , , and .

Question 4

Solve on with and for time step using the Crank–Nicolson method with and ().

Setting up initial values and the Crank–Nicolson system (): At , the nodal values at are . Substituting into :

Multiplying through by gives .

Solving for and : With :

By symmetry , so .

Answer:

At , and .

Question 5

Solve the 1D wave equation on with , initial displacement , and zero initial velocity . Take and , and compute up to .

Evaluating and initial displacements at : Here , so . At :

Computing () and ():

  • At ( since and ):
  • At ():
Answer:

At :

  • :
  • :
← Solution of Ordinary Differential Equations (ODE)