The electrostatic potential \(\varPhi (\mathbf {r})\) of a charge distribution \(\rho (\mathbf {r})\) is a solution Footnote 1 of Poisson’s equation

$$\begin{aligned} \triangle \varPhi (\mathbf {r})=-\rho (\mathbf {r}) \end{aligned}$$
(18.1)

which, for spatially varying dielectric constant \(\varepsilon (\mathbf {r})\) becomes

$$\begin{aligned} {div}(\varepsilon (\mathbf {r})\,\ {grad }\ \varPhi (\mathbf {r}))=-\rho (\mathbf {r}) \end{aligned}$$
(18.2)

and, if mobile charges are taken into account, like for an electrolyte or semiconductor, turns into the Poisson–Boltzmann equation

$$\begin{aligned} {div}(\varepsilon (\mathbf {r})\,\ {grad }\ \varPhi (\mathbf {r}))=-\rho _{fix}(\mathbf {r})-\sum _{i}n_{i}^{0}Z_{i}e\,\mathrm {e}^{-Z_{i}e\varPhi (\mathbf {r})/k_{B}T}. \end{aligned}$$
(18.3)

In this chapter we discretize the Poisson and the linearized Poisson–Boltzmann equation by finite volume methods which are applicable even in case of discontinuous \(\varepsilon \). We solve the discretized equations iteratively with the method of successive over-relaxation. The solvation energy of a charged sphere in a dielectric medium is calculated to compare the accuracy of several methods. This can be studied also in a computer experiment.

Since the Green’s function is analytically available for the Poisson and Poisson–Boltzmann equations, alternatively the method of boundary elements can be applied, which can reduce the computer time, for instance for solvation models. A computer experiment simulates a point charge within a spherical cavity and calculates the solvation energy with the boundary element method.

1 Poisson Equation

From a combination of the basic equations of electrostatics

$$\begin{aligned} \text {div}\, D(\mathbf {r})=\rho (\mathbf {r}) \end{aligned}$$
(18.4)
$$\begin{aligned} D(\mathbf {r})=\varepsilon (\mathbf {r})E(\mathbf {r}) \end{aligned}$$
(18.5)
$$\begin{aligned} E(\mathbf {r})=-\text {grad}\,\varPhi (\mathbf {r}) \end{aligned}$$
(18.6)

the generalized Poisson equation is obtained

$$\begin{aligned} \text {div}(\varepsilon (\mathbf {r})\,\text {grad}\varPhi (\mathbf {r}))=-\rho (\mathbf {r}) \end{aligned}$$
(18.7)

which can be written in integral form with the help of Gauss’ theorem

$$\begin{aligned} \oint _{\partial V}d\mathbf {A}\,\text {div}(\varepsilon (\mathbf {r})\,\text {grad}\varPhi (\mathbf {r}))=\int _{V}dV\,\varepsilon (\mathbf {r})\,\text {grad}\varPhi (\mathbf {r}))=-\int _{V}dV\,\rho (\mathbf {r}). \end{aligned}$$
(18.8)

If \(\varepsilon (\mathbf {r}\)) is continuously differentiable, the product rule for differentiation gives

$$\begin{aligned} \varepsilon (\mathbf {r}) \triangle \varPhi (\mathbf {r})+\left( \text {grad }\varepsilon (\mathbf {r})\right) \left( \text {grad }\varPhi (\mathbf {r})\right) =-\rho (\mathbf {r}) \end{aligned}$$
(18.9)

which for constant \(\varepsilon \) simplifies to the Poisson equation

$$\begin{aligned} \varDelta \varPhi (\mathbf {r})=-\frac{\rho (\mathbf {r})}{\varepsilon }. \end{aligned}$$
(18.10)

1.1 Homogeneous Dielectric Medium

We begin with the simplest case of a dielectric medium with constant \(\varepsilon \) and solve (18.10) numerically. We use a finite volume method (Sect. 12.3) which corresponds to a finite element method with piecewise constant test functions. The integration volume is divided into small cubes \(V_{ijk}\) which are centered at the grid points (Fig. 18.1)

$$\begin{aligned} r_{ijk}=(hi,hj, hk). \end{aligned}$$
(18.11)
Fig. 18.1
figure 1

(Finite volume for the Poisson equation) The control volume is a small cube centered at a grid point (full circle)

Integration of (18.10) over the control volume \(V_{ijk}\) around \(\mathbf {r}_{ijk}\) gives

$$\begin{aligned} \int _{V}dV\,\text {div grad }\varPhi =\oint _{\partial V}\text { grad }\varPhi \mathbf {dA}=-\frac{1}{\varepsilon }\int _{V}dV\,\rho (\mathbf {r})=-\frac{Q_{ijk}}{\varepsilon }. \end{aligned}$$
(18.12)

\(Q_{ijk}\) is the total charge in the control volume. The flux integral is approximated by (12.85)

(18.13)

The derivatives are approximated by symmetric differences

$$\begin{aligned}&\oint _{\partial V}\text { grad }\varPhi \,\mathbf {dA}=-h\left\{ \left( \varPhi (x_{i+1},y_{j},z_{k})-\varPhi (x_{i},y_{j},z_{k})\right) \right. \nonumber \\&-\left( \varPhi (x_{i},y_{j}, z_{k})-\varPhi (x_{i-1},y_{j},z_{k})\right) \nonumber \\&+\left( \varPhi (x_{i}, y_{j+1},z_{k})-\varPhi (x_{i},y_{j},z_{k})\right) \nonumber \\&-\left( \varPhi (x_{i},y_{j},z_{k})-\varPhi (x_{i}, y_{j-1},z_{k})\right) \nonumber \\&+\left( \varPhi (x_{i},y_{j}, z_{k+1})-\varPhi (x_{i},y_{j},z_{k})\right) \nonumber \\&-\left. \left( \varPhi (x_{i},y_{j},z_{k})-\varPhi (x_{i},y_{j}, z_{k-1})\right) \right\} \nonumber \\&=-h\left( \varPhi (x_{i-1},y_{j}, z_{k})+\varPhi (x_{i+1},y_{j},z_{k})+\varPhi (x_{i}, y_{j-1},z_{k})+\varPhi (x_{i}, y_{j+1},z_{k})\right. \nonumber \\&\left. +\,\varPhi (x_{i},y_{j}, z_{k-1})+\varPhi (x_{i},y_{j}, z_{k+1})-6\varPhi (x_{i},y_{j}, z_{k})\right) \end{aligned}$$
(18.14)

which coincides with the simplest discretization of the second derivatives (3.40). Finally we obtain the discretized Poisson equation in the more compact form

$$\begin{aligned} \sum _{s=1}^{6}(\varPhi (r_{ijk}+d\mathbf {r}_{s})-\varPhi (r_{ijk}))=-\frac{Q_{ijk}}{\varepsilon h} \end{aligned}$$
(18.15)

which involves an average over the 6 neighboring cells

$$\begin{aligned} d\mathbf {r}_{1}=(-h, 0,0)\text { }\dots d\mathbf {r}_{6}=(0,0,h). \end{aligned}$$
(18.16)

1.2 Numerical Methods for the Poisson Equation

Equation (18.15) is a system of linear equations with very large dimension (for a grid with \(100\times 100\times 100\) points the dimension of the matrix is \(10^{6}\times 10^{6}\) !). Our computer experiments use the iterative method (Sect. 5.5)

$$\begin{aligned} \varPhi ^{new}(r_{ijk})=\frac{1}{6}\left( \sum _{s}\varPhi ^{old}(\mathbf {r}_{ijk}+d\mathbf {r}_{s})+\frac{Q_{ijk}}{\varepsilon h}\right) . \end{aligned}$$
(18.17)

Jacobi’s method (5.121 on p. 80) makes all the changes in one step whereas the Gauss–Seidel method (5.124 on p. 80) makes one change after the other. The chessboard (or black red method) divides the grid into two subgrids (with \(i+j+k\) even or odd) which are treated subsequently. The vector \(d\mathbf {r}_{s}\) connects points of different subgrids. Therefore it is not necessary to store intermediate values like for the Gauss–Seidel method.

Convergence can be improved with the method of successive over-relaxation (SOR, 5.128 on p. 81) using a mixture of old and new values

$$\begin{aligned} \varPhi ^{new}(r_{ijk})=(1-\omega )\varPhi ^{old}(\mathbf {r}_{ijk})+\omega \frac{1}{6}\left( \sum \varPhi ^{old}(\mathbf {r}_{ijk}+d\mathbf {r}_{s})+\frac{Q_{ijk}}{\varepsilon h}\right) \end{aligned}$$
(18.18)

