Invntr
Source

All instruments

stoich_balance

Balances a chemical equation, ionic ones too (charge is a conserved row), by the exact integer null space of its composition matrix; molar masses from formulas with brackets and hydrates; limiting reagent, theoretical and percent yield, excess left over, atom economy.

Field
Chemistry
Version
0.1.0
Runs as
Compiled (Rust)
Typical run
0.01 s

Compiled from source: run sh packs/install.sh once before admitting it.

Known answers it must pass

Admission replaystoich_balance 0.1.0 · files fb2b8f591779…f72b
  1. r0001propane combustion, textbook: C3H8 + 5 O2 -> 3 CO2 + 4 H2O (exact integers)passed

    coefficients= [1, 5, 3, 4][1, 5, 3, 4]lockedexact match
    coefficient_sum= 1313lockedexact match
  2. r0002permanganate oxidises HCl, textbook redox: 2 KMnO4 + 16 HCl -> 2 KCl + 2 MnCl2 + 8 H2O + 5 Cl2 (exact integers)passed

    coefficients= [2, 16, 2, 2, 8, 5][2, 16, 2, 2, 8, 5]lockedexact match
  3. r0003ionic, textbook half-reactions: MnO4- + 5 Fe2+ + 8 H+ -> Mn2+ + 5 Fe3+ + 4 H2O, charge +17 on each side (exact integers)passed

    coefficients= [1, 5, 8, 1, 5, 4][1, 5, 8, 1, 5, 4]lockedexact match
    charge_per_side= 1717lockedexact match
  4. r0004ionic with carets, textbook dichromate-iron(II): Cr2O7^2- + 6 Fe^2+ + 14 H^+ -> 2 Cr^3+ + 6 Fe^3+ + 7 H2O, charge +24 per side (exact integers)passed

    coefficients= [1, 6, 14, 2, 6, 7][1, 6, 14, 2, 6, 7]lockedexact match
    charge_per_side= 2424lockedexact match
  5. r0005classic hard redox with a complex ion, literature coefficients: 10 K4[Fe(CN)6] + 122 KMnO4 + 299 H2SO4 -> 162 KHSO4 + 5 Fe2(SO4)3 + 122 MnSO4 + 60 HNO3 + 60 CO2 + 188 H2O (exact integers)passed

    coefficients= [10, 122, 299, 162, 5, 122, 60, 60, 188][10, 122, 299, 162, 5, 122, 60, 60, 188]lockedexact match
  6. r00064 g H2 + 16 g O2 with H = 1, O = 16 exactly, closed form: O2 limits (0.5 mol), 18 g water, 2 g H2 left, 9 g weighed = 50 % yield, atom economy 100 % (rel 1e-9)passed

    limiting_reagent= O2O2lockedexact match
    extent_mol0.5 ± 5e-100.5lockedunder 0.01 % of the tolerance used
    theoretical_yield_g18 ± 1.8e-0818lockedunder 0.01 % of the tolerance used
    theoretical_yield_mol1 ± 1e-091lockedunder 0.01 % of the tolerance used
    excess_left_g2 ± 2e-092lockedunder 0.01 % of the tolerance used
    percent_yield_pct50 ± 5e-0850lockedunder 0.01 % of the tolerance used
    atom_economy_pct100 ± 1e-07100lockedunder 0.01 % of the tolerance used
  7. r00074 g H2 + 16 g O2 with IUPAC weights, textbook: O2 limits, 18.0 g water (textbook gives 3 significant figures, so abs 0.05 g)passed

    limiting_reagent= O2O2lockedexact match
    theoretical_yield_g18 ± 0.0518.0161locked32 % of the tolerance used
  8. r0008copper(II) sulfate pentahydrate CuSO4.5H2O, textbook molar mass 249.68 g/mol (textbook gives 2 decimals, so abs 0.005)passed

    molar_mass_g_per_mol249.68 ± 0.005249.677locked60 % of the tolerance used
    formula_hill= CuH10O9SCuH10O9Slockedexact match
  9. r0009brackets, exact by construction with integer weights Ca = 40, P = 31, O = 16: Ca3(PO4)2 = 3*40 + 2*31 + 8*16 = 310 g/mol (rel 1e-12)passed

    molar_mass_g_per_mol310 ± 3.1e-10310lockedunder 0.01 % of the tolerance used
    composition.0.count= 3misseddiffers
  10. r0010two balances possible, coefficients given and checked: 3 H2 + 2 O2 -> 2 H2O + H2O2 conserves H (6 = 4 + 2) and O (4 = 2 + 2) by hand count (exact integers)passed

    coefficients= [3, 2, 2, 1][3, 2, 2, 1]lockedexact match
    coefficients_given= truetruelockedexact match
    charge_per_side= 00lockedexact match
10 of 10 cases passed · sandbox macos-seatbeltrecorded from the kernel in a fresh lab

Each line is one reading the kernel checked. The bright band is the tolerance; the needle is the value the instrument actually returned when it was admitted. A needle near the centre line used little of its tolerance.

Inputs

NameUnitDefaultMeaning
equation1Reactants -> products, without coefficients (they are computed). '=', '=>', '<=>' also work. Charges: Fe2+, MnO4-, SO4^2-, [Fe(CN)6]4-; electron e-; phase labels (aq) (s) (l) (g) are dropped. Empty: no balance, only 'formula'.
formula1One formula for its molar mass and mass composition: Ca3(PO4)2, K4[Fe(CN)6], CuSO4.5H2O, SO4^2-. Empty: skipped.
masses_g{}Mass of each reactant you have, in grams, by species as written in the equation: {"H2": 4, "O2": 16}. A reactant left out is taken to be in excess. Each above 0 and at most 1e12 g.
moles_mol{}Amount of each reactant in moles, instead of masses_g (a reactant in only one of the two).
product1The product whose yield is reported, as written in the equation. Empty: the first product.
actual_yield_ggMass of the product you obtained, for the percent yield. Optional: leave it out for no percent yield.
coefficients1Optional: coefficients you already know, one per species in the order written. They are checked for atoms and charge, not computed. Needed when atoms and charge alone allow more than one balance.
atomic_weights{}Atomic weights that replace the built-in IUPAC abridged standard atomic weights (CIAAW 2021), or supply one for an element without a standard weight (Tc, Pm, Po, ...): {"Tc": 98.0}. Each above 0 and at most 1000 g/mol.

Readings

NameUnitMeaning
balanced_equation1The equation with the smallest whole-number coefficients.
coefficients1Coefficients in the order the species are written.
coefficients_given1true when the coefficients were given as an input and only checked.
species1
coefficient_sum1
charge_per_side1Total charge on each side, in elementary charges (equal on both sides by construction).
limiting_reagent1
extent_molmolExtent of reaction set by the limiting reagent: its moles over its coefficient.
product1
theoretical_yield_gg
theoretical_yield_molmol
percent_yield_pct%
excess_left_ggTotal mass of the given reactants left unreacted.
atom_economy_pct%Mass of the chosen product over the mass of all reactants, with the coefficients.
species_table1
atom_balance1
formula_hill1
molar_mass_g_per_molg/mol
formula_charge1
composition1
ok1false when the actual yield is above the theoretical yield.
warnings1

Try the call

Change a value and the command updates. Nothing runs here; paste it into your terminal or give it to your agent.

Terminal
MCP call