Class ReactionBalancer
java.lang.Object
org.episteme.natural.chemistry.ReactionBalancer
Utility for balancing chemical equations.
- Since:
- 1.0
- Author:
- Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
-
Method Summary
-
Method Details
-
balance
Balances a chemical equation string. Example: "H2 + O2 = H2O" -> "2H2 + O2 -> 2H2O"- Parameters:
equation- The unbalanced reaction equation.- Returns:
- A balanced ChemicalReaction object.
-
balance
Balances coefficients for a given set of reactants and products.- Parameters:
compounds- List of all compound formulas involved. Reactants first, then Products.isProduct- Boolean array corresponding to compounds.- Returns:
- Map of Compound -> Coefficient
-