with the relaxation parameter \(\omega \). For \(1<\omega <2\) convergence is faster than for \(\omega =1\). The optimum choice of \(\omega \) for the Poisson problem in any dimension is discussed in [225].

Convergence can be further improved by multigrid methods [226, 227]. Error components with short wavelengths are strongly damped during a few iterations whereas it takes a very large number of iterations to remove the long wavelength components. But here a coarser grid is sufficient and reduces computing time. After a few iterations a first approximation \(\varPhi _{1}\) is obtained with the finite residual

$$\begin{aligned} r_{1}=\varDelta \varPhi {}_{1}+\frac{1}{\varepsilon }\rho . \end{aligned}$$
(18.19)

Then more iterations on a coarser grid are made to find an approximate solution \(\varPhi _{2}\) of the equation

$$\begin{aligned} \varDelta \varPhi =-r_{1}=-\frac{1}{\varepsilon }\rho -\varDelta \varPhi _{1}. \end{aligned}$$
(18.20)

The new residual is

$$\begin{aligned} r_{2}=\varDelta \varPhi _{2}+r_{1}. \end{aligned}$$
(18.21)

Function values of \(\varPhi _{2}\) on the finer grid are obtained by interpolation and finally the sum \(\varPhi _{1}+\varPhi _{2}\) provides an improved approximation to the solution since

$$\begin{aligned} \varDelta (\varPhi _{1}+\varPhi _{2})=-\frac{1}{\varepsilon }\rho +r_{1}+(r_{2}-r_{1})=-\frac{1}{\varepsilon }\rho +r_{2}. \end{aligned}$$
(18.22)

This method can be extended to a hierarchy of many grids.

Alternatively, the Poisson equation can be solved non-iteratively with pseudospectral methods [228, 229]. For instance, if the boundary is the surface of a cube, eigenfunctions of the Laplacian are for homogeneous boundary conditions \((\varPhi =0)\) given by

$$\begin{aligned} N_{\mathbf {k}}(\mathbf {r})=\sin (k_{x}x)\sin (k_{y}y)\sin (k_{z}z) \end{aligned}$$
(18.23)

and for no-flow boundary conditions (\(\frac{\partial }{\partial n}\varPhi =0\)) by

$$\begin{aligned} N_{\mathbf {k}}(\mathbf {r})=\cos (k_{x}x)\cos (k_{y}y)\cos (k_{z}z) \end{aligned}$$
(18.24)

which can be used as expansion functions for the potential

$$\begin{aligned} \varPhi (\mathbf {r})=\sum _{k_{x},k_{y}, k_{z}}\varPhi _{\mathbf {k}}N_{\mathbf {k}}(\mathbf {r}). \end{aligned}$$
(18.25)

Introducing collocation points \(\mathbf {r}_{j}\) the condition on the residual becomes

$$\begin{aligned} 0=\triangle \varPhi (\mathbf {r}_{j})+\frac{1}{\varepsilon }\rho (\mathbf {r}_{j})=\sum _{k_{x},k_{y}, k_{z}}k^{2}\varPhi _{\mathbf {k}}N_{\mathbf {k}}(\mathbf {r}_{j})+\frac{1}{\varepsilon }\rho (\mathbf {r}_{j}) \end{aligned}$$
(18.26)

which can be inverted with an inverse discrete sine transformation, (respectively an inverse discrete cosine transformation for no-flux boundary conditions) to obtain the Fourier components of the potential. Another discrete sine (or cosine) transformation gives the potential in real space.

1.3 Charged Sphere

As a simple example we consider a sphere of radius R with a homogeneous charge density of

$$\begin{aligned} \rho _{0}=e\cdot \frac{3}{4\pi R^{3}}. \end{aligned}$$
(18.27)

The exact potential is given by

$$\begin{aligned}&\varPhi (r)=\frac{e}{4\pi \varepsilon _{0}R}+\frac{e}{8\pi \varepsilon _{0}R}\left( 1-\frac{r^{2}}{R^{2}}\right) \quad \text {for }r<R \nonumber \\&\varPhi (r)=\frac{e}{4\pi \epsilon _{0}r}\quad \text {for }r>R. \end{aligned}$$
(18.28)

The charge density (18.27) is discontinuous at the surface of the sphere. Integration over a control volume smears out this discontinuity which affects the potential values around the boundary (Fig. 18.2). Alternatively we could assign the value \(\rho (\mathbf {r}_{ijk})\) which is either \(\rho _{0}\) (18.27) or zero to each control volume which retains a sharp transition but changes the shape of the boundary surface and does not conserve the total charge. This approach was discussed in the first edition of this book in connection with a finite differences method. The most precise but also complicated method divides the control volumes at the boundary into two irregularly shaped parts [230, 231].

Fig. 18.2
figure 2

(Discretization of the discontinuous charge density) Left the most precise method divides the control volumes at the boundary into two irregularly shaped parts. Middle assigning either the value \(\rho _{0}\) or zero retains the discontinuity but changes the shape of the boundary. Right averaging over a control volume smears out the discontinuous transition

Initial guess as well as boundary values are taken from

$$\begin{aligned} \varPhi _{0}(r)=\frac{e}{4\pi \varepsilon _{0}\max (r, h)} \end{aligned}$$
(18.29)

which provides proper boundary values but is far from the final solution inside the sphere. The interaction energy is given by (Sect. 18.5)

$$\begin{aligned} E_{int}=\frac{1}{2}\int _{V}\rho (\mathbf {r})\varPhi (\mathbf {r})dV=\frac{3}{20}\frac{e^{2}}{\pi \varepsilon _{0}R}\,. \end{aligned}$$
(18.30)

Calculated potential (Fig. 18.3) and interaction energy (Figs. 18.4, 18.5) converge rapidly. The optimum relaxation parameter is around \(\omega \approx 1.9\).

Fig. 18.3
figure 3

(Electrostatic potential of a charged sphere) A charged sphere is simulated with radius \(R=0.25\) and a homogeneous charge density . The grid consists of \(200^{3}\) points with a spacing of \(h=0.025\). The calculated potential (circles) is compared to the exact solution (18.28, solid curve), the initial guess is shown by the dashed line

Fig. 18.4
figure 4

(Influence of the relaxation parameter) The convergence of the interaction energy (18.30, which has a value of 34.56 eV for this example) is studied as a function of the relaxation parameter \(\omega \). The optimum value is around \(\omega \approx 1.9\). For \(\omega >2\) there is no convergence. The dashed line shows the exact value

Fig. 18.5
figure 5

(Influence of grid size) The convergence of the interaction energy (18.30) and the central potential value are studied as a function of grid size. The dashed lines show the exact values

Fig. 18.6
figure 6

Face center of the control volume

1.4 Variable \(\varepsilon \)

In the framework of the finite volume method we take the average over a control volume to discretize \(\varepsilon \) Footnote 2 and \(\varPhi \)

$$\begin{aligned} \varepsilon _{ijk}=\overline{\varepsilon }(\mathbf {r}_{ijk})=\frac{1}{h^{3}}\int _{V_{ijk}}dV\,\varepsilon (\mathbf {r}) \end{aligned}$$
(18.31)
$$\begin{aligned} \varPhi _{ijk}=\overline{\varPhi }(\mathbf {r}_{ijk})=\frac{1}{h^{3}}\int _{V_{ijk}}dV\,\varPhi (\mathbf {r}). \end{aligned}$$
(18.32)

Integration of (18.7) gives

$$\begin{aligned} \int _{V}dV\,\text {div }\left( \varepsilon (\mathbf {r})\text { grad }\varPhi (\mathbf {r})\right) =\oint _{\partial V}\varepsilon (\mathbf {r})\text { grad }\varPhi \mathbf {dA}=-\int _{V}dV\,\rho (\mathbf {r})=-Q_{ijk}. \end{aligned}$$
(18.33)

The surface integral is

$$\begin{aligned} \oint _{\partial V}\mathbf {dA}\,\varepsilon \,\text {grad}\varPhi =\sum _{s\in faces}\int _{A_{s}}dA\,\varepsilon (\mathbf {r)}\,\frac{\partial }{\partial n}\varPhi . \end{aligned}$$
(18.34)

Applying the midpoint rule (12.77) we find (Fig. 18.6)

