mapping field lines
an idea that didn’t fly
tl;dr
Is there a trick I could use to work my way around branch cuts of \(\log(z-z_0)\) and thereby salvage my idea of using complex analysis to find 2D electric field lines as level curves of the imaginary part of a holomorphic function derived from the electric potential?
too short, tell me more
Consider if you will a little stream of water carving its way at the bottom of a hill. It suddenly encounters an abrupt cliff, cascades straight down, and emerges at the bottom in a new valley where it continues its local meandering. An eagle, observing the scene from a great height and just above the vertical drop, sees an uninterrupted line of water. This is, in essence, the problem I’m facing below.
The standard method
All of the interactive 2D representations I’ve seen online appear to be inaccurate in terms of field line density. They typically start with a specific number of field lines emerging at equi-spaced angles around a first charge, follow them up along the field until they reach a sink or go outside the window. For subsequent charges present in the scene, it is a bit unclear how to to add new lines, because they must complement the ones previously drawn, and also have a number (density) that reflects the local field strength. This is in fact also a problem for the first charge, for which equispaced field lines assumes isotropic field strength.
I believe a correct solution is non-trivial and would require an optimisation / iterative procedure for a given scene, whereby an initial set of such field lines is gradually re-arranged so as to obtain inter-line spacings that correspond to the local field strength. I have not seen this done anywhere.
(Note: I’m ignoring the fact that any 2D picture of field lines will not be physically accurate in terms of field lines density being proportional to the flux. One can think of infinite line charges orthogonal to the plane, instead of true point charges.)
The “clever” idea (or so I thought)
An elegant suggestion to solve some 2D electrostatics problems is the use of conformal mapping / complex holomorphic functions. At first sight, I thought that this problem would be amenable to a neat solution based on complex analysis.
We know how to calculate the potential \(V(x,y)\) everywhere quite trivially (the sum of \(q_i/|r-r)i|\)), which is a solution of Laplace’s equation everywhere (outside the charges). From this, one can construct via the Cauchy-Riemann relations a corresponding function \(W(x,y)\), also solution of Laplace’s equation, such that
\[ f(z) = V(x,y) + i W(x,y) \]
is a holomorphic function (outside the poles \(z_i\) corresponding to the point charges). The level curves of \(V\) are equipotentials, and everywhere orthogonal to the level curves of \(W\): these would be the sought-after field lines. Sounds good so far. Finding \(W\) from \(V\) can be done via the Cauchy-Riemann relations, or apparently more simply using the Milne-Thomson trick. But the solution is probably quite well-known anyway, and turns out to be
\[ f(z) = \log(z - z_0) \]
for a unit charge at \(z_0\). It’s trivial to generalise this to our \(N\) charges by linearity. The real part of the principal value \(\log z = \log |z| + i\theta\) does yield the electric potential,
\[ V(x,y) = \sum_{i=1}^N q_i\log\left((x-x_i)^2+(y-y_i)^2\right) \]
The complex log is multivalued, unfortunately, so things aren’t that simple. Blatantly ignoring this “subtelty” for now and taking the imaginary part of its principal value yields,
\[ W(x,y) = \sum_{i=1}^N q_i\mathrm{Arg} \left(z-z_i\right) = \sum_{i=1}^N \tan^{-1}\left( q_i \frac{y-y_i} {x-x_i}\right) \] For a single charge, \(V\) and \(W\) describe circles and radial lines, respectively. Let’s plot the level curves for a few charges.
Looking great, aside from those few ugly “artefacts” (so I thought). We got field lines, everywhere orthogonal to equipotentials, with very little effort (the graphics package has a routine for level curves), and they’re equispaced in terms of field gradient by construction.
A 3D perspective of the \(E\) landscape reveals some deeper flaws, however.
The problem
Let’s take a step back and look at the function \(W\) that gives us our field lines / level curves for a single charge,
Oops. Indeed, in order to have radial level curves around a volcano, it has to spiral like a helix.
The branch cut of the complex log is indeed a problem, we can’t simply sweep it under the carpet by taking the principal value.
The level curves algorithm doesn’t know what to do around a discontinuity: it wants to add \(N\) level lines on either sides of the jump (branch cut / cliff).
The failed hack
One may think that these horizontal artefacts, being unrelated to the physics, could be worked around by rotating the coordinates. It doesn’t matter for the physics which is called \(x\) or \(y\), and if we swap them around we can obtain vertical artefacts. Could one combine the two pictures and select the field lines in the artefacts-free regions?
Unfortunately, I don’t think so. Let’s overlap the two,
While in most regions we may be able to pick one set or the other to avoid discontinuities, there are some regions where neither of the sets of field lines avoids crossing any branch cuts. As a result we still have some discontinuities in the field lines. Additionally, in the problems-free regions for both sets, the level curves don’t coincide exactly, which means that if we were to stitch together the two solutions we would not end up with a rigorously correct density of field lines everywhere.
It may be that a clever level curves algorithm could look at the whole landscape and go straight across cliffs.
If anyone sees a way to salvage this doomed idea, please let me know!