# the brusselator reaction-diffusion model # reaction terms f(u,v)=a-(b+1)*u+v*u^2 g(u,v)=b*u-v*u^2 par a=1,b=1.5 # # equations u0=u1 v0=v1 u251=u250 v251=v250 %[1..250] u[j]'=f(u[j],v[j]) + du*(u[j+1]-2*u[j]+u[j-1])/(h*h) v[j]'=g(u[j],v[j]) + dv*(v[j+1]-2*v[j]+v[j-1])/(h*h) % # # spatial parameters par h=.2,du=.1,dv=4 # initial data init u[4..250]=1 init u[1..3]=1.2 init v[1..250]=1.5 # numerical stuff @ meth=cvode,atol=1e-5,tol=1e-6,total=400,dt=.25 done