next up previous
Next: Solution of Poisson's equation Up: Particle-in-cell codes Previous: Solution of electron equations

Evaluation of electron number density

In order to obtain the electron number density $n(x)$ from the electron coordinates $r_i$ we adopt a so-called particle-in-cell (PIC) approach. Let us define a set of $J$ equally spaced spatial grid-points located at coordinates
\begin{displaymath}
x_j = j\,\delta x,
\end{displaymath} (300)

for $j=0,J-1$, where $\delta x = L / J$. Let $n_j\equiv n(x_j)$. Suppose that the $i$th electron lies between the $j$th and $(j+1)$th grid-points: i.e., $x_j < r_i < x_{j+1}$. We let
\begin{displaymath}
n_j \rightarrow n_j+\left.\left(\frac{x_{j+1}-r_i}{x_{j+1}-x_j}\right)\right/\delta x,
\end{displaymath} (301)

and
\begin{displaymath}
n_{j+1} \rightarrow n_{j+1}+ \left.\left(\frac{r_i-x_j}{x_{j+1}-x_j}\right)\right/\delta x.
\end{displaymath} (302)

Thus, $n_j\,\delta x$ increases by 1 if the electron is at the $j$th grid-point, $n_{j+1}\,\delta x$ increases by 1 if the electron is at the $(j+1)$th grid-point, and $n_j\,\delta x$ and $n_{j+1}\,\delta x$ both increase by $1/2$ if the electron is halfway between the two grid-points, etc. Performing a similar assignment for each electron in turn allows us to build up the $n_j$ from the electron coordinates (assuming that all the $n_j$ are initialized to zero at the start of this process).


next up previous
Next: Solution of Poisson's equation Up: Particle-in-cell codes Previous: Solution of electron equations
Richard Fitzpatrick 2006-03-29