Use FiPy in the Jupyter Notebook

In [3]:
from fipy import Grid2D, CellVariable, Viewer, DiffusionTerm

mesh = Grid2D(nx=100, ny=100)
var = CellVariable(mesh=mesh)
var.constrain(0, mesh.facesLeft)
var.constrain(1, mesh.facesDown)
var.constrain(2, mesh.facesRight)
var.constrain(3, mesh.facesUp)
DiffusionTerm().solve(var)
Viewer(var).plot()
In [ ]: