# wellbalanced

*module*

Global (0D) and 1D fluid models of low-temperature plasmas.

A global model balances, averaged over a chamber, the density of every species
and the electron energy (and optionally the gas temperature): the reactions,
the losses to the walls, the feed and pumping of the gases and external
sources such as a fast beam. Reactions take their rates from plasmacoll's
cross sections, the same data its Monte Carlo collisions use, so a fluid and a
kinetic model of the same plasma differ in their physics, not their data.

:class:`Fluid1D` resolves the same plasma along one dimension: drift-diffusion of
every species, the electron energy and Poisson's equation, implicit, with
boundaries that can be changed between steps.

:class:`GasDynamics` is the neutral gas of a sputtering magnetron, argon and the sputtered
metal as one compressible gas in one or two dimensions (its boundaries and sources are in
:mod:`wellbalanced.gasdynamics`).

:class:`RFDriver` is a 0D RF driver: a global model of its plasma and a transformer
model of the coil's coupling, giving the coil current and the RF power transfer efficiency
(:mod:`wellbalanced.driver`). The spatially resolved models are in
:mod:`wellbalanced.spatial`: :class:`InductiveField2D`, the inductive RF field of coil
windings, conductors and a prescribed plasma in a 2D cut or in r–z, with cold or viscous
electrons, and :class:`DriverCoupling`, that field with a power-dependent plasma.

The solves, time steps and runs carry scope-profiler regions tagged ``"wellbalanced"``,
an opt-in tag: they record nothing unless an application enables it, e.g. with
``scope_profiler.setup(enable_tags=["wellbalanced"])``.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/__init__.py#L1-L1)

## wellbalanced.ELECTRON

*attribute* · *module attribute*

```python
ELECTRON = Species('e', ELECTRON_MASS, -1)
```

Re-exported from: `wellbalanced.species`

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/species.py#L50-L50)

## wellbalanced.MATERIALS

*attribute* · *module attribute*

```python
MATERIALS: dict[str, TargetMaterial] = {m.name: m for m in (_material('Al', 26.982, 5.986, 3, 0.65, 0.55), _material('Cr', 51.996, 6.767, 1, 0.9, 0.8), _material('Cu', 63.546, 7.726, 1, 1.0, 1.0), _material('Ti', 47.867, 6.828, 2, 0.4, 0.3), _material('Au', 196.967, 9.226, 1, 2.4, 2.5), _material('Mo', 95.95, 7.092, 1, 0.7, 0.8), _material('Nb', 92.906, 6.759, 1, 0.5, 0.6))}
```

Re-exported from: `wellbalanced.magnetron`

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/magnetron.py#L232-L243)

## wellbalanced.Boundary

*class* · *dataclass*

```python
class Boundary
```

Re-exported from: `wellbalanced.fluid1d`

The condition of one species at one end.

Use the constructors: :meth:`wall`, :meth:`density`, :meth:`flux`,
:meth:`symmetry`. ``value`` is the density (m^-3) or the flux into the
domain (m^-2 s^-1); ``temperature`` (eV) the electron temperature of a
prescribed electron density; ``reflection`` the wall's reflection coefficient.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/fluid1d.py#L135-L168)

### wellbalanced.Boundary.kind

*attribute* · *instance attribute*

```python
kind: str
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/fluid1d.py#L145-L145)

### wellbalanced.Boundary.reflection

*attribute* · *class attribute* · *instance attribute*

```python
reflection: float = 0.0
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/fluid1d.py#L148-L148)

### wellbalanced.Boundary.temperature

*attribute* · *class attribute* · *instance attribute*

```python
temperature: float | None = None
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/fluid1d.py#L147-L147)

### wellbalanced.Boundary.value

*attribute* · *class attribute* · *instance attribute*

```python
value: float = 0.0
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/fluid1d.py#L146-L146)

### wellbalanced.Boundary.density

*method* · *classmethod*

```python
def density(value: float, temperature: float | None = None) -> Boundary
```

A prescribed density at the boundary (and, for electrons, temperature).

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/fluid1d.py#L155-L158)

### wellbalanced.Boundary.flux

*method* · *classmethod*

```python
def flux(value: float, temperature: float | None = None) -> Boundary
```

A prescribed flux into the domain (and, for electrons, their temperature).

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/fluid1d.py#L160-L163)

### wellbalanced.Boundary.symmetry

*method* · *classmethod*

```python
def symmetry() -> Boundary
```

No flux.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/fluid1d.py#L165-L168)

### wellbalanced.Boundary.wall

*method* · *classmethod*

```python
def wall(reflection: float = 0.0) -> Boundary
```

An absorbing wall: outflow ``(1 - r)/(1 + r) (max(v_drift, 0) + v_th / 2) n``.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/fluid1d.py#L150-L153)

## wellbalanced.CellGrid

*class*

```python
class CellGrid
```

Re-exported from: `wellbalanced.spatial.grid`

Cells of a tensor-product grid with any edges, in a cut or in r–z.

**Parameters**

- `x_edges` (`Sequence[float] | np.ndarray`) — Cell edges of the first axis (``x``, or ``r`` from ``>= 0``) [m].
- `y_edges` (`Sequence[float] | np.ndarray`) — Cell edges of the second axis (``y``, or ``z``) [m].
- `geometry` (`Geometry`) (default: `'cartesian'`) — ``"cartesian"`` or ``"cylindrical"``.
- `boundaries` (`tuple[AxisBoundary, AxisBoundary]`) (default: `('dirichlet', 'dirichlet')`) — The boundary of each axis: ``"dirichlet"`` (the field is 0 at the edge), ``"neumann"`` (no flux) or ``"periodic"``. In r–z the radial axis cannot be periodic, and its lower boundary is the axis when the first edge is 0, whatever is given.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/spatial/grid.py#L83-L393)

### wellbalanced.CellGrid.boundaries

*attribute* · *instance attribute*

```python
boundaries = tuple(boundaries)
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/spatial/grid.py#L121-L121)

### wellbalanced.CellGrid.cell_areas

*attribute* · *instance attribute*

```python
cell_areas = np.outer(np.diff(self.x_edges), np.diff(self.y_edges))
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/spatial/grid.py#L128-L128)

### wellbalanced.CellGrid.cell_volumes

*attribute* · *instance attribute*

```python
cell_volumes = self.cell_areas * self.circumference
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/spatial/grid.py#L137-L137)

### wellbalanced.CellGrid.circumference

*attribute* · *instance attribute*

```python
circumference = np.ones(self.shape) if geometry == 'cartesian' else np.broadcast_to(2.0 * np.pi * self.x[:, None], self.shape).copy()
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/spatial/grid.py#L131-L135)

### wellbalanced.CellGrid.geometry

*attribute* · *instance attribute*

```python
geometry: Geometry = geometry
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/spatial/grid.py#L120-L120)

### wellbalanced.CellGrid.shape

*attribute* · *instance attribute*

```python
shape = (self.x.size, self.y.size)
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/spatial/grid.py#L124-L124)

### wellbalanced.CellGrid.size

*attribute* · *instance attribute*

```python
size = self.shape[0] * self.shape[1]
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/spatial/grid.py#L125-L125)

### wellbalanced.CellGrid.x

*attribute* · *instance attribute*

```python
x = 0.5 * self.x_edges[1:] + self.x_edges[:-1]
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/spatial/grid.py#L122-L122)

### wellbalanced.CellGrid.x_edges

*attribute* · *instance attribute*

```python
x_edges = np.asarray(x_edges, dtype=float)
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/spatial/grid.py#L105-L105)

### wellbalanced.CellGrid.y

*attribute* · *instance attribute*

```python
y = 0.5 * self.y_edges[1:] + self.y_edges[:-1]
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/spatial/grid.py#L123-L123)

### wellbalanced.CellGrid.y_edges

*attribute* · *instance attribute*

```python
y_edges = np.asarray(y_edges, dtype=float)
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/spatial/grid.py#L106-L106)

### wellbalanced.CellGrid.coordinate_names

*property*

```python
coordinate_names: tuple[str, str]
```

``("x", "y")`` or ``("r", "z")``.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/spatial/grid.py#L145-L147)

### wellbalanced.CellGrid.cylindrical

*property*

```python
cylindrical: bool
```

Whether the grid is the axisymmetric r–z plane.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/spatial/grid.py#L140-L142)

### wellbalanced.CellGrid.dims

*property*

```python
dims: tuple[str, ...]
```

The dimensions of a field in a dataset: the two axes.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/spatial/grid.py#L150-L152)

### wellbalanced.CellGrid.on_axis

*property*

```python
on_axis: bool
```

Whether the r–z domain reaches the axis (its first radial edge is 0).

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/spatial/grid.py#L245-L247)

### wellbalanced.CellGrid.cell_field

*method*

```python
def cell_field(value: CellField, dtype: Any = float) -> np.ndarray
```

A :data:`CellField` evaluated on the cell centres, shape :attr:`shape`.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/spatial/grid.py#L179-L185)

### wellbalanced.CellGrid.coordinates

*method*

```python
def coordinates() -> dict[str, tuple[str, np.ndarray, dict[str, str]]]
```

The cell-centre coordinates as xarray coordinate entries.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/spatial/grid.py#L387-L393)

### wellbalanced.CellGrid.curl

*method*

```python
def curl(a: np.ndarray) -> tuple[np.ndarray, np.ndarray]
```

The in-plane curl of the normal field ``a`` on the cell centres.

``(d_y a, -d_x a)`` in the cut; ``(-d_z a, (1 / r) d(r a) / dr)`` in r–z.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/spatial/grid.py#L368-L381)

### wellbalanced.CellGrid.curl_curl

*method*

```python
def curl_curl(face_coefficient: np.ndarray | None = None, active: np.ndarray | None = None) -> sp.csr_matrix
```

The curl-curl of the normal field, integrated over the cells (symmetric).

``(K a)_i`` is ``V_i (curl curl a)_i`` for the field ``a`` on the cells, zero at
the Dirichlet edges. ``face_coefficient`` (a cell field) scales each face by the
mean of its two cells, the coefficient of ``curl (mu curl a)``, e.g. a
viscosity. With ``active``, only those cells are unknowns: a face to an
inactive cell becomes a Dirichlet edge (``a = 0``) at the face, and the rows
and columns of inactive cells are zero.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/spatial/grid.py#L280-L353)

### wellbalanced.CellGrid.locate

*method*

```python
def locate(x: float, y: float) -> tuple[int, int]
```

The cell whose centre is nearest to ``(x, y)`` along each axis.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/spatial/grid.py#L154-L156)

### wellbalanced.CellGrid.mask

*method*

```python
def mask(shape: Any) -> np.ndarray
```

The cells whose centre a shape (anything with ``contains_points``) contains.

``contains_points`` takes the ``(2, n)`` centres; a CuPy result is copied to
the host.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/spatial/grid.py#L187-L197)

### wellbalanced.CellGrid.net_current

*method*

```python
def net_current(residual: np.ndarray, region: np.ndarray) -> Any
```

The current through a region's cross-section from ``V J`` on its cells.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/spatial/grid.py#L383-L385)

### wellbalanced.CellGrid.union_mask

*method*

```python
def union_mask(shapes: Sequence[Any]) -> np.ndarray
```

The cells any of ``shapes`` contains.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/spatial/grid.py#L199-L204)

### wellbalanced.CellGrid.wall_cells

*method*

```python
def wall_cells(inside: np.ndarray) -> np.ndarray
```

The cells of ``inside`` with a face to a cell outside it or to the domain's edge.

The axis of an r–z domain and periodic seams are not walls.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/spatial/grid.py#L158-L175)

## wellbalanced.Chamber

*class* · *dataclass*

```python
class Chamber
```

Re-exported from: `wellbalanced.global_model`

The volume and walls of the plasma.

**Attributes**

- `volume` (`float`) — The volume in m^3.
- `wall_area` (`float`) — The total wall area in m^2, seen by the neutrals.
- `ion_loss_area` (`float | None`) — The area in m^2 through which ions leave unconfined; the whole wall if ``None``.
- `h_factor` (`float`) — The edge-to-centre density ratio at that area.
- `cusp` (`Cusp | None`) — Magnetic cusps through which ions leave as well.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/global_model.py#L99-L134)

### wellbalanced.Chamber.cusp

*attribute* · *class attribute* · *instance attribute*

```python
cusp: Cusp | None = None
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/global_model.py#L116-L116)

### wellbalanced.Chamber.h_factor

*attribute* · *class attribute* · *instance attribute*

```python
h_factor: float = 1.0
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/global_model.py#L115-L115)

### wellbalanced.Chamber.ion_loss_area

*attribute* · *class attribute* · *instance attribute*

```python
ion_loss_area: float | None = None
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/global_model.py#L114-L114)

### wellbalanced.Chamber.volume

*attribute* · *instance attribute*

```python
volume: float
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/global_model.py#L112-L112)

### wellbalanced.Chamber.wall_area

*attribute* · *instance attribute*

```python
wall_area: float
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/global_model.py#L113-L113)

### wellbalanced.Chamber.ion_area

*method*

```python
def ion_area(electron_temperature: float, ion_temperature: float, ion_mass: float) -> float
```

Return the effective area in m^2 through which an ion leaves at ``u_B``.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/global_model.py#L125-L134)

## wellbalanced.Coil

*class* · *dataclass*

```python
class Coil
```

Re-exported from: `wellbalanced.driver`

The RF coil: ``turns`` windings of ``radius`` (m) over ``length`` (m).

``field_factor`` is the ratio of its inductance to the long-solenoid one;
Nagaoka's coefficient of the coil if ``None``.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driver.py#L120-L150)

### wellbalanced.Coil.field_factor

*attribute* · *class attribute* · *instance attribute*

```python
field_factor: float | None = None
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driver.py#L131-L131)

### wellbalanced.Coil.length

*attribute* · *instance attribute*

```python
length: float
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driver.py#L130-L130)

### wellbalanced.Coil.radius

*attribute* · *instance attribute*

```python
radius: float
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driver.py#L129-L129)

### wellbalanced.Coil.turns

*attribute* · *instance attribute*

```python
turns: float
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driver.py#L128-L128)

### wellbalanced.Coil.factor

*property*

```python
factor: float
```

The inductance ratio used: ``field_factor`` or Nagaoka's coefficient.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driver.py#L141-L145)

### wellbalanced.Coil.inductance

*property*

```python
inductance: float
```

The coil's inductance without plasma, ``K mu0 pi b^2 N^2 / l`` in H.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driver.py#L148-L150)

## wellbalanced.Conductor

*class* · *dataclass*

```python
class Conductor
```

Re-exported from: `wellbalanced.spatial.inductive`

A perfect conductor (``E = 0`` inside): one or several connected shapes.

**Attributes**

- `shapes` (`Sequence[Any]`) — The shapes it is made of (anything with ``contains_points``).
- `floating` (`bool`) — ``False`` (grounded, the default): ``a = 0`` inside, the value of the far boundary, any net current. ``True`` (in a cut only): one uniform unknown ``A_z`` and zero net current, a closed loop of plates.
- `name` (`str`) — A label for :attr:`InductiveSolution.conductor_currents`.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/spatial/inductive.py#L123-L137)

### wellbalanced.Conductor.floating

*attribute* · *class attribute* · *instance attribute*

