# Reaction-Diffusion Systems

Nonlinear PDE's Course
Current Topic Reaction-Diffusion Systems
Next Topic Burgers Equation
Previous Topic Example Calculations for the KdV and IST

We present here a brief theory of reaction diffusion waves.

## Law of Mass Action

The law of mass action states that equation rates are proportional to the concentration of reacting species and the ratio in which they combined. It is discussed in detail in Billingham and King 2000. We will present here a few simple examples.

### Example 1: Simple Decay

Suppose we have of chemical $\displaystyle{ P }$ which decays to $\displaystyle{ A }$, i.e.

$\displaystyle{ P \to A }$

with rate $\displaystyle{ k[P] }$ where $\displaystyle{ [P] }$ denotes concentration. Then if we set $\displaystyle{ p=[P] }$ and $\displaystyle{ a = [A] }$ we obtain the equations

$\displaystyle{ \frac{\mathrm{d}p}{\mathrm{d}t} = -kp\,\,\,\textrm{and}\,\,\, \frac{\mathrm{d}a}{\mathrm{d}t} = kp }$

which has solution

$\displaystyle{ p = p_0 e^{-kt}\,\,\,\textrm{and}\,\,\, a = a_0 + p_0(1-e^{-kt}) }$

where $\displaystyle{ a_0 }$ and $\displaystyle{ p_0 }$ are the values of $\displaystyle{ a }$ $\displaystyle{ p }$ repectively at $\displaystyle{ t=0 }$.

This example will be important when we consider reaction diffusion problems. We consider the reaction

$\displaystyle{ A + B \to 2B }$

with rate proportional to $\displaystyle{ k[A][B] }$. If we define $\displaystyle{ a = [A] }$ and $\displaystyle{ b = [B] }$ we obtain the following equations

$\displaystyle{ \frac{\mathrm{d}a}{\mathrm{d}t} = -kab\,\,\,\textrm{and}\,\,\, \frac{\mathrm{d}b}{\mathrm{d}t} = kab }$

We can solve these equations by observing that

$\displaystyle{ \frac{\mathrm{d}(a+b)}{\mathrm{d}t} = 0 }$

so that $\displaystyle{ a + b = a_0 + b_0 }$. We can then eliminate $\displaystyle{ a }$ to obtain

$\displaystyle{ \frac{\mathrm{d}b}{\mathrm{d}t} = k(a_0 + b_0 - b)b }$

which is separable with solution

$\displaystyle{ b = \frac{b_0(a_0 + b_0)e^{k(a_0 + b_0)t}}{a_0 + b_0e^{k(a_0 + b_0)t}} }$

and

$\displaystyle{ a = \frac{a_0(a_0 + b_0)}{a_0 + b_0e^{k(a_0 + b_0)t}} }$

Note that $\displaystyle{ a\to 0 }$ and $\displaystyle{ b\to a_0 + b_0 }$ as $\displaystyle{ t\to \infty. }$

## Diffusion

The equation for spatially homogeneous diffusion of a chemical with concentration $\displaystyle{ c }$ is

$\displaystyle{ \partial_t c = D\nabla^2 c }$

which is the heat equation. We will consider this in only one spatial dimension. Consider it on the boundary $\displaystyle{ -\infty \lt x \lt \infty }$. In this case we can solve by the Fourier transform and obtain

$\displaystyle{ \partial_t \hat{c} = -D k^2 \hat{c} }$

where $\displaystyle{ \hat{c} }$ is the Fourier transform of $\displaystyle{ c }$. This has solution

$\displaystyle{ \hat{c} = \hat{c}_0 e^{-D k^2 t} }$

We can find the inverse transform using convolution and obtain

$\displaystyle{ c(x,t) = \frac{1}{\sqrt{4\pi D t}} \int_{-\infty}^{\infty} c_0(x) e^{(x-s)^2/4Dt}\mathrm{d}s }$

### Solution of the dispersion equation using FFT

We can solve the dispersion equation using the discrete Fourier transform and its closely related numerical implementation the FFT (Fast Fourier Transform). We have already met the FFT Numerical Solution of the KdV but we consider it here in more detail. We consider the concentration on the finite domain $\displaystyle{ -L \leq x \leq L }$ and use a Fourier series expansion

