next up previous contents
Next: Debugging: Up: Potential from a sum Previous: Debugging:

Computation of total electrostatic potential energy U

 

We now solve Poisson's equation for the Gaussian charge distributions above. Because the energy of a periodic system is infinite if each unit cell contains a net charge, we will consider the charge distribution rho=rho1-rho2 from part 2.2.1. This net distribution has one unit of positive charge in a peak of width tex2html_wrap_inline539 and one unit of negative charge in a more spread-out peak of width tex2html_wrap_inline541 , as in Figure 1.

   figure169
Figure 1: Distribution of charges for three-dimensional solution of Poisson's equation

The total electrostatic energy of any distribution of charges is

  equation176

Note that, because tex2html_wrap_inline543 is real, the complex conjugation `*' does not do anything. We include it for convenience so that we may use the tex2html_wrap_inline545 and tex2html_wrap_inline547 operators as defined in lecture.

If we have the coefficients, tex2html_wrap_inline549 and tex2html_wrap_inline551 , for the expansions of these fields

eqnarray183

then, substituting into Eq. (1) we find (in the notation from lecture),

displaymath553

As discussed in lecture, we can always find the vectors of expansion coefficients from vectors of sample values by using our inverse transform operator,

eqnarray191

Thus our final result for the potential energy is

  equation197

After the check of the integrals of rho1, rho2 and rho (from part 2.2.1) in physics.C, have your code determine and print out the total potential energy of the total charge-density distribution rho using the one-line solution of Poisson's equation from class

  phi=I(Linv((-4*pi)*O(J(rho))));
and the computational representation of Eq. 2 for U,
  U=0.5*real(J(rho)^O(J(phi)));
Note that we need to take the real part of the complex result of the `^' operator so that we can store the answer in U, a double precision value.

Compare your computed result for U with the analytic result for the total potential energy of a sum of two Gaussian distributions, one of width tex2html_wrap_inline555 with positive unit charge and one of width tex2html_wrap_inline557 with negative unit charge:

displaymath559




next up previous contents
Next: Debugging: Up: Potential from a sum Previous: Debugging:

Tomas Arias
Fri Apr 14 12:12:49 EDT 2000