This browser has no WebGPU, so the sketch cannot run here. The program is below, and it runs in a current Chrome, Edge or Safari.
Reaction Diffusion
parametric Grey-Scott Reaction Diffusion
/////////////////////////////////////////
// reaction-diffusion
// parametric Grey-Scott Reaction Diffusion
////////////////////////////////////////
&dim = (512,512,1);
&V4 = add(#(-1,0), #(1,0), #(0, -1), #(0,1));
&N = sub(&V4, mlt(#, 4));
&UVV = mlt(#.x,#.y,#.y);
&F = add(0.04, mlt(C.x, 0.04));
&K = add(0.06, mlt(C.y, 0.01));
&Du = 0.15;
&Dv = 0.06;
#A{
dim = &dim;
val_dom = UNIT;
bound = CLAMP;
set = sml(0.1, rand(1));
run =
add(
frc(#.xyy),
(
add(
sub(mlt(&Du, &N.x), &UVV),
mlt(&F, sub(1.0, #.x))
),
sub(
add(mlt(&Dv, &N.y), &UVV),
mlt(#.y, add(&F, &K))
),
0.0
)
);
}
~B {
dim = &dim;
col = sub(1,#A.x);
}
{
= (2);
= (0.5);
= (0);
}