```python
floating: bool = False
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/spatial/inductive.py#L136-L136)

### wellbalanced.Conductor.name

*attribute* · *class attribute* · *instance attribute*

```python
name: str = ''
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/spatial/inductive.py#L137-L137)

### wellbalanced.Conductor.shapes

*attribute* · *instance attribute*

```python
shapes: Sequence[Any]
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/spatial/inductive.py#L135-L135)

## wellbalanced.Cusp

*class* · *dataclass*

```python
class Cusp
```

Re-exported from: `wellbalanced.global_model`

Multicusp magnetic confinement: cusp lines with a field at the wall.

``line_length`` (m) is the total length of the cusp lines, ``field`` (T) the
field at the wall. The ions leave through a strip of the hybrid leak width
``w = 4 sqrt(rho_e rho_i)`` along the lines, with ``rho = sqrt(m T) / (e B)``
the gyroradius at the thermal speed ``sqrt(T / m)``.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/global_model.py#L64-L96)

### wellbalanced.Cusp.field

*attribute* · *instance attribute*

```python
field: float
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/global_model.py#L74-L74)

### wellbalanced.Cusp.line_length

*attribute* · *instance attribute*

```python
line_length: float
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/global_model.py#L75-L75)

### wellbalanced.Cusp.area

*method*

```python
def area(electron_temperature: float, ion_temperature: float, ion_mass: float) -> float
```

Return the leak area in m^2.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/global_model.py#L90-L96)

### wellbalanced.Cusp.leak_width

*method*

```python
def leak_width(electron_temperature: float, ion_temperature: float, ion_mass: float) -> float
```

Return the leak width in m.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/global_model.py#L82-L88)

## wellbalanced.DriftFluid2D

*class* · *dataclass*

```python
class DriftFluid2D
```

Re-exported from: `wellbalanced.driftfluid2d`

The magnetron plane of the module docstring.

**Attributes**

- `length_x` (`float`) — The cathode-anode gap (m).
- `length_y` (`float`) — The azimuthal period (m).
- `nx` (`int`) — Cells along ``x``.
- `ny` (`int`) — Cells along ``y`` (at least 4).
- `voltage` (`float`) — The discharge voltage (V): the cathode is at ``-voltage``, the anode at 0.
- `magnetic_field` (`Callable[[Any], Any] | float`) — ``B_z(x)`` in T: a callable of the cell positions, or a number.
- `gas_density` (`float`) — The neutral density at rest ``N_0`` (m^-3).
- `electron_temperature` (`float | None`) — ``T_e`` held fixed (eV), or ``None`` for the energy equation.
- `momentum_rate` (`float | Callable[[Any], Any]`) — Electron-neutral momentum-transfer rate coefficient ``k_en`` (m^3/s), ``nu_en = k_en N``: a number, or a function of ``T_e`` (eV; the default is the PLACEHOLDER :func:`argon_momentum_rate`).
- `ion_friction_rate` (`float`) — Ion-neutral momentum-transfer rate coefficient (m^3/s). PLACEHOLDER.
- `ion_mass_u` (`float`) — The ion mass in atomic mass units (argon).
- `ion_temperature` (`float`) — ``T_i`` in eV (also the gas temperature).
- `ionization_rate` (`Callable[[Any], Any]`) — Rate coefficient (m^3/s) as a function of ``T_e`` (eV).
- `excitation_rate` (`Callable[[Any], Any] | None`) — Excitation rate coefficient (m^3/s) as a function of ``T_e``, or ``None`` for none; ``excitation_energy_ev`` is the energy it costs (eV), and ``ionization_energy_ev`` the energy an ionization costs. Both are channels of the electron energy loss, with the elastic loss ``3 (m / M) nu_en (T_e - T_i)``.
- `secondary_emission` (`float`) — Electrons emitted per ion hitting the cathode. PLACEHOLDER.
- `cathode_current_density` (`float | None`) — If given (A/m^2), the cathode emits this net electron current density, whatever the ion flux, instead of ``secondary_emission`` per ion. This is the condition of Boeuf's PIC (``j_e0 = 0.03 A/m^2``, the electrons returning to the cathode re-emitted): a fixed ``gamma`` makes the discharge an avalanche whenever ``gamma M >= 1`` (``M`` the multiplication), a fixed emitted current gives a stable steady state with ``gamma_net = j_e0 / j_ion``.
- `secondary_energy_ev` (`float`) — Temperature of the emitted electrons (eV).
- `refill_rate` (`float`) — Relaxation rate (1/s) of the gas towards ``N_0`` (the gas flow and the sputter wind): the explicit parameter, with ``depletion``, of the neutral dynamics.
- `depletion` (`float`) — Fraction of the ionization events that remove a neutral (1: full depletion, 0: a frozen gas).
- `field_bc` (`float | None`) — ``None`` for the electrodes at ``-voltage`` and 0 V. A number ``E_0`` (V/m) replaces them by a fixed axial field ``E_x = E_0`` at both ends (a pinned potential), so that a perturbation can be uniform along ``x``: the setting for comparing with the local dispersion relation.
- `heating_scale` (`float`) — Factor on the Joule heating of the electron energy (a diagnostic switch).
- `floor_added` (`dict`) — Running total of the density (summed over cells, m^-3) that the floor ``N_FLOOR`` on ``ne``, ``ni`` and ``N`` created in the Euler stages, a diagnostic of how much charge the limiter invents; reset it to zero to start counting.
- `anode_thermal_flux` (`bool`) — Adds the thermal flux of an absorbing wall, ``n v_bar / 2`` with ``v_bar = sqrt(8 e T_e / (pi m))`` (Hagelaar et al. 2000, reflection 0), to the drift flux of the electrons at the anode, which otherwise only leave at the drift rate; the outflow is then the larger of the two, and the density next to the anode falls to what carries the current. Tested for Boeuf's case without success: the 1D discharge then decays and runs away (no sheath barrier for the wall flux), so it is off.
- `diamagnetic` (`float`) — Factor on the electron pressure-gradient (diamagnetic) force in the fluxes and the Poisson solve (a diagnostic switch for the linear analysis; 1 is the model).
- `periodic_x` (`bool`) — Periodic along ``x`` as well, for a uniform plasma in a uniform field ``field_bc`` (required) and a uniform ``B``: pure Fourier modes ``(k_x, k_y)`` exist, which is what the local dispersion relation describes.
- `bohm` (`float`) — ``alpha`` of the anomalous frequency ``alpha omega_ce / 16`` (0 off).
- `external_sources` (`dict[str, np.ndarray]`) — Volume sources added to the time derivative of an unknown (``"ne"``, ``"ni"``, ``"N"``, ``"vx"``, ``"vy"``, ``"w"``), numbers or arrays on the cells, per unit time. :meth:`stationary_sources` returns the ones that make a given state stationary.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driftfluid2d.py#L634-L1602)

### wellbalanced.DriftFluid2D.anode_thermal_flux

*attribute* · *class attribute* · *instance attribute*

```python
anode_thermal_flux: bool = False
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driftfluid2d.py#L722-L722)

### wellbalanced.DriftFluid2D.bohm

*attribute* · *class attribute* · *instance attribute*

```python
bohm: float = 0.0
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driftfluid2d.py#L726-L726)

### wellbalanced.DriftFluid2D.cathode_current_density

*attribute* · *class attribute* · *instance attribute*

```python
cathode_current_density: float | None = None
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driftfluid2d.py#L714-L714)

### wellbalanced.DriftFluid2D.depletion

*attribute* · *class attribute* · *instance attribute*

```python
depletion: float = 1.0
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driftfluid2d.py#L717-L717)

### wellbalanced.DriftFluid2D.diamagnetic

*attribute* · *class attribute* · *instance attribute*

```python
diamagnetic: float = 1.0
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driftfluid2d.py#L721-L721)

### wellbalanced.DriftFluid2D.electron_temperature

*attribute* · *class attribute* · *instance attribute*

```python
electron_temperature: float | None = 5.0
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driftfluid2d.py#L704-L704)

### wellbalanced.DriftFluid2D.excitation_energy_ev

*attribute* · *class attribute* · *instance attribute*

```python
excitation_energy_ev: float = 11.56
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driftfluid2d.py#L712-L712)

### wellbalanced.DriftFluid2D.excitation_rate

*attribute* · *class attribute* · *instance attribute*

```python
excitation_rate: Callable[[Any], Any] | None = argon_excitation_rate
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driftfluid2d.py#L710-L710)

### wellbalanced.DriftFluid2D.external_sources

*attribute* · *class attribute* · *instance attribute*

```python
external_sources: dict[str, np.ndarray] = field(default_factory=dict)
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driftfluid2d.py#L727-L727)

### wellbalanced.DriftFluid2D.field_bc

*attribute* · *class attribute* · *instance attribute*

```python
field_bc: float | None = None
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driftfluid2d.py#L718-L718)

### wellbalanced.DriftFluid2D.floor_added

*attribute* · *class attribute* · *instance attribute*

```python
floor_added: dict = field(default_factory=lambda : {'ne': 0.0, 'ni': 0.0, 'N': 0.0})
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driftfluid2d.py#L723-L723)

### wellbalanced.DriftFluid2D.gas_density

*attribute* · *class attribute* · *instance attribute*

```python
gas_density: float = 1.45e+20
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driftfluid2d.py#L703-L703)

### wellbalanced.DriftFluid2D.heating_scale

*attribute* · *class attribute* · *instance attribute*

```python
heating_scale: float = 1.0
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driftfluid2d.py#L720-L720)

### wellbalanced.DriftFluid2D.ion_friction_rate

*attribute* · *class attribute* · *instance attribute*

```python
ion_friction_rate: float = 1e-15
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driftfluid2d.py#L706-L706)

### wellbalanced.DriftFluid2D.ion_mass_u

*attribute* · *class attribute* · *instance attribute*

```python
ion_mass_u: float = 39.948
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driftfluid2d.py#L707-L707)

### wellbalanced.DriftFluid2D.ion_temperature

*attribute* · *class attribute* · *instance attribute*

```python
ion_temperature: float = 0.025
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driftfluid2d.py#L708-L708)

### wellbalanced.DriftFluid2D.ionization_energy_ev

*attribute* · *class attribute* · *instance attribute*

```python
ionization_energy_ev: float = 15.76
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driftfluid2d.py#L711-L711)

### wellbalanced.DriftFluid2D.ionization_rate

*attribute* · *class attribute* · *instance attribute*

```python
ionization_rate: Callable[[Any], Any] = argon_ionization_rate
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driftfluid2d.py#L709-L709)

### wellbalanced.DriftFluid2D.length_x

*attribute* · *instance attribute*

```python
length_x: float
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driftfluid2d.py#L697-L697)

### wellbalanced.DriftFluid2D.length_y

*attribute* · *instance attribute*

```python
length_y: float
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driftfluid2d.py#L698-L698)

### wellbalanced.DriftFluid2D.magnetic_field

*attribute* · *class attribute* · *instance attribute*

```python
magnetic_field: Callable[[Any], Any] | float = 0.0
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driftfluid2d.py#L702-L702)

### wellbalanced.DriftFluid2D.momentum_rate

*attribute* · *class attribute* · *instance attribute*

```python
momentum_rate: float | Callable[[Any], Any] = argon_momentum_rate
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driftfluid2d.py#L705-L705)

### wellbalanced.DriftFluid2D.nx

*attribute* · *instance attribute*

```python
nx: int
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driftfluid2d.py#L699-L699)

### wellbalanced.DriftFluid2D.ny

*attribute* · *instance attribute*

```python
ny: int
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driftfluid2d.py#L700-L700)

### wellbalanced.DriftFluid2D.periodic_x

*attribute* · *class attribute* · *instance attribute*

```python
periodic_x: bool = False
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driftfluid2d.py#L719-L719)

### wellbalanced.DriftFluid2D.refill_rate

*attribute* · *class attribute* · *instance attribute*

```python
refill_rate: float = 10000.0
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driftfluid2d.py#L716-L716)

### wellbalanced.DriftFluid2D.secondary_emission

*attribute* · *class attribute* · *instance attribute*

```python
secondary_emission: float = 0.06
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driftfluid2d.py#L713-L713)

### wellbalanced.DriftFluid2D.secondary_energy_ev

*attribute* · *class attribute* · *instance attribute*

```python
secondary_energy_ev: float = 1.0
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driftfluid2d.py#L715-L715)

### wellbalanced.DriftFluid2D.voltage

*attribute* · *class attribute* · *instance attribute*

```python
voltage: float = 260.0
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driftfluid2d.py#L701-L701)

### wellbalanced.DriftFluid2D.charge_residual

*method*

```python
def charge_residual(state: DriftFluid2DState) -> float
```

Largest ``|eps0 div E - rho| / (e n)``: how far the state is from Poisson's equation.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driftfluid2d.py#L1594-L1602)

### wellbalanced.DriftFluid2D.electric_field

*method*

```python
def electric_field(state: DriftFluid2DState) -> np.ndarray
```

The cell-centre electric field ``(E_x, E_y)``, shape ``(2, nx, ny)`` (V/m).

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driftfluid2d.py#L1579-L1581)

### wellbalanced.DriftFluid2D.electron_flux

*method*

```python
def electron_flux(state: DriftFluid2DState)
```

The electron flux on the x-faces ``(nx + 1, ny)`` and the y-faces ``(nx, ny)`` (m^-2 s^-1).

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driftfluid2d.py#L1583-L1592)

### wellbalanced.DriftFluid2D.exb_velocity

*method*

```python
def exb_velocity(state: DriftFluid2DState) -> np.ndarray
```

The cell-centre E x B drift ``(E x B) / B^2``, shape ``(2, nx, ny)`` (m/s).

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driftfluid2d.py#L1573-L1577)

### wellbalanced.DriftFluid2D.initial_state

*method*

```python
def initial_state(density: float | np.ndarray = 1000000000000000.0, electron_temperature: float | None = None, gas_density: float | np.ndarray | None = None, potential: np.ndarray | None = None) -> DriftFluid2DState
```

A quasi-neutral plasma of ``density`` (a number or an ``(nx, ny)`` array).

The potential is the vacuum one (linear between the electrodes) unless given.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driftfluid2d.py#L943-L977)

### wellbalanced.DriftFluid2D.linear_modes

*method*

```python
def linear_modes(state: DriftFluid2DState, mode: int, frozen: tuple[str, ...] = (), epsilon: float = 1e-06) -> LinearModes
```

Linear stability of a y-uniform state to the azimuthal mode ``mode``, x-resolved.

