- /
-
Petri-dish Slime Growth (Gray-Scott model)
on 10 Oct 2021
- 3
- 95
- 5
- 0
- 274
%-----------------------------------------------------
%% GRAY-SCOTT REACTION-DIFFUSION MODEL (Slime-growth)
%-----------------------------------------------------
clc; clear; close all;
%% system parameters
f=0.0545; % slime feedrate
k=0.062; % slime killrate
N=2^7; % gridsize (N=128)
M=N/2; % middle (M=64)
%% initial conditions
x = single(meshgrid(1:N));
u = 0*x+1;
v = 0*u;
v(M,M) = 1; % center seeding
%% petri-dish filter
w = (sqrt((x-M).^2 + (x.'-M).^2) <= .975*M);
%% numerical PDE solver
j = 0;
while j < 15e3
u = u+w.*((del2(u,2))-u.*v.^2+f.*(1-u));
v = v+w.*((del2(v,2))/2+u.*v.^2-(f+k).*v);
j = j + 1;
%% uncomment to see slime growing!
% if mod(j,M) == 0
% imshow(u);
% colormap(bone);
% end
end
%% plotting magic ;)
imshow(u);
colormap(bone);
%% References:
% [1] A. M. Turing, The chemical basis of morphogenesis, Philosophical Transactions of the
% Royal Society of London (Biological Sciences), 237: 37-72, 1952.
% [2] K. Käfer and M. SchulzGray, Gray-Scott Model of a Reaction-Diffusion System Pattern Formation
% https://itp.uni-frankfurt.de/~gros/StudentProjects/Projects_2020/projekt_schulz_kaefer/
% (Accessed at October, 2021).
%% Notes:
% i) Please check the references for other f,k parameters!
% ii) Yes, indeed. THE "Alan Turing" studied these dynamic models ;o