$$\begin{aligned} \oint _{\partial V}\mathbf {dA}\,\varepsilon \,\text {grad}\varPhi \approx h^{2}\sum _{r=1}^{6}\varepsilon \left( \mathbf {r}_{ijk}+\frac{1}{2}d\mathbf {r}_{s}\right) \frac{\partial }{\partial n}\varPhi \left( \mathbf {r}_{ijk}+\frac{1}{2}d\mathbf {r}_{s}\right) . \end{aligned}$$
(18.35)

The potential \(\varPhi \) as well as the product \(\varepsilon (\mathbf {r})\frac{\partial \varPhi }{\partial n}\) are continuous, therefore we make the approximation [230]

$$\begin{aligned}&\varepsilon \left( \mathbf {r}_{ijk}+\frac{1}{2}d\mathbf {r}_{s}\right) \frac{\partial \varPhi }{\partial n}\left( \mathbf {r}_{ijk}+\frac{1}{2}d\mathbf {r}_{s}\right) =\overline{\varepsilon }(\mathbf {r}_{ijk})\frac{\overline{\varPhi }\left( \mathbf {r}_{ijk}+\frac{1}{2}d\mathbf {r}_{s}\right) -\overline{\varPhi }(\mathbf {r}_{ijk})}{\frac{h}{2}} \nonumber \\&=\overline{\varepsilon }(\mathbf {r}_{ijk}+d\mathbf {r}_{s})\frac{\overline{\varPhi }(\mathbf {r}_{ijk}+d\mathbf {r}_{s})-\overline{\varPhi }\left( \mathbf {r}_{ijk}+\frac{1}{2}d\mathbf {r}_{s}\right) }{\frac{h}{2}}. \end{aligned}$$
(18.36)

From this equation the unknown potential value on the face of the control volume \(\overline{\varPhi }(\mathbf {r}_{ijk}+\frac{1}{2}d\mathbf {r}_{s})\) (Fig. 18.6) can be calculated

$$\begin{aligned} \overline{\varPhi }\left( \mathbf {r}_{ijk}+\frac{1}{2}d\mathbf {r}_{s}\right) =\frac{\overline{\varepsilon }(\mathbf {r}_{ijk})\overline{\varPhi }(\mathbf {r}_{ijk})+\overline{\varepsilon }(\mathbf {r}_{ijk}+d\mathbf {r}_{s})\overline{\varPhi }(\mathbf {r}_{ijk}+d\mathbf {r}_{s})}{\overline{\varepsilon }(\mathbf {r}_{ijk})+\overline{\varepsilon }(\mathbf {r}_{ijk}+d\mathbf {r}_{s})} \end{aligned}$$
(18.37)

which gives

$$\begin{aligned} \varepsilon \left( \mathbf {r}_{ijk}+\frac{1}{2}d\mathbf {r}_{s}\right) \frac{\partial }{\partial n}\varPhi \left( \mathbf {r}_{ijk}+\frac{1}{2}d\mathbf {r}_{s}\right) =\frac{2\overline{\varepsilon }(\mathbf {r}_{ijk})\overline{\varepsilon }(\mathbf {r}_{ijk}+d\mathbf {r}_{s})}{\overline{\varepsilon }(\mathbf {r}_{ijk})+\overline{\varepsilon }(\mathbf {r}_{ijk}+d\mathbf {r}_{s})}\,\,\frac{\overline{\varPhi }(r_{ijk}+dr_{s})-\overline{{\varPhi }}(r_{ijk})}{h}. \end{aligned}$$
(18.38)

Finally we obtain the discretized equation

$$\begin{aligned} -Q_{ijk}=h\sum _{s=1}^{6}\frac{2\overline{\varepsilon }(\mathbf {r}_{ijk}+d\mathbf {r}{}_{s})\overline{\varepsilon }(\mathbf {r}_{ijk})}{\overline{\varepsilon }(\mathbf {r}_{ijk}+d\mathbf {r}_{s})+\overline{\varepsilon }(\mathbf {r}_{ijk})}(\overline{\varPhi }(\mathbf {r}{}_{ijk}+d\mathbf {r}{}_{s})-\overline{\varPhi }(\mathbf {r}{}_{ijk})) \end{aligned}$$
(18.39)

which can be solved iteratively according to

$$\begin{aligned} \varPhi ^{new}(\mathbf {r}{}_{ijk})=\frac{\sum \frac{2\varepsilon (\mathbf {r}{}_{ijk}+d\mathbf {r}{}_{s})\varepsilon (\mathbf {r}{}_{ijk})}{\varepsilon (\mathbf {r}_{ijk}+d\mathbf {r}_{s})+\varepsilon (\mathbf {r}_{ijk})}\varPhi ^{old}(\mathbf {r}{}_{ijk}+d\mathbf {r}{}_{s})+\frac{Q_{ijk}}{h}}{\sum \frac{2\varepsilon (\mathbf {r}{}_{ijk}+d\mathbf {r}{}_{s})\varepsilon (\mathbf {r}{}_{ijk})}{\varepsilon (\mathbf {r}_{ijk}+d\mathbf {r}_{s})+\varepsilon (\mathbf {r}_{ijk})}}. \end{aligned}$$
(18.40)

1.5 Discontinuous \(\varepsilon \)

For practical applications models are often used with piecewise constant \(\varepsilon \). A simple example is the solvation of a charged molecule in a dielectric medium (Fig. 18.9). Here \(\varepsilon =\varepsilon _{0}\) within the molecule and \(\varepsilon =\varepsilon _{0}\varepsilon _{1}\) within the medium. At the boundary \(\varepsilon \) is discontinuous. In (18.40) the discontinuity is replaced by a smooth transition between the two values of \(\varepsilon \) (Fig. 18.7).

Fig. 18.7
figure 7

(Transition of \(\varepsilon \)) The discontinuous \(\varepsilon (r)\) (black line) is averaged over the control volumes to obtain the discretized values \(\varepsilon _{ijk}\) (full circles). Equation (18.40) takes the harmonic average over two neighbor cells (open circles) and replaces the discontinuity by a smooth transition over a distance of about h

If the discontinuity of \(\varepsilon \) is inside a control volume \(V_{ijk}\) then (18.31) takes the arithmetic average

$$\begin{aligned} \overline{\varepsilon }_{ijk}=V_{ijk}^{(1)}\varepsilon _{1}+V_{ijk}^{(2)}\varepsilon _{2} \end{aligned}$$
(18.41)

which corresponds to the parallel connection of two capacities (Fig. 18.8). Depending on geometry, a serial connection may be more appropriate which corresponds to the weighted harmonic average

$$\begin{aligned} \overline{\varepsilon }_{ijk}=\frac{1}{V_{ijk}^{(1)}\varepsilon _{1}^{-1}+V_{ijk}^{(2)}\varepsilon _{2}^{-1}}. \end{aligned}$$
(18.42)
Fig. 18.8
figure 8

Average of \(\varepsilon \) over a control volume

1.6 Solvation Energy of a Charged Sphere

We consider again a charged sphere, which is now embedded in a dielectric medium (Fig. 18.9) with relative dielectric constant \(\varepsilon _{1}\).

Fig. 18.9
figure 9

(Solvation of a charged sphere in a dielectric medium) Charge density and dielectric constant are discontinuous at the surface of the sphere

For a spherically symmetrical problem (18.7) can be solved by application of Gauss’s theorem

