I'm working on modeling reactions involving combinations of hydrogen (H), nitrogen (N), and strontium (Sr) elements. I've obtained the temperature-dependent Gibbs free energy of formation, enthalpy, and entropy for all the species involved in these reactions. My goal is to determine the extent of the reaction (denoted as x) as a function of pressure (p) and temperature (T) using the activity of these species.
In my model, all species containing Sr* are considered solid, and I've set their activity to one. For gas-phase species, I'm calculating the activity using the following expression:
$$ \text{activity(p, x)}_\text{gas} = \left( \frac{p}{p_{\text{ref}}} \cdot \frac{n_{i,0} + \text{exponent_sign} \cdot v_i \cdot x}{\sum n_i + x \cdot \sum v_i} \right)^{v_i \cdot \text{exponent_sign}} $$
Here, $v_i$ represents the stoichiometric coefficient of species, $n_{i,0}$ is the initial mole amount of species, $\sum n_i$ is the total initial mole amount, $\sum v_i$ is the total stoichiometric coefficient, and exponent_sign is negative for reactants and positive for products.
To calculate the Gibbs energy of the reaction: $$ G(T, p, x) = G_{\text{formation}}(T) + R \cdot T \cdot \ln{\left( \prod_{i} a_i(x, p) \right)} $$
However, when I attempt to minimize this expression, I'm obtaining reaction extents of either 1 or 0, but not values in between. I suspect there might be an error in my approach, or perhaps I'm overlooking something. Can anyone offer insights into what might be causing this issue? Alternatively, if my approach is incorrect, I would appreciate suggestions on how to accurately calculate the reaction extent as a function of pressure and temperature using the available data.
Any assistance or guidance on this matter would be greatly appreciated! Thank you in advance for your help :)
Edit:
- I'm currently confused about calculating the total mole amount using: $$ \sum {n_i}, $$ Should this summation include both species in solid and gas phases, or only species in gas phase? Similarly, I'm uncertain about:$$ \sum {v_i}, $$ In my understanding, both terms are meant to reflect "Le Chatelier's Principle." Do solids have an effect on this summation, or should it only consider gas species?
- If the function values of $G(T, p, x)$ for all reaction extend $x$ are negative respective positive, what does that mean?