Difference between revisions of "Reaction-Diffusion Systems"

From WikiWaves
Jump to navigationJump to search
 
(60 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{incomplete pages}}
+
{{nonlinear waves course
 +
| chapter title = Reaction-Diffusion Systems
 +
| next chapter = [[Burgers Equation]]
 +
| previous chapter = [[Example Calculations for the KdV and IST]]
 +
}}
 +
 
 +
{{complete pages}}
  
 
We present here a brief theory of reaction diffusion waves.
 
We present here a brief theory of reaction diffusion waves.
Line 18: Line 24:
 
set <math>p=[P]</math> and <math>a = [A] </math> we obtain the equations
 
set <math>p=[P]</math> and <math>a = [A] </math> we obtain the equations
 
<center>
 
<center>
<math> \frac{dp}{dt} = -kp\,\,\,\textrm{and}\,\,\,  \frac{da}{dt} = kp</math>
+
<math> \frac{\mathrm{d}p}{\mathrm{d}t} = -kp\,\,\,\textrm{and}\,\,\,  \frac{\mathrm{d}a}{\mathrm{d}t} = kp</math>
 
</center>
 
</center>
 
which has solution
 
which has solution
Line 26: Line 32:
 
</math>
 
</math>
 
</center>
 
</center>
 +
where <math>a_0</math> and <math>p_0</math> are the values of <math>a</math>
 +
<math>p</math> repectively at <math>t=0</math>.
  
 
=== Example 2: Quadratic Autocatalysis ===
 
=== Example 2: Quadratic Autocatalysis ===
Line 37: Line 45:
 
and <math>b = [B]</math> we obtain the following equations
 
and <math>b = [B]</math> we obtain the following equations
 
<center>
 
<center>
<math> \frac{da}{dt} = -kab\,\,\,\textrm{and}\,\,\,  \frac{db}{dt} = kab</math>
+
<math> \frac{\mathrm{d}a}{\mathrm{d}t} = -kab\,\,\,\textrm{and}\,\,\,  \frac{\mathrm{d}b}{\mathrm{d}t} = kab</math>
 
</center>
 
</center>
 
We can solve these equations by observing that
 
We can solve these equations by observing that
 
<center>
 
<center>
 
<math>  
 
<math>  
\frac{d(a+b)}{dt} = 0
+
\frac{\mathrm{d}(a+b)}{\mathrm{d}t} = 0
 
</math>
 
</math>
 
</center>
 
</center>
so that <math>a = b = a_0 + b_0</math>. We can then eliminate <math>a</math> to obtain
+
so that <math>a + b = a_0 + b_0</math>. We can then eliminate <math>a</math> to obtain
 
<center>
 
<center>
 
<math>  
 
<math>  
\frac{db}{dt} = k(a_0 + b_0 - b)b
+
\frac{\mathrm{d}b}{\mathrm{d}t} = k(a_0 + b_0 - b)b
 
</math>
 
</math>
</center><math><math>Insert formula here</math></math>
+
</center>
 
which is separable with solution  
 
which is separable with solution  
 
<center>
 
<center>
Line 92: Line 100:
 
<center>
 
<center>
 
<math>  
 
<math>  
c(x,t) = \frac{1}{\sqrt{4\pi D t}} \int_{-\infty}^{\infty} c_0(x) e^{(x-s)^2/4Dt}ds
+
c(x,t) = \frac{1}{\sqrt{4\pi D t}} \int_{-\infty}^{\infty} c_0(x) e^{(x-s)^2/4Dt}\mathrm{d}s
 
</math>
 
</math>
 
</center>
 
</center>
Line 99: Line 107:
  
 
We can solve the dispersion equation using the discrete Fourier transform and
 
We can solve the dispersion equation using the discrete Fourier transform and
its closely related numerical implementation the FFT. We consider the  concentration  
+
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 <math>-L \leq x \leq  L</math> and use a  
 
on the finite domain <math>-L \leq x \leq  L</math> and use a  
 
