There’s a great discussion in Griffiths book on electromagnetism (typical book used for junior/senior course for physics majors) about what happens to free charges inside a conductor. He discusses how they will always find their way to the surface, distributing themselves to cancel the field inside the conductor. If they don’t do that, there will be a residual field to push more charges around. This happens until the field is totally cancelled. In a footnote he mentions how this surface effect only happens in 3D. In lower dimensions, like charges on a plate, say, the charges don’t necessarily go to the boundary.
One thing I really like about his discussion is how he tries to get students to think about other ways the charges could distribute themselves to minimize their energy. He points out that, in one sense, it’s strange that the charges all go to the surface. They congregate there next to each other, even though they don’t like to be close to each other. Why don’t a few float to the interior to relieve some of that stress?
I’m teaching this course right now and, as I was preparing my thoughts for this section, I thought it might be fun to show students how we could model this. I’m writing this post for me, for my students, and for anyone else who might be interested in this approach.
What I decided to do was to model a finite number of charges dumped into a region of space where they were free to move, while interacting with each other via the Coulomb force. When they get to the boundary of the conductor, they feel a force that tries to keep them inside.
As usual, instead of directly calculating all the forces, I decided to approach this through a Lagrangian formalism. I calculate the potential of the system as a function of the locations of all the particles. Then, for each component of each particle, I can determine the equation of motion via the Euler-Lagrange equation:
Where L is the difference between the kinetic and potential energy written in terms of the particle positions () and velocities (). Mathematica is perfectly happy to analytically figure out all of those equations of motion for me and to numerically integrate all of them to let me make pretty pictures (see below). The big trick, of course, is making sure you can correctly calculate the potential energy (typically, the kinetic energy is pretty easy: ).
The potential I ended up using has three parts:
- The particles: For every pair of particles there’s a contribution that looks like this:
- Mathematica’s Subsets command helps with finding all the pairs
- The wall: I’m using various polar functions () to make the walls of the conductors. Following what I did in this post, I made the potential rise as a steep ramp as the position got further outside of the conductor. This forces the particle back into the conductor where this potential term goes back to zero.
- External field: Sometimes I turn on an external electric field by simply supplying an extra term to the potential energy in the form of some constant times the y-component of the particle. This models a constant field in the -y direction.
Once I have the potential, Mathematica is ready to go.
By the way, one other thing I did was to add in some viscous friction so that the charges would settle down into their lowest energy state. Without this, the charges just continue to oscillate wildly. My students and I used this trick when trying to find the equilibrium state for a complex system of masses and springs. Basically we just set the initial conditions randomly and waited for the particles to settle down. Works like a charm.
The first conductor I tried was a sphere. I dumped in 10 free charges and let them go nuts.
It’s hard to see without being able to twist the image around, but, trust me, they end up on the surface.
Here’s what it looks like with an external field (directed to out of the face closest to you):
You can see how all the charges favor the side closest to you, and, once again, they all end up on the surface.
2D circular conductor
I wanted to see what would happen if I did the same thing in two dimensions. Here’s the no field case:
Now here’s something cool! You can see that the lowest energy state for this case does not have all the charges going to the edge. One of the charges stays in the middle. Just like what Griffiths suggested in his footnote.
Here’s just the last frame for the case when there’s a downward directed external field:
Once again you can see that there’s a charge in left in the interior while all of them are being forced downward, at least a little.
Getting away from circles and spheres
I wanted to see if the same things would happen if the conductor shapes weren’t so simple. Here’s the result of a wavy sphere:
Yep, all on the surface.
Here’s the last frame of the case of a non-circular conductor in the 2D realm:
I like this one because I did 20 charges and you can see that three charges stayed in the interior. Cool stuff, for sure.
Comments on Mathematica
I just wanted to finish with a some comments on how using Mathematica to do this was a great experience. First of all, everything you’ve seen was done with 21 lines of code. Some of those are function definitions, some are setting initial conditions, and some are for plotting. If I tried, I could probably get it down to under 10 lines of code (though one line would be quite long).
Next, keeping track of the variables was really easy. The basic format was r[i][j] where i ran from 1-3 to denote x, y, and z, and j counted the particles. That format made keeping track of things great and Mathematica was perfectly happy to take analytical derivatives with respect to each of them (and their time derivatives!).
The most complicated run I did was 20 particles for a 3D case. That meant integrating 60 coupled, second order differential equation. One command, NDSolve, took care of that for me. I didn’t have to convert the second order equations into first order ones, which is a nice bother to skip.
Plotting, and animating, was also very straightforward. Being able to easily adjust the opacity of the sphere, for example, was quite useful.
I hope this is useful to my students this coming week as we talk about this. I hope it’s useful to me in future years. Finally, I hope it’s useful to some of you!