$$\begin{aligned} 4\pi r^{2}\varepsilon (r)\frac{\mathrm {d}\varPhi }{\mathrm {d}r}=-4\pi \int _{0}^{r}\rho (r')r'^{2}dr'=-q(r) \end{aligned}$$
(18.43)
$$\begin{aligned} \varPhi (r)=-\int _{0}^{r}\frac{q(r)}{4\pi r^{2}\varepsilon (r)}+\varPhi (0). \end{aligned}$$
(18.44)

For the charged sphere we find

$$\begin{aligned}&q(r)=\left\{ \begin{array}{c} Qr^{3}/R^{3}\text { for }r<R\\ Q\text { for }r>R \end{array}\right. \end{aligned}$$
(18.45)
$$\begin{aligned}&\varPhi (r)=-\frac{Q}{4\pi \varepsilon _{0}R^{3}}\frac{r^{2}}{2}+\varPhi (0)\quad \text {for }r<R\end{aligned}$$
(18.46)
$$\begin{aligned}&\varPhi (r)=-\frac{Q}{8\pi \varepsilon _{0}R}+\varPhi (0)+\frac{Q}{4\pi \varepsilon _{0}\varepsilon _{1}}\left( \frac{1}{r}-\frac{1}{R}\right) \quad \text {for }r>R. \end{aligned}$$
(18.47)

The constant \(\varPhi (0)\) is chosen to give vanishing potential at infinity

$$\begin{aligned} \varPhi (0)=\frac{Q}{4\pi \varepsilon _{0}\varepsilon _{1}R}+\frac{Q}{8\pi \varepsilon _{0}R}. \end{aligned}$$
(18.48)

The interaction energy is

$$\begin{aligned} E_{int}=\frac{1}{2}\int _{0}^{R}4\pi r^{2}dr\,\rho \varPhi (r)=\frac{Q^{2}(5+\varepsilon _{1})}{40\pi \varepsilon _{0}\varepsilon _{1}R}. \end{aligned}$$
(18.49)

Numerical results for \(\varepsilon _{1}=4\) are shown in Fig. 18.10.

Fig. 18.10
figure 10

(Charged sphere in a dielectric medium) Numerical results for \(\varepsilon _{1}=4\) outside the sphere and \(200^{3}\) grid points (circles) are compared to the exact solution (18.46,18.47, solid curves)

Fig. 18.11
figure 11

(Shifted grid method) A different grid is used for the discretization of \(\varepsilon \) which is shifted by h / 2 in all directions

1.7 The Shifted Grid Method

An alternative approach uses a different grid for \(\varepsilon \) which is shifted by h / 2 in all directions (Fig. 18.11) [232] or, more generally, a dual grid (12.74).

(18.50)

The value of \(\varepsilon \) has to be averaged over four neighboring cells to obtain the discretized equation

$$\begin{aligned}&-\frac{Q_{ijk}}{h^{2}}=\sum _{s}\varepsilon (\mathbf {r}_{ijk}+d\mathbf {r}_{s})\frac{\partial \varPhi }{\partial n}(\mathbf {r}_{ijk}+d\mathbf {r}_{s}) \nonumber \\&=\frac{\varPhi _{i,j, k+1}-\varPhi _{i,j,k}}{h}\frac{\varepsilon _{ijk}+\varepsilon _{i, j-1,k}+\varepsilon _{i-1,j, k}+\varepsilon _{i-1,j-1,k}}{4} \nonumber \\&+\frac{\varPhi _{i,j, k-1}-\varPhi _{i,j, k}}{h}\frac{\varepsilon _{ijk-1}+\varepsilon _{i, j-1,k-1}+\varepsilon _{i-1,j, k-1}+\varepsilon _{i-1,j-1,k-1}}{4} \nonumber \\&+\frac{\varPhi _{i+1,j,k}-\varPhi _{i,j,k}}{h}\frac{\varepsilon _{ijk}+\varepsilon _{i, j-1,k}+\varepsilon _{i,j, k-1}+\varepsilon _{i, j-1,k-1}}{4} \nonumber \\&+\frac{\varPhi _{i-1,j,k}-\varPhi _{i,j, k}}{h}\frac{\varepsilon _{i-1jk}+\varepsilon _{i-1,j-1,k}+\varepsilon _{i-1,j, k-1}+\varepsilon _{i-1,j-1,k-1}}{4} \nonumber \\&+\frac{\varPhi _{i, j+1,k}-\varPhi _{i,j, k}}{h}\frac{\varepsilon _{ijk}+\varepsilon _{i-1,j,k}+\varepsilon _{i,j, k-1}+\varepsilon _{i-1,j, k-1}}{4} \nonumber \\&+\frac{\varPhi _{i,, j-1,k}-\varPhi _{i,j, k}}{h}\frac{\varepsilon _{ij-1k}+\varepsilon _{i-1,j-1,k}+\varepsilon _{i, j-1,k-1}+\varepsilon _{i-1,j-1,k-1}}{4} . \end{aligned}$$
(18.51)

The shifted-grid method is especially useful if \(\varepsilon \) changes at planar interfaces. Numerical results of several methods are compared in Fig. 18.12.

Fig. 18.12
figure 12

(Comparison of numerical errors) The Coulomb interaction of a charged sphere is calculated with several methods for \(100^{3}\) grid points. circles (18.40, \(\varepsilon \) averaged) diamonds (18.40, \(\varepsilon ^{-1}\) averaged) squares (18.51, \(\varepsilon \) averaged), triangles (18.51, \(\varepsilon ^{-1}\) averaged), solid curve analytical solution (18.49)

2 Poisson–Boltzmann Equation

Electrostatic interactions are very important in molecular physics. Bio-molecules are usually embedded in an environment which is polarizable and contains mobile charges (\(Na^{+},K^{+},Mg^{++}, Cl^{-}\cdots )\).

We divide the charge density formally into a fixed and a mobile part

$$\begin{aligned} \rho (\mathbf {r})=\rho _{fix}(\mathbf {r})+\rho _{mobile}(\mathbf {r}). \end{aligned}$$
(18.52)

The fixed part represents, for instance, the charge distribution of a protein molecule which, neglecting polarization effects, is a given quantity and provides the inhomogeneity of the equation. The mobile part, on the other hand, represents the sum of all mobile charges (e is the elementary charge and \(Z_{i}\) the charge number of ion species i)

$$\begin{aligned} \rho _{mobile}(\mathbf {r})=\sum _{i}Z_{i}e\, n{}_{i}(\mathbf {r}) \end{aligned}$$
(18.53)

which move around until an equilibrium is reached which is determined by the mutual interaction of the ions. The famous Debye–Huckel [233] and Gouy–Chapman models [234, 235] assume that the electrostatic interaction

$$\begin{aligned} U(\mathbf {r})=Z_{i}e\varPhi (\mathbf {r}) \end{aligned}$$
(18.54)

is dominant and the density of the ions \(n_{i}\) is given by a Boltzmann-distribution

$$\begin{aligned} n_{i}(\mathbf {r})=n_{i}^{(0)}\mathrm {e}^{-Z_{i}e\varPhi (\mathbf {r})/k_{B}T}. \end{aligned}$$
(18.55)

The potential \(\varPhi (\mathbf {r})\) has to be calculated in a self consistent way together with the density of mobile charges. The charge density of the free ions is

$$\begin{aligned} \rho _{mobile}(\mathbf {r})=\sum _{i}n_{i}^{(0)}eZ_{i}e^{-Z_{i}e\varPhi /k_{B}T} \end{aligned}$$
(18.56)

and the Poisson equation (18.7) turns into the Poisson–Boltzmann equation [236]

$$\begin{aligned} \text {div}(\varepsilon (\mathbf {r})\,\text {grad}\varPhi (\mathbf {r}))+\sum _{i}n_{i}^{(0)}eZ_{i}e^{-Z_{i}e\varPhi /k_{B}T}=-\rho _{fix}(\mathbf {r}). \end{aligned}$$
(18.57)

2.1 Linearization of the Poisson–Boltzmann Equation

For small ion concentrations the exponential can be expanded

$$\begin{aligned} e^{-Z_{i}e\varPhi /kT}\approx 1-\frac{Z_{i}e\varPhi }{k_{B}T}+\frac{1}{2}\left( \frac{Z_{i}e\varPhi }{k_{B}T}\right) ^{2}+\cdots . \end{aligned}$$
(18.58)

For a neutral system

$$\begin{aligned} \sum _{i}n_{i}^{(0)}Z_{i}e=0 \end{aligned}$$
(18.59)

and the linearized Poisson–Boltzmann-equation is obtained:

$$\begin{aligned} \text {div}(\varepsilon (\mathbf {r})\,\text {grad }\varPhi (\mathbf {r}))-\sum _{i}n_{i}^{(0)}\frac{Z_{i}^{2}e^{2}}{k_{B}T}\,\varPhi (\mathbf {r})=-\rho _{fix}. \end{aligned}$$
(18.60)

With

$$\begin{aligned} \varepsilon (\mathbf {r})=\varepsilon _{0}\varepsilon _{r}(\mathbf {r}) \end{aligned}$$
(18.61)

and the definition

$$\begin{aligned} \kappa (\mathbf {r})^{2}=\frac{e^{2}}{\varepsilon _{0}\varepsilon _{r}(\mathbf {r})k_{B}T}\sum n_{i}^{(0)}Z_{i}^{2} \end{aligned}$$
(18.62)

we have finally

$$\begin{aligned} \text {div}(\varepsilon _{r}(\mathbf {r})\,\text {grad }\varPhi (\mathbf {r}))-\varepsilon _{r}\kappa ^{2}\varPhi =-\frac{1}{\varepsilon _{0}}\rho . \end{aligned}$$
(18.63)

For a charged sphere with radius a embedded in a homogeneous medium the solution of (18.63) is given by

$$\begin{aligned} \varPhi =\frac{A}{r}e^{-\kappa r}\quad A=\frac{e}{4\pi \varepsilon _{0}\varepsilon _{r}}\frac{e^{\kappa a}}{1+\kappa a}. \end{aligned}$$
(18.64)

The potential is shielded by the ions. Its range is of the order \(\lambda _{Debye}=1/\kappa \) (the so-called Debye length).

2.2 Discretization of the Linearized Poisson Boltzmann Equation

To solve (18.63) the discrete equation (18.39) is generalized to [237]

$$\begin{aligned}&\sum \frac{2\varepsilon _{r}(\mathbf {r}{}_{ijk}+d\mathbf {r}_{s})\varepsilon _{r}(\mathbf {r}{}_{ijk)})}{\varepsilon _{r}(\mathbf {r}{}_{ijk}+d\mathbf {r}_{s})+\varepsilon _{r}(\mathbf {r}{}_{ijk)})}\left( \varPhi (\mathbf {r}_{ijk}+d\mathbf {r}{}_{s})-\varPhi (\mathbf {r}{}_{ijk})\right) \nonumber \\&\quad -\varepsilon _{r}(\mathbf {r}_{ijk})\kappa ^{2}(\mathbf {r}_{ijk})h^{2}\varPhi (\mathbf {r}{}_{ijk})=-\frac{Q_{ijk}}{h\varepsilon _{0}}. \end{aligned}$$
(18.65)