[http://en.wikipedia.org/wiki/Fourier_series Fourier series] expansion  
 
[http://en.wikipedia.org/wiki/Fourier_series Fourier series] expansion  
Line 118: Line 128:
 
<center>
 
<center>
 
<math>  
 
<math>  
c_n(0) = \frac{1}{2L} \int_{-L}^{L} e^{-\mathrm{i} k_n x} c_0(x) dx
+
\hat{c}_n(0) = \frac{1}{2L} \int_{-L}^{L} e^{-\mathrm{i} k_n x} c_0(x) \mathrm{d}x
 
</math>
 
</math>
 
</center>
 
</center>
Line 127: Line 137:
 
<center>
 
<center>
 
<math>  
 
<math>  
c_n(0) = \frac{1}{N} \sum_{m=0}^{N-1} e^{-\mathrm{i} k_n x_m} c_0(x_m)
+
\hat{c}_n(0) = \frac{1}{N} \sum_{m=0}^{N-1} e^{-\mathrm{i} k_n x_m} c_0(x_m)
 
</math>
 
</math>
 
</center>
 
</center>
 
<center>
 
<center>
 
<math>  
 
<math>  
= \frac{1}{N} \sum_{m=0}^{N-1} e^{-2\mathrm{i} \pi nm/N} e^{-\mathrm{i} \pi n} c_0(x_m)
+
= \frac{1}{N} \sum_{m=0}^{N-1} e^{-2\mathrm{i} \pi nm/N} e^{\mathrm{i} \pi n} c_0(x_m)
 
</math>
 
</math>
 
</center>
 
</center>
Line 139: Line 149:
 
<center>
 
<center>
 
<math>  
 
<math>  
c(x_m,t) = \sum_{-\infty}^{\infty} \hat{c}_n(t) e^{\mathrm{i} k_n x_m}
+
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}
 +
</math>
 +
</center>
 +
<center>
 +
<math>
 +
= \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}  
 
</math>
 
</math>
 
</center>
 
</center>
 +
but we know that
 
<center>
 
<center>
 
<math>  
 
<math>  
= \sum_{-\infty}^{\infty} \hat{c}_n(t) e^{2\mathrm{i} \pi nm/N} e^{\mathrm{i} \pi n}  
+
\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)
 
</math>
 
</math>
 
</center>
 
</center>
Line 151: Line 167:
 
The
 
The
 
