Spherical Capacitor


The following tutorial presents an electrostatic application. This example looks at a spherical capacitor formed of a solid conductor sphere, marked with 1 in the figure, and a hollow spherical conductor shell, marked with 3 in the figure, where the region between the conductors is a dielectric material, marked with 2 in the figure. The aim is to reproduce an electric potential distribution using the finite element method and compare the result to an analytical solution of the capacitance. The following sketch shows the geometry of the capacitor in 3D, where the different colors represent the material of each region.


Typically a 3D electrostatic equation is used to create a partial differential equation model for a 3D capacitor. Since the geometry and the boundary conditions, in this case, are rotationally symmetric about any axis, including the -axis, a 2D axisymmetric electrostatic equation can be used to model the capacitor. An axisymmetric model has the advantage that the computational cost in both time and memory is much less than in the case of solving a full 3D model.

Load the finite element package:

Electrostatic equation

Electrostatics can be modeled with a Poisson equation. The 2D axisymmetric Poisson equation is given as:


where is the electric potential in , is the absolute permittivity in of the material and in is the volume charge density.

The axisymmetric Poisson equation uses a truncated cylindrical coordinate system in 2D with independent variables instead of the cylindrical coordinates . The cylindrical coordinate variable disappears because the system is rotationally symmetric about the -axis. For further reference see DiffusionPDETerm.

The symbols and corresponding units used throughout this tutorial are summarized in the Nomenclature section.


The model consists of a multilayered ball. The inner most layer, the inner conductor, extends to a radius of and has a charge of . The next layer is a dielectric layer and extends from to r2. This is the layer we are interested in. The out layer, a second conductor extends from r2 to r3. This outer layer is connected to ground and has a potential of .

Both conductors have different but constant electrostatic conditions. This implies that the potential on each surface is also constant, though different. The goal of this simulation is to compute the distribution of the electric potential in in the dielectric layer.


The domain of the dielectric is an axially symmetric annulus. The external boundaries represent the interfaces between the dielectric and the conductors.

First, the dimensions of the domain are defined, and then an element mesh is created with ToElementMesh.

Specify the parameters of the geometry in :

will be used for a three dimensional visualization.

Create the mesh:
Visualize the mesh:

Parameters setup

Next, we set up the material parameters and the 2D axisymmetric electrostatic equation. These include the relative permittivity , a dimensionless number, and the charge .

Define the variables and material parameters of the model:
Define the charge :

The ElectrostaticPDEComponent function can produce the axisymmetric form of the electrostatic equation. To do so the parameter "RegionSymmetry" is set to "Axisymmetric".

Set up the "RegionSymmetry" parameter:
Set up the PDE component:

Boundary conditions

The boundary conditions considered here include both DirichletCondition and NeumannValue. The ElectricPotentialCondition specifies a ground boundary potential of at the outer boundary of the annulus at . The use of point element markers will be used here to specify where the ElectricPotentialCondition is applied.

Inspect the point element markers for the mesh:
Visualize the point element markers:

The outer boundary has a point element marker of 3 assigned to it. Because the marker assignment algorithm cannot know what markers are supposed to be assigned at corners a unique marker is assigned there and thus allows for a choice whether that corner node should be part of the Dirichlet boundary condition or not.

Visualize the point element markers at the corners:

In the top left corner we see a corner point element marker of 8 and in the bottom left corner a point element marker of 7 where we also want the electric potential condition to apply.

Point element markers are used for DirichletCondition. For NeumannValue boundary element markers are to be used. The ElectricFluxDensityValue specifies a surface charge density in at the boundary of the annulus at , which represents the charge that has the inner conductor.

The surface charge density of a sphere of radius is given by:
Inspect the boundary element marker for the mesh:
Visualize the boundary element markers:

On a boundary that falls on the symmetry axis, like the -axis in this case, a Neumann 0 value needs to be specified because we are dealing with a Symmetry Boundary Condition. As Neumann 0 boundary conditions are the natural default boundary conditions, these can be left out.

Model evaluation

Compute the numeric solution of the PDE with NDSolveValue.

Solve the equation:


Plot the electric potential in the dielectric region with DensityPlot:
Plot the potential from {} at :

To visualize the full 3D solution from the axisymmetric model one approach is to apply the interpolating function to visualize the data in a 3D domain. In other words, do a revolution plot of the data. We use RegionPlot3D to make a plot showing the three-dimensional region in which pred is the equation of a sphere of radius and specify a color function that does the mapping from the 3D data point to the 2D solution function.

Visualize the solution from the 2D axisymmetric model in 3D:


The definition of a capacitance is given as

C =

where is the charge that has the inner conductor sphere and is the potential difference between the conductors.

For a spherical capacitor the capacitance is

C =

where is the relative permittivity of the dielectric layer which is delimited by the radius and .

See [Hayt & Buck, 2012] for further reference. Alternative methods to compute the capacitance can be found in the Capacitance section of the electrostatics monograph.

Compute the capacitance from the numerical solution:
Get the vacuum and relative permittivity values:
Compute the capacitance from the analytical solution:
Compare the values of capacitance between the numerical solution and the analytical solution in percent:

Another way to verify the 2D axisymmetric model is to compare it with a full 3D model.

Create the 3D mesh:
Compute the solution:
Plot the relative error between the 3D solution and the 2D axisymmetric solution:

The graph shows that the 2D axisymmetric model matches the full 3D model.



1.  Hayt, W. H., & Buck, J. A. (2019). Engineering electromagnetics. McGraw-Hill Education.