$\displaystyle{ c(x,t) = \sum_{n=-\infty}^{\infty} \hat{c}_n(t) e^{\mathrm{i} k_n x} }$

where $\displaystyle{ k_n = \pi n /L }$. If we substitute this into the diffusion equation we obtain

$\displaystyle{ c(x,t) = \sum_{n=-\infty}^{\infty} \hat{c}_n(0)e^{-k_n^2 D t} e^{\mathrm{i} k_n x} }$

Note that this is not the same solution as we obtained on the infinite domain because of the boundary conditions on the finite domain. The coefficients $\displaystyle{ \hat{c}_n(0) }$ are found using the initial conditions so that

$\displaystyle{ \hat{c}_n(0) = \frac{1}{2L} \int_{-L}^{L} e^{-\mathrm{i} k_n x} c_0(x) \mathrm{d}x }$

The key to the numerical solution of this equation is the use of the FFT. We begin by discretising the domain into a series of $\displaystyle{ N }$ points $\displaystyle{ x_m = -L + 2Lm/N }$. We then use this to approximate the integral above and obtain

$\displaystyle{ \hat{c}_n(0) = \frac{1}{N} \sum_{m=0}^{N-1} e^{-\mathrm{i} k_n x_m} c_0(x_m) }$

$\displaystyle{ = \frac{1}{N} \sum_{m=0}^{N-1} e^{-2\mathrm{i} \pi nm/N} e^{\mathrm{i} \pi n} c_0(x_m) }$

We also get

$\displaystyle{ c(x_m,t) = \sum_{n=-\infty}^{\infty} \hat{c}_n(0) e^{-k_n^2 D t} e^{\mathrm{i} k_n x_m} }$

$\displaystyle{ = \sum_{n=-\infty}^{\infty} \hat{c}_n(0) e^{-k_n^2 D t} e^{2\mathrm{i} \pi nm/N} e^{-\mathrm{i} \pi n} }$

but we know that

$\displaystyle{ \hat{c}_n(0) e^{-\mathrm{i} \pi n} = \frac{1}{N} \sum_{m=0}^{N-1} e^{-2\mathrm{i} \pi nm/N} c_0(x_m) }$

### The discrete Fourier transform

The discrete Fourier transform of a sequence of 2N complex numbers c0, ..., c2N−1 is transformed into the sequence of N complex numbers $\displaystyle{ \hat{c} }$0, ..., $\displaystyle{ \hat{c} }$N−1 by the DFT according to the formula:

$\displaystyle{ \hat{c}_m = \sum_{n=0}^{N-1} c_n e^{-2\pi \mathrm{i}mn/N} \quad \quad m = 0, \dots, N-1 }$

We denote the transform by the symbol $\displaystyle{ \mathcal{F} }$, as in $\displaystyle{ \mathbf{X} = \mathcal{F} \left \{ \mathbf{x} \right \} }$ or $\displaystyle{ \mathcal{F} \left ( \mathbf{x} \right ) }$ or $\displaystyle{ \mathcal{F} \mathbf{x} }$.

The inverse discrete Fourier transform (IDFT) is given by

$\displaystyle{ c_n = \frac{1}{2N} \sum_{m=0}^{N-1} \hat{c}_m e^{2\pi \mathrm{i}mn/N} \quad \quad n = 0,\dots,N-1. }$

Therefore we can write

$\displaystyle{ c(x_m,t) = \mathcal{F} \left\{ e^{-k_n^2 D t} \mathcal{F}^{-1} \left\{ c_0(x_m) \right\} \right\} }$

The only difficulty is that we need to define carefully the values of $\displaystyle{ k_n }$

The real power of this method lies with the Fast Fourier Transform or FFT algorithm. A naive implementation of the discrete Fourier transform above (or its inverse) will involve order $\displaystyle{ N^2 }$ operations. Using FFT algorithms, this can be reduced to order $\displaystyle{ N \log(N) }$. This is an incredible speed up, for example if N = 1024, FFT algorithms are more efficient by a factor of 147. This is the reason FFT algorithms are used so extensively.

## Reaction Diffusion Equations

