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 3.2.1. This net distribution has one unit of positive charge in a peak of width tex2html_wrap_inline600 and one unit of negative charge in a more spread-out peak of width tex2html_wrap_inline602 , as in Figure 1.

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

The total electrostatic energy of any distribution of charges is

  equation183

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

If we have the coefficients, tex2html_wrap_inline610 and tex2html_wrap_inline612 , for the expansions of these fields

eqnarray190

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

displaymath614

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

eqnarray198

Thus our final result for the potential energy is

  equation204

After the check of the integrals of rho1, rho2 and rho (from part 3.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_inline616 with positive unit charge and one of width tex2html_wrap_inline618 with negative unit charge:

displaymath620




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

Tomas Arias
Sun Apr 15 19:43:40 EDT 2001