Computational Physics, Physics, Math, Python.
pn)**2)/numpy.sum(pn**2)) Now, let’s define a function that will apply Jacobi’s method for Laplace’s equation. Three of the boundaries are Dirichlet boundaries and so we can simply leave them alone. Only the Neumann boundary needs to be explicitly calculated at each iteration, and we’ll do it by