MTH3007b Lecture 8

Me, in the lecture

zzzzz…

This session continues from lecture 7 by applying both threads - the diffusion equation and stochastic processes - to more interesting setups. We look at a singular initial condition for the diffusion equation and introduce the first-passage time problem for the OU process.

Diffusion with a Dirac Delta Initial Condition

Instead of a smooth initial profile, suppose all the “heat” (or probability mass) starts concentrated at a single point at . The initial condition is then a Dirac delta function:

The Dirac Delta Function

The Dirac delta function is defined by two properties:

  • It is zero everywhere except at , where it is a spike.
  • Its integral over any interval containing equals 1:

The sifting property states that for any smooth function :

Discrete Approximation

On a grid with spacing , the Dirac delta is approximated by setting the grid value at to and all other values to zero:

This ensures the discrete sum approximates the integral: .

Analytical Solution

The analytical solution to the diffusion equation with a delta function initial condition is a Gaussian:

Running FTCS with the discrete delta IC recovers this spreading Gaussian numerically, making it a good verification test for the code.

Stochastic Processes: Continued

The following topics continue from lecture 7. Recall that a a random variable takes values drawn from a probability distribution, and that the Wiener and OU processes are built from Gaussian increments .

Recap: Gaussian Random Numbers

If , then . In Python: np.random.normal(mu, sigma, N).

Recap: Wiener and OU

First-Passage Time

The First-passage time is the time at which a stochastic process first reaches or exceeds a threshold . For the OU process :

  1. Run the OU simulation with the standard update: .
  2. At each step, check whether .
  3. When the condition is met, record the elapsed time and stop that simulation.
  4. Repeat for many independent realisations (walkers).
  5. Compute the average first-passage time from the ensemble.

This is purely a simulation exercise - run the process, apply the stopping criterion, and average the results.


Pre-Lecture Notes from University Notes

  • Dirac delta IC: spike at with unit area; discrete approximation , rest zero.
  • Sifting property: .
  • Analytical solution with delta IC is a Gaussian: .
  • Running FTCS with the delta IC numerically reproduces this Gaussian spread.
  • First-passage time: run OU, stop when , record time; average over many walkers.
  • Next session: FTCS stability analysis and the implicit BTCS scheme.