Tutorials
Jupyter notebooks in this section are executed when the documentation is built. Download a notebook from its page to run it yourself.
- Atomic hydrogen: populations, dominant processes and effective coefficients.
- Emission and spectra: lines, photon emissivity coefficients, line ratios and a synthetic spectrum.
- Ionization balance: closed steady states, quasi-neutrality and export.
- Custom networks: building, checking and saving a network, and non-Maxwellian electrons.
- Time dependence: transients with a stiff integrator, constant and time-dependent conditions.
- Radiation trapping: escape factors, the self-consistent solve, the absorption length.
- Batched scans: the quasi-static reduction of a whole grid at once on cunumpy.
- JAX backend: jitted rates, a vmapped scan and automatic differentiation.
- Molecular hydrogen: the vibrational distribution, effective rates of H₂ and negative ions.
- Sensitivities and inference: sensitivities to the data, uncertainty propagation, and from line ratios.
- Surrogates: a dataset with provenance, a baseline surrogate, held-out errors and the out-of-domain flag.
- Loading figure…
Atomic hydrogen
This tutorial solves the hydrogen/atomic/basic model: the populations of H(n) in a plasma of given electron temperature and density, the processes that set them, and the effective…
- Loading figure…
Emission and spectra
The lines of a solve, their photon emissivity coefficients split into excitation and recombination, line ratios and a synthetic spectrum.
- Loading figure…
Ionization balance
Without prescribed drivers, a closed steady state needs the total density of each element; with electrondensity=None the electron density follows from quasi-neutrality, which makes the problem…
Custom networks
A network is built from plain objects: species, states, rate models and reactions, each reaction with the provenance of its data. This tutorial builds a three-level atom, checks and saves it, and…
- Loading figure…
Time dependence
Model.solvetransient integrates the population equations from initial densities with a stiff integrator (BDF by default) and the model's sparse Jacobian. The prescribed states of the conditions stay…
- Loading figure…
Radiation trapping
An optically thick line is re-absorbed before it leaves the plasma; only a fraction, the escape factor g, of its spontaneous emission gets out. OpenCR applies escape factors explicitly: given per…
- Loading figure…
Batched scans
opencr.scan solves one point after another on the reference path. For quasi-static solves of Maxwellian plasmas, batchedscan evaluates the rate coefficients and the quasi-static reduction of every…
- Loading figure…
JAX backend
With the jax extra, JaxModel runs the rate evaluation, the population equations and the quasi-static reduction on JAX: jitted, vectorised with vmap, and differentiable. See Backends for what it…
- Loading figure…
Molecular hydrogen
hydrogen/molecular/basic resolves H₂ in the vibrational levels of its ground state; hydrogen/molecular/ions adds H⁻ and H₃⁺. The states, processes and limits are in Molecular hydrogen.
- Loading figure…
Sensitivities and inference
How a result depends on the rate data, how uncertain it is, and how to infer Te and ne from line ratios. The methods are in Sensitivities and inference.
Surrogates
A surrogate learns a model's outputs from a dataset of solves; the solver stays the reference. See Sensitivities and inference.
Nothing matches.