# Reaction-Diffusion PDEs

## 1 Finite difference methods for diffusion equations

Reaction-diffusion equations are partial differential equations of the form

$\frac{\partial u}{\partial t} = f(u) + D \frac{\partial^2 u}{\partial x^2}$

The solution $u(t,x)$ depends both on time $t$ and space $x$. The term $f(u)$ is the reaction term and the term $D \frac{\partial^2 u}{\partial x^2}$ is the diffusion term. The second derivative is called Laplacian. The Laplacian is written for a one dimensional space. For 2 and 3 dimensions, the Laplacian reads $\frac{\partial^2 u}{\partial x^2} + \frac{\partial^2 u}{\partial y^2}$ and $\frac{\partial^2 u}{\partial x^2} + \frac{\partial^2 u}{\partial y^2} + \frac{\partial^2 u}{\partial z^2}.$ The notation $\Delta$ or $\nabla^2$ are often used to denote the Laplacian (in any dimension): $\Delta u = \nabla^2 u = \frac{\partial^2 u}{\partial x^2} + \frac{\partial^2 u}{\partial y^2} + \frac{\partial^2 u}{\partial z^2}.$

The following script implement the 1D FitzHugh-Nagumo reaction-diffusion equation. This equation can used to simulate the progression of an action potential along an axon.

## 3 1D/2D Crank-Nicolson methods

As an example, we take the reaction-diffusion equation known as the Fisher-KPP or FKPP equation (Fisher-Kolmogorov-Petrovski-Piskunov) $\frac{\partial u}{\partial t} = r u ( 1 - u ) + D \frac{\partial^2 u}{\partial t^2}$

You can find below several numerical schemes to solve the FKPP equation in one and two dimensional spaces

• 1D and 2D Explicit finite difference
• 1D/2D Crank-Nicolson implicit finite difference
• 2D Crank-Nicolson with alternating-direction implicit method (ADI)

#### 1D explicit finite difference scheme

The explicit finite difference scheme for the FKPP equation is found below

#### 1D Crank-Nicolson scheme (implicit method)

The Crank-Nicolson implicit finite difference scheme for the FKPP equation is found below

## 4 Individual-Based-Methods (IBM)

As an example, we take the reaction-diffusion equation known as the Fisher-KPP or FKPP equation (Fisher-Kolmogorov-Petrovski-Piskunov) $\frac{\partial u}{\partial t} = r u ( 1 - u ) + D \frac{\partial^2 u}{\partial t^2}$

You can find below two different individual-based modelling approaches for solving the FKPP equation in one dimensional spaces