Differential Equations  Gray Scott Equations
微分方程Introduction to Gray Scott Equations
The GrayScott equations are a set of partial differential equations used to model reactiondiffusion systems, particularly in chemistry and biology. They describe the interaction between two chemical species, typically referred to as
The GrayScott model is known for producing a variety of complex, spatially structured patterns, such as spots, stripes, and waves. The nature of the patterns depends on the parameters
Formulation of GrayScott Equations
The GrayScott model is defined by the following system of PDEs:
where: 
Interpretation of Terms
 Diffusion Terms:
and represent the spatial diffusion of species and . These terms cause the chemicals to spread out over time.  Reaction Terms:
and represent the interaction between and . The term in the equation for indicates that is consumed in the reaction to produce , while the term in the equation for indicates that is produced in the reaction.  Feed and Decay Terms:
represents the addition of species into the system at a constant rate, while represents the decay of species .
Derivation of Numerical Solutions
We try to keep everything simple. The GrayScott equations are discretized in space using a finite difference method, and the resulting system of ODEs is solved using explicit Euler timestepping.
To give the formulation, we use
The Laplacian in 2D cartesian coordinates is approximated using the fivepoint stencil:
Here we formally present the algorithm for solving the GrayScott equations:
 Use a rectangular grid to discretize the spatialtemporal domain.
 Use forward difference to approximate the time derivative, and fivepoint central difference to approximate the Laplacian to obtain
at each grid point. The term form the truncation error of the finite difference method. The same applies to . The equation applies for time steps 。  Drop the truncation error terms and rearrange the equation to obtain the update rule
.  The initial condition (IC) is set by assigning given values to all
at . The periodic boundary condition (BC) is set by copying the values of at the opposite boundary, i.e., and the same for . The boundary condition is applied at each time step .
The update rule
1 

The periodic boundary condition is not explicitly implemented in the shader. Instead, we use the GL_REPEAT
texture wrapping mode to handle the boundary condition.
Test of Accuracy and Stability
Accuracy
It is difficult to obtain an analytical solution for the GrayScott equations. From the truncation error term, we could expect the method to have a firstorder accuracy in time and secondorder accuracy in space.
Convergence
We could empirically show that the method converges under the condition
First we test the convergence of the method by increasing the spatial resolution while keeping the time step size constant. We set
We also tried to change the time step size while keeping the spatial resolution constant. The result shows that lower time step size leads to consistent results, and the system diverges when the time step size exceeds a certain value.
We finally demonstrate that by decreasing the time step size and increasing the spatial resolution simultaneously, the method could be conditionally convergent. Following the condition