Computational Physics, Physics, Math, Python.
p[1:-1, -2] # 1st order approx of a derivative l2norm = L2_error(p, pn) return p The initial values of the potential field are zero everywhere (initial guess), except at the boundary: ##variable declarations nx = 41 ny = 41 ##initial conditions p = numpy.zeros((ny,nx)) ##create a XxY vector of 0's