Solving for the Electric Field

To calculate the electric field at each time-step due to the free charges, we solve Poisson’s Equation given by

\[\begin{split}- \nabla^2 \Phi(x) = \rho(x), \\ \nabla E(x) = \rho_i(x) - \rho_e(x)\end{split}\]

where \(\rho_i, \rho_e\) are the charge densities for ions and electrons, respectively, and \(\Phi\) is the electrostatic potential. Assuming that the ion density stays uniform and constant, this can be solved in the pseudo-spectral domain by computing the Fourier transform of the above equation. The solution in Fourier space is given by

\[E(k_x) = \frac{1 - \rho_e(k_x)}{-i k_x}.\]
\[E(x) = \sum_{x={x_{min}}}^{x_{max}}\frac{1 - \rho_e(k_x)}{-i k_x} \exp{(i k_x x)}.\]

This solver is tested to reproduce analytical solutions to a periodic Poisson system.

The Poisson Solver is tested in tests/test_fieldsolver.py and the tests are illustrated in notebooks/test_poisson.ipynb. Below, we show a sample test result.

_images/poisson_solver.png