# computeChargeError¶

Computes the simulation charge error which is measured as the difference in charge as computed from the divergence of the electric field and that computed using the continuity equation. This source does not compute $$\nabla\cdot E$$, instead this value is passed in.

\begin{align} \delta = \nabla\cdot E-\frac{1}{\epsilon_{0}}\sum_{i}\frac{q_{i}}{m_{i}}\rho_{i} \end{align}

where $$E$$ is the electric field, $$m_{i}$$ is the species mass, $$q_{i}$$ is the species charge, $$\epsilon_{0}$$ is the permittivity, $$\rho_{i}$$ is the species mass density.

## Parameters¶

speciesCharge (vector float)
Species charge in the order they appear in the input list.
speciesMass (vector float)
The charge of the fluid species.
epsilon0 (float)
The permittivity of free space.

## Parent Updater Data¶

in (string vector, required)

1st Variable

1. $$\nabla\cdot E$$ The divergence of the electric field

Remaining variables

This source takes an arbitrary number of species mass variables, but requires at least 1.

1. $$\rho$$ species mass density
out (string vector, required)

The output is the charge error

1st Variable

1. $$\delta$$ The charge error.

## Example¶

<Equation>
kind = computeChargeError
speciesCharge = [ELECTRON_CHARGE, ION_CHARGE]
speciesMass = [ELECTRON_MASS, ION_MASS]
epsilon0 = EPSILON0
</Equation>