2. Plotting Field Lines and Equipotentials
- Ingredients for the field-line plotter:
- a function to compute the potential phi(x,y)
- a function to compute the electric field E(x,y)
- a function to take a step of specified length in the local
direction of the E-field
- a function to choose (place limits on) the step
- a function to set up the charge distribution
- a function to draw the field line through a specified
point, stopping the calculation on a negative charge or
when the line is too far from the origin
- a function to draw all the field lines originating near a
positive charge
- a main program to set parameters and oversee the
calculation
- Demonstration 1
- Equipotentials may be handled somewhat similarly
(now taking a step in the direction perpendicular to the
local field), except that
- the choice of initial conditions is different
- we have a measure (dphi) of how far we are from the
correct equipotential, so we can in principle apply a
correction at the end of each step to force us back
onto the correct track
- the equipotentials from closed loops, so special care
must be taken to make the loops actually close:
- use a symmetric integrator
- stop when "near" the initial point
- Demonstration 2
- Homework #1