ChemPy is a Python library that provides functions and classes for solving chemistry related problems. It includes classes for representing substances, reactions, and systems of reactions. It also includes well established formulae from physical chemistry, as well as analytic solutions to some differential equations commonly encountered in chemical kinetics. Last, but not the least, it collects parametrizations of chemical properties of substances from the literature. Its intended audience is primarily researchers and engineers who need to perform modelling work. But since the intermediate representations of, e.g., ODE systems and systems of non-linear equations are available symbolically, ChemPy may also be used in an educational setting. Substances are represented by a class that holds their names and, optionally, information on their composition, weight, charge etc., as well as how to pretty print them using LaTeX, HTML and unicode. Both the composition and stylistic representations can be deduced by ChemPy's parser. Reactions are represented through their stoichiometry and thermodynamic/kinetic parameters. If the stoichiometry of a reaction is unknown, ChemPy can balance it based on the composition of the substances. The classes for representing systems of reactions provide methods to analyze, e.g., if there are disjoint sets of reactions, or if all are connected in the same network. The classes also offer a series of checks performed at initialization, ensuring balanced reactions with sane coefficients and consistent units. Systems of reactions can be represented as graphs, tables, systems of ordinary differential equations (chemical kinetics) or non-linear equations (chemical equilibria). The latter two forms can be solved numerically using pyodesys (Dahlgren 2018b) and pyneqsys (Dahlgren 2018a) respectively.
CITATION STYLE
Dahlgren, B. (2018). ChemPy: A package useful for chemistry written in Python. Journal of Open Source Software, 3(24), 565. https://doi.org/10.21105/joss.00565
Mendeley helps you to discover research relevant for your work.