[http://en.wikipedia.org/wiki/Discrete_Fourier_transform discrete Fourier transform]
 
[http://en.wikipedia.org/wiki/Discrete_Fourier_transform discrete Fourier transform]
of a sequence of ''N'' complex numbers ''x''<sub>0</sub>, ..., ''x''<sub>''N''−1</sub> is transformed into the  sequence of ''N'' complex numbers ''X''<sub>0</sub>, ..., ''X''<sub>''N''−1</sub> by the DFT according to the formula:
+
of a sequence of ''2N'' complex numbers ''c''<sub>0</sub>, ..., ''c''<sub>''2N''−1</sub> is transformed into the  sequence of ''N'' complex numbers <math>\hat{c}</math><sub>0</sub>, ..., <math>\hat{c}</math><sub>''N''−1</sub> by the DFT according to the formula:
 
<center>
 
<center>
<math>X_k = \sum_{n=0}^{N-1} x_n e^{-\frac{2 \pi i}{N} k n} \quad \quad k = 0, \dots, N-1</math>   
+
<math>\hat{c}_m = \sum_{n=0}^{N-1} c_n e^{-2\pi \mathrm{i}mn/N} \quad \quad m = 0, \dots, N-1</math>   
 
</center>           
 
</center>           
  
The transform is sometimes denoted by the symbol <math>\mathcal{F}</math>, as in <math>\mathbf{X} = \mathcal{F} \left \{ \mathbf{x} \right \} </math> or <math>\mathcal{F} \left ( \mathbf{x} \right )</math> or <math>\mathcal{F} \mathbf{x}</math>.   
+
We denote the transform by the symbol <math>\mathcal{F}</math>, as in <math>\mathbf{X} = \mathcal{F} \left \{ \mathbf{x} \right \} </math> or <math>\mathcal{F} \left ( \mathbf{x} \right )</math> or <math>\mathcal{F} \mathbf{x}</math>.   
  
 
The '''inverse discrete Fourier transform (IDFT)''' is given by  
 
The '''inverse discrete Fourier transform (IDFT)''' is given by  
 
<center>
 
<center>
<math>x_n = \frac{1}{N} \sum_{k=0}^{N-1} X_k e^{\frac{2\pi i}{N} k n} \quad \quad n = 0,\dots,N-1.</math>
+
<math>c_n = \frac{1}{N} \sum_{m=0}^{N-1} \hat{c}_m e^{2\pi \mathrm{i}mn/N} \quad \quad n = 0,\dots,N-1.</math>
 
</center>
 
</center>
  
Line 166: Line 182:
 
<center>
 
<center>
 
<math>  
 
<math>  
c(x_m,t) =  \mathcal{F} \left\{ e^{-k_n^2 D t} \mathcal{F}^{-1} c_0(x_m)}
+
c(x_m,t) =  \mathcal{F} \left\{ e^{-k_n^2 D t} \mathcal{F}^{-1} \left\{ c_0(x_m) \right\}
 
\right\}  
 
\right\}  
 
</math>
 
</math>
 
</center>
 
</center>
 +
Note that the choice of where to put the <math>1/N</math> is arbitrary in the definition of FFT and IFFT and
 +
does not exactly match here.  Of course since it appears once the formula above is correct regardless.
 +
The only difficulty is that we need to define carefully the values of
 +
<math>k_n</math>
 +
 +
The real power of this method lies with the [http://en.wikipedia.org/wiki/FFT Fast Fourier Transform]
 +
or '''FFT''' algorithm. A naive implementation of the discrete Fourier transform above (or its inverse)
 +
will involve order <math>N^2</math> operations. Using FFT algorithms, this can be reduced to  order <math>N  \log(N)</math>. 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 ==
 
== Reaction Diffusion Equations ==
Line 184: Line 210:
 
<center>
 
<center>
 
<math>
 
<math>
z = x/x^*\,\,\,\tau = t/t^*\,\,\,\alpha = a/a_0\,\,\,\beta = b/a^*
+
z = x/x^*\,\,\,\tau = t/t^*\,\,\,\alpha = a/a_0\,\,\,\beta = b/a_0
 
</math>
 
</math>
 
</center>
 
</center>
Line 221: Line 247:
  
 
=== Solution via split step method ===
 
=== Solution via split step method ===
 +
 +
[[Image:Reaction diffusion.gif|thumb|right|500px|Solutions for <math>\alpha(z,0) =1
 +
\, \beta(z,0) = \exp(-10z^2)</math>]]
  
 
We can solve this equations numerically using a  
 
We can solve this equations numerically using a  
[http://en.wikipedia.org/wiki/Split-step_method split step method]. We write
+
[http://en.wikipedia.org/wiki/Split-step_method split step method]. We assume
 +
that at time <math>\tau</math> we know <math>\alpha(z,\tau)</math>
 +
and <math>\beta(z,\tau)</math>. We then solve first the following equation
 
<center>
 
<center>
 
<math>
 
<math>
Line 231: Line 262:
 
from <math>\tau</math> to <math>\tau + \Delta\tau</math>
 
from <math>\tau</math> to <math>\tau + \Delta\tau</math>
 
(which we can do exactly using the spectral methods just discussed for
 
(which we can do exactly using the spectral methods just discussed for
the dispersion equation. Then we solve  
+
the dispersion equation). We write this solution as
 +
<math>\tilde{\alpha}(z,\tau + \Delta\tau)</math>
 +
Then we solve  
 
<center>
 
<center>
 
<math>
 
<math>
Line 237: Line 270:
 
</math>
 
</math>
 
</center>
 
</center>
using the solution
+
by assuming that <math>\beta</math> is constant and subject to the boundary
 +
condition that <math>\alpha(z,\tau) = \tilde{\alpha}(z,\tau + \Delta\tau)</math>.
 +
This gives
 
<center>
 
<center>
 
<math>
 
<math>
\alpha(\tau + \Delta\tau = e^{-\beta(\tau) \Delta\tau} \alpha(\tau)
+
\alpha(z,\tau + \Delta\tau) = e^{-\beta(z,\tau) \Delta\tau} \tilde{\alpha}(z,\tau+ \Delta\tau)\,
 
</math>
 
</math>
 
</center>
 
</center>
Line 247: Line 282:
 
approximation with error which becomes smaller as the step size becomes
 
approximation with error which becomes smaller as the step size becomes
 
smaller.
 
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 <math>y = z - v\tau</math> (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
 +
<math>\alpha(y)</math> and <math>\beta(y)</math> which satisfy
 +
<center>
 +
<math>
 +
\frac{\mathrm{d}^2 \alpha}{\mathrm{d}y^2} + v \frac{\mathrm{d} \alpha}{\mathrm{d}y} = \alpha\beta
 +
</math>
 +
</center>
 +
and
 +
<center>
 +
<math>
 +
\frac{\mathrm{d}^2 \beta}{\mathrm{d}y^2} + v \frac{\mathrm{d} \beta}{\mathrm{d}y} = -\alpha\beta
 +
</math>
 +
</center>
 +
If we add these equations we obtain
 +
<center>
 +
<math>
 +
\frac{\mathrm{d}^2 (\alpha+\beta)}{\mathrm{d}y^2} + v \frac{\mathrm{d} (\alpha+\beta)}{\mathrm{d}y} = 0
 +
</math>
 +
</center>
 +
so that <math>\alpha + \beta = c_0 + c_1 e^{-vy}</math>. Boundary conditions
 +
are that as <math>y\to\infty </math> <math>\alpha = 1</math> and
 +
<math>\beta = 0</math> and if <math>y\to-\infty</math> then <math>\alpha = 0</math> and
 +
<math>\beta = 1</math>. Therefore <math>\alpha + \beta = 1</math>.
 +
This means that, since <math>\alpha \geq 0</math>, we must have
 +
<math>0\leq \beta \leq 1</math>.
 +
We can then obtain the following equation
 +
<center>
 +
<math>
 +
\frac{\mathrm{d}^2 \beta}{\mathrm{d}y^2} + v \frac{\mathrm{d} \beta}{\mathrm{d}y} + \beta(1-\beta)= 0
 +
</math>
 +
</center>
 +
which we can write as the system of first order equations.
 +
 +
[[Image:R_d_phase_portrait.jpg|thumb|right|500px|Phase portrait for out system showing
 +
the equilibrium points and the heteroclinic connection]]
 +
 +
We define the variable <math>\gamma = \frac{\mathrm{d}\beta}{\mathrm{d}y}</math>
 +
and we obtain
 +
<center><math>
 +
\begin{align}
 +
\frac{\mathrm{d}\beta}{\mathrm{d} y} &= \gamma&\\
 +
\frac{\mathrm{d}\gamma}{\mathrm{d} y} &= -v\gamma + \beta(\beta -1)& \\
 +
\end{align}
 +
</math></center>
 +
This dynamical system has equilibrium points at <math>(0,0)</math>
 +
and <math>(1,0)</math>. We can analyse these equilibrium points by
 +
linearization. The Jacobian matrix is
 +
<center>
 +
<math>
 +
J =\begin{pmatrix}
 +
0 & 1 \\
 +
-1 + 2\beta & -v
 +
\end{pmatrix}
 +
</math>
 +
</center>
 +
 +
We can easily see that the Jacobian evaluated at our first equilibrium point is
 +
<center>
 +
<math>
 +
J_{(0,0)} =\begin{pmatrix}
 +
0 & 1 \\
 +
-1 & -v
 +
\end{pmatrix}
 +
</math>
 +
</center>
 +
which has eigenvalues <math>\mu_{\pm} = -1/2 (v \mp \sqrt{v^2-4})</math>.  Therefore
 +
this point is a nodal sink (possibly a spiral)
 +
 +
 +
[[Image:R_d_wave.gif|right|Travelling wave solution for v=2 and the position on
 +
the heteroclinic connection]]
 +
 +
 +
Additionally,
 +
<center>
 +
<math>
 +
J_{(1,0)} =\begin{pmatrix}
 +
0 & 1 \\
 +
1 & -v
 +
\end{pmatrix}
 +
</math>
 +
</center>
 +
which has eigenvalues  <math>\lambda_{\pm} = -1/2 (v \mp \sqrt{v^2+4})</math>.
 +
This is a a saddle point. The unstable and stable
 +
separatrices leave the equilibrium point at <math>(1,0)</math> in the directions 
 +
<math> \begin{pmatrix}\lambda_{\pm} \\ 1\end{pmatrix}</math>.  The only path on which <math>\beta</math> is bounded
 +
as <math>y\to-\infty</math> are the unstable separatrices. Also, only the
 +
unstable separatrix which enters the region <math>\beta<1</math> 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 <math>0\leq \beta \leq 1</math>.
 +
 +
We need to show that the heteroclinic connection does not cross the <math>\beta</math> axis.
 +
Consider the region
 +
<center>
 +
<math>
 +
R = \left\{(\beta,\gamma)\,|\, \beta<1,\,-k\beta<\gamma<0\right\}
 +
</math>
 +
</center>
 +
On the line <math>\beta = 1,d\beta/dy<0</math> and hence all flow it into <math>R</math>.
 +
On the line <math>\gamma = 0, d\gamma/dy < 0</math> for <math>0<\beta<1</math>.  On the line
 +
<math>\gamma = -k \beta</math> we know that <math>d\beta/dy < 0</math> so that integral paths
 +
enter the region if and only if <math>d\gamma/d\beta < \gamma/\beta</math>. We know that
 +
<center>
 +
<math>
 +
d\gamma/d\beta - \gamma/\beta = -v - \frac{\beta(1-\beta)}{\gamma} -\frac{\gamma}{\beta}
 +
= \frac{1}{k} (k^2 - vk +1 -\beta)
 +
</math>
 +
</center>
 +
when <math>\gamma = -k\beta</math>.  Therefore we need to find a value of <math>k</math>
 +
so that <math>k^2 - vk +1 < 0</math>, which is possible provided <math>v\geq 2</math>, for example
 +
<math>k = \dfrac{v}{2}</math>.
 +
 +
== Lecture Videos ==
 +
 +
=== Part 1 ===
 +
 +
{{#ev:youtube|rF4X42jP0v8}}
 +
 +
=== Part 2 ===
 +
 +
{{#ev:youtube|D0NwYlM-uOg}}
 +
 +
=== Part 3 ===
 +
 +
{{#ev:youtube|5IEZJtJaDHk}}
 +
 +
=== Part 4 ===
 +
 +
{{#ev:youtube|t_OjTSwVgdo}}
 +
 +
=== Part 5 ===
 +
 +
{{#ev:youtube|kTHVZaYezLk}}
 +
 +
=== Part 6 ===
 +
 +
{{#ev:youtube|MVuSg5_sfYI}}
 +
 +
=== Part 7 ===
 +
 +
{{#ev:youtube|hxKMOHyy6Bw}}
 +
 +
=== Part 8 ===
 +
 +
{{#ev:youtube|yQ-O2KIqu44}}
 +
  
  
 
[[Category:Simple Nonlinear Waves]]
 
[[Category:Simple Nonlinear Waves]]

Latest revision as of 23:15, 24 October 2024

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 [math]\displaystyle{ P }[/math] which decays to [math]\displaystyle{ A }[/math], i.e.

[math]\displaystyle{ P \to A }[/math]

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

[math]\displaystyle{ \frac{\mathrm{d}p}{\mathrm{d}t} = -kp\,\,\,\textrm{and}\,\,\, \frac{\mathrm{d}a}{\mathrm{d}t} = kp }[/math]

which has solution

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

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

Example 2: Quadratic Autocatalysis

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

[math]\displaystyle{ A + B \to 2B }[/math]

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

[math]\displaystyle{ \frac{\mathrm{d}a}{\mathrm{d}t} = -kab\,\,\,\textrm{and}\,\,\, \frac{\mathrm{d}b}{\mathrm{d}t} = kab }[/math]

We can solve these equations by observing that

[math]\displaystyle{ \frac{\mathrm{d}(a+b)}{\mathrm{d}t} = 0 }[/math]

so that [math]\displaystyle{ a + b = a_0 + b_0 }[/math]. We can then eliminate [math]\displaystyle{ a }[/math] to obtain

[math]\displaystyle{ \frac{\mathrm{d}b}{\mathrm{d}t} = k(a_0 + b_0 - b)b }[/math]

which is separable with solution

[math]\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}} }[/math]

and

[math]\displaystyle{ a = \frac{a_0(a_0 + b_0)}{a_0 + b_0e^{k(a_0 + b_0)t}} }[/math]

Note that [math]\displaystyle{ a\to 0 }[/math] and [math]\displaystyle{ b\to a_0 + b_0 }[/math] as [math]\displaystyle{ t\to \infty. }[/math]

Diffusion

The equation for spatially homogeneous diffusion of a chemical with concentration [math]\displaystyle{ c }[/math] is

[math]\displaystyle{ \partial_t c = D\nabla^2 c }[/math]

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

[math]\displaystyle{ \partial_t \hat{c} = -D k^2 \hat{c} }[/math]

where [math]\displaystyle{ \hat{c} }[/math] is the Fourier transform of [math]\displaystyle{ c }[/math]. This has solution

[math]\displaystyle{ \hat{c} = \hat{c}_0 e^{-D k^2 t} }[/math]

We can find the inverse transform using convolution and obtain

[math]\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 }[/math]

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 [math]\displaystyle{ -L \leq x \leq L }[/math] and use a Fourier series expansion

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

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

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

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 [math]\displaystyle{ \hat{c}_n(0) }[/math] are found using the initial conditions so that

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

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 [math]\displaystyle{ N }[/math] points [math]\displaystyle{ x_m = -L + 2Lm/N }[/math]. We then use this to approximate the integral above and obtain

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

[math]\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) }[/math]

We also get

[math]\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} }[/math]

[math]\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} }[/math]

but we know that

[math]\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) }[/math]

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 [math]\displaystyle{ \hat{c} }[/math]0, ..., [math]\displaystyle{ \hat{c} }[/math]N−1 by the DFT according to the formula:

[math]\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 }[/math]

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

The inverse discrete Fourier transform (IDFT) is given by

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

Therefore we can write

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

Note that the choice of where to put the [math]\displaystyle{ 1/N }[/math] is arbitrary in the definition of FFT and IFFT and does not exactly match here. Of course since it appears once the formula above is correct regardless. The only difficulty is that we need to define carefully the values of [math]\displaystyle{ k_n }[/math]

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 [math]\displaystyle{ N^2 }[/math] operations. Using FFT algorithms, this can be reduced to order [math]\displaystyle{ N \log(N) }[/math]. 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

[math]\displaystyle{ \partial_t a = D\partial_x^2 a - kab }[/math]

[math]\displaystyle{ \partial_t b = D\partial_x^2 b + kab }[/math]

We can non-dimensionalise these equations scaling the variables as

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

So that the equations become

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

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

If we choose

[math]\displaystyle{ x^* = \sqrt{\frac{D}{ka_0}}\,\,\,t^*=\frac{1}{ka_0} }[/math]

then we obtain the system

[math]\displaystyle{ \partial_\tau \alpha = \partial_z^2 \alpha -\alpha\beta }[/math]

[math]\displaystyle{ \partial_\tau \beta =\partial_z^2 \beta + \alpha\beta }[/math]

Solution via split step method

Solutions for [math]\displaystyle{ \alpha(z,0) =1 \, \beta(z,0) = \exp(-10z^2) }[/math]

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

[math]\displaystyle{ \partial_\tau \alpha = \partial_z^2 \alpha }[/math]

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

[math]\displaystyle{ \partial_\tau \alpha = -\alpha\beta }[/math]

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

[math]\displaystyle{ \alpha(z,\tau + \Delta\tau) = e^{-\beta(z,\tau) \Delta\tau} \tilde{\alpha}(z,\tau+ \Delta\tau)\, }[/math]

and we do likewise for the equation for [math]\displaystyle{ \beta }[/math]. 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 [math]\displaystyle{ y = z - v\tau }[/math] (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 [math]\displaystyle{ \alpha(y) }[/math] and [math]\displaystyle{ \beta(y) }[/math] which satisfy

[math]\displaystyle{ \frac{\mathrm{d}^2 \alpha}{\mathrm{d}y^2} + v \frac{\mathrm{d} \alpha}{\mathrm{d}y} = \alpha\beta }[/math]

and

[math]\displaystyle{ \frac{\mathrm{d}^2 \beta}{\mathrm{d}y^2} + v \frac{\mathrm{d} \beta}{\mathrm{d}y} = -\alpha\beta }[/math]

If we add these equations we obtain

[math]\displaystyle{ \frac{\mathrm{d}^2 (\alpha+\beta)}{\mathrm{d}y^2} + v \frac{\mathrm{d} (\alpha+\beta)}{\mathrm{d}y} = 0 }[/math]

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

[math]\displaystyle{ \frac{\mathrm{d}^2 \beta}{\mathrm{d}y^2} + v \frac{\mathrm{d} \beta}{\mathrm{d}y} + \beta(1-\beta)= 0 }[/math]

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 [math]\displaystyle{ \gamma = \frac{\mathrm{d}\beta}{\mathrm{d}y} }[/math] and we obtain

[math]\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} }[/math]

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

[math]\displaystyle{ J =\begin{pmatrix} 0 & 1 \\ -1 + 2\beta & -v \end{pmatrix} }[/math]

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

[math]\displaystyle{ J_{(0,0)} =\begin{pmatrix} 0 & 1 \\ -1 & -v \end{pmatrix} }[/math]

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


Travelling wave solution for v=2 and the position on the heteroclinic connection


Additionally,

[math]\displaystyle{ J_{(1,0)} =\begin{pmatrix} 0 & 1 \\ 1 & -v \end{pmatrix} }[/math]

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

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

[math]\displaystyle{ R = \left\{(\beta,\gamma)\,|\, \beta\lt 1,\,-k\beta\lt \gamma\lt 0\right\} }[/math]

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

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

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

Lecture Videos

Part 1

Part 2

Part 3

Part 4

Part 5

Part 6

Part 7

Part 8