Check if reaction is stoichiometry balanced
rcolpo opened this issue · 1 comments
rcolpo commented
Is there are why to check if a chemical equation is stoichiometry balanced?
For example, "C5H6N2O5 + H + HO4P = C4H6N1O4 + C1H2N1O5P1" is balanced and should return True. "C5H6N2O5 + HO4P = C4H6N1O4 + C1H2N1O5P1" is unbalanced and should return false.
bjodah commented
Sure, if you create a ReactionSystem (using .from_string
is the easiest when your substances are represented by their chemical formulae), you can call .obeys_mass_balance()
:
chempy/chempy/reactionsystem.py
Line 356 in dd8b934