title: Heat diffusion on a 2d plate- Python
body: <p>I need to complete a task, and I'm kind of in the middle of nowhere. I dont know whats wrong with the solver, and I dont know how to visualize the data.
  My task is to simulate heat diffusion on a 2D plate. It has to have 2 heaters, and two holes in the middle of the plate. BCs are as always zero.</p>
  
  <p>My questions are: 
  How do I make simulation run through time? I'm asking this because when I plot it this way it shows me heaters on a plate, but all of the heat is concentrated on them. Another question is, how can I visualize the results as video or as pictures at given time? 
  Here is my code. Thank you.</p>
  
  <pre><code>import numpy as np
  import matplotlib.pyplot as plt
  
  dt=0.1
  dx=0.1
  
  L=50                        #length of the plate
  Ly=np.linspace(0,L,50)
  B=50                        #width of the plate
  Bx=np.linspace(0,B,50)
  
  M=np.zeros([L,B])           #matrix
  
  #heating device shaped like X
  Gr=np.eye(10)*2000
  for iGr in range(10):
      Gr[iGr,-iGr-1]=2000
  
  #implementing heaters to matrix    
  M[20:30,10:20]=Gr
  M[20:30,30:40]=Gr
  
  t=0
  #wannabe solver
  while t&lt;10:
      t=0.1+t
      for j in range(1,L-1):
          for i in range(1,B-1):            
              if 24&lt;j&lt;28:
                  if 29&lt;i&lt;32:
                      k=0
                  elif 23&lt;i&lt;20: # holes for liquid
                      k=0
                  else:
                      break
              else:
                  k=0.5
                  break
  
              M[i,j]=M[i,j]+k*((dt)/dx**2)*(M[i,j+1]-2*M[i,j]+M[i,j-1])+k*((dt)/dx**2)*(M[i+1,j]-2*M[i,j]+M[i-1,j])
  
  
  plt.pcolormesh(M)
  plt.colorbar()
  plt.show()
  </code></pre>