Computational Physics, Physics, Math, Python.
solutions Returns: ------- p: 2D array of float Potential distribution after relaxation ''' l2norm = 1 pn = numpy.empty_like(p) while l2norm > l2_target: pn = p.copy() p[1:-1,1:-1] = .25 * (pn[1:-1,2:] + pn[1:-1, :-2] \ + pn[2:, 1:-1] + pn[:-2, 1:-1]) ##Neumann B.C. along x = L p[1:-1, -1] =