Header image
 
Ph.D. Student  
 
 

Reaction-Diffusion simulation

This applet implements reaction-diffusion system. The reaction-diffusion system is modelled by the Gray-Scott equations

The system can be solved by the forward Euler method (key e) and the alternating direction implicit method (key a) which is faster. Both methods are described in details in Numerical Solution of Partial Differential Equations: An Introduction by K. W. Morton and D. F. Mayers.

Instead of using if-clauses to handle boundary specifics I used a scheme adapted from Digital Image Processing. The actual grid is bigger than the visible one and I replicate all 4 boundaries. Therefore no if-clauses have to be evaluated for each grid cell in each time-step which speeds up the program significantly.

Usage instructions:

  • SPACE start/stop animation
  • i initialize/reset system
  • d toggle diffusion/diffusion-reaction
  • e use forward euler
  • a use ADI
  • p toggle constant / spatial varying parameters
  • 1 spots
  • 2 stripes
  • 3 spirals
  • 4 pulsating waves

[ download source | applet page ]

Sample pictures:

Spatial varying parameters (press p to toggle) Dots (key 1)
Stripes (key 2) Spirals (key 3)

 


Navigation