We consider an auto catalytic reaction where the chemical species also diffuse. In this case the equations are

$\displaystyle{ \partial_t a = D\partial_x^2 a - kab }$

$\displaystyle{ \partial_t b = D\partial_x^2 b + kab }$

We can non-dimensionalise these equations scaling the variables as

$\displaystyle{ z = x/x^*\,\,\,\tau = t/t^*\,\,\,\alpha = a/a_0\,\,\,\beta = b/a_0 }$

So that the equations become

$\displaystyle{ \frac{1}{t^*}\partial_\tau \alpha = \frac{a_0}{(x^*)^2}D\partial_z^2 \alpha - k a_0^2 \alpha\beta }$

$\displaystyle{ \frac{1}{t^*}\partial_\tau \beta = \frac{a_0}{(x^*)^2}D\partial_z^2 \beta + k a_0^2 \alpha\beta }$

If we choose

$\displaystyle{ x^* = \sqrt{\frac{D}{ka_0}}\,\,\,t^*=\frac{1}{ka_0} }$

then we obtain the system

$\displaystyle{ \partial_\tau \alpha = \partial_z^2 \alpha -\alpha\beta }$

$\displaystyle{ \partial_\tau \beta =\partial_z^2 \beta + \alpha\beta }$

### Solution via split step method Solutions for $\displaystyle{ \alpha(z,0) =1 \, \beta(z,0) = \exp(-10z^2) }$

We can solve this equations numerically using a split step method. We assume that at time $\displaystyle{ \tau }$ we know $\displaystyle{ \alpha(z,\tau) }$ and $\displaystyle{ \beta(z,\tau) }$. We then solve first the following equation

$\displaystyle{ \partial_\tau \alpha = \partial_z^2 \alpha }$

from $\displaystyle{ \tau }$ to $\displaystyle{ \tau + \Delta\tau }$ (which we can do exactly using the spectral methods just discussed for the dispersion equation). We write this solution as $\displaystyle{ \tilde{\alpha}(z,\tau + \Delta\tau) }$ Then we solve

$\displaystyle{ \partial_\tau \alpha = -\alpha\beta }$

by assuming that $\displaystyle{ \beta }$ is constant and subject to the boundary condition that $\displaystyle{ \alpha(z,\tau) = \tilde{\alpha}(z,\tau + \Delta\tau) }$. This gives

$\displaystyle{ \alpha(z,\tau + \Delta\tau) = e^{-\beta(z,\tau) \Delta\tau} \tilde{\alpha}(z,\tau+ \Delta\tau)\, }$

and we do likewise for the equation for $\displaystyle{ \beta }$. Note that while both steps are exact the result from the split step method is an approximation with error which becomes smaller as the step size becomes smaller.

We can easily implement this split step method in matlab and we obtain a pair of travelling waves.

## Travelling Waves solution

When we solve the equations we found the solution formed travelling waves and we now consider this phenomena in detail.

We define a new coordinate $\displaystyle{ y = z - v\tau }$ (so we will consider only waves travelling to the right, although we could analyse waves travelling to the left in a similar fashion). We seek stationary solutions in $\displaystyle{ \alpha(y) }$ and $\displaystyle{ \beta(y) }$ which satisfy

$\displaystyle{ \frac{\mathrm{d}^2 \alpha}{\mathrm{d}y^2} + v \frac{\mathrm{d} \alpha}{\mathrm{d}y} = \alpha\beta }$

and

$\displaystyle{ \frac{\mathrm{d}^2 \beta}{\mathrm{d}y^2} + v \frac{\mathrm{d} \beta}{\mathrm{d}y} = -\alpha\beta }$

If we add these equations we obtain

$\displaystyle{ \frac{\mathrm{d}^2 (\alpha+\beta)}{\mathrm{d}y^2} + v \frac{\mathrm{d} (\alpha+\beta)}{\mathrm{d}y} = 0 }$

