Warning, /education/kalzium/src/solver/README is written in an unsupported language. File is not indexed.
0001 You will need a working objective caml installation and 0002 the FaCiLe library properly configured and installed 0003 to compile eqchem. 0004 0005 In practice, one would only run make in this directory (src/solver) 0006 "make" 0007 "make clean", etc 0008 0009 To assemble with a c++ or a kde program, the object files 0010 solver.o and modwrap.o must be added and linked with : 0011 -L/usr/lib/ocaml -L/usr/lib/ocaml/facile -lasmrun -lstr -lnums -lm -ldl solver.o modwrap.o 0012 0013 The program built can then be run without the objective caml tools. 0014 0015 Console examples can also be generated (try "make test") 0016 0017 0018 == Comments for usage == 0019 0020 The goal is to solve simple chemical equations of the form : 0021 a formula1 + b formula2 ... -> c formula3 + d formula4 .. 0022 like in : aCH3CH2OH + bO2 -> cH2O + dCO2 0023 (1 CH3CH2OH + 3 O2 -> 3 H2O + 2 CO2 is suggested as a solution) 0024 0025 The solver finds integer values for the quantities a, b, c, d 0026 and can be used to point out mistakes in formula or for searching new ones. 0027 0028 It is also possible to give initial values for the quantities a, b, c .. 0029 for instance 3 CH3CH2OH + bO2 -> cH2O + dCO2 0030 (a possible solution is : 3 CH3CH2OH + 9 O2 -> 9 H2O + 6 CO2) 0031 0032 Using the solver 0033 ---------------- 0034 0035 *** Parenthesis are allowed, provided that 0036 a value is present after the closing parenthesis 0037 0038 aCH3(CH2)3COOH + bO2 -> cH2O + dCO2 0039 aCH3(CH2)2CH3 + bCH3CH2CH3+bO2 -> cH2O + dCO2 0040 0041 *** It is possible to insert a value instead of a symbol 0042 on the left of a molecule, as in the following examples : 0043 xCH4 + yC2H6 + zO2 + uHNO3 -> cH2O + dCO2 + eNO2 0044 3CH4 + 2C2H6 + zO2 + uHNO3 -> cH2O + dCO2 + eNO2 0045 1CH4 + 5C2H6 + zO2 + 10HNO3 -> cH2O + dCO2 + eNO2 0046 0047 *** If the equation in input does not match the syntax 0048 the solver will answer "Parse error" 0049 * missing number after parenthesis 0050 * missing arrow in the middle 0051 * missing number on the left of a molecule 0052 * ambiguous characters : 0/O, l/L/1 0053 0054 *** When the solver will answer "Not found" when it 0055 encounters an infeasible equation like the following : 0056 1CH4 + 1O2 + 1HNO3 -> cH2O + fCH2ONO2 + eNO2 0057 0058 **** electric charges are allowed using the following syntax 0059 4H2O -> aH3O[+]+bOH[-] 0060 aFe[2+]+bMnO4[-]+cH3O[+]->dMn[2+]+eH2O+fFe[3+] 0061 0062 WARNING: 0063 since eqchem computes integers, equations like this : 0064 xCH4 + 3C2H6 + zO2 -> cH2O + dCO2 0065 do not always have a solution (in this case, z would be 29/2)