Skip to content
Projects

Conductors at prescribed potentials, by the boundary-integral (panel) method.

A particle code with electrodes needs conductors held at prescribed potentials, not just grounded absorbing walls or the two infinite grounded plates of :class:tree_d_3d.GroundedStripField. :class:tree_d_3d.BoundaryIntegralElectrodes discretises each conductor’s boundary into straight panels (here from :mod:simgeometry shapes, by :func:tree_d_3d.conductors_from_shape), collocates the Dirichlet condition at their midpoints and solves the resulting dense linear system for the induced line-charge density — the standard first-kind single-layer boundary-element method, with a closed-form self-term for each panel and the exact field of a uniformly charged segment for the panels near a target (farther ones are summed fast as Gauss points). This example checks it against two cases with an exact answer in the code’s own units, both line-charge electrostatics with the log kernel phi = -2 k_e q ln r:

A grounded circular conductor with one external line charge has a closed-form solution with three real images: the usual inverse-point image that cancels the source on the circle, plus a charge at the circle’s centre that removes the constant potential offset the first image leaves behind (a detail of the log kernel’s reference point, only visible written out — and the reason the single-conductor problem degenerates when the circle’s radius equals the kernel’s reference length). Two concentric circular conductors at different potentials is the classic cylindrical capacitor, with an exact logarithmic potential profile between them and a known induced charge from Gauss’s law.

Source: examples/boundary_integral_electrodes.py. Run it yourself with python examples/boundary_integral_electrodes.py [--output examples/output] [--quick] (needs pip install "tree-d-3d[examples]").

the boundary potential around a grounded circle with an external charge, sampled between the panels (not at the collocation points), against the target of zero.

the force the circle exerts back on the external charge against the three-image closed form, over the panel count — the convergence of the method, at second order in the panel length, since panels near a target enter with their exact field (the plain midpoint rule converges at first order).

the potential across the gap of a two-conductor cylindrical capacitor against the exact logarithmic profile.

the induced charge on the inner conductor against the exact Gauss’s-law value, over the panel count: third order.

a filled contour of the potential around a grounded, non-convex (L-shaped) conductor with a nearby charge — panels need no special treatment at a corner, unlike methods that assume a smooth boundary; the boundary potential error is printed, there being no closed form for this shape.

--quick uses fewer panels in the convergence studies (under a minute instead of a few); --smoke is the tiny configuration the test suite runs. Needs Plotly (pip install 'tree-d-3d[examples]').