The Jacobian of the semi-discrete operator (the time derivative of every unknown,
with the potential from Poisson's equation) about ``state``, restricted to
perturbations ``exp(i k y)``, ``k = 2 pi mode / length_y``: one column per unknown and
cell, by finite differences with a cosine and a sine perturbation (the operator is
real and invariant along ``y``, so the response to ``exp(i k y)`` stays in that
mode). The electrodes, the gradients, the Hall tensor and the energy equation are
all in it; nothing is x-uniform or local. The state is made stationary by
sources of its own residual (as :meth:`stationary_sources`); ``external_sources``
are restored afterwards.

``frozen`` switches off responses, to see what each does: ``"temperature"`` (``T_e``
held at its value, no energy perturbation), ``"ionization"`` (the ionization source held
at its base value), ``"gas"`` (the neutral density not perturbed).

With ``s = gamma - i omega`` the eigenvalues, ``exp(i k y + s t)``, ``gamma > 0``
grows and ``omega / k > 0`` moves along ``+y`` (the E x B direction when ``E_x < 0``
and ``B_z > 0``).

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driftfluid2d.py#L1285-L1379)

### wellbalanced.DriftFluid2D.run

*method*

```python
def run(state: DriftFluid2DState, t_end: float, dt: float | None = None, cfl: float = 0.4, record_every: float | None = None, probe_x: float | None = None, callback: Callable[[DriftFluid2DState], None] | None = None) -> Run
```

Advance ``state`` by ``t_end`` seconds and record the electron density along ``y``.

**Parameters**

- `state` (`DriftFluid2DState`) — The initial state.
- `t_end` (`float`) — The duration (s).
- `dt` (`float | None`) (default: `None`) — A fixed step (s); by default the step is re-chosen from ``cfl`` every 20 steps.
- `cfl` (`float`) (default: `0.4`) — The Courant number of the chosen step.
- `record_every` (`float | None`) (default: `None`) — The recording interval (s); ``t_end / 200`` by default.
- `probe_x` (`float | None`) (default: `None`) — Where along ``x`` to record (m); mid-gap by default.
- `callback` (`Callable[[DriftFluid2DState], None] | None`) (default: `None`) — Called with the state at every recording.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driftfluid2d.py#L1497-L1569)

### wellbalanced.DriftFluid2D.stationary_sources

*method*

```python
def stationary_sources(state: DriftFluid2DState) -> dict[str, np.ndarray]
```

The external sources that make ``state`` stationary (well-balanced equilibria).

Sets ``external_sources`` to ``-d u / d t`` of the state without them and returns
it, so that the state is a steady state of the discrete equations and only a
perturbation evolves; the way to test linear growth on an equilibrium that
the physical sources would not hold.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driftfluid2d.py#L1381-L1393)

### wellbalanced.DriftFluid2D.step

*method*

```python
def step(state: DriftFluid2DState, dt: float) -> DriftFluid2DState
```

Advance by ``dt`` with SSP-RK3; the potential of the result is that of the last stage.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driftfluid2d.py#L1460-L1470)

### wellbalanced.DriftFluid2D.suggest_timestep

*method*

```python
def suggest_timestep(state: DriftFluid2DState, cfl: float = 0.4) -> float
```

A step with Courant number ``cfl``: electron drift, ions, and diffusion.

The diffusive limit is that of the (explicit) energy and density diffusion with
``D = (5/3) mu_perp T_e``, which becomes the binding one where ``B`` is small
and the electrons are hot.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driftfluid2d.py#L1472-L1495)

## wellbalanced.DriftFluid2DState

*class* · *dataclass*

```python
class DriftFluid2DState
```

Re-exported from: `wellbalanced.driftfluid2d`

The fields on the ``(nx, ny)`` cells.

**Attributes**

- `x` (`np.ndarray`) — Cell centres along ``x`` (m).
- `y` (`np.ndarray`) — Cell centres along ``y`` (m).
- `electron_density` (`np.ndarray`) — ``n_e`` (m^-3).
- `ion_density` (`np.ndarray`) — ``n_i`` (m^-3).
- `ion_velocity` (`np.ndarray`) — ``(v_x, v_y)`` of the ions, shape ``(2, nx, ny)`` (m/s).
- `gas_density` (`np.ndarray`) — The neutral density ``N`` (m^-3).
- `electron_temperature` (`np.ndarray`) — ``T_e`` (eV).
- `potential` (`np.ndarray`) — ``phi`` (V).
- `time` (`float`) — Time (s).

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driftfluid2d.py#L187-L251)

### wellbalanced.DriftFluid2DState.electron_density

*attribute* · *instance attribute*

```python
electron_density: np.ndarray
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driftfluid2d.py#L205-L205)

### wellbalanced.DriftFluid2DState.electron_temperature

*attribute* · *instance attribute*

```python
electron_temperature: np.ndarray
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driftfluid2d.py#L209-L209)

### wellbalanced.DriftFluid2DState.gas_density

*attribute* · *instance attribute*

```python
gas_density: np.ndarray
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driftfluid2d.py#L208-L208)

### wellbalanced.DriftFluid2DState.ion_density

*attribute* · *instance attribute*

```python
ion_density: np.ndarray
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driftfluid2d.py#L206-L206)

### wellbalanced.DriftFluid2DState.ion_velocity

*attribute* · *instance attribute*

```python
ion_velocity: np.ndarray
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driftfluid2d.py#L207-L207)

### wellbalanced.DriftFluid2DState.potential

*attribute* · *instance attribute*

```python
potential: np.ndarray
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driftfluid2d.py#L210-L210)

### wellbalanced.DriftFluid2DState.time

*attribute* · *class attribute* · *instance attribute*

```python
time: float = 0.0
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driftfluid2d.py#L211-L211)

### wellbalanced.DriftFluid2DState.x

*attribute* · *instance attribute*

```python
x: np.ndarray
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driftfluid2d.py#L203-L203)

### wellbalanced.DriftFluid2DState.y

*attribute* · *instance attribute*

```python
y: np.ndarray
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driftfluid2d.py#L204-L204)

### wellbalanced.DriftFluid2DState.copy

*method*

```python
def copy() -> DriftFluid2DState
```

A deep copy.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driftfluid2d.py#L213-L225)

### wellbalanced.DriftFluid2DState.to_dataset

*method*

```python
def to_dataset() -> xr.Dataset
```

The state as a labelled dataset on ``(x, y)``.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driftfluid2d.py#L227-L251)

## wellbalanced.DriverCoupling

*class* · *dataclass*

```python
class DriverCoupling
```

Re-exported from: `wellbalanced.spatial.coupling`

A field model and a power-dependent plasma model, solved together.

**Attributes**

- `field` (`Callable[[PlasmaProfile], InductiveField2D]`) — ``profile -> InductiveField2D``.
- `plasma` (`Callable[[float], tuple[PlasmaProfile, Any]]`) — ``absorbed power [W] -> (PlasmaProfile, anything)``.
- `network_resistance` (`float`) — ``R_net`` [Ohm].
- `depth` (`float | None`) — The effective depth of a cut [m]; ``None`` in r–z.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/spatial/coupling.py#L112-L193)

### wellbalanced.DriverCoupling.depth

*attribute* · *class attribute* · *instance attribute*

```python
depth: float | None = None
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/spatial/coupling.py#L126-L126)

### wellbalanced.DriverCoupling.field

*attribute* · *instance attribute*

```python
field: Callable[[PlasmaProfile], InductiveField2D]
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/spatial/coupling.py#L123-L123)

### wellbalanced.DriverCoupling.network_resistance

*attribute* · *instance attribute*

```python
network_resistance: float
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/spatial/coupling.py#L125-L125)

### wellbalanced.DriverCoupling.plasma

*attribute* · *instance attribute*

```python
plasma: Callable[[float], tuple[PlasmaProfile, Any]]
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/spatial/coupling.py#L124-L124)

### wellbalanced.DriverCoupling.at_absorbed_power

*method*

```python
def at_absorbed_power(power: float) -> CoupledState
```

The operating point where the plasma absorbs ``power`` W.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/spatial/coupling.py#L132-L147)

### wellbalanced.DriverCoupling.at_rf_power

*method*

```python
def at_rf_power(rf_power: float, *, guess: float | None = None, tolerance: float = 1e-06, max_iterations: int = 50, relaxation: float = 1.0) -> CoupledState
```

The operating point at the generator power ``rf_power`` W.

Iterates ``P <- P + relaxation (eta(P) P_RF - P)`` from ``guess`` (half the
generator power by default) until ``|eta P_RF - P| < tolerance P_RF``.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/spatial/coupling.py#L149-L193)

## wellbalanced.DriverState

*class* · *dataclass*

```python
class DriverState
```

Re-exported from: `wellbalanced.driver`

A driver at one absorbed power: its plasma and the coil's view of it.

**Attributes**

- `plasma` (`GlobalState`) — The steady state of the driver's global model.
- `power` (`float`) — The power the plasma absorbs in W.
- `frequency` (`float`) — The RF frequency in Hz.
- `collision_frequency` (`float`) — The electrons' momentum-transfer frequency ``nu_m`` (1/s).
- `coil_impedance` (`complex`) — ``Z_s`` in Ohm; its real part is ``R_s``.
- `network_resistance` (`float`) — ``R_net`` in Ohm.
- `skin_depth` (`float`) — ``1 / Re k`` in m.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driver.py#L214-L282)

### wellbalanced.DriverState.coil_impedance

*attribute* · *instance attribute*

```python
coil_impedance: complex
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driver.py#L232-L232)

### wellbalanced.DriverState.collision_frequency

*attribute* · *instance attribute*

```python
collision_frequency: float
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driver.py#L231-L231)

### wellbalanced.DriverState.frequency

*attribute* · *instance attribute*

```python
frequency: float
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driver.py#L230-L230)

### wellbalanced.DriverState.network_resistance

*attribute* · *instance attribute*

```python
network_resistance: float
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driver.py#L233-L233)

### wellbalanced.DriverState.plasma

*attribute* · *instance attribute*

```python
plasma: GlobalState
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driver.py#L228-L228)

### wellbalanced.DriverState.power

*attribute* · *instance attribute*

```python
power: float
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driver.py#L229-L229)

### wellbalanced.DriverState.skin_depth

*attribute* · *instance attribute*

```python
skin_depth: float
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driver.py#L234-L234)

### wellbalanced.DriverState.coil_current

*property*

```python
coil_current: float
```

The coil current amplitude ``sqrt(2 P / R_s)`` in A.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driver.py#L242-L244)

### wellbalanced.DriverState.coil_voltage

*property*

```python
coil_voltage: float
```

The voltage amplitude across the coil, ``|Z_s| I``, in V.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driver.py#L247-L249)

### wellbalanced.DriverState.efficiency

*property*

```python
efficiency: float
```

The RF power transfer efficiency ``R_s / (R_s + R_net)``.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driver.py#L252-L255)

### wellbalanced.DriverState.plasma_resistance

*property*

```python
plasma_resistance: float
```

``R_s = Re Z_s`` in Ohm.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driver.py#L237-L239)

### wellbalanced.DriverState.rf_power

*property*

```python
rf_power: float
```

The power the generator delivers, ``P / eta``, in W.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driver.py#L258-L260)

### wellbalanced.DriverState.to_dataset

*method*

```python
def to_dataset() -> xr.Dataset
```

The plasma's dataset with the coupling's quantities.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driver.py#L262-L282)

## wellbalanced.Fluid1D

*class* · *dataclass*

```python
class Fluid1D
```

Re-exported from: `wellbalanced.fluid1d`

A plasma between ``x = 0`` and ``length`` on ``cells`` cells; see the module docstring.

**Attributes**

- `species` (`Sequence[FluidSpecies]`) — The fluid species, the electrons (``"e"``) included.
- `reactions` (`Sequence[Reaction]`) — The volume reactions; reactants that are not fluid species must be in ``fixed``.
- `length` (`float`) — The domain length (m).
- `cells` (`int`) — The number of cells.
- `fixed` (`Mapping[str, float | np.ndarray]`) — Densities of species not carried by the model, e.g. the gas (m^-3, a number or an array on the cells).
- `gas_temperature` (`float`) — ``T_g`` in eV.
- `electron_temperature` (`float | None`) — ``None`` solves the electron energy equation; a number holds ``T_e`` fixed (isothermal electrons).
- `boundaries` (`dict[str, dict[str, Boundary]]`) — ``{"left": {species: Boundary}, "right": {...}}``; a species missing at an end has a wall there.
- `potential` (`dict[str, PotentialBoundary]`) — ``{"left": PotentialBoundary, "right": ...}``; grounded if missing.
- `heating` (`float | np.ndarray`) — Power to the electrons (W/m^3), a number or an array on the cells.
- `sources` (`Mapping[str, float | np.ndarray]`) — External volume sources ``{species: rate}`` (m^-3 s^-1), numbers or arrays on the cells.
- `volume_sources` (`Sequence[VolumeSource]`) — External sources as for the global model, e.g. a beam's (:meth:`wellbalanced.neutralizer.Neutralizer.beam_sources`): rates per unit density of fluid or fixed species, numbers or arrays on the cells, with the energy they give the electrons.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/fluid1d.py#L281-L1000)

### wellbalanced.Fluid1D.boundaries

*attribute* · *class attribute* · *instance attribute*

```python
boundaries: dict[str, dict[str, Boundary]] = field(default_factory=dict)
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/fluid1d.py#L315-L315)

### wellbalanced.Fluid1D.cells

*attribute* · *instance attribute*

```python
cells: int
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/fluid1d.py#L311-L311)

### wellbalanced.Fluid1D.electron_temperature

*attribute* · *class attribute* · *instance attribute*

```python
electron_temperature: float | None = None
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/fluid1d.py#L314-L314)

### wellbalanced.Fluid1D.fixed

*attribute* · *class attribute* · *instance attribute*

```python
fixed: Mapping[str, float | np.ndarray] = field(default_factory=dict)
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/fluid1d.py#L312-L312)

### wellbalanced.Fluid1D.gas_temperature

*attribute* · *class attribute* · *instance attribute*

```python
gas_temperature: float = 0.025
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/fluid1d.py#L313-L313)

### wellbalanced.Fluid1D.heating

*attribute* · *class attribute* · *instance attribute*

```python
heating: float | np.ndarray = 0.0
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/fluid1d.py#L317-L317)

### wellbalanced.Fluid1D.length

*attribute* · *instance attribute*

```python
length: float
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/fluid1d.py#L310-L310)

### wellbalanced.Fluid1D.potential

*attribute* · *class attribute* · *instance attribute*

```python
potential: dict[str, PotentialBoundary] = field(default_factory=dict)
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/fluid1d.py#L316-L316)

### wellbalanced.Fluid1D.reactions

*attribute* · *instance attribute*

```python
reactions: Sequence[Reaction]
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/fluid1d.py#L309-L309)

### wellbalanced.Fluid1D.sources

*attribute* · *class attribute* · *instance attribute*

```python
sources: Mapping[str, float | np.ndarray] = field(default_factory=dict)
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/fluid1d.py#L318-L318)

### wellbalanced.Fluid1D.species

*attribute* · *instance attribute*

```python
species: Sequence[FluidSpecies]
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/fluid1d.py#L308-L308)

### wellbalanced.Fluid1D.volume_sources

*attribute* · *class attribute* · *instance attribute*

```python
volume_sources: Sequence[VolumeSource] = ()
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/fluid1d.py#L319-L319)

### wellbalanced.Fluid1D.advance

*method*

```python
def advance(unknowns: np.ndarray, duration: float, dt: float) -> np.ndarray
```

Step ``duration`` seconds with steps of at most ``dt``, halving failed ones.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/fluid1d.py#L882-L895)

### wellbalanced.Fluid1D.balance

*method*

```python
def balance(state: FluidState) -> dict[str, float]
```

Return the volume source minus the net outflow of every species.

In m^-2 s^-1 (per unit area of the slab); zero at a steady state.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/fluid1d.py#L986-L1000)

### wellbalanced.Fluid1D.boundary

*method*

```python
def boundary(end: str, name: str) -> Boundary
```

The condition of a species at an end (a wall unless set).

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/fluid1d.py#L369-L371)

### wellbalanced.Fluid1D.energy_balance

*method*

```python
def energy_balance(state: FluidState) -> dict[str, float]
```

Return the electron energy terms, integrated over the slab (eV m^-2 s^-1).

``heating`` (external), ``field`` (work of the field, ``-Gamma_e E``),
``reactions`` (lost in collisions, negative), ``sources`` (given by the
volume sources) and ``walls`` (the energy flux out through both ends,
negative); at a steady state they sum to zero.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/fluid1d.py#L951-L984)

### wellbalanced.Fluid1D.pack

*method*

```python
def pack(densities: Mapping[str, np.ndarray | float], electron_temperature: np.ndarray | float = 2.0, potential: np.ndarray | float = 0.0, fluxes: Mapping[str, np.ndarray | float] | None = None) -> np.ndarray
```

The unknowns of fields on the cells (densities by name, ``T_e``, ``phi``).

``fluxes`` start the species with momentum: on the ``cells + 1`` faces
(as :attr:`FluidState.fluxes`), on the ``cells - 1`` faces between
cells, or a number; zero if missing.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/fluid1d.py#L407-L437)

### wellbalanced.Fluid1D.set_boundary

*method*

```python
def set_boundary(end: str, name: str, boundary: Boundary) -> None
```

Change the condition of a species at an end, e.g. between steps.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/fluid1d.py#L373-L377)

### wellbalanced.Fluid1D.state

*method*

```python
def state(unknowns: np.ndarray, time: float = 0.0, converged: bool = True) -> FluidState
```

The :class:`FluidState` of a vector of unknowns.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/fluid1d.py#L932-L949)

### wellbalanced.Fluid1D.steady_state

*method*

```python
def steady_state(unknowns: np.ndarray, *, dt: float = 1e-09, growth: float = 2.0, max_dt: float = 1.0, max_steps: int = 400) -> FluidState
```

Return the steady state.

Steps in pseudo-time from ``unknowns`` with a step growing from ``dt`` up
to ``max_dt``, then solves the steady equations from there. A failed step
is retried with a quarter of it; below a millionth of the first step the
search stops and the state is returned with ``converged=False``.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/fluid1d.py#L897-L930)

### wellbalanced.Fluid1D.step

*method*

```python
def step(unknowns: np.ndarray, dt: float) -> tuple[np.ndarray, bool]
```

One backward-Euler step of ``dt`` seconds; return the new unknowns and success.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/fluid1d.py#L878-L880)

## wellbalanced.FluidSpecies

*class* · *dataclass*

```python
class FluidSpecies
```

Re-exported from: `wellbalanced.fluid1d`

A species carried by the fluid model.

**Attributes**

- `species` (`Species`) — Name, mass and charge.
- `mobility` (`float`) — ``mu`` in m^2/(V s) (charged species).
- `diffusion` (`float | None`) — ``D`` in m^2/s; for a charged species ``None`` takes the Einstein relation ``D = mu T`` (``T_e`` for electrons, ``T_g`` for ions).
- `momentum` (`bool`) — Solve the momentum equation of this ion species (with the friction ``e / (M mu)`` of its mobility) instead of drift-diffusion.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/fluid1d.py#L93-L132)

### wellbalanced.FluidSpecies.diffusion

*attribute* · *class attribute* · *instance attribute*

```python
diffusion: float | None = None
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/fluid1d.py#L108-L108)

### wellbalanced.FluidSpecies.mobility

*attribute* · *class attribute* · *instance attribute*

```python
mobility: float = 0.0
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/fluid1d.py#L107-L107)

### wellbalanced.FluidSpecies.momentum

*attribute* · *class attribute* · *instance attribute*

```python
momentum: bool = False
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/fluid1d.py#L109-L109)

### wellbalanced.FluidSpecies.species

*attribute* · *instance attribute*

```python
species: Species
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/fluid1d.py#L106-L106)

### wellbalanced.FluidSpecies.name

*property*

```python
name: str
```

The species name.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/fluid1d.py#L130-L132)

## wellbalanced.FluidState

*class* · *dataclass*

```python
class FluidState
```

Re-exported from: `wellbalanced.fluid1d`

The fields on the cells and the fluxes on the faces.

**Attributes**

- `x` (`np.ndarray`) — Cell centres (m).
- `faces` (`np.ndarray`) — Face positions (m).
- `densities` (`dict[str, np.ndarray]`) — Density of every fluid species on the cells (m^-3).
- `electron_temperature` (`np.ndarray`) — ``T_e`` on the cells (eV).
- `potential` (`np.ndarray`) — ``phi`` on the cells (V).
- `fluxes` (`dict[str, np.ndarray]`) — Flux of every fluid species on the faces (m^-2 s^-1), positive along ``x``; ``"energy"`` is the electron energy flux (eV m^-2 s^-1).
- `reaction_rates` (`dict[str, np.ndarray]`) — Volume rate of every reaction on the cells (m^-3 s^-1).
- `time` (`float`) — Time (s) of the state; ``inf`` for a steady state.
- `converged` (`bool`) — Whether the last solve converged.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/fluid1d.py#L189-L278)

### wellbalanced.FluidState.converged

*attribute* · *class attribute* · *instance attribute*

```python
converged: bool = True
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/fluid1d.py#L214-L214)

### wellbalanced.FluidState.densities

*attribute* · *instance attribute*

```python
densities: dict[str, np.ndarray]
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/fluid1d.py#L208-L208)

### wellbalanced.FluidState.electron_temperature

*attribute* · *instance attribute*

```python
electron_temperature: np.ndarray
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/fluid1d.py#L209-L209)

### wellbalanced.FluidState.faces

*attribute* · *instance attribute*

```python
faces: np.ndarray
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/fluid1d.py#L207-L207)

### wellbalanced.FluidState.fluxes

*attribute* · *instance attribute*

```python
fluxes: dict[str, np.ndarray]
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/fluid1d.py#L211-L211)

### wellbalanced.FluidState.potential

*attribute* · *instance attribute*

```python
potential: np.ndarray
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/fluid1d.py#L210-L210)

### wellbalanced.FluidState.reaction_rates

*attribute* · *instance attribute*

```python
reaction_rates: dict[str, np.ndarray]
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/fluid1d.py#L212-L212)

### wellbalanced.FluidState.time

*attribute* · *class attribute* · *instance attribute*

```python
time: float = 0.0
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/fluid1d.py#L213-L213)

### wellbalanced.FluidState.x

*attribute* · *instance attribute*

```python
x: np.ndarray
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/fluid1d.py#L206-L206)

### wellbalanced.FluidState.integral

*method*

```python
def integral(values: np.ndarray) -> float
```

The integral of a cell field over the domain.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/fluid1d.py#L216-L218)

### wellbalanced.FluidState.to_dataset

*method*

```python
def to_dataset() -> xr.Dataset
```

The state as a labelled dataset.

Fields on the cells ``x``, fluxes on the faces ``x_face``, per ``species`` and
``reaction``.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/fluid1d.py#L230-L278)

### wellbalanced.FluidState.velocity

*method*

```python
def velocity(name: str) -> np.ndarray
```

The mean velocity of a species on the faces (m/s): its flux over the density there.

The density on a face between cells is the mean of the two; on an end
face, that of the cell next to it.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/fluid1d.py#L220-L228)

## wellbalanced.GasDynamics

*class*

```python
class GasDynamics
```

Re-exported from: `wellbalanced.gasdynamics`

Two-species compressible gas in 1D or 2D; see the module docstring.

**Parameters**

- `length` (`float`) — Length of the domain along ``x`` in m (the target at ``x = 0``).
- `cells` (`int`) — Number of cells along ``x``.
- `width` (`float`) (default: `1.0`) — Width in ``y`` in m (the depth of a 1D model: totals are per m^2 for 1).
- `cells_y` (`int`) (default: `1`) — Number of cells along ``y`` (1: one-dimensional).
- `gas_mass` (`float`) (default: `ARGON_MASS`) — The mass of an atom of the gas in kg (argon).
- `metal_mass` (`float`) (default: `47.867 * ATOMIC_MASS`) — The mass of a metal atom in kg (titanium by default).
- `gamma` (`float`) (default: `5.0 / 3.0`) — The adiabatic index (5/3: monatomic).
- `diffusion` (`float | Callable[[np.ndarray, np.ndarray], np.ndarray] | None`) (default: `None`) — The binary diffusion coefficient ``D`` in m^2/s: a number or a function of the temperature (K) and the pressure (Pa) arrays (see :func:`binary_diffusion`). ``None``: no diffusion.
- `thermal_conductivity` (`float | Callable[[np.ndarray], np.ndarray]`) (default: `0.0`) — ``kappa`` in W/(m K) (number or function of ``T``); 0: none.
- `boundaries` (`Mapping[str, Boundary] | None`) (default: `None`) — The conditions at ``"left"`` and ``"right"`` (default: a wall at the left, an outflow at the right).
- `limiter` (`str`) (default: `'vanleer'`) — ``"minmod"``, ``"vanleer"`` (default), ``"mc"`` or ``"none"`` (central slopes: second order on smooth flow, not monotone).
- `cfl` (`float`) (default: `0.4`) — The Courant number of the hyperbolic step.
- `source_cfl` (`float`) (default: `0.2`) — The largest share of the content of a cell that a wall emission, a source or a sink may add or remove in one step.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/gasdynamics.py#L539-L1209)

### wellbalanced.GasDynamics.boundaries

*attribute* · *instance attribute*

```python
boundaries: dict[str, Boundary] = {'left': Boundary.wall(), 'right': Boundary.outflow()}
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/gasdynamics.py#L597-L600)

### wellbalanced.GasDynamics.budget

*attribute* · *instance attribute*

```python
budget = dict.fromkeys(QUANTITIES, 0.0)
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/gasdynamics.py#L621-L621)

### wellbalanced.GasDynamics.cfl

*attribute* · *instance attribute*

```python
cfl = cfl
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/gasdynamics.py#L595-L595)

### wellbalanced.GasDynamics.diffusion

*attribute* · *instance attribute*

```python
diffusion = diffusion
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/gasdynamics.py#L592-L592)

### wellbalanced.GasDynamics.exchange

*attribute* · *instance attribute*

```python
exchange: list[IonExchange] = []
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/gasdynamics.py#L613-L613)

### wellbalanced.GasDynamics.gamma

*attribute* · *instance attribute*

```python
gamma = gamma
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/gasdynamics.py#L591-L591)

### wellbalanced.GasDynamics.limiter

*attribute* · *instance attribute*

```python
limiter = limiter
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/gasdynamics.py#L594-L594)

### wellbalanced.GasDynamics.masses

*attribute* · *instance attribute*

```python
masses = {'gas': gas_mass, 'metal': metal_mass}
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/gasdynamics.py#L590-L590)

### wellbalanced.GasDynamics.relaxation

*attribute* · *instance attribute*

```python
relaxation: list[ThermalRelaxation] = []
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/gasdynamics.py#L614-L614)

### wellbalanced.GasDynamics.sink_frequencies

*attribute* · *instance attribute*

```python
sink_frequencies: dict[str, float | np.ndarray] = {}
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/gasdynamics.py#L612-L612)

### wellbalanced.GasDynamics.sinks

*attribute* · *instance attribute*

```python
sinks: dict[str, float | np.ndarray] = {}
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/gasdynamics.py#L611-L611)

### wellbalanced.GasDynamics.source_cfl

*attribute* · *instance attribute*

```python
source_cfl = source_cfl
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/gasdynamics.py#L596-L596)

### wellbalanced.GasDynamics.sources

*attribute* · *instance attribute*

```python
sources: list[VolumeSource] = []
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/gasdynamics.py#L610-L610)

### wellbalanced.GasDynamics.steps

*attribute* · *instance attribute*

```python
steps = 0
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/gasdynamics.py#L618-L618)

### wellbalanced.GasDynamics.thermal_conductivity

*attribute* · *instance attribute*

```python
thermal_conductivity = thermal_conductivity
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/gasdynamics.py#L593-L593)

### wellbalanced.GasDynamics.time

*attribute* · *instance attribute*

```python
time = 0.0
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/gasdynamics.py#L617-L617)

### wellbalanced.GasDynamics.x

*attribute* · *instance attribute*

```python
x = np.arange(cells) + 0.5 * self.dx
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/gasdynamics.py#L615-L615)

### wellbalanced.GasDynamics.y

*attribute* · *instance attribute*

```python
y = np.arange(cells_y) + 0.5 * self.dy
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/gasdynamics.py#L616-L616)

### wellbalanced.GasDynamics.run

*method*

```python
def run(t_end: float, *, callback: Callable[[GasDynamics], None] | None = None, every: int = 1) -> GasState
```

Step until ``time == t_end`` (the last step is shortened); returns the state.

**Parameters**

- `t_end` (`float`) — The end time in s.
- `callback` (`Callable[[GasDynamics], None] | None`) (default: `None`) — Called with the model after every ``every`` steps.
- `every` (`int`) (default: `1`) — The interval of the callback in steps.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/gasdynamics.py#L1145-L1166)

### wellbalanced.GasDynamics.set_state

*method*

```python
def set_state(gas_density: float | np.ndarray, metal_density: float | np.ndarray = 0.0, u: float | np.ndarray = 0.0, v: float | np.ndarray = 0.0, pressure: float | np.ndarray = 1.0, *, time: float = 0.0) -> None
```

Set the gas: mass densities (kg/m^3), velocities (m/s) and the pressure (Pa).

Each is a number, an array of ``(nx,)`` along ``x`` (``(nx, 1)`` is also
accepted) or of the grid's shape.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/gasdynamics.py#L627-L665)

### wellbalanced.GasDynamics.set_uniform

*method*

```python
def set_uniform(pressure: float, temperature: float, metal_fraction: float = 0.0) -> None
```

A gas at rest of one pressure, temperature and metal mass fraction.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/gasdynamics.py#L667-L676)

### wellbalanced.GasDynamics.stable_step

*method*

```python
def stable_step() -> float
```

The acoustic CFL time step of the current state.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/gasdynamics.py#L944-L953)

### wellbalanced.GasDynamics.state

*method*

```python
def state() -> GasState
```

The current gas as a :class:`GasState`.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/gasdynamics.py#L692-L708)

### wellbalanced.GasDynamics.steady_state

*method*

```python
def steady_state(tolerance: float = 1e-08, max_time: float = 1.0, check_every: int = 200) -> GasState
```

Step until the density of the gas and of the metal stop changing.

Stops when the largest relative change of the densities over ``check_every``
steps, per unit time of ``length / c``, is below ``tolerance``.

**Raises**

- `RuntimeError` — If ``max_time`` is reached first.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/gasdynamics.py#L1168-L1209)

### wellbalanced.GasDynamics.step

*method*

```python
def step(dt: float | None = None) -> float
```

Advance one step (the stable step by default); returns the step taken.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/gasdynamics.py#L1121-L1139)

### wellbalanced.GasDynamics.temperature

*method*

```python
def temperature(prim: np.ndarray | None = None) -> np.ndarray
```

The temperature field in K.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/gasdynamics.py#L687-L690)

### wellbalanced.GasDynamics.totals

*method*

```python
def totals() -> dict[str, float]
```

The integrals of the conserved quantities over the domain (per unit depth).

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/gasdynamics.py#L710-L717)

## wellbalanced.GasState

*class* · *dataclass*

```python
class GasState
```

Re-exported from: `wellbalanced.gasdynamics`

The gas on the grid: the primitive variables at one time.

**Attributes**

- `time` (`float`) — The time in s.
- `x` (`np.ndarray`) — Cell centres along the axis, m.
- `y` (`np.ndarray`) — Cell centres across, m.
- `gas_density` (`np.ndarray`) — Argon mass density, kg/m^3, shape ``(nx, ny)``.
- `metal_density` (`np.ndarray`) — Metal mass density, kg/m^3.
- `u` (`np.ndarray`) — Axial velocity, m/s.
- `v` (`np.ndarray`) — Azimuthal velocity, m/s.
- `pressure` (`np.ndarray`) — Pressure, Pa.
- `temperature` (`np.ndarray`) — Temperature, K.
- `gas_number` (`np.ndarray`) — Argon number density, m^-3.
- `metal_number` (`np.ndarray`) — Metal number density, m^-3.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/gasdynamics.py#L291-L346)

### wellbalanced.GasState.gas_density

*attribute* · *instance attribute*

```python
gas_density: np.ndarray
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/gasdynamics.py#L312-L312)

### wellbalanced.GasState.gas_number

*attribute* · *instance attribute*

```python
gas_number: np.ndarray
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/gasdynamics.py#L318-L318)

### wellbalanced.GasState.metal_density

*attribute* · *instance attribute*

```python
metal_density: np.ndarray
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/gasdynamics.py#L313-L313)

### wellbalanced.GasState.metal_number

*attribute* · *instance attribute*

```python
metal_number: np.ndarray
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/gasdynamics.py#L319-L319)

### wellbalanced.GasState.pressure

*attribute* · *instance attribute*

```python
pressure: np.ndarray
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/gasdynamics.py#L316-L316)

### wellbalanced.GasState.temperature

*attribute* · *instance attribute*

```python
temperature: np.ndarray
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/gasdynamics.py#L317-L317)

### wellbalanced.GasState.time

*attribute* · *instance attribute*

```python
time: float
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/gasdynamics.py#L309-L309)

### wellbalanced.GasState.u

*attribute* · *instance attribute*

```python
u: np.ndarray
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/gasdynamics.py#L314-L314)

### wellbalanced.GasState.v

*attribute* · *instance attribute*

```python
v: np.ndarray
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/gasdynamics.py#L315-L315)

### wellbalanced.GasState.x

*attribute* · *instance attribute*

```python
x: np.ndarray
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/gasdynamics.py#L310-L310)

### wellbalanced.GasState.y

*attribute* · *instance attribute*

```python
y: np.ndarray
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/gasdynamics.py#L311-L311)

### wellbalanced.GasState.to_dataset

*method*

```python
def to_dataset() -> xr.Dataset
```

The state as a labelled dataset: ``x`` (and ``y`` when the grid has more than one cell).

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/gasdynamics.py#L321-L346)

## wellbalanced.GasTemperature

*class* · *dataclass*

```python
class GasTemperature
```

Re-exported from: `wellbalanced.global_model`

The gas temperature as a balance: heating by the reactions against conduction.

The conduction loss is ``kappa (T_g - T_w) / Lambda^2`` (W/m^3), with the
thermal conductivity ``kappa`` (W/m/K) and the diffusion length ``Lambda``
(m) of the chamber. ``heat_capacity`` is the heat capacity per particle in
units of ``k`` (3/2 for atoms, 5/2 for diatomic molecules), which only sets
how fast the temperature moves towards its steady state.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/global_model.py#L137-L156)

### wellbalanced.GasTemperature.conductivity

*attribute* · *instance attribute*

```python
conductivity: float
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/global_model.py#L149-L149)

### wellbalanced.GasTemperature.diffusion_length

*attribute* · *instance attribute*

```python
diffusion_length: float
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/global_model.py#L150-L150)

### wellbalanced.GasTemperature.heat_capacity

*attribute* · *class attribute* · *instance attribute*

```python
heat_capacity: float = 2.5
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/global_model.py#L151-L151)

### wellbalanced.GasTemperature.wall_temperature

*attribute* · *instance attribute*

```python
wall_temperature: float
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/global_model.py#L148-L148)

## wellbalanced.GlobalModel

*class* · *dataclass*

```python
class GlobalModel
```

Re-exported from: `wellbalanced.global_model`

The balances of a plasma in a chamber; see the module docstring.

**Attributes**

- `species` (`Sequence[Species]`) — Every species, the electrons (named ``"e"``) included.
- `reactions` (`Sequence[Reaction]`) — The volume reactions.
- `chamber` (`Chamber`) — Volume, walls and confinement.
- `power` (`float | Callable[[float], float]`) — Power absorbed by the electrons in W, or a function of the time in s, ``power(t)``, for :meth:`GlobalModel.evolve` (a steady state is then taken at ``t = 0``).
- `fixed` (`Mapping[str, float]`) — Densities held fixed (m^-3), e.g. a gas at a given pressure.
- `feed` (`Mapping[str, float]`) — Particles per second fed into the chamber, by species.
- `pumping_speed` (`float`) — Volume per second (m^3/s) pumped out, of every neutral species that is not held fixed.
- `sources` (`Sequence[VolumeSource]`) — External volume sources.
- `wall_reactions` (`Sequence[WallReaction]`) — Losses of neutral species at the walls.
- `ion_wall_products` (`Mapping[str, Mapping[str, float]]`) — What an ion returns to the volume after reaching the wall, ``{ion: {product: number}}``, e.g. ``{"H2+": {"H2": 1}}``.
- `gas_temperature` (`float | GasTemperature`) — A fixed gas temperature in eV, or its balance.
- `thermalize_electrons` (`bool`) — Keep ``T_e >= T_g``. Without sources of energy the wall losses cool the electrons of a decaying plasma below the gas, which no elastic collision allows; set it for afterglows.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/global_model.py#L308-L715)

### wellbalanced.GlobalModel.chamber

*attribute* · *instance attribute*

```python
chamber: Chamber
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/global_model.py#L335-L335)

### wellbalanced.GlobalModel.feed

*attribute* · *class attribute* · *instance attribute*

```python
feed: Mapping[str, float] = field(default_factory=dict)
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/global_model.py#L338-L338)

### wellbalanced.GlobalModel.fixed

*attribute* · *class attribute* · *instance attribute*

```python
fixed: Mapping[str, float] = field(default_factory=dict)
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/global_model.py#L337-L337)

### wellbalanced.GlobalModel.gas_temperature

*attribute* · *class attribute* · *instance attribute*

```python
gas_temperature: float | GasTemperature = 0.025
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/global_model.py#L343-L343)

### wellbalanced.GlobalModel.ion_wall_products

*attribute* · *class attribute* · *instance attribute*

```python
ion_wall_products: Mapping[str, Mapping[str, float]] = field(default_factory=dict)
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/global_model.py#L342-L342)

### wellbalanced.GlobalModel.power

*attribute* · *class attribute* · *instance attribute*

```python
power: float | Callable[[float], float] = 0.0
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/global_model.py#L336-L336)

### wellbalanced.GlobalModel.pumping_speed

*attribute* · *class attribute* · *instance attribute*

```python
pumping_speed: float = 0.0
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/global_model.py#L339-L339)

### wellbalanced.GlobalModel.reactions

*attribute* · *instance attribute*

```python
reactions: Sequence[Reaction]
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/global_model.py#L334-L334)

### wellbalanced.GlobalModel.sources

*attribute* · *class attribute* · *instance attribute*

```python
sources: Sequence[VolumeSource] = ()
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/global_model.py#L340-L340)

### wellbalanced.GlobalModel.species

*attribute* · *instance attribute*

```python
species: Sequence[Species]
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/global_model.py#L333-L333)

### wellbalanced.GlobalModel.thermalize_electrons

*attribute* · *class attribute* · *instance attribute*

```python
thermalize_electrons: bool = False
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/global_model.py#L344-L344)

### wellbalanced.GlobalModel.wall_reactions

*attribute* · *class attribute* · *instance attribute*

```python
wall_reactions: Sequence[WallReaction] = ()
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/global_model.py#L341-L341)

### wellbalanced.GlobalModel.evaluate

*method*

```python
def evaluate(state: np.ndarray, converged: bool = True, t: float = 0.0) -> GlobalState
```

Return the :class:`GlobalState` of a state vector at ``t``, with every term.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/global_model.py#L581-L605)

### wellbalanced.GlobalModel.evolve

*method*

```python
def evolve(times: Sequence[float] | np.ndarray, initial: Mapping[str, float] | GlobalState | None = None, *, breakpoints: Sequence[float] = ()) -> list[GlobalState]
```

The states at ``times`` (s) of the balances integrated in time.

The integration starts at ``times[0]`` from ``initial`` (see
:meth:`steady_state`) with an implicit method, driven by ``power(t)`` if
that is a function. Stop at every ``breakpoints`` time inside the
interval, where the drive jumps (the edges of a pulse), so the step
size does not have to find them.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/global_model.py#L651-L693)

### wellbalanced.GlobalModel.scan

*method*

```python
def scan(parameter: str, values: Sequence[Any], **guess: float) -> list[GlobalState]
```

Steady states for every value of a field of the model.

Each starts from the last (a continuation); ``guess`` starts the first.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/global_model.py#L701-L715)

### wellbalanced.GlobalModel.steady_state

*method*

```python
def steady_state(initial: Mapping[str, float] | GlobalState | None = None, *, t_max: float = 10.0, tolerance: float = 1e-08) -> GlobalState
```

Return the steady state.

The balances are integrated in pseudo-time from ``initial`` (densities
by name, ``"Te"`` and ``"Tg"`` in eV; a previous :class:`GlobalState`
for a continuation) with an implicit method for up to ``t_max``
seconds, and the end point refined with a root finder. ``converged`` is
set when every relative rate of change is below ``tolerance`` times the
fastest rate of the model's processes.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/global_model.py#L609-L649)

## wellbalanced.GlobalState

*class* · *dataclass*

```python
class GlobalState
```

Re-exported from: `wellbalanced.global_model`

A solution of the global model, with every term of its balances.

**Attributes**

- `densities` (`dict[str, float]`) — Every species' density in m^-3, the electrons included.
- `electron_temperature` (`float`) — ``T_e`` in eV.
- `gas_temperature` (`float`) — ``T_g`` in eV.
- `reaction_rates` (`dict[str, float]`) — Volume rate of every reaction (m^-3 s^-1), by name.
- `wall_losses` (`dict[str, float]`) — Volume rate at which every species reaches the walls (m^-3 s^-1), the electrons included.
- `power` (`dict[str, float]`) — Electron power terms in W (positive: gained), by channel; at steady state they sum to zero.
- `particle_balance` (`dict[str, float]`) — ``dn/dt`` of every species (m^-3 s^-1); zero at steady state, except for a species held fixed, where it is the rate the reactions consume it at (and its feed would have to make up).
- `converged` (`bool`) — Whether the steady state was reached.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/global_model.py#L216-L305)

### wellbalanced.GlobalState.converged

*attribute* · *class attribute* · *instance attribute*

```python
converged: bool = True
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/global_model.py#L242-L242)

### wellbalanced.GlobalState.densities

*attribute* · *instance attribute*

```python
densities: dict[str, float]
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/global_model.py#L235-L235)

### wellbalanced.GlobalState.electron_temperature

*attribute* · *instance attribute*

```python
electron_temperature: float
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/global_model.py#L236-L236)

### wellbalanced.GlobalState.gas_temperature

*attribute* · *instance attribute*

```python
gas_temperature: float
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/global_model.py#L237-L237)

### wellbalanced.GlobalState.particle_balance

*attribute* · *instance attribute*

```python
particle_balance: dict[str, float]
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/global_model.py#L241-L241)

### wellbalanced.GlobalState.power

*attribute* · *instance attribute*

```python
power: dict[str, float]
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/global_model.py#L240-L240)

### wellbalanced.GlobalState.reaction_rates

*attribute* · *instance attribute*

```python
reaction_rates: dict[str, float]
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/global_model.py#L238-L238)

### wellbalanced.GlobalState.wall_losses

*attribute* · *instance attribute*

```python
wall_losses: dict[str, float]
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/global_model.py#L239-L239)

### wellbalanced.GlobalState.electron_density

*property*

```python
electron_density: float
```

``n_e`` in m^-3.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/global_model.py#L245-L247)

### wellbalanced.GlobalState.electronegativity

*method*

```python
def electronegativity(negative_ions: Iterable[str]) -> float
```

``sum n_- / n_e`` for the named negative ions.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/global_model.py#L254-L256)

### wellbalanced.GlobalState.ionization_degree

*method*

```python
def ionization_degree(gases: Iterable[str]) -> float
```

``n_e / (n_e + sum n_gas)`` for the named gases.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/global_model.py#L249-L252)

### wellbalanced.GlobalState.to_dataset

*method*

```python
def to_dataset() -> xr.Dataset
```

The state as a labelled dataset (dimensions ``species``, ``reaction``, ``channel``).

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/global_model.py#L258-L305)

## wellbalanced.InductiveField2D

*class*

```python
class InductiveField2D
```

Re-exported from: `wellbalanced.spatial.inductive`

The magnetoquasistatic field of coil windings, conductors and a plasma.

**Parameters**

- `x_edges` (`Sequence[float] | np.ndarray | None`) (default: `None`) — Cell edges of the first axis (``x``, or ``r`` from ``>= 0``) [m]: a tensor grid; or give ``grid``.
- `y_edges` (`Sequence[float] | np.ndarray | None`) (default: `None`) — Cell edges of the second axis (``y``, or ``z``) [m].
- `frequency` (`float`) — The driving frequency [Hz].
- `windings` (`Sequence[Winding]`) (default: `()`) — The coil windings; each carries ``sign`` times the coil current.
- `conductors` (`Sequence[Conductor]`) (default: `()`) — The perfect conductors.
- `electron_density` (`CellField`) (default: `0.0`) — ``n_e`` [m^-3] on the cells (set to zero in the windings, the conductors and outside ``plasma_region``).
- `collision_frequency` (`CellField`) (default: `0.0`) — The electron momentum-transfer frequency ``nu`` [1/s].
- `electron_temperature` (`CellField | None`) (default: `None`) — ``T_e`` [eV]: with it, the electrons carry the collisional viscosity ``(2/3) n_e e T_e / nu`` (``nu > 0`` in the plasma).
- `electron_viscosity` (`CellField | None`) (default: `None`) — ``mu_e`` [Pa s] directly, instead of from ``T_e``; zero gives the momentum balance without viscosity (the cold plasma, solved with ``u``).
- `plasma_region` (`PlasmaRegion | None`) (default: `None`) — Where the plasma is; everywhere if ``None``.
- `boundaries` (`tuple[AxisBoundary, AxisBoundary] | None`) (default: `None`) — The boundary of each axis (see :class:`CellGrid`); default ``("dirichlet", "dirichlet")``, or the grid's.
- `geometry` (`Geometry | None`) (default: `None`) — ``"cartesian"`` (a cut, ``A_z``) or ``"cylindrical"`` (r–z, ``A_phi``); default ``"cartesian"``, or the grid's.
- `electron_drift` (`Any`) (default: `None`) — The in-plane electron velocity for the RF Lorentz force; not implemented until ``Fluid2D`` provides it.
- `grid` (`CellGrid | PatchGrid | None`) (default: `None`) — A grid instead of the edges, e.g. a :class:`~wellbalanced.spatial.patches.PatchGrid` (its geometry and boundaries are the model's).

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/spatial/inductive.py#L337-L684)

### wellbalanced.InductiveField2D.collision_frequency

*attribute* · *instance attribute*

```python
collision_frequency = grid.cell_field(collision_frequency)
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/spatial/inductive.py#L415-L415)

### wellbalanced.InductiveField2D.conductor_masks

*attribute* · *instance attribute*

```python
conductor_masks = [grid.union_mask(c.shapes) for c in self.conductors]
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/spatial/inductive.py#L424-L424)

### wellbalanced.InductiveField2D.conductors

*attribute* · *instance attribute*

```python
conductors = tuple(conductors)
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/spatial/inductive.py#L410-L410)

### wellbalanced.InductiveField2D.electron_density

*attribute* · *instance attribute*

```python
electron_density = grid.cell_field(electron_density)
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/spatial/inductive.py#L414-L414)

### wellbalanced.InductiveField2D.frequency

*attribute* · *instance attribute*

```python
frequency = float(frequency)
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/spatial/inductive.py#L408-L408)

### wellbalanced.InductiveField2D.grid

*attribute* · *instance attribute*

```python
grid: CellGrid | PatchGrid = grid
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/spatial/inductive.py#L407-L407)

### wellbalanced.InductiveField2D.viscosity

*attribute* · *instance attribute*

```python
viscosity = self._viscosity(electron_temperature, electron_viscosity)
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/spatial/inductive.py#L426-L426)

### wellbalanced.InductiveField2D.winding_masks

*attribute* · *instance attribute*

```python
winding_masks = [grid.mask(w.shape) for w in self.windings]
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/spatial/inductive.py#L423-L423)

### wellbalanced.InductiveField2D.windings

*attribute* · *instance attribute*

```python
windings = tuple(windings)
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/spatial/inductive.py#L409-L409)

### wellbalanced.InductiveField2D.plasma

*property*

```python
plasma: np.ndarray
```

The plasma cells: a positive electron density.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/spatial/inductive.py#L466-L468)

### wellbalanced.InductiveField2D.shape

*property*

```python
shape: tuple[int, ...]
```

The shape of a field: cells along each axis, or ``(n,)`` leaf cells.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/spatial/inductive.py#L445-L447)

### wellbalanced.InductiveField2D.x

*property*

```python
x: np.ndarray
```

Cell centres of the first axis [m].

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/spatial/inductive.py#L435-L437)

### wellbalanced.InductiveField2D.y

*property*

```python
y: np.ndarray
```

Cell centres of the second axis [m].

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/spatial/inductive.py#L440-L442)

### wellbalanced.InductiveField2D.conductivity

*method*

```python
def conductivity(omega: float) -> np.ndarray
```

``sigma = n_e e^2 / (m_e (nu + i omega))`` [S/m] on the cells (cold plasma).

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/spatial/inductive.py#L528-L531)

### wellbalanced.InductiveField2D.modified_frequency

*method* · *staticmethod*

```python
def modified_frequency(frequency: float, dt: float) -> float
```

The frequency whose harmonic solution the trapezoidal steady state equals.

``omega' = (2 / dt) tan(omega dt / 2)``, as a frequency [Hz].

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/spatial/inductive.py#L677-L684)

### wellbalanced.InductiveField2D.solve

*method*

```python
def solve(coil_current: complex = 1.0, *, frequency: float | None = None) -> InductiveSolution
```

The time-harmonic field for a coil current amplitude [A].

``frequency`` overrides the model's (the time-dependent form's modified
frequency is the use of it).

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/spatial/inductive.py#L538-L549)

### wellbalanced.InductiveField2D.time_stepper

*method*

```python
def time_stepper(dt: float) -> InductiveTimeStepper
```

The time-dependent form with steps of ``dt`` [s] (cold plasma only).

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/spatial/inductive.py#L669-L675)

## wellbalanced.InductiveSolution

*class* · *dataclass*

```python
class InductiveSolution
```

Re-exported from: `wellbalanced.spatial.inductive`

The time-harmonic field of :meth:`InductiveField2D.solve`, as complex amplitudes.

The instant value of an amplitude ``X`` is ``Re(X exp(i omega t))``. Extensive
quantities are totals in r–z and per unit length along ``z`` in a cut.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/spatial/inductive.py#L140-L323)

### wellbalanced.InductiveSolution.coil_current

*attribute* · *instance attribute*

```python
coil_current: complex
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/spatial/inductive.py#L150-L150)

### wellbalanced.InductiveSolution.collision_frequency

*attribute* · *instance attribute*

```python
collision_frequency: np.ndarray
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/spatial/inductive.py#L155-L155)

### wellbalanced.InductiveSolution.conductor_currents

*attribute* · *class attribute* · *instance attribute*

```python
conductor_currents: dict[str, complex] = field(default_factory=dict)
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/spatial/inductive.py#L158-L158)

### wellbalanced.InductiveSolution.electron_density

*attribute* · *instance attribute*

```python
electron_density: np.ndarray
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/spatial/inductive.py#L154-L154)

### wellbalanced.InductiveSolution.electron_velocity

*attribute* · *class attribute* · *instance attribute*

```python
electron_velocity: np.ndarray | None = None
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/spatial/inductive.py#L156-L156)

### wellbalanced.InductiveSolution.frequency

*attribute* · *instance attribute*

```python
frequency: float
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/spatial/inductive.py#L149-L149)

### wellbalanced.InductiveSolution.grid

*attribute* · *instance attribute*

```python
grid: CellGrid | PatchGrid
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/spatial/inductive.py#L148-L148)

### wellbalanced.InductiveSolution.plasma_current_density

*attribute* · *instance attribute*

```python
plasma_current_density: np.ndarray
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/spatial/inductive.py#L152-L152)

### wellbalanced.InductiveSolution.source_current_density

*attribute* · *instance attribute*

```python
source_current_density: np.ndarray
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/spatial/inductive.py#L153-L153)

### wellbalanced.InductiveSolution.vector_potential

*attribute* · *instance attribute*

```python
vector_potential: np.ndarray
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/spatial/inductive.py#L151-L151)

### wellbalanced.InductiveSolution.viscous_power

*attribute* · *class attribute* · *instance attribute*

```python
viscous_power: float = 0.0
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/spatial/inductive.py#L157-L157)

### wellbalanced.InductiveSolution.absorbed_power

*property*

```python
absorbed_power: float
```

The power the plasma absorbs [W] (per unit length in a cut [W/m]).

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/spatial/inductive.py#L201-L203)

### wellbalanced.InductiveSolution.cell_areas

*property*

```python
cell_areas: np.ndarray
```

The cross-section areas of the cells [m^2].

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/spatial/inductive.py#L176-L178)

### wellbalanced.InductiveSolution.cell_volumes

*property*

```python
cell_volumes: np.ndarray
```

The cell volumes [m^3] (per metre along ``z`` in a cut).

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/spatial/inductive.py#L181-L183)

### wellbalanced.InductiveSolution.electric_field

*property*

```python
electric_field: np.ndarray
```

``E = -i omega a`` [V/m], normal to the plane.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/spatial/inductive.py#L186-L188)

### wellbalanced.InductiveSolution.friction_power

*property*

```python
friction_power: float
```

The part of :attr:`absorbed_power` the friction with the gas dissipates.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/spatial/inductive.py#L206-L217)

### wellbalanced.InductiveSolution.magnetic_field

*property*

```python
magnetic_field: tuple[np.ndarray, np.ndarray]
```

The in-plane field [T]: ``(B_x, B_y)`` in a cut, ``(B_r, B_z)`` in r–z.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/spatial/inductive.py#L191-L193)

### wellbalanced.InductiveSolution.omega

*property*

```python
omega: float
```

The angular frequency [1/s].

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/spatial/inductive.py#L161-L163)

### wellbalanced.InductiveSolution.power_density

*property*

```python
power_density: np.ndarray
```

The time-averaged absorbed power density ``1/2 Re(J E*)`` [W/m^3].

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/spatial/inductive.py#L196-L198)

### wellbalanced.InductiveSolution.source_power

*property*

```python
source_power: complex
```

The complex power the windings deliver [W] (per unit length in a cut).

``-1/2 sum E J_coil* dV``; its real part equals :attr:`absorbed_power`, its
imaginary part is the reactive power, positive for the inductive load.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/spatial/inductive.py#L220-L229)

### wellbalanced.InductiveSolution.x

*property*

```python
x: np.ndarray
```

Cell centres of the first axis (``x`` or ``r``) [m]; per cell on patches.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/spatial/inductive.py#L166-L168)

### wellbalanced.InductiveSolution.y

*property*

```python
y: np.ndarray
```

Cell centres of the second axis (``y`` or ``z``) [m]; per cell on patches.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/spatial/inductive.py#L171-L173)

### wellbalanced.InductiveSolution.efficiency

*method*

```python
def efficiency(network_resistance: float, depth: float | None = None) -> float
```

The RF power transfer efficiency ``R_p / (R_p + R_net)``.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/spatial/inductive.py#L249-L254)

### wellbalanced.InductiveSolution.for_power

*method*

```python
def for_power(power: float, depth: float | None = None) -> InductiveSolution
```

The solution whose plasma absorbs ``power`` [W] (over ``depth`` in a cut).

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/spatial/inductive.py#L276-L281)

### wellbalanced.InductiveSolution.plasma_resistance

*method*

```python
def plasma_resistance(depth: float | None = None) -> float
```

The plasma resistance seen by the coil, ``2 P / |I|^2`` [Ohm].

``depth`` [m] turns the power per unit length of a cut into the device's; an
r–z solution takes none.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/spatial/inductive.py#L241-L247)

### wellbalanced.InductiveSolution.scaled

*method*

```python
def scaled(coil_current: complex) -> InductiveSolution
```

The same solution for another coil current (the problem is linear).

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/spatial/inductive.py#L256-L274)

### wellbalanced.InductiveSolution.to_dataset

*method*

```python
def to_dataset() -> xr.Dataset
```

The amplitudes and the power density as a labelled dataset.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/spatial/inductive.py#L283-L323)

## wellbalanced.Magnetron

*class* · *dataclass*

```python
class Magnetron
```

Re-exported from: `wellbalanced.magnetron`

The ionization region of a magnetron: geometry, gas and target; see the module docstring.

The defaults are placeholders of the order of a 3 inch magnetron, not a
particular device.

**Attributes**

- `material` (`TargetMaterial`) — The target material.
- `target_area` (`float`) — The area of the racetrack the ions hit, in m^2.
- `region_height` (`float`) — The height of the ionization region above it in m; the volume is ``target_area * region_height``.
- `side_area` (`float`) — The other boundaries ions leave the region through, in m^2.
- `h_factor` (`float`) — The edge-to-centre density ratio at the boundaries.
- `pressure` (`float`) — The argon filling pressure in Pa, at ``gas_temperature``.
- `gas_temperature` (`float`) — The gas temperature in K.
- `refill_time` (`float`) — The time in s in which the argon of the region is replaced.
- `wind_efficiency` (`float`) — Ar atoms pushed out per sputtered atom (0: no sputter wind).
- `heating_fraction` (`float`) — The share of the secondary electron energy the plasma electrons keep: at most 1 if the secondary electron yield is right; a larger value, as :meth:`calibrate_heating` may find, means the yield of the placeholder material is too low (only the product matters).
- `seed` (`float`) — A pair source in m^-3 s^-1 that stands for the residual plasma and preionization at the start of a pulse; it keeps the density from decaying to zero in the afterglow.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/magnetron.py#L250-L752)

### wellbalanced.Magnetron.gas_temperature

*attribute* · *class attribute* · *instance attribute*

```python
gas_temperature: float = 300.0
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/magnetron.py#L283-L283)

### wellbalanced.Magnetron.h_factor

*attribute* · *class attribute* · *instance attribute*

```python
h_factor: float = 0.5
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/magnetron.py#L281-L281)

### wellbalanced.Magnetron.heating_fraction

*attribute* · *class attribute* · *instance attribute*

```python
heating_fraction: float = 1.0
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/magnetron.py#L286-L286)

### wellbalanced.Magnetron.material

*attribute* · *class attribute* · *instance attribute*

```python
material: TargetMaterial = TITANIUM
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/magnetron.py#L277-L277)

### wellbalanced.Magnetron.pressure

*attribute* · *class attribute* · *instance attribute*

```python
pressure: float = 1.0
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/magnetron.py#L282-L282)

### wellbalanced.Magnetron.refill_time

*attribute* · *class attribute* · *instance attribute*

```python
refill_time: float = 0.0001
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/magnetron.py#L284-L284)

### wellbalanced.Magnetron.region_height

*attribute* · *class attribute* · *instance attribute*

```python
region_height: float = 0.02
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/magnetron.py#L279-L279)

### wellbalanced.Magnetron.seed

*attribute* · *class attribute* · *instance attribute*

```python
seed: float = 1e+19
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/magnetron.py#L287-L287)

### wellbalanced.Magnetron.side_area

*attribute* · *class attribute* · *instance attribute*

```python
side_area: float = 0.0001
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/magnetron.py#L280-L280)

### wellbalanced.Magnetron.target_area

*attribute* · *class attribute* · *instance attribute*

```python
target_area: float = 0.001
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/magnetron.py#L278-L278)

### wellbalanced.Magnetron.wind_efficiency

*attribute* · *class attribute* · *instance attribute*

```python
wind_efficiency: float = 0.0
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/magnetron.py#L285-L285)

### wellbalanced.Magnetron.chamber

*property*

```python
chamber: Chamber
```

The region as a chamber: ions leave through the target and the sides.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/magnetron.py#L339-L347)

### wellbalanced.Magnetron.gas_density

*property*

```python
gas_density: float
```

The argon filling density in m^-3.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/magnetron.py#L322-L324)

### wellbalanced.Magnetron.species

*property*

```python
species: dict[str, Species]
```

The species by role: ``e``, ``gas``, ``gas_ion``, ``metal``, ``metal_ion``.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/magnetron.py#L327-L336)

### wellbalanced.Magnetron.volume

*property*

```python
volume: float
```

The volume of the ionization region in m^3.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/magnetron.py#L317-L319)

### wellbalanced.Magnetron.bohm_flux_coefficient

*method*

```python
def bohm_flux_coefficient(te: float, ion: str) -> float
```

The loss rate of the ion named ``ion`` to the target per unit density, in 1/s.

``h u_B(T_e) A_t / V``.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/magnetron.py#L349-L355)

### wellbalanced.Magnetron.calibrate_heating

*method*

```python
def calibrate_heating(current: float, voltage: float) -> Magnetron
```

A copy whose heating fraction makes the dc discharge current match ``current``.

The share of the secondary electron energy that heats the plasma is the
least known closure. The model's own ion current to the target,
``I_D`` of :meth:`target_currents`, rises with it; this fits it to one
measured point so that the others are predictions. A value above 1
means the secondary electron yield is too low; it raises a
``ValueError`` if no value up to 10 does, which says that the sputter
yields or the geometry are off.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/magnetron.py#L514-L540)

### wellbalanced.Magnetron.current_scan

*method*

```python
def current_scan(currents: Sequence[float], voltage: float | Callable[[float], float]) -> xr.Dataset
```

The dc states against the discharge current, with the spoke diagnostics.

``voltage`` is a number or a function of the current ``V_D(I_D)``, e.g.
the measured characteristic. Every state starts from the last (a
continuation); the dataset has the densities (``species``), the
:meth:`diagnostics` and the model's ``I_D`` over ``current``.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/magnetron.py#L698-L737)

### wellbalanced.Magnetron.diagnostics

*method*

```python
def diagnostics(state: GlobalState) -> dict[str, float]
```

The quantities that decide the spoke regime, for a state.

- ``rarefaction``: ``n_Ar`` in the region over the filling density
  (1: none; the sputter wind and the ionization of the gas lower it);
- ``metal_to_argon``: the neutral metal over the neutral argon density;
- ``metal_ion_fraction``: the metal share of the ion flux to the target;
- ``self_sputtering_share``: the share of the sputtered flux that the
  metal ions make (1: the discharge runs on the metal alone);
- ``electron_density`` in m^-3, and the electron temperature in eV;
- ``discharge_current``: the model's ``I_D`` in A, to compare with the
  prescribed one.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/magnetron.py#L579-L608)

### wellbalanced.Magnetron.guess

*method*

```python
def guess(ion_density: float = 1e+17) -> dict[str, float]
```

A starting state: the filling gas and a plasma of ``ion_density``.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/magnetron.py#L492-L501)

### wellbalanced.Magnetron.heating_power

*method*

```python
def heating_power(current: float, voltage: float) -> float
```

The power the plasma electrons absorb at a discharge current and voltage, in W.

``P = f gamma / (1 + gamma) I_D V_D``, with ``gamma`` the secondary
electron yield of the argon ions.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/magnetron.py#L452-L459)

### wellbalanced.Magnetron.metal_ionization

*method*

```python
def metal_ionization(state: GlobalState) -> float
```

The ionized fraction of the metal in the region, ``n_M+ / (n_M + n_M+)``.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/magnetron.py#L610-L615)

### wellbalanced.Magnetron.model

*method*

```python
def model(current: float | Callable[[float], float], voltage: float | Callable[[float], float]) -> GlobalModel
```

The global model driven by the discharge current ``I_D(t)`` and voltage ``V_D(t)``.

Each is a number (dc) or a function of the time in s, e.g. from
:func:`pulse`.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/magnetron.py#L461-L490)

### wellbalanced.Magnetron.pulse

*method*

```python
def pulse(current: float, voltage: float, on_time: float, period: float, *, periods: int = 20, points: int = 200, tolerance: float = 0.001, initial: Mapping[str, float] | GlobalState | None = None) -> xr.Dataset
```

The periodic state of a rectangular pulse, as a dataset over the time ``t`` in a period.

The discharge current and voltage are ``current`` and ``voltage`` for
``on_time`` seconds of every ``period``, and zero in between. Periods
are run until the densities at the start of a period change by less than
``tolerance`` (relative, in the log) from one period to the next, or
``periods`` are done; ``attrs["periodicity_error"]`` is the last change
and ``attrs["periods"]`` how many were run. The variables are the
densities, the electron temperature, the model's currents at the target
(``I_D``, ``I_<ion>``), the sputtered flux and the metal ion fraction.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/magnetron.py#L619-L672)

### wellbalanced.Magnetron.reactions

*method*

```python
def reactions() -> list[Reaction]
```

The ionization, excitation, elastic and charge-exchange reactions.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/magnetron.py#L357-L406)

### wellbalanced.Magnetron.scan

*method*

```python
def scan(parameter: str, values: list, current: float, voltage: float) -> list[GlobalState]
```

Dc states for values of a field of the magnetron, each started from the last.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/magnetron.py#L739-L752)

### wellbalanced.Magnetron.sources

*method*

```python
def sources() -> list[VolumeSource]
```

Sputtering and the sputter wind by the ion flux to the target, and the seed.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/magnetron.py#L408-L450)

### wellbalanced.Magnetron.steady_state

*method*

```python
def steady_state(current: float, voltage: float, initial: Mapping[str, float] | GlobalState | None = None) -> GlobalState
```

The dc state at a discharge current and voltage.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/magnetron.py#L503-L512)

### wellbalanced.Magnetron.target_currents

*method*

```python
def target_currents(state: GlobalState) -> dict[str, float]
```

The currents and fluxes at the target for a state.

Returns the ion currents ``I_<ion>`` to the target in A, the discharge
current ``I_D`` including the secondary electrons, the sputtered atom
flux ``sputtered`` in 1/s, the ``metal_ion_fraction`` of the ion flux to
the target and the ``metal_ion_density_fraction`` of the ion density.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/magnetron.py#L544-L577)

## wellbalanced.PlasmaRegion

*class* · *dataclass*

```python
class PlasmaRegion
```

Re-exported from: `wellbalanced.spatial.regions`

The cells of a plasma: the union of ``shapes`` minus the union of ``excluded``.

**Attributes**

- `shapes` (`Sequence[Any]`) — Shapes whose union is the region (e.g. the driver and the expansion region as two rectangles, a T in r–z).
- `excluded` (`Sequence[Any]`) — Shapes cut out of it (e.g. an internal structure).

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/spatial/regions.py#L25-L56)

### wellbalanced.PlasmaRegion.excluded

*attribute* · *class attribute* · *instance attribute*

```python
excluded: Sequence[Any] = ()
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/spatial/regions.py#L36-L36)

### wellbalanced.PlasmaRegion.shapes

*attribute* · *instance attribute*

```python
shapes: Sequence[Any]
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/spatial/regions.py#L35-L35)

### wellbalanced.PlasmaRegion.mask

*method*

```python
def mask(grid: CellGrid | PatchGrid) -> np.ndarray
```

The cells whose centre is in the region, shape ``grid.shape``.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/spatial/regions.py#L43-L48)

### wellbalanced.PlasmaRegion.wall_faces

*method*

```python
def wall_faces(grid: CellGrid | PatchGrid) -> np.ndarray
```

The region's cells that have a neighbour outside it (or the domain edge).

The cells next to a wall, where a fluid model applies its wall conditions; the
axis of an r–z domain and periodic seams are not walls.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/spatial/regions.py#L50-L56)

## wellbalanced.PotentialBoundary

*class* · *dataclass*

```python
class PotentialBoundary
```

Re-exported from: `wellbalanced.fluid1d`

The potential at one end: a value (V) or the field ``E`` (V/m) there.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/fluid1d.py#L171-L186)

### wellbalanced.PotentialBoundary.kind

*attribute* · *instance attribute*

```python
kind: str
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/fluid1d.py#L175-L175)

### wellbalanced.PotentialBoundary.value

*attribute* · *class attribute* · *instance attribute*

```python
value: float = 0.0
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/fluid1d.py#L176-L176)

### wellbalanced.PotentialBoundary.field

*method* · *classmethod*

```python
def field(value: float = 0.0) -> PotentialBoundary
```

A prescribed field, zero for a symmetry plane.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/fluid1d.py#L183-L186)

### wellbalanced.PotentialBoundary.potential

*method* · *classmethod*

```python
def potential(value: float) -> PotentialBoundary
```

A prescribed potential.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/fluid1d.py#L178-L181)

## wellbalanced.RFDriver

*class* · *dataclass*

```python
class RFDriver
```

Re-exported from: `wellbalanced.driver`

A cylindrical RF driver: its plasma's global model and its coil.

The chamber is the driver's cylinder; the ions leave through its whole wall,
the end open to the expansion region included, with the low-pressure
edge-to-centre ratios ``h_L = 0.86 / sqrt(3 + l / (2 lambda_i))`` (ends) and
``h_R = 0.8 / sqrt(4 + R / lambda_i)`` (side) of Lieberman and Lichtenberg
(sec. 10.2) for the ion mean free path ``lambda_i``.

**Attributes**

- `species` (`Sequence[Species]`) — Every species, the electrons (``"e"``) included.
- `reactions` (`Sequence[Reaction]`) — The volume reactions.
- `fixed` (`Mapping[str, float]`) — Densities held fixed (m^-3), the gases.
- `radius` (`float`) — The plasma radius ``R`` in m.
- `length` (`float`) — The driver's length in m.
- `coil_turns` (`float`) — The coil's turns ``N``.
- `coil_radius` (`float`) — The coil's radius ``b`` in m.
- `coil_length` (`float | None`) — The coil's length ``l`` in m; the driver's if ``None``.
- `frequency` (`float`) — The RF frequency in Hz.
- `network_resistance` (`float`) — ``R_net`` in Ohm.
- `momentum_transfer` (`Sequence[str]`) — Names of the reactions whose rates per electron make up ``nu_m`` (the elastic electron collisions).
- `ion_mean_free_path` (`float`) — ``lambda_i`` in m.
- `skin_density_factor` (`float`) — The electron density of the skin layer over the volume average.
- `field_factor` (`float | None`) — The coil's inductance over the long-solenoid one; Nagaoka's coefficient if ``None``.
- `coupling` (`Literal['transformer', 'solenoid']`) — ``"transformer"`` (:func:`transformer_impedance`) or ``"solenoid"``, the exact uniform column (:func:`solenoid_impedance`).
- `model_options` (`Mapping[str, Any]`) — Further fields of the :class:`GlobalModel` (gas temperature, wall reactions, ion wall products, ...).

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driver.py#L285-L450)

### wellbalanced.RFDriver.coil_length

*attribute* · *class attribute* · *instance attribute*

```python
coil_length: float | None = None
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driver.py#L331-L331)

### wellbalanced.RFDriver.coil_radius

*attribute* · *instance attribute*

```python
coil_radius: float
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driver.py#L325-L325)

### wellbalanced.RFDriver.coil_turns

*attribute* · *instance attribute*

```python
coil_turns: float
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driver.py#L324-L324)

### wellbalanced.RFDriver.coupling

*attribute* · *class attribute* · *instance attribute*

```python
coupling: Literal['transformer', 'solenoid'] = 'transformer'
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driver.py#L333-L333)

### wellbalanced.RFDriver.field_factor

*attribute* · *class attribute* · *instance attribute*

```python
field_factor: float | None = None
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driver.py#L332-L332)

### wellbalanced.RFDriver.fixed

*attribute* · *instance attribute*

```python
fixed: Mapping[str, float]
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driver.py#L321-L321)

### wellbalanced.RFDriver.frequency

*attribute* · *instance attribute*

```python
frequency: float
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driver.py#L326-L326)

### wellbalanced.RFDriver.ion_mean_free_path

*attribute* · *instance attribute*

```python
ion_mean_free_path: float
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driver.py#L329-L329)

### wellbalanced.RFDriver.length

*attribute* · *instance attribute*

```python
length: float
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driver.py#L323-L323)

### wellbalanced.RFDriver.model_options

*attribute* · *class attribute* · *instance attribute*

```python
model_options: Mapping[str, Any] = field(default_factory=dict)
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driver.py#L334-L334)

### wellbalanced.RFDriver.momentum_transfer

*attribute* · *instance attribute*

```python
momentum_transfer: Sequence[str]
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driver.py#L328-L328)

### wellbalanced.RFDriver.network_resistance

*attribute* · *instance attribute*

```python
network_resistance: float
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driver.py#L327-L327)

### wellbalanced.RFDriver.radius

*attribute* · *instance attribute*

```python
radius: float
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driver.py#L322-L322)

### wellbalanced.RFDriver.reactions

*attribute* · *instance attribute*

```python
reactions: Sequence[Reaction]
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driver.py#L320-L320)

### wellbalanced.RFDriver.skin_density_factor

*attribute* · *class attribute* · *instance attribute*

```python
skin_density_factor: float = 1.0
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driver.py#L330-L330)

### wellbalanced.RFDriver.species

*attribute* · *instance attribute*

```python
species: Sequence[Species]
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driver.py#L319-L319)

### wellbalanced.RFDriver.chamber

*property*

```python
chamber: Chamber
```

The driver's cylinder with its effective edge-to-centre ratio.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driver.py#L366-L376)

### wellbalanced.RFDriver.coil

*property*

```python
coil: Coil
```

The coil.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driver.py#L356-L363)

### wellbalanced.RFDriver.couple

*method*

```python
def couple(plasma: GlobalState, power: float) -> DriverState
```

The coil's view of a plasma absorbing ``power`` W.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driver.py#L389-L409)

### wellbalanced.RFDriver.model

*method*

```python
def model(power: float) -> GlobalModel
```

The global model of the driver plasma absorbing ``power`` W.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driver.py#L378-L387)

### wellbalanced.RFDriver.scan

*method*

```python
def scan(parameter: str, values: Sequence[Any], *, power: float | None = None, guess: GlobalState | Mapping[str, float] | None = None) -> list[DriverState]
```

Driver states for every value of ``"power"`` or a field of the driver.

Each global model starts from the last state (a continuation); a scan of a
field needs the absorbed ``power``.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driver.py#L424-L450)

### wellbalanced.RFDriver.solve

*method*

```python
def solve(power: float, guess: GlobalState | Mapping[str, float] | None = None) -> DriverState
```

The driver absorbing ``power`` W; ``guess`` starts the global model.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driver.py#L411-L422)

## wellbalanced.Reaction

*class* · *dataclass*

```python
class Reaction
```

Re-exported from: `wellbalanced.reactions`

One reaction of the model.

**Attributes**

- `reactants` (`Sequence[str]`) — Species names, repeated for a species that appears twice.
- `products` (`Sequence[str]`) — Species names, repeated likewise.
- `rate` (`float | RateTable | RateFunction`) — ``K`` in m^3/s (for two reactants): a number, a :class:`plasmacoll.RateTable`, or a function of the temperature in eV.
- `temperature` (`str`) — ``"electron"`` or ``"gas"``, the temperature ``K`` depends on.
- `electron_energy_loss` (`float`) — Energy in eV the electrons lose per reaction (negative for a gain, e.g. superelastic or detachment energy).
- `gas_heating` (`float`) — Energy in eV the gas gains per reaction (Franck-Condon fragments, charge exchange).
- `elastic_mass` (`float | None`) — For an elastic electron collision, the target mass in kg: the electrons then lose ``3 (m_e / M) (T_e - T_g)`` per collision.
- `name` (`str`) — A name for diagnostics; built from the equation if empty.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/reactions.py#L36-L201)

### wellbalanced.Reaction.elastic_mass

*attribute* · *class attribute* · *instance attribute*

```python
elastic_mass: float | None = None
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/reactions.py#L61-L61)

### wellbalanced.Reaction.electron_energy_loss

*attribute* · *class attribute* · *instance attribute*

```python
electron_energy_loss: float = 0.0
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/reactions.py#L59-L59)

### wellbalanced.Reaction.gas_heating

*attribute* · *class attribute* · *instance attribute*

```python
gas_heating: float = 0.0
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/reactions.py#L60-L60)

### wellbalanced.Reaction.name

*attribute* · *class attribute* · *instance attribute*

```python
name: str = ''
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/reactions.py#L62-L62)

### wellbalanced.Reaction.products

*attribute* · *instance attribute*

```python
products: Sequence[str]
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/reactions.py#L56-L56)

### wellbalanced.Reaction.rate

*attribute* · *instance attribute*

```python
rate: float | RateTable | RateFunction
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/reactions.py#L57-L57)

### wellbalanced.Reaction.reactants

*attribute* · *instance attribute*

```python
reactants: Sequence[str]
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/reactions.py#L55-L55)

### wellbalanced.Reaction.temperature

*attribute* · *class attribute* · *instance attribute*

```python
temperature: str = 'electron'
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/reactions.py#L58-L58)

### wellbalanced.Reaction.stoichiometry

*property*

```python
stoichiometry: dict[str, int]
```

Net change of every species per reaction (products minus reactants).

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/reactions.py#L93-L95)

### wellbalanced.Reaction.coefficient

*method*

```python
def coefficient(electron_temperature: float, gas_temperature: float) -> float
```

Return ``K`` at the temperatures (eV).

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/reactions.py#L97-L99)

### wellbalanced.Reaction.coefficients

*method*

```python
def coefficients(electron_temperature: np.ndarray | float, gas_temperature: np.ndarray | float) -> np.ndarray
```

Return ``K`` at arrays of temperatures (eV), e.g. on the cells of a mesh.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/reactions.py#L101-L111)

### wellbalanced.Reaction.electron_loss

*method*

```python
def electron_loss(electron_temperature: float, gas_temperature: float) -> float
```

Energy in eV the electrons lose per reaction.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/reactions.py#L113-L120)

### wellbalanced.Reaction.from_cross_section

*method* · *classmethod*

```python
def from_cross_section(reactants: Sequence[str], products: Sequence[str], cross_section: CrossSection, reduced_mass: float, *, incident_mass: float | None = None, temperature: str = 'electron', electron_energy_loss: float = 0.0, gas_heating: float = 0.0, elastic_mass: float | None = None, name: str = '') -> Reaction
```

A reaction whose rate is ``cross_section`` averaged over a Maxwellian.

``reduced_mass`` (kg) is the electron mass for electron impact;
``incident_mass`` is needed for a table in the lab frame (see
:func:`plasmacoll.rate_coefficient`).

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/reactions.py#L128-L161)

### wellbalanced.Reaction.from_process

*method* · *classmethod*

```python
def from_process(process: CollisionProcess, reactants: Sequence[str], products: Sequence[str], *, incident_mass: float = ELECTRON_MASS, target_mass: float | None = None, temperature: str = 'electron', gas_heating: float = 0.0) -> Reaction
```

A reaction from a plasmacoll process: its cross section, frame and energy loss.

The reactants and products are given here, since a process only names
the species it tracks. ``target_mass`` (kg) gives the reduced mass and,
for an elastic process, the energy transfer; without it the target is
taken as infinitely heavy.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/reactions.py#L163-L201)

### wellbalanced.Reaction.gas_gain

*method*

```python
def gas_gain(electron_temperature: float, gas_temperature: float) -> float
```

Energy in eV the gas gains per reaction.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/reactions.py#L122-L126)

## wellbalanced.Species

*class* · *dataclass*

```python
class Species
```

Re-exported from: `wellbalanced.species`

A species of the plasma or the gas.

**Attributes**

- `name` (`str`) — A unique name, used by the reactions (``"e"`` for electrons).
- `mass` (`float`) — The mass in kg.
- `charge` (`int`) — The charge in elementary charges.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/species.py#L12-L46)

### wellbalanced.Species.charge

*attribute* · *class attribute* · *instance attribute*

```python
charge: int = 0
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/species.py#L24-L24)

### wellbalanced.Species.mass

*attribute* · *instance attribute*

```python
mass: float
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/species.py#L23-L23)

### wellbalanced.Species.name

*attribute* · *instance attribute*

```python
name: str
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/species.py#L22-L22)

### wellbalanced.Species.is_electron

*property*

```python
is_electron: bool
```

Whether this is the electron species.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/species.py#L39-L41)

### wellbalanced.Species.is_neutral

*property*

```python
is_neutral: bool
```

Whether the species has no charge.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/species.py#L44-L46)

### wellbalanced.Species.atomic

*method* · *classmethod*

```python
def atomic(name: str, mass_u: float, charge: int = 0) -> Species
```

A species of mass ``mass_u`` in atomic mass units, minus the electrons of its charge.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/species.py#L33-L36)

## wellbalanced.SpokeReport

*class* · *dataclass*

```python
class SpokeReport
```

Re-exported from: `wellbalanced.driftfluid2d`

What a run says about its azimuthal structure, in the terms of the experiments.

**Attributes**

- `mode` (`int`) — The dominant azimuthal mode number ``m >= 1`` (largest time-averaged amplitude).
- `wavelength` (`float`) — ``length_y / m`` (m).
- `growth_rate` (`float`) — Growth rate (1/s) of that mode over the window.
- `phase_velocity` (`float`) — Phase velocity (m/s) along ``+y``.
- `exb_velocity` (`float`) — The azimuthal E x B velocity (m/s) at the probe, averaged over the window and ``y``.
- `relative_direction` (`int`) — ``+1`` if the mode moves along E x B, ``-1`` against it.
- `speed_ratio` (`float`) — ``|phase_velocity| / |exb_velocity|``.
- `cathode_modulation` (`float`) — Peak-to-peak density modulation next to the cathode, ``(max - min) / (2 mean)`` along ``y``, averaged over the window.
- `potential_hump` (`float`) — ``max_y(phi) - mean_y(phi)`` at the probe (V), window average.
- `azimuthal_field` (`float`) — ``max_y |E_y|`` at the probe (V/m), window average.
- `window` (`tuple[float, float]`) — The ``(t0, t1)`` (s) of the analysis.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driftfluid2d.py#L321-L351)

### wellbalanced.SpokeReport.azimuthal_field

*attribute* · *instance attribute*

```python
azimuthal_field: float
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driftfluid2d.py#L350-L350)

### wellbalanced.SpokeReport.cathode_modulation

*attribute* · *instance attribute*

```python
cathode_modulation: float
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driftfluid2d.py#L348-L348)

### wellbalanced.SpokeReport.exb_velocity

*attribute* · *instance attribute*

```python
exb_velocity: float
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driftfluid2d.py#L345-L345)

### wellbalanced.SpokeReport.growth_rate

*attribute* · *instance attribute*

```python
growth_rate: float
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driftfluid2d.py#L343-L343)

### wellbalanced.SpokeReport.mode

*attribute* · *instance attribute*

```python
mode: int
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driftfluid2d.py#L341-L341)

### wellbalanced.SpokeReport.phase_velocity

*attribute* · *instance attribute*

```python
phase_velocity: float
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driftfluid2d.py#L344-L344)

### wellbalanced.SpokeReport.potential_hump

*attribute* · *instance attribute*

```python
potential_hump: float
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driftfluid2d.py#L349-L349)

### wellbalanced.SpokeReport.relative_direction

*attribute* · *instance attribute*

```python
relative_direction: int
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driftfluid2d.py#L346-L346)

### wellbalanced.SpokeReport.speed_ratio

*attribute* · *instance attribute*

```python
speed_ratio: float
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driftfluid2d.py#L347-L347)

### wellbalanced.SpokeReport.wavelength

*attribute* · *instance attribute*

```python
wavelength: float
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driftfluid2d.py#L342-L342)

### wellbalanced.SpokeReport.window

*attribute* · *instance attribute*

```python
window: tuple[float, float]
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driftfluid2d.py#L351-L351)

## wellbalanced.TargetMaterial

*class* · *dataclass*

```python
class TargetMaterial
```

Re-exported from: `wellbalanced.magnetron`

The sputtered metal and the response of the target to the ions.

**Attributes**

- `name` (`str`) — The element, e.g. ``"Ti"``; the species are ``name`` and ``name+``.
- `mass_u` (`float`) — The atomic mass in u.
- `ionization_energy` (`float`) — The first ionization energy in eV.
- `outer_electrons` (`int`) — The electrons of the outer shell in the Lotz formula.
- `argon_yield` (`float`) — Atoms sputtered per ``Ar+`` at the cathode-fall energy.
- `self_yield` (`float`) — Atoms sputtered per metal ion (self-sputtering).
- `argon_secondary` (`float`) — Secondary electrons emitted per ``Ar+``.
- `self_secondary` (`float`) — Secondary electrons emitted per metal ion.
- `charge_exchange` (`float`) — Rate of ``Ar+ + M -> Ar + M+`` in m^3/s.
- `verified` (`bool`) — ``False`` while the yields and rates are placeholders.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/magnetron.py#L161-L196)

### wellbalanced.TargetMaterial.argon_secondary

*attribute* · *instance attribute*

```python
argon_secondary: float
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/magnetron.py#L184-L184)

### wellbalanced.TargetMaterial.argon_yield

*attribute* · *instance attribute*

```python
argon_yield: float
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/magnetron.py#L182-L182)

### wellbalanced.TargetMaterial.charge_exchange

*attribute* · *instance attribute*

```python
charge_exchange: float
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/magnetron.py#L186-L186)

### wellbalanced.TargetMaterial.ionization_energy

*attribute* · *instance attribute*

```python
ionization_energy: float
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/magnetron.py#L180-L180)

### wellbalanced.TargetMaterial.mass_u

*attribute* · *instance attribute*

```python
mass_u: float
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/magnetron.py#L179-L179)

### wellbalanced.TargetMaterial.name

*attribute* · *instance attribute*

```python
name: str
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/magnetron.py#L178-L178)

### wellbalanced.TargetMaterial.outer_electrons

*attribute* · *instance attribute*

```python
outer_electrons: int
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/magnetron.py#L181-L181)

### wellbalanced.TargetMaterial.self_secondary

*attribute* · *instance attribute*

```python
self_secondary: float
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/magnetron.py#L185-L185)

### wellbalanced.TargetMaterial.self_yield

*attribute* · *instance attribute*

```python
self_yield: float
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/magnetron.py#L183-L183)

### wellbalanced.TargetMaterial.verified

*attribute* · *class attribute* · *instance attribute*

```python
verified: bool = False
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/magnetron.py#L187-L187)

## wellbalanced.VolumeSource

*class* · *dataclass*

```python
class VolumeSource
```

Re-exported from: `wellbalanced.global_model`

An external volume source, e.g. ionization or stripping by a fast beam.

Its rate is ``rate * prod n_per`` (m^-3 s^-1): ``rate`` alone, or per unit
density of the species ``per`` (for a beam of density ``n_b`` and speed
``v_b`` ionizing a gas with the cross section ``sigma``,
``rate = n_b sigma v_b`` and ``per = ("gas",)``). Each event changes the
densities by ``changes`` and gives the electrons ``electron_energy`` (eV).
``rate`` may be a function of the electron and gas temperatures in eV,
``rate(T_e, T_g)``, for a source that follows the plasma, e.g. sputtering
by the ion flux to a target (``per = ("Ar+",)``, ``rate`` the Bohm flux
times the yield per volume). In a :class:`~wellbalanced.Fluid1D` it may
also be an array on the cells, a source that varies in space.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/global_model.py#L159-L194)

### wellbalanced.VolumeSource.changes

*attribute* · *instance attribute*

```python
changes: Mapping[str, int]
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/global_model.py#L175-L175)

### wellbalanced.VolumeSource.electron_energy

*attribute* · *class attribute* · *instance attribute*

```python
electron_energy: float = 0.0
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/global_model.py#L178-L178)

### wellbalanced.VolumeSource.name

*attribute* · *class attribute* · *instance attribute*

```python
name: str = 'source'
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/global_model.py#L179-L179)

### wellbalanced.VolumeSource.per

*attribute* · *class attribute* · *instance attribute*

```python
per: Sequence[str] = ()
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/global_model.py#L177-L177)

### wellbalanced.VolumeSource.rate

*attribute* · *instance attribute*

```python
rate: float | np.ndarray | Callable[[float, float], float]
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/global_model.py#L176-L176)

### wellbalanced.VolumeSource.coefficient

*method*

```python
def coefficient(electron_temperature: float, gas_temperature: float) -> float
```

Return ``rate`` at the temperatures (eV).

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/global_model.py#L188-L194)

## wellbalanced.WallReaction

*class* · *dataclass*

```python
class WallReaction
```

Re-exported from: `wellbalanced.global_model`

A neutral species lost at the walls, with a probability per impact.

It returns ``products`` (``{name: number}``), e.g.
``WallReaction("H", 0.1, {"H2": 0.5})`` for atoms recombining to molecules.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/global_model.py#L197-L213)

### wellbalanced.WallReaction.probability

*attribute* · *instance attribute*

```python
probability: float
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/global_model.py#L206-L206)

### wellbalanced.WallReaction.products

*attribute* · *class attribute* · *instance attribute*

```python
products: Mapping[str, float] = field(default_factory=dict)
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/global_model.py#L207-L207)

### wellbalanced.WallReaction.species

*attribute* · *instance attribute*

```python
species: str
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/global_model.py#L205-L205)

## wellbalanced.Winding

*class* · *dataclass*

```python
class Winding
```

Re-exported from: `wellbalanced.spatial.inductive`

One coil winding: a region carrying ``sign`` times the coil current.

**Attributes**

- `shape` (`Any`) — A 2D shape with ``contains_points`` (e.g. a :class:`simgeometry.Circle` of the tube's radius).
- `sign` (`float`) — The direction of the current: ``+1`` or ``-1`` (the two sides of a driver in a cut carry opposite signs), or a turn count.
- `name` (`str`) — A label for the diagnostics.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/spatial/inductive.py#L106-L120)

### wellbalanced.Winding.name

*attribute* · *class attribute* · *instance attribute*

```python
name: str = ''
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/spatial/inductive.py#L120-L120)

### wellbalanced.Winding.shape

*attribute* · *instance attribute*

```python
shape: Any
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/spatial/inductive.py#L118-L118)

### wellbalanced.Winding.sign

*attribute* · *class attribute* · *instance attribute*

```python
sign: float = 1.0
```

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/spatial/inductive.py#L119-L119)

## wellbalanced.spoke_report

*function*

```python
def spoke_report(run: Run, window: tuple[float, float] | None = None) -> SpokeReport
```

Re-exported from: `wellbalanced.driftfluid2d`

The :class:`SpokeReport` of a run over a time window (the last half by default).

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/driftfluid2d.py#L354-L384)

## wellbalanced.stack

*function*

```python
def stack(results: Sequence[_HasDataset], dim: str, values: Sequence[Any] | np.ndarray, *, long_name: str | None = None, units: str = '', attrs: Mapping[str, Any] | None = None) -> xr.Dataset
```

Re-exported from: `wellbalanced.datasets`

The datasets of a scan joined along the scanned parameter.

**Parameters**

- `results` (`Sequence[_HasDataset]`) — The results, e.g. of :meth:`GlobalModel.scan`.
- `dim` (`str`) — The name of the new dimension, e.g. ``"power"``.
- `values` (`Sequence[Any] | np.ndarray`) — The parameter's value of every result.
- `long_name` (`str | None`) (default: `None`) — Its label; ``dim`` if ``None``.
- `units` (`str`) (default: `''`) — Its units.
- `attrs` (`Mapping[str, Any] | None`) (default: `None`) — Further attributes of the dataset.

[View source](https://github.com/max-models/wellbalanced/blob/devel/src/wellbalanced/datasets.py#L33-L67)

**Modules**

- `wellbalanced.datasets`
- `wellbalanced.driftfluid2d`
- `wellbalanced.driver`
- `wellbalanced.fluid1d`
- `wellbalanced.gasdynamics`
- `wellbalanced.global_model`
- `wellbalanced.magnetron`
- `wellbalanced.neutralizer`
- `wellbalanced.reactions`
- `wellbalanced.spatial`
- `wellbalanced.species`
