These exercises are not tied to a specific programming language. Example implementations are provided under the Code tab, but the Exercises can be implemented in whatever platform you wish to use (e.g., Excel, Python, MATLAB, etc.).

### Exercise 1: Calculate the electric field of a single point charge at many grid points
Consider a $1.0$nC point charge at the origin. Construct a 100x100 grid in the
$xy$-plane. Let both $x$ and $y$ be in the range from $-5.0$ to $5.0$.
1. Describe (in words or pseudocode) and then implement a procedure to calculate the components of the electric field at each point on the grid according to
$$\vec{E}(\vec{r}) = \frac{1}{4\pi\epsilon_0} \frac{q\left( \vec{r} - \vec{r}\ ' \right)}{\left\vert\vec{r} - \vec{r}\ ' \right\vert^3},$$
where $\vec{r}$ is a point on the 100x100 grid and $\vec{r}\ '$ is the location of the point charge (in this case, the origin).
2. Choose several points at which to validate your numerical calculation of the electric field with an analytical calculation done by hand.
2. Construct a vector plot of the resulting electric field. What are the major features you see? Do they align with your expectations from what you already know about electric field lines?
3. Repeat this process for a negative point charge - compare and contrast
your plots.
### Exercise 2: Calculate the electric potential of a single point charge at many grid points
Consider the same $1.0$ nC point charge at the origin, and the same 100x100 grid in the $xy$-plane.
1. At each point on the grid, describe (in words or pseudocode) and then implement a procedure to calculate the electric
potential according to
$$ V(\vec{r}) = \frac{1}{4\pi\epsilon_0} \frac{q}{\left\vert\vec{r} - \vec{r} \ ' \right\vert}. $$
2. Choose several points at which to validate your numerical calculation of the electric potential with an analytical calculation done by hand.
3. Construct a contour plot of the resulting electric potential. Since the
contour lines represent lines of equal electric potential, they are
known as **equipotential lines**. What are the major features you see? Do they align with your expectations from what you already know about electric potential?
4. Repeat this process for a negative point charge again - compare and
contrast your plots.
5. Now, overlay your previous electric field vector plot with your
equipotential lines on the same plot. What relationship do you see
between the electric field lines and the equipotential lines?
### Exercise 3: Plot electric field and equipotential lines for collections of multiple charges
Now, adapt the above methods to produce plots that contain both the
electric field and equipotential lines for each of the following
collections of point charges. **Note**: In your plots, it will turn out
to be helpful to highlight the $V=0$ equipotentials, for example by
plotting that line extra thickly.
1. A positive charge of $1$nC at $(x,y) = (1.0, 0.0)$, and an equal
but opposite charge at $(x,y) = (-1.0, 0.0)$.
2. A positive charge at $1nC$ $(x,y) = (1.0, 0.0)$, and another
positive charge of equal magnitude at $(x,y) = (-1.0, 0.0)$.
3. A positive charge of $1$nC at $(x,y) = (4.0,0.0)$, and a negative
charge of half the magnitude at $(x,y) = (1.0,0.0)$.
4. A set of four point charges: $+1$nC at $(+1.0, +1.0)$, $-1$nC at
$(-1.0, +1.0)$, $+1$nC at $(-1.0, -1.0)$, and $-1$nC at
$(+1.0, -1.0)$.
Describe the shapes of the electric field lines and the equipotential
lines for each case. Compare and contrast the features of these plots
with the single-particle cases above.
### Exercise 4: The method of images
The motivation for the method of images is the **uniqueness theorem**
for electrostatics - it does not matter *how* a solution to an
electrostatics problem is found, as long as the solution satisfies the
problem's boundary conditions.
1. Consider an infinite plane conductor, situated at $x=0$, that is
held at a fixed potential $V=0$. A charge $1.0$nC is placed at
$(1.0, 0.0, 0.0)$. What are the electric field and the electric
potential everywhere in the region $x>0$?
- Review the plots you made in Exercise 3. *Do any of the plots
satisfy this current problem's specifications* (namely, a charge
at $(1.0, 0.0, 0.0)$, and a $V=0$ equipotential plane at $x=0$)?
- Now, use the method of images to plot the electric field and
electric potential for *this* problem, in the region $x>0$.
- Finally, make a plot of the *induced surface charge density* on
the plate. You may restrict your plot to the $z=0$ cross
section, and plot $\sigma(y, z=0)$ as a function of $y$.
2. Now, consider a spherical conductor, of radius 2m, centered at the
origin. The spherical conductor is held at a fixed potential $V=0$.
A charge $+1$nC is placed at $(4.0, 0.0, 0.0)$. What are the
electric field and the electric potential everywhere outside of the
spherical conductor?
- Review the plots you made in Exercise 3. *Do any of the plots
satisfy this current problem's specifications*?
- Now, use the method of images to plot the electric field and
electric potential for *this* problem, outside of the spherical
conductor.
3. Now, consider a plane conductor that is "bent" into a 90$^\circ$
angle (so that one of the two flat pieces line up with $x=0$, and
the other with $y=0$). A charge $1$nC is placed at
$(1.0, 1.0, 0.0)$. What are the electric field and the electric
potential in the region $x>0, y>0$?
- Review the plots you made in Exercise 3. *Do any of the plots
satisfy this current problem's specifications*?
- Now, use the method of images to plot the electric field and
electric potential for *this* problem, in the region $x>0, y>0$.