title: Gray Scott Model
body: <p>I am trying to show the gray scott model of diffusion.  I keep getting a bunch of runtime warning errors even though I feel like my code is really close to correct.  Is there something wrong with my discretization?</p>
  
  <pre><code>import numpy as np
  import matplotlib.pyplot as plt
  
  #parameters
  N=128
  F=.042
  k=.062
  Du=(2**-5)*(N**2/6.25)
  Dv=(1**-5)*(N**2/6.25)
  tend=1000                             
  dt=tend/N
  t=0
  
  #start arrays
  U=np.ones((N,N))
  V=np.zeros((N,N))
  
  #Initial Value Boxes (20x20 in middle)
  low=int(((N/2)-10))
  high=int(((N/2)+10))+1
  U[low:high,low:high]=.5
  V[low:high,low:high]=.25
  
  #Random Noise
  U+=.01*np.random.random((N,N))
  V+=.01*np.random.random((N,N))
  
  #Laplace
  def Laplace(f):
      return np.roll(f,1)+np.roll(f,-1)+np.roll(f,1,axis=False)+np.roll(f,-1,axis=False)-4*f
  
  #Solve
  pstep=100
  for t in range(tend):
      U+=((Du*Laplace(U))-(U*V*V)+(F*(1-U)))
      V+=((Dv*Laplace(V))+(U*V*V)-(V*(F+k)))
      if t%pstep ==0:
          print(t//pstep)
          plt.imshow(U, interpolation='bicubic',cmap=plt.cm.jet)
  </code></pre>