If \(\varepsilon \) is constant then we iterate

$$\begin{aligned} \varPhi ^{new}(\mathbf {r}{}_{ijk})=\frac{\frac{Q_{ijk}}{h\varepsilon _{0}\varepsilon _{r}}+\sum \varPhi ^{old}(\mathbf {r}{}_{ijk}+d\mathbf {r}{}_{s})}{6+h^{2}\kappa ^{2}(\mathbf {r}{}_{ijk})}. \end{aligned}$$
(18.66)

3 Boundary Element Method for the Poisson Equation

Often continuum models are used to describe the solvation of a subsystem which is treated with a high accuracy method. The polarization of the surrounding solvent or protein is described by its dielectric constant \(\varepsilon \) and the subsystem is placed inside a cavity with \(\varepsilon =\varepsilon _{0}\) (Fig. 18.13). Instead of solving the Poisson equation for a large solvent volume another kind of method is often used which replaces the polarization of the medium by a distribution of charges over the boundary surface.

In the following we consider model systems which are composed of two spatial regions:

  • the outer region is filled with a dielectric medium (\(\varepsilon _{1})\) and contains no free charges

  • the inner region (“Cavity”) contains a charge distribution \(\rho (r)\) and its dielectric constant is \(\varepsilon =\varepsilon _{0}\).

Fig. 18.13
figure 13

Cavity in a dielectric medium

3.1 Integral Equations for the Potential

Starting from the Poisson equation

$$\begin{aligned} \text {div}(\varepsilon (\mathbf {r})\text {grad}\varPhi (\mathbf {r}))=-\rho (\mathbf {r}) \end{aligned}$$
(18.67)

we will derive some useful integral equations in the following. First we apply Gauss’s theorem to the expression [150]

