utils
species_concentration
Calculate the species concentrations through the mass action law.
With \(S_i\) being the concentration of the species \(i\), \(\beta_i\) the equilibrium constant of the species \(i\), \(C_j\) the concentration of the component \(j\), and \(p_{ij}\) the stoichiometric coefficient of the component \(j\) in the species \(i\).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
concentration |
ndarray
|
The concentration array of shape (n, c+p), where n is the number of points c is the number of components and p is the number of solid species. |
required |
log_beta |
ndarray
|
The logarithm of the equilibrium constants with shape (n, s), where s is the number of solid species. |
required |
stoichiometry |
ndarray
|
The stoichiometry matrix with shape (n, s), where s is the number of soluble species. |
required |
full |
bool
|
If True, return the concentrations of all species including the original concentrations. If False, return only the concentrations of the new species. |
False
|
Returns:
Type | Description |
---|---|
ndarray
|
The calculated species concentrations. |