PHYS 220 — Lab #9

This lab is the final section of a two-part sequence that will address certain topics in electromagnetism. In this first part you will numerically solve Laplace's equation and learn a few techniques for visualizing the solution. The assignment is due at the beginning of lecture on Monday, 20 April. Your solutions should include code listings and plots of the potential, the electric field and the level of convergence in your solution at exit.


  1. Select a conductor configuration from your text shown in either Fig. 5.4, Fig. 5.6 or given by Exercise 5.6.
  2. For your selection, use the Jacobi relaxation method to solve Laplace's equation for your conductor configuration. It will help to code a few modules to tackle the problem:
  3. You calculate your electric field after you solve for the potential. The electric field is simply E = -∇V. For example, in the x-direction this is Ex = - ∂V/∂x ≈ -(V(i+1,j) - V(i-1,j))/2Δx. Note that using this formulation, you must be careful not to use cells that are outside your boundary conditions. You can also use the gradient function in MATLAB to calculate this.
  4. A suggestion is to explore my Jacobi method codes on the course outline and adapt them for your own purposes. Too, you may want to begin with a relatively coarse mesh for your first attempts, then make your mesh finer for your final submission.