so that $\displaystyle{ \alpha + \beta = c_0 + c_1 e^{-vy} }$. Boundary conditions are that as $\displaystyle{ y\to\infty }$ $\displaystyle{ \alpha = 1 }$ and $\displaystyle{ \beta = 0 }$ and if $\displaystyle{ y\to-\infty }$ then $\displaystyle{ \alpha = 0 }$ and $\displaystyle{ \beta = 1 }$. Therefore $\displaystyle{ \alpha + \beta = 1 }$. This means that, since $\displaystyle{ \alpha \geq 0 }$, we must have $\displaystyle{ 0\leq \beta \leq 1 }$. We can then obtain the following equation

$\displaystyle{ \frac{\mathrm{d}^2 \beta}{\mathrm{d}y^2} + v \frac{\mathrm{d} \beta}{\mathrm{d}y} + \beta(1-\beta)= 0 }$

which we can write as the system of first order equations. Phase portrait for out system showing the equilibrium points and the heteroclinic connection

We define the variable $\displaystyle{ \gamma = \frac{\mathrm{d}\beta}{\mathrm{d}y} }$ and we obtain

\displaystyle{ \begin{align} \frac{\mathrm{d}\beta}{\mathrm{d} y} &= \gamma&\\ \frac{\mathrm{d}\gamma}{\mathrm{d} y} &= -v\gamma + \beta(\beta -1)& \\ \end{align} }

This dynamical system has equilibrium points at $\displaystyle{ (0,0) }$ and $\displaystyle{ (1,0) }$. We can analyse these equilibrium points by linearization. The Jacobian matrix is

$\displaystyle{ J =\begin{pmatrix} 0 & 1 \\ -1 + 2\beta & -v \end{pmatrix} }$

We can easily see that the Jacobian evaluated at our first equilibrium point is

$\displaystyle{ J_{(0,0)} =\begin{pmatrix} 0 & 1 \\ -1 & -v \end{pmatrix} }$

which has eigenvalues $\displaystyle{ \mu_{\pm} = -1/2 (v \mp \sqrt{v^2-4}) }$. Therefore this point is a nodal sink (possibly a spiral)

$\displaystyle{ J_{(1,0)} =\begin{pmatrix} 0 & 1 \\ 1 & -v \end{pmatrix} }$

which has eigenvalues $\displaystyle{ \lambda_{\pm} = -1/2 (v \mp \sqrt{v^2+4}) }$. This is a a saddle point. The unstable and stable separatrices leave the equilibrium point at $\displaystyle{ (1,0) }$ in the directions $\displaystyle{ \begin{pmatrix}\lambda_{\pm} \\ 1\end{pmatrix} }$. The only path on which $\displaystyle{ \beta }$ is bounded as $\displaystyle{ y\to-\infty }$ are the unstable separatrices. Also, only the unstable separatrix which enters the region $\displaystyle{ \beta\lt 1 }$ is physically meaningful.

To find a travelling wave we need to find a heteroclinic connection between the two equilibrium points which also has to satisfy the conditions that $\displaystyle{ 0\leq \beta \leq 1 }$.

We need to show that the heteroclinic connection does not cross the $\displaystyle{ \beta }$ axis. Consider the region

$\displaystyle{ R = \left\{(\beta,\gamma)\,|\, \beta\lt 1,\,-k\beta\lt \gamma\lt 0\right\} }$

On the line $\displaystyle{ \beta = 1,d\beta/dy\lt 0 }$ and hence all flow it into $\displaystyle{ R }$. On the line $\displaystyle{ \gamma = 0, d\gamma/dy \lt 0 }$ for $\displaystyle{ 0\lt \beta\lt 1 }$. On the line $\displaystyle{ \gamma = -k \beta }$ we know that $\displaystyle{ d\beta/dy \lt 0 }$ so that integral paths enter the region if and only if $\displaystyle{ d\gamma/d\beta \lt \gamma/\beta }$. We know that

$\displaystyle{ d\gamma/d\beta - \gamma/\beta = -v - \frac{\beta(1-\beta)}{\gamma} -\frac{\gamma}{\beta} = \frac{1}{k} (k^2 - vk +1 -\beta) }$

when $\displaystyle{ \gamma = -k\beta }$. Therefore we need to find a value of $\displaystyle{ k }$ so that $\displaystyle{ k^2 - vk +1 \lt 0 }$, which is possible provided $\displaystyle{ v\geq 2 }$, for example $\displaystyle{ k = \dfrac{v}{2} }$.