$$\begin{aligned}&\text {div}\left[ G(\mathbf {r}-\mathbf {r}')\varepsilon (\mathbf {r})\text {grad}(\varPhi (\mathbf {r}))-\varPhi (\mathbf {r})\varepsilon (\mathbf {r})\text {grad}(G(\mathbf {r}-\mathbf {r}'))\right] \nonumber \\&=-\rho (\mathbf {r})G(\mathbf {r}-\mathbf {r}')-\varPhi (\mathbf {r})\varepsilon (\mathbf {r})\text {div}\text {grad}(G(\mathbf {r}-\mathbf {r}'))-\varPhi (\mathbf {r})\text {grad}\varepsilon (\mathbf {r)}\text {grad}(G(\mathbf {r}-\mathbf {r}')) \end{aligned}$$
(18.68)

with the yet undetermined function \(G(\mathbf {r}-\mathbf {r}')\). Integration over a volume V gives

$$\begin{aligned}&-\int _{V}dV\,\left( \rho (\mathbf {r})G(\mathbf {r}-\mathbf {r}')+\varPhi (\mathbf {r})\varepsilon (\mathbf {r})\text {div}\text {grad}(G(\mathbf {r}-\mathbf {r}'))\right. \nonumber \\&\left. +\varPhi (\mathbf {r})\text {grad}\varepsilon (\mathbf {r)}\text {grad}(G(\mathbf {r}-\mathbf {r}'))\right) \nonumber \\&=\oint _{\partial V}dA\left( G(\mathbf {r}-\mathbf {r}')\varepsilon (\mathbf {r})\frac{\partial }{\partial n}(\varPhi (\mathbf {r}))-\varPhi (\mathbf {r})\varepsilon (\mathbf {r})\frac{\partial }{\partial n}(G(\mathbf {r}-\mathbf {r}'))\right) . \end{aligned}$$
(18.69)

Now choose G as the fundamental solution of the Poisson equation

$$\begin{aligned} G_{0}(\mathbf {r}-\mathbf {r}')=-\frac{1}{4\pi |\mathbf {r}-\mathbf {r}'|} \end{aligned}$$
(18.70)

which obeys

$$\begin{aligned} \text {div grad}G_{0}=\delta (\mathbf {r}-\mathbf {r}') \end{aligned}$$
(18.71)

to obtain the following integral equation for the potential:

$$\begin{aligned}&\varPhi (\mathbf {r}')\varepsilon (\mathbf {r})=\int _{V}dV\frac{\rho (\mathbf {r})}{4\pi |\mathbf {r}-\mathbf {r}'|}+\frac{1}{4\pi }\int _{V}dV\varPhi (\mathbf {r})\text {grad}\varepsilon (\mathbf {r)}\text {grad}\left( \frac{1}{|\mathbf {r}-\mathbf {r}'|}\right) \nonumber \\&-\frac{1}{4\pi }\oint _{\partial V}dA\left( \frac{1}{|\mathbf {r}-\mathbf {r}'|}\varepsilon (\mathbf {r})\frac{\partial }{\partial n}(\varPhi (\mathbf {r}))+\varPhi (\mathbf {r})\varepsilon (\mathbf {r})\frac{\partial }{\partial n}\left( \frac{1}{|\mathbf {r}-\mathbf {r}'|}\right) \right) . \end{aligned}$$
(18.72)

First consider as the integration volume a sphere with increasing radius. Then the surface integral vanishes for infinite radius (\(\varPhi \rightarrow 0\) at large distances) [150].

The gradient of \(\varepsilon (\mathbf {r})\) is nonzero only on the boundary surface (Fig. 18.14) of the cavity and with the limiting procedure (\(d\rightarrow 0)\)

$$ \text {grad}\varepsilon (\mathbf {r})dV=\mathbf {n}\frac{\epsilon _{1}-1}{d}\epsilon _{0}dV=dA\,\mathbf {n}(\epsilon _{1}-1)\epsilon _{0} $$

we obtain

$$\begin{aligned} \varPhi (\mathbf {r}')=\frac{1}{\varepsilon (\mathbf {r}')}\int _{cav}dV\frac{\rho (\mathbf {r})}{4\pi |\mathbf {r}-\mathbf {r}'|}+\frac{(\epsilon _{1}-1)\epsilon _{0}}{4\pi \varepsilon (\mathbf {r}')}\oint _{S}dA\,\varPhi (\mathbf {r})\frac{\partial }{\partial n}\frac{1}{|\mathbf {r}-\mathbf {r}'|}. \end{aligned}$$
(18.73)
Fig. 18.14
figure 14

Discontinuity at the cavity boundary

This equation allows to calculate the potential inside and outside the cavity from the given charge density and the potential at the boundary.

Next we apply (18.72) to the cavity volume (where \(\varepsilon =\epsilon _{0}\)) and obtain

$$\begin{aligned}&\varPhi _{in}(\mathbf {r}')=\int _{V}dV\,\frac{\rho (\mathbf {r})}{4\pi |\mathbf {r}-\mathbf {r}'|\epsilon _{0}}\nonumber \\&-\frac{1}{4\pi }\oint _{S}dA\left( \varPhi _{in}(\mathbf {r})\frac{\partial }{\partial n}\frac{1}{|\mathbf {r}-\mathbf {r}'|}-\frac{1}{|\mathbf {r}-\mathbf {r}'|}\frac{\partial }{\partial n}\varPhi _{in}(\mathbf {r})\right) . \end{aligned}$$
(18.74)

From comparison with (18.73) we have

$$ \oint _{S}dA\frac{1}{|\mathbf {r}-\mathbf {r}'|}\frac{\partial }{\partial n}\varPhi _{in}(\mathbf {r})=\epsilon _{1}\oint _{S}dA\varPhi _{in}(\mathbf {r})\frac{\partial }{\partial n}\frac{1}{|\mathbf {r}-\mathbf {r}'|} $$

and the potential can be alternatively calculated from the values of its normal gradient at the boundary

$$\begin{aligned} \varPhi (\mathbf {r}')=\frac{1}{\varepsilon (\mathbf {r}')}\int _{cav}dV\frac{\rho (\mathbf {r})}{4\pi |\mathbf {r}-\mathbf {r}'|}+\frac{\left( 1-\frac{1}{\epsilon _{1}}\right) \epsilon _{0}}{4\pi \varepsilon (\mathbf {r}')}\oint _{S}dA\,\frac{1}{|\mathbf {r}-\mathbf {r}'|}\frac{\partial }{\partial n}\varPhi _{in}(\mathbf {r}). \end{aligned}$$
(18.75)

This equation can be interpreted as the potential generated by the charge density \(\rho \) plus an additional surface charge density

$$\begin{aligned} \sigma (\mathbf {r})=\left( 1-\frac{1}{\epsilon _{1}}\right) \epsilon _{0}\frac{\partial }{\partial n}\varPhi _{in}(\mathbf {r}). \end{aligned}$$
(18.76)

Integration over the volume outside the cavity (where \(\varepsilon =\epsilon _{1}\epsilon _{0}\)) gives the following expression for the potential:

$$\begin{aligned} \varPhi _{out}(\mathbf {r}')=\frac{1}{4\pi }\oint _{S}dA\left( \varPhi _{out}(\mathbf {r})\frac{\partial }{\partial n}\frac{1}{|\mathbf {r}-\mathbf {r}'|}-\frac{1}{|\mathbf {r}-\mathbf {r}'|}\frac{\partial }{\partial n}\varPhi _{out}(\mathbf {r})\right) . \end{aligned}$$
(18.77)

At the boundary the potential is continuous

$$\begin{aligned} \varPhi _{out}(\mathbf {r})=\varPhi _{in}(\mathbf {r})\quad \mathbf {r}\in A \end{aligned}$$
(18.78)

whereas the normal derivative (hence the normal component of the electric field) has a discontinuity

$$\begin{aligned} \epsilon _{1}\frac{\partial \varPhi _{out}}{\partial n}=\frac{\partial \varPhi _{in}}{\partial n}. \end{aligned}$$
(18.79)

3.2 Calculation of the Boundary Potential

For a numerical treatment the boundary surface is approximated by a finite set of small surface elements \(S_{i}, i=1\cdots N\) centered at \(\mathbf {r}_{i}\) with an area \(A_{i}\) and normal vector \(\mathbf {n}_{i}\) (Fig. 18.15). (We assume planar elements in the following, the curvature leads to higher order corrections).

Fig. 18.15
figure 15

Representation of the boundary by surface elements

The corresponding values of the potential and its normal derivative are denoted as \(\varPhi _{i}=\varPhi (\mathbf {r}_{i})\) and \(\frac{\partial \varPhi _{i}}{\partial n}=\mathbf {n}_{i}\text { grad}\varPhi (\mathbf {r}_{i})\). At a point \(\mathbf {r}_{j}^{\pm }\) close to the element \(S_{j}\) we obtain the following approximate equations:

$$\begin{aligned}&\varPhi _{in}(\mathbf {r}_{j}^{-})=\int _{V}dV\,\frac{\rho (\mathbf {r})}{4\pi |\mathbf {r}-\mathbf {r}_{j}^{-}|\epsilon _{0}}\nonumber \\&-\frac{1}{4\pi }\sum _{i}\varPhi _{i}\oint _{S_{i}}dA\,\frac{\partial }{\partial n}\frac{1}{|\mathbf {r}-\mathbf {r}_{j}^{-}|}+\frac{1}{4\pi }\sum _{i}\frac{\partial \varPhi _{i, in}}{\partial n}\oint _{S_{i}}dA\,\frac{1}{|\mathbf {r}-\mathbf {r}_{j}^{-}|}\end{aligned}$$
(18.80)
$$\begin{aligned}&\varPhi _{out}(\mathbf {r}_{j}^{+})=\frac{1}{4\pi }\sum _{i}\varPhi _{i}\oint _{S_{i}}dA\,\frac{\partial }{\partial n}\frac{1}{|\mathbf {r}-\mathbf {r}_{j}^{+}}-\frac{1}{4\pi }\sum _{i}\frac{\partial \varPhi _{i, out}}{\partial n}\oint _{S_{i}}dA\,\frac{1}{|\mathbf {r}-\mathbf {r}_{j}^{+}|} . \end{aligned}$$
(18.81)

These two equations can be combined to obtain a system of equations for the potential values only. To that end we approach the boundary symmetrically with \(\mathbf {r}_{i}^{\pm }=\mathbf {r}_{i}\pm d\mathbf {n}_{i}\). Under this circumstance

$$\begin{aligned}&\oint _{S_{i}}dA\,\frac{1}{|\mathbf {r}-\mathbf {r}_{j}^{+}|}=\oint _{S_{i}}dA\,\frac{1}{|\mathbf {r}-\mathbf {r}_{j}^{-}|}\nonumber \\&\oint _{S_{i}}dA\,\frac{\partial }{\partial n}\frac{1}{|\mathbf {r}-\mathbf {r}_{i}^{+}|}=-\oint _{S_{i}}dA\,\frac{\partial }{\partial n}\frac{1}{|\mathbf {r}-\mathbf {r}_{i}^{-}|}\nonumber \\&\oint _{S_{i}}dA\,\frac{\partial }{\partial n}\frac{1}{|\mathbf {r}-\mathbf {r}_{j}^{+}|}=\oint _{S_{i}}dA\,\frac{\partial }{\partial n}\frac{1}{|\mathbf {r}-\mathbf {r}_{j}^{-}|}\quad j\ne i \end{aligned}$$
(18.82)

and we find

$$\begin{aligned}&(1+\epsilon _{1})\varPhi _{j}=\int _{V}dV\,\frac{\rho (\mathbf {r})}{4\pi \epsilon _{0}|\mathbf {r}-\mathbf {r}_{j}|}\nonumber \\&-\frac{1}{4\pi }\sum _{i\ne j}(1-\epsilon _{1})\varPhi _{i}\oint _{S_{i}}dA\,\frac{\partial }{\partial n}\frac{1}{|\mathbf {r}-\mathbf {r}_{j}^{-}|}-\frac{1}{4\pi }(1+\epsilon _{1})\varPhi _{j}\oint _{S_{j}}dA\,\frac{\partial }{\partial n}\frac{1}{|\mathbf {r}-\mathbf {r}_{j}^{-}|}. \end{aligned}$$
(18.83)

The integrals for \(i\ne j\) can be approximated by

$$\begin{aligned} \oint _{S_{i}}dA\,\frac{\partial }{\partial n}\frac{1}{|\mathbf {r}-\mathbf {r}_{j}^{-}|}=A_{i}\,\mathbf {n}_{i}\text {grad}_{i}\frac{1}{|\mathbf {r}_{i}-\mathbf {r}_{j}|}. \end{aligned}$$
(18.84)

The second integral has a simple geometrical interpretation (Fig. 18.16).

Fig. 18.16
figure 16

Projection of the surface element

Since \(\text {grad}\frac{1}{|r-r'|}=-\frac{1}{|r-r'|^{2}}\frac{r-r'}{|r-r'|}\) the area element \(d\mathbf {A}\) is projected onto a sphere with unit radius. The integral \(\oint _{S_{j}}d\mathbf {A}\text { grad}_{r-}\frac{1}{|\mathbf {r_{j}}-\mathbf {r}_{j}^{-}|}\) is given by the solid angle of \(\mathbf {S}_{j}\) with respect to \(r'\). For \(r'\rightarrow r_{j}\) from inside this is just minus half of the full space angle of \(4\pi \). Thus we have

$$\begin{aligned}&(1+\epsilon _{1})\varPhi _{j}=\int _{V}dV\,\frac{\rho (\mathbf {r})}{4\pi |\mathbf {r}-\mathbf {r}_{j}|\epsilon _{0}}\nonumber \\&-\frac{1}{4\pi }\sum _{i\ne j}(1-\epsilon _{1})\varPhi _{i}A_{i}\frac{\partial }{\partial n_{i}}\frac{1}{|\mathbf {r}_{i}-\mathbf {r}_{j}|}+\frac{1}{2}(1+\epsilon _{1})\varPhi _{j} \end{aligned}$$
(18.85)

or

$$\begin{aligned} \varPhi _{j}=\frac{2}{1+\epsilon _{1}}\int _{V}dV\,\frac{\rho (\mathbf {r})}{4\pi \epsilon _{0}|\mathbf {r}-\mathbf {r}_{j}|}+\frac{1}{2\pi }\sum _{i\ne j}\frac{\epsilon _{1}-1}{\epsilon _{1}+1}\varPhi _{i}A_{i}\frac{\partial }{\partial n_{i}}\frac{1}{|\mathbf {r}_{i}-\mathbf {r}_{j}|}. \end{aligned}$$
(18.86)

This system of equations can be used to calculate the potential on the boundary. The potential inside the cavity is then given by (18.73). Numerical stability is improved by a related method which considers the potential gradient along the boundary. Taking the normal derivative

$$\begin{aligned} \frac{\partial }{\partial n_{j}}=\mathbf {n}_{j}\text {grad}_{r_{j}\pm } \end{aligned}$$
(18.87)

of (18.80, 18.81) gives

$$\begin{aligned}&\frac{\partial }{\partial n_{j}}\varPhi _{in}(\mathbf {r}_{j}^{-})=\frac{\partial }{\partial n_{j}}\int _{V}dV\,\frac{\rho (\mathbf {r})}{4\pi |\mathbf {r}-\mathbf {r}_{j}^{-}|\epsilon _{0}}\nonumber \\&-\frac{1}{4\pi }\sum _{i}\varPhi _{i}\oint _{S_{i}}dA\,\frac{\partial ^{2}}{\partial n\partial n_{j}}\frac{1}{|\mathbf {r}-\mathbf {r}_{j}^{-}|}+\frac{1}{4\pi }\sum _{i}\frac{\partial \varPhi _{i, in}}{\partial n}\oint _{S_{i}}dA\,\frac{\partial }{\partial n_{j}}\frac{1}{|\mathbf {r}-\mathbf {r}_{j}^{-}|}\end{aligned}$$
(18.88)
$$\begin{aligned}&\frac{\partial }{\partial n_{j}}\varPhi _{out}(\mathbf {r}_{j}^{+})=\frac{1}{4\pi }\sum _{i}\varPhi _{i}\oint _{S_{i}}dA\,\frac{\partial ^{2}}{\partial n\partial n_{j}}\frac{1}{|\mathbf {r}-\mathbf {r}_{j}^{+}|}\nonumber \\&-\frac{1}{4\pi }\sum _{i}\frac{\partial \varPhi _{i, out}}{\partial n}\oint _{S_{i}}dA\,\frac{\partial }{\partial n_{j}}\frac{1}{|\mathbf {r}-\mathbf {r}_{j}^{+}|}. \end{aligned}$$
(18.89)

In addition to (18.82) we have now

$$\begin{aligned} \oint _{S_{i}}dA\,\frac{\partial ^{2}}{\partial n\partial n_{j}}\frac{1}{|\mathbf {r}-\mathbf {r}_{j}^{-}|}=\oint _{S_{i}}dA\,\frac{\partial ^{2}}{\partial n\partial n_{j}}\frac{1}{|\mathbf {r}-\mathbf {r}_{j}^{+}|} \end{aligned}$$
(18.90)

and the sum of the two equations gives

$$\begin{aligned}&\left( 1+\frac{1}{\epsilon _{1}}\right) \frac{\partial }{\partial n_{j}}\varPhi _{in, j}\nonumber \\&=\frac{\partial }{\partial n_{j}}\left( \int _{V}dV\,\frac{\rho (\mathbf {r})}{4\pi \epsilon _{0}|\mathbf {r}-\mathbf {r}_{j}|}+\frac{1-\frac{1}{\epsilon _{1}}}{4\pi }\sum _{i\ne j}A_{i}\frac{\partial \varPhi _{i, in}}{\partial n}\frac{1}{|\mathbf {r}_{i}-\mathbf {r}_{j}|}\right) \nonumber \\&+\frac{1+\frac{1}{\epsilon _{1}}}{2\pi }\frac{\partial \varPhi _{j, in}}{\partial n} \end{aligned}$$
(18.91)

or finally

$$\begin{aligned}&\frac{\partial }{\partial n_{j}}\varPhi _{in, j}=\frac{2\epsilon _{1}}{\epsilon _{1}+1}\frac{\partial }{\partial n_{j}}\int _{V}dV\,\frac{\rho (\mathbf {r})}{4\pi \epsilon _{0}|\mathbf {r}-\mathbf {r}_{j}|}\nonumber \\&+2\frac{\epsilon _{1}-1}{\epsilon _{1}+1}\sum _{i\ne j}A_{i}\frac{\partial \varPhi _{i, in}}{\partial n}\frac{\partial }{\partial n_{j}}\frac{1}{|\mathbf {r}_{i}-\mathbf {r}_{j}|}. \end{aligned}$$
(18.92)

In terms of the surface charge density this reads:

$$\begin{aligned} \sigma '_{j}=2\varepsilon _{0}\frac{\left( 1-\varepsilon _{1}\right) }{(1+\varepsilon _{1})}\left( -\mathbf {n}_{j}\text {grad}\int dV\frac{\rho (\mathbf {r})}{4\pi \epsilon _{0}|\mathbf {r}-\mathbf {r}'|}+\frac{1}{4\pi \varepsilon _{0}}\sum _{i\ne j}\sigma '_{i}A_{i}\frac{\mathbf {n}_{j}(\mathbf {r}_{j}-\mathbf {r}_{i})}{|\mathbf {r}_{i}-\mathbf {r}_{j}|^{3}}\right) . \end{aligned}$$
(18.93)

This system of linear equations can be solved directly or iteratively (a simple damping scheme \(\sigma _{m}'\rightarrow \omega \sigma _{m}'+(1-\omega )\sigma _{m, old}'\) with \(\omega \approx 0.6\) helps to get rid of oscillations). From the surface charges \(\sigma _{i}A_{i}\) the potential is obtained with the help of (18.75).

4 Boundary Element Method for the Linearized Poisson–Boltzmann Equation

We consider now a cavity within an electrolyte. The fundamental solution of the linear Poisson–Boltzmann equation (18.63)

$$\begin{aligned} G_{\kappa }(\mathbf {r}-\mathbf {r}')=-\frac{e^{-\kappa |\mathbf {r}-\mathbf {r}'|}}{4\pi |\mathbf {r}-\mathbf {r}'|} \end{aligned}$$
(18.94)

obeys

$$\begin{aligned} \text {div grad}G_{\kappa }(\mathbf {r}-\mathbf {r}')-\kappa ^{2}G_{\kappa }(\mathbf {r}-\mathbf {r}')=\delta (\mathbf {r}-\mathbf {r}'). \end{aligned}$$
(18.95)

Inserting into Green’s theorem (18.69) we obtain the potential outside the cavity

$$\begin{aligned} \varPhi _{out}(\mathbf {r}')=-\oint _{S}dA\left( \varPhi _{out}(\mathbf {r})\frac{\partial }{\partial n}G_{\kappa }(\mathbf {r}-\mathbf {r}')-G_{\kappa }(\mathbf {r}-\mathbf {r}')\frac{\partial }{\partial n}\varPhi _{out}(\mathbf {r})\right) \end{aligned}$$
(18.96)

which can be combined with (18.74, 18.79) to give the following equations [238]

$$\begin{aligned}&(1+\epsilon _{1})\varPhi (\mathbf {r}')=\oint _{S}dA\left[ \varPhi (\mathbf {r})\frac{\partial }{\partial n}(G_{0}-\epsilon _{1}G_{\kappa })-(G_{0}-G_{\kappa })\frac{\partial }{\partial n}\varPhi _{in}(\mathbf {r})\right] \nonumber \\&+\int _{cav}\frac{\rho (\mathbf {r)}}{4\pi \epsilon _{0}|\mathbf {r}-\mathbf {r}'|}dV \end{aligned}$$
(18.97)
$$\begin{aligned}&(1+\epsilon _{1})\frac{\partial }{\partial n'}\varPhi _{in}(\mathbf {r}')=\oint _{S}dA\varPhi (\mathbf {r})\frac{\partial ^{2}}{\partial n\partial n'}(G_{0}-G_{\kappa })\nonumber \\&-\oint _{S}dA\frac{\partial }{\partial n}\varPhi _{in}(\mathbf {r})\frac{\partial }{\partial n'}\left( G_{0}-\frac{1}{\epsilon _{1}}G_{k}\right) +\frac{\partial }{\partial n'}\int _{cav}\frac{\rho (\mathbf {r})}{4\pi \epsilon |\mathbf {r}-\mathbf {r}'|}dV. \end{aligned}$$
(18.98)

For a set of discrete boundary elements the following equations determine the values of the potential and its normal derivative at the boundary:

$$\begin{aligned}&\frac{1+\epsilon _{1}}{2}\varPhi _{j}=\sum _{i\ne j}\varPhi _{i}\oint dA\frac{\partial }{\partial n}(G_{0}-\epsilon _{1}G_{\kappa })-\sum _{i\ne j}\frac{\partial }{\partial n}\varPhi _{i, in}\oint dA(G_{0}-G_{\kappa })\nonumber \\&+\int \frac{\rho (\mathbf {r)}}{4\pi \epsilon _{0}|\mathbf {r}-\mathbf {r}_{i}|}dV \end{aligned}$$
(18.99)
$$\begin{aligned}&\frac{1+\epsilon _{1}}{2}\frac{\partial }{\partial n'}\varPhi _{i, in}=\sum _{i\ne j}\varPhi _{i}\oint dA\frac{\partial ^{2}}{\partial n\partial n'}(G_{0}-G_{\kappa })\nonumber \\&-\sum _{i\ne j}\frac{\partial }{\partial n}\varPhi _{i, in}\oint dA\frac{\partial }{\partial n'}\left( G_{0}-\frac{1}{\epsilon _{1}}G_{k}\right) +\frac{\partial }{\partial n'}\int \frac{\rho (\mathbf {r})}{4\pi \epsilon |\mathbf {r}-\mathbf {r}_{i}|}dV. \end{aligned}$$
(18.100)

The situation is much more involved than for the simpler Poisson equation (with \(\kappa =0\)) since the calculation of many integrals including such with singularities is necessary [238, 239].

5 Electrostatic Interaction Energy (Onsager Model)

A very important quantity in molecular physics is the electrostatic interaction of a molecule and the surrounding solvent [240, 241]. We calculate it by taking a small part of the charge distribution from infinite distance (\(\varPhi (r\rightarrow \infty )=0)\) into the cavity. The charge distribution thereby changes from \(\lambda \rho (r)\) to \((\lambda +d\lambda )\rho (r)\) with \(0\le \lambda \le 1\). The corresponding energy change is

$$\begin{aligned}&dE=\int d\lambda \cdot \rho (r)\,\varPhi _{\lambda }(r)dV \nonumber \\&=\int d\lambda \cdot \rho (r)\,\left( \sum _{n}\frac{\sigma _{n}(\lambda )A_{n}}{4\pi \varepsilon _{0}|r-r_{n}|}+\int \frac{\lambda \rho (r')}{4\pi \varepsilon _{0}|r-r'|}dV'\right) dV. \end{aligned}$$
(18.101)

Multiplication of the equations (18.93) by a factor of \(\lambda \) shows that the surface charges \(\lambda \sigma _{n}\) are the solution corresponding to the charge density \(\lambda \rho (r)\). It follows that \(\sigma _{n}(\lambda )=\lambda \sigma _{n}\) and hence

$$\begin{aligned} dE=\lambda d\lambda \,\int \rho (r)\,\left( \sum _{n}\frac{\sigma _{n}A_{n}}{4\pi \varepsilon _{0}|r-r_{n}|}+\frac{\rho (r')}{4\pi \varepsilon _{0}|r-r'|}dV'\right) . \end{aligned}$$
(18.102)

The second summand is the self energy of the charge distribution which does not depend on the medium. The first summand vanishes without a polarizable medium and gives the interaction energy. Hence we have the final expression

$$\begin{aligned}&E_{int}=\int dE=\int _{0}^{1}\lambda d\lambda \int \rho (r)\sum _{n}\frac{\sigma _{n}A_{n}}{4\pi \varepsilon _{0}|r-r_{n}|}dV \nonumber \\&=\sum _{n}\sigma _{n}A_{n}\int \frac{\rho (r)}{8\pi \varepsilon _{0}|r-r_{n}|}dV. \end{aligned}$$
(18.103)

For the special case of a spherical cavity with radius a an analytical solution by a multipole expansion is available [242]

$$\begin{aligned} E_{int}=-\frac{1}{8\pi \varepsilon _{0}}\sum _{l}\sum _{m=-l}^{l}\frac{(l+1)(\varepsilon _{1}-1)}{\left[ l+\varepsilon _{1}(l+1)\right] a^{2l+1}}M_{l}^{m}M_{l}^{m} \end{aligned}$$
(18.104)

with the multipole moments

$$\begin{aligned} M_{l}^{m}=\int \rho (r,\theta ,\varphi )\sqrt{\frac{4\pi }{2l+1}}r^{l}Y_{l}^{m}(\theta ,\varphi )dV. \end{aligned}$$
(18.105)

The first two terms of this series are:

$$\begin{aligned}&E_{int}^{(0)}=-\frac{1}{8\pi \varepsilon _{0}}\frac{\varepsilon _{1}-1}{\varepsilon _{1}a}M_{0}^{0}M_{0}^{0}=-\frac{1}{8\pi \varepsilon _{0}}\left( 1-\frac{1}{\varepsilon _{1}}\right) \frac{Q^{2}}{a}\end{aligned}$$
(18.106)
$$\begin{aligned}&E_{int}^{(1)}=-\frac{1}{8\pi \varepsilon _{0}}\frac{2(\varepsilon _{1}-1)}{(1+2\varepsilon _{1})a^{3}}(M_{1}^{-1}M_{1}^{-1}+M_{1}^{0}M_{1}^{0}+M_{1}^{1}M_{1}^{1}) \nonumber \\&=-\frac{1}{8\pi \varepsilon _{0}}\frac{2(\varepsilon _{1}-1)}{1+2\varepsilon _{1}}\frac{\mu ^{2}}{a^{3}}. \end{aligned}$$
(18.107)

5.1 Example: Point Charge in a Spherical Cavity

Consider a point charge Q in the center of a spherical cavity of radius R (Fig. 18.17). The dielectric constant is given by

$$\begin{aligned} \varepsilon =\left\{ \begin{array}{c} \varepsilon _{0}\quad r<R\\ \varepsilon _{1}\varepsilon _{0}\quad r>R \end{array}\right. . \end{aligned}$$
(18.108)
Fig. 18.17
figure 17

Surface charges

Electric field and potential are inside the cavity

$$\begin{aligned} E=\frac{Q}{4\pi \varepsilon _{0}r^{2}}\quad \varPhi =\frac{Q}{4\pi \varepsilon _{0}r}+\frac{Q}{4\pi \varepsilon _{0}R}\left( \frac{1}{\varepsilon _{1}}-1\right) \end{aligned}$$
(18.109)

and outside

$$\begin{aligned} E=\frac{Q}{4\pi \varepsilon _{1}\varepsilon _{0}r^{2}}\quad \varPhi =\frac{Q}{4\pi \varepsilon _{1}\varepsilon _{0}r}\quad r>R \end{aligned}$$
(18.110)

which in terms of the surface charge density \(\sigma \) is

$$\begin{aligned} E=\frac{Q+4\pi R^{2}\sigma }{4\pi \varepsilon _{0}r^{2}}\quad r>R \end{aligned}$$
(18.111)

with the total surface charge

$$\begin{aligned} 4\pi R^{2}\sigma =Q\left( \frac{1}{\varepsilon _{1}}-1\right) . \end{aligned}$$
(18.112)

The solvation energy (18.103) is given by

$$\begin{aligned} E_{int}=\frac{Q^{2}}{8\pi \varepsilon _{0}}\left( \frac{1}{\varepsilon _{1}}-1\right) \end{aligned}$$
(18.113)

which is the first term (18.106) of the multipole expansion. Figure 18.18 shows numerical results.

Fig. 18.18
figure 18

(Solvation energy with the boundary element method) A spherical cavity is simulated with radius a \(=\) 1Å which contains a point charge in its center. The solvation energy is calculated with \(25\times 25\) (circles) and \(50\times 50\) (squares) surface elements of equal size. The exact expression (18.106) is shown by the solid curve