Cabal-Version: 2.2
Name: chemical-equation
Version: 0.0.2
Synopsis: Balance chemical equations
Description:
Balance coefficients of chemical equations.
You only give the list of reactants,
the program will automatically find out
on which side of the equation the reactants are placed.
However, the first reactant is always placed on the left side
and the order of all reactants is preserved as good as possible.
.
> $ balance-chemical-equation C O2 CO2
> C + O2 <=> CO2
.
> $ balance-chemical-equation CH4 O2 CO2 H2O
> CH4 + 2 O2 <=> CO2 + 2 H2O
.
> $ balance-chemical-equation C8H18 O2 CO2 H2O
> 2 C8H18 + 25 O2 <=> 16 CO2 + 18 H2O
.
> $ balance-chemical-equation NH4Cl "Ca(OH)2" NH3 CaCl2 H2O
> 2 NH4Cl + Ca(OH)2 <=> 2 NH3 + CaCl2 + 2 H2O
.
You may use a custom reaction arrow:
.
> $ balance-chemical-equation --arrow="->" HCl NaOH NaCl H2O
> HCl + NaOH -> NaCl + H2O
.
You may choose output of Unicode subscript and arrow characters:
.
> $ balance-chemical-equation --unicode --arrow=$'\u21CC' N2 H2 NH3
.
Ion charges in @mhchem@ notation:
.
> $ balance-chemical-equation --unicode --arrow=$'\u2192' Ca^2+ Cl^- CaCl2
.
If you mix multiple reactions
then the program takes them apart, again.
However, the resulting partial reactions may not be chemically sensible.
.
> $ balance-chemical-equation C CH4 O2 CO2 H2O
> 2 C + 2 H2O <=> CH4 + CO2
> C + O2 <=> CO2
.
The program knows nothing about chemistry and has no dictionary of elements.
It cannot check whether the reactants are existing chemical substances
or whether the reactions can happen in the real world.
It accepts any capital letter followed
by many lower-case letters as element symbols.
.
Mathematically speaking, balancing a reaction equation
means computing the nullspace of an integer matrix,
where all coefficients in the nullspace vectors are in turn integers.
The matrix has a row for every element and a column for every reactant
and every cell contains
the multiplicity of an element in the according reactant.
Our solver transforms this matrix to Reduced Row Echelon form,
a generalization of Gauss elimination.
Homepage: https://hub.darcs.net/thielema/chemical-equation
License: BSD-3-Clause
License-File: LICENSE
Author: Henning Thielemann
Maintainer: haskell@henning-thielemann.de
Category: Chemistry
Build-Type: Simple
Flag flint
Description: Implementation using FLINT library
Manual: True
Default: False
Flag lapack
Description: Enable experimental implementation using LAPACK
Manual: True
Default: False
Source-Repository this
Tag: 0.0.2
Type: darcs
Location: https://hub.darcs.net/thielema/chemical-equation
Source-Repository head
Type: darcs
Location: https://hub.darcs.net/thielema/chemical-equation
Executable balance-chemical-equation
Build-Depends:
numeric-quest >=0.2.1 && <0.3,
shell-utility >=0.1 && <0.2,
optparse-applicative >=0.11 && <0.20,
comfort-array >=0.5 && <0.6,
parsec >=3.1 && <3.2,
unicode >=0.0 && <0.1,
transformers >=0.3 && <0.7,
containers >=0.4 && <0.9,
non-empty >=0.3 && <0.4,
utility-ht >=0.0.11 && <0.1,
base >=4.5 && <5
Default-Language: Haskell2010
GHC-Options: -Wall
Hs-Source-Dirs: src
Main-is: Main.hs
Other-Modules:
Common
Executable balance-chemical-equation-flint
If flag(flint)
Build-Depends:
shell-utility >=0.1 && <0.2,
optparse-applicative >=0.11 && <0.20,
comfort-array >=0.5 && <0.6,
parsec >=3.1 && <3.2,
unicode >=0.0 && <0.1,
transformers >=0.3 && <0.7,
containers >=0.4 && <0.9,
non-empty >=0.3 && <0.4,
utility-ht >=0.0.11 && <0.1,
base >=4.5 && <5
Else
Buildable: False
PkgConfig-Depends: flint >=3 && <4
Default-Language: Haskell2010
GHC-Options: -Wall
Hs-Source-Dirs: src
Main-is: FLINT.hs
Other-Modules:
FLINT.Example
FLINT.Utility
FLINT.MatrixInteger
FLINT.Integer
FLINT.Type
Common
Executable balance-chemical-equation-lapack
If flag(lapack)
Build-Depends:
shell-utility >=0.1 && <0.2,
optparse-applicative >=0.11 && <0.20,
lapack >=0.4 && <0.6,
netlib-ffi >=0.1 && <0.2,
comfort-array >=0.5 && <0.6,
parsec >=3.1 && <3.2,
unicode >=0.0 && <0.1,
containers >=0.4 && <0.9,
non-empty >=0.3 && <0.4,
utility-ht >=0.0.11 && <0.1,
base >=4.5 && <5
Else
Buildable: False
Default-Language: Haskell2010
GHC-Options: -Wall
Hs-Source-Dirs: src
Main-is: LAPACK.hs
Other-Modules: LAPACK.Common, Common