Computational Physics, Physics, Math, Python.
the grid size! That doesn’t seem right. We’ll fix it by normalizing the norm, dividing the above formula by the norm of the potential field at iteration k. For two successive iterations, the relative L2 norm is then calculated as def L2_error(p, pn): return numpy.sqrt(numpy.sum((p -