For the past couple of weeks I've been playing around building a Charge Simulation in C#. The result is Charge Lab, a 2D simulator that can:
- Simulate motion of charges due to adjacent charges
- Fill the edges of conducting surfaces
- Produce Field Lines
- Measure Potential
- Draw Equipotential Surfaces
Place charges and observe attraction and repulsion |
Charges migrate to the edges of conductors and congregate in the corners |
Observe Field Lines |
Observe Equipotential Surfaces and Potential Gradients |
I'm putting a version of the program out there now even though it's not finished because it's in a usable state. My students and I have been playing around with it in class and it seems to be really valuable for observing how charges behave on conductors as well as shapes and structures in Electric Fields. But I need some help sorting out some of the remaining issues surrounding charges moving along surfaces. Any comments you have are welcome!
Issue: Charges can't slide across diagonal edges well
See the charge on the left? He's stuck on a corner between two diagonal pixels. His two buddies to the right should be pushing him down the line to the lower left, but he can't get over the edge of the pixel.
Solved Issue: Potential Gradients (and therefore Field Lines as well) were not matching theory quite right.
Transforming Electrostatics Equations from 3 down to 2 Dimensions (k' is a different constant to k) |
I'm not 100% sure about these adjustments. They seem to produce charge and field behavior in 2 dimensions that matches what we expect in 3 dimensions. I'm happy to discuss this issue more if there is interest.