Steady states
The equations of opencr.solvers.steady, declared on the code that implements them and checked by the tests.
constraint_rows
functionsourceReturn the rows to replace, the constraint matrix and the totals.
- constraint
- Assumes
- one row per conserved element replaced by its total from
Conditions.totals; a missing total raisesUnderdeterminedError - for atomic hydrogen in
fullmode every state holds one H, so the H(n=1) row is replaced
- one row per conserved element replaced by its total from
- Built from
solve_steady
functionsourceReturn the steady densities of the evolving states and the report.
- linear
- quasi neutral
- continuation
- damping
- relaxation
- Assumes
- linear systems (one evolving reactant, given ): one LU solve; a zero diagonal (a state without losses) raises
SingularSystemError - quasi-neutral and linear for given , without a start: the bracket ( the total charge scale) widened by up to 20 times; a negative excess at the lower end raises
- otherwise pseudo-transient continuation with switched evolution relaxation (no separate Newton phase); a step that raises tenfold undamped is rejected with , a non-finite one with
- the default start puts each total in the lowest-energy neutral holder (10% in the lowest ion when quasi-neutral), plus in every state
- negatives within of the largest density are zeroed; only the relative residual decides failure, above
- linear systems (one evolving reactant, given ): one LU solve; a zero diagonal (a state without losses) raises
- References
- Virtanen et al., Nat. Methods 17, 261 (2020) (
splu,brentq)
- Virtanen et al., Nat. Methods 17, 261 (2020) (
- Built from