Skip to content
Projects

Population equations

The equations of opencr.kinetics.system, declared on the code that implements them and checked by the tests.

conservation

functionsource

Return the conserved elements and their matrix over the evolving states.

conserved
∑icei νir=0for every reaction r⇒ddt∑iceini=0\sum_i c_{ei}\, \nu_{ir} = 0 \quad \text{for every reaction } r \qquad \Rightarrow \qquad \frac{d}{dt}\sum_i c_{ei} n_i = 0
Assumes
  • ceic_{ei} the atoms of element ee in evolving state ii; checked to 10−1210^{-12}
  • elements only: charge is not a row, since the electron is not a state
  • a reaction that moves an element to a prescribed state or out of the system (wall loss, pumping) removes it from the list

electron_density

functionsource

Return n_e for the evolving densities n.

quasi neutral
ne=max⁡(0, ∑jzjnj)n_e = \max\Big(0,\ \sum_j z_j n_j\Big)
Assumes
  • the sum runs over every charged state, prescribed and evolving; the electron is never a state
  • with Conditions.electron_density given, nen_e is that value

jacobian

functionsource

Return dR/dn as a sparse matrix.

jacobian
∂Ri∂nc=∑rνir[krneare∏pnparp∂∂nc∏jnjarj+are kr neare−1zc∏pnparp∏jnjarj]\frac{\partial R_i}{\partial n_c} = \sum_r \nu_{ir} \left[ k_r n_e^{a_{re}} \prod_p n_p^{a_{rp}} \frac{\partial}{\partial n_c}\prod_j n_j^{a_{rj}} + a_{re}\, k_r\, n_e^{a_{re}-1} z_c \prod_p n_p^{a_{rp}} \prod_j n_j^{a_{rj}} \right]
Assumes
  • the second term only for a quasi-neutral nen_e
  • a reactant listed twice is two slots: the derivative of each slot is the product of the others, summed
  • assembled analytically as a sparse matrix

linear_parts

functionsource

Return M and b of R = M n + b for a linear system.

linear
R(n)=Mn+b,M=J(0),b=R(0)R(\mathbf n) = M\mathbf n + \mathbf b, \qquad M = J(\mathbf 0), \qquad \mathbf b = R(\mathbf 0)
Assumes
  • at most one evolving reactant per reaction and a given nen_e
Built from

reaction_rates

functionsource

Return w_r in m^-3 s^-1 for every reaction at the densities n.

rate
wr=kr neare∏pnparp∏iniariw_r = k_r\, n_e^{a_{re}} \prod_p n_p^{a_{rp}} \prod_i n_i^{a_{ri}}
Assumes
  • aria_{ri} the multiplicity of state ii among the reactants (a state listed twice counts twice), area_{re} that of the electron
  • pp the prescribed states (Conditions.densities), ii the evolving ones; krk_r and the prescribed densities are folded into one factor per reaction
  • mass action: krk_r in m3(k−1)^{3(k-1)}/s for kk reactants
Built from

rhs

functionsource

Return R(n) = dn/dt for the evolving states.

balance
dnidt=Ri(n)=∑rνir wr\frac{dn_i}{dt} = R_i(\mathbf n) = \sum_r \nu_{ir}\, w_r
Assumes
  • νir\nu_{ir} the net stoichiometry (products minus reactants) over the evolving states
  • zero-dimensional: no transport beyond explicit wall-loss and pumping reactions
References
Built from