Teaching chemical equilibria using open source software OCTAVE

Computational software can greatly enhance the teaching of chemical equilibria by enabling complex problem-solving without simplifications and performing numerous calculations quickly. This work presents two practical examples of varying complexity to demonstrate a general approach for numerically solving multi-equilibria problems, regardless of the types or number of equilibria involved. The method involves creating a system of non-linear equations from equilibrium constant expressions and necessary conservation balances to match the number of chemical species. The exact solution is obtained using the fsolve tool in the open-source software OCTAVE. The method also allows for automatic recalculations with varying initial conditions and graphical representations of species concentrations as a function of selected variables, such as initial concentration or reagent volume.