PIC - Example Implementation
\[\]

Notes and details for an electrostatic PIC implementation.

Dimensions and Normalizations #

To make the relevant physics as easy to model and visualize as possible, let’s choose units such that time is normalized by the plasma frequency and length scales of interest are of order unity. This will make things a lot easier to plot and interpret in the long run, even though normalizations like \( m = q /(q / m) \) seem arcane.

The fundamental quantities of interest are:

VariablePhysical ExpressionComputer Value
Number of Particlesn\( N \)Variable (default 128)
System LengthL\( L \)
Grid CellsM\( M \)32
Grid Spacingdx\( L / M \)1/M
Plasma Frequency \( (\omega_p) \)wp\( \sqrt{\frac{n q^2}{\epsilon_0 m}} = \sqrt{\frac{N}{\hat{L}} \frac{1}{\epsilon_0}q \frac{q}{m}} \)1
Positionx[i]\( x_{min} + \frac{j L}{m} \)(x[i] - x_min)/(x_max - x_min) or j/m. This means it is bounded \( [0, 1] \)
Electric Constanteps0\( \epsilon_0 \)1
Charge to Mass Ratioqm\( q/m \)-1
Particle Chargeq\( \frac{\omega_p ^2 (L/N) \epsilon_0}{(q/m)} \)wp**2 * eps0 / (n * qm) (simplifies to -1/n)
Particle Massm\( q / (q/m) \)wp**2 * eps0 / (n * qm**2) (simplifies to 1/n)

In SI units, we have:

  • \( x_i \): Position (meters) of particle \( i \) within the range \( [-\frac{L}{2}, \frac{L}{2}] \), relative to the center of the periodic domain.
  • \( L \): Length (meters) of periodic spatial domain
  • \( x_{min} \): Equal to \( - L / 2 \)
  • \( x_{max} \): Equal to \( L / 2 \)
  • \( v_i \): Velocity (meters/s) of particle \( i \).

Comparing results to theory #

Finding the distance between peaks in the field energy is a good way of measuring the frequency.

Notes for write-up #

When you read a paper, you typically read the title, abstract, introduction, conclusions, and look at the figures and captions. Then, if you want more details on something in particular, you dive into the larger sections. The figures are key to this. They should be clearly labelled and captions, and they should clearly convey a specific idea.