VII. Applications: sciences, economics and optimization
47. Chemistry
Chemistry calculations are in the "Applications" section of the home screen, the Chemistry field: balancing a chemical equation, the pH of an acid, a base, a salt or a polyprotic acid, a buffer, a titration with its curve, the Arrhenius equation and the Beer–Lambert law. In the form you choose the problem and the quantity sought and fill in the values with their units; the "?" icon explains where the formula comes from. Small constants can be typed as 1.8e-5 or 1,8·10^-5, measured values (a table of temperatures, a calibration) as numbers separated by spaces.
A chemical equation can simply be typed into the manual input, e.g. Fe + O2 -> Fe2O3 (the arrow -> or =, an equilibrium <=>), also with ions MnO4^- and Fe^3+, brackets Ca(OH)2, hydrates CuSO4·5H2O and states (aq). The coefficients are the kernel of the matrix of the elements' (and the charge's) balance: the steps write the balance equations, the matrix, its reduced form by Gaussian elimination, the free coefficient as a parameter and the smallest whole numbers, then a check. It also recognizes an equation that can't be balanced (an element on one side only, a substance on the wrong side) or whose balance isn't unique.
The pH is computed exactly (for a weak acid by a quadratic equation), with the school simplification and the degree of dissociation alongside; for a polyprotic acid the charge balance is solved numerically and the graph shows the shares of the acid's forms against pH. For a buffer with a strong acid or base added it computes the new equilibrium and the change of pH. A titration gets its pH by the region of the curve (the start, the buffer region, the equivalence point, the excess titrant) and the graph shows the whole titration curve. The Arrhenius equation from two measurements or from a table by the regression of ln k against 1/T; the Beer–Lambert law from a known ε, a standard or a calibration line.
Examples
KMnO4 + HCl -> KCl + MnCl2 + H2O + Cl2


MnO4^- + Fe^2+ + H^+ -> Mn^2+ + Fe^3+ + H2O


model(ph; find=pH[one]; c=0.1[mol_l]; K=1.8e-5[one]; kind=weakAcid; constant=K)![model(ph; find=pH[one]; c=0.1[mol_l]; K=1.8e-5[one]; kind=weakAcid; constant=K)](img/chem-weak-acid.png)
![model(ph; find=pH[one]; c=0.1[mol_l]; K=1.8e-5[one]; kind=weakAcid; constant=K)](img/chem-weak-acid-1.png)
![model(ph; find=pH[one]; c=0.1[mol_l]; K=1.8e-5[one]; kind=weakAcid; constant=K)](img/chem-weak-acid-2.png)
model(ph; find=pH[one]; c=0.1[mol_l]; K1=7.5e-3[one]; K2=6.2e-8[one]; K3=4.8e-13[one]; kind=polyprotic; constant=K)![model(ph; find=pH[one]; c=0.1[mol_l]; K1=7.5e-3[one]; K2=6.2e-8[one]; K3=4.8e-13[one]; kind=polyprotic; constant=K)](img/chem-polyprotic.png)
![model(ph; find=pH[one]; c=0.1[mol_l]; K1=7.5e-3[one]; K2=6.2e-8[one]; K3=4.8e-13[one]; kind=polyprotic; constant=K)](img/chem-polyprotic-1.png)
![model(ph; find=pH[one]; c=0.1[mol_l]; K1=7.5e-3[one]; K2=6.2e-8[one]; K3=4.8e-13[one]; kind=polyprotic; constant=K)](img/chem-polyprotic-2.png)
model(buffer; find=pH[one]; pK=4.74[one]; ca=0.1[mol_l]; cs=0.1[mol_l]; V=100[ml]; n=1[mmol]; kind=acidic; constant=pK; add=acid)![model(buffer; find=pH[one]; pK=4.74[one]; ca=0.1[mol_l]; cs=0.1[mol_l]; V=100[ml]; n=1[mmol]; kind=acidic; constant=pK; add=acid)](img/chem-buffer.png)
![model(buffer; find=pH[one]; pK=4.74[one]; ca=0.1[mol_l]; cs=0.1[mol_l]; V=100[ml]; n=1[mmol]; kind=acidic; constant=pK; add=acid)](img/chem-buffer-1.png)
![model(buffer; find=pH[one]; pK=4.74[one]; ca=0.1[mol_l]; cs=0.1[mol_l]; V=100[ml]; n=1[mmol]; kind=acidic; constant=pK; add=acid)](img/chem-buffer-2.png)
model(titration; find=pH[one]; ca=0.1[mol_l]; Va=25[ml]; ct=0.1[mol_l]; K=1.8e-5[one]; Vt=25[ml]; kind=weakAcid; constant=K)![model(titration; find=pH[one]; ca=0.1[mol_l]; Va=25[ml]; ct=0.1[mol_l]; K=1.8e-5[one]; Vt=25[ml]; kind=weakAcid; constant=K)](img/chem-titration.png)
![model(titration; find=pH[one]; ca=0.1[mol_l]; Va=25[ml]; ct=0.1[mol_l]; K=1.8e-5[one]; Vt=25[ml]; kind=weakAcid; constant=K)](img/chem-titration-1.png)
![model(titration; find=pH[one]; ca=0.1[mol_l]; Va=25[ml]; ct=0.1[mol_l]; K=1.8e-5[one]; Vt=25[ml]; kind=weakAcid; constant=K)](img/chem-titration-2.png)
model(arrhenius; find=Ea[kJ_mol]; TT=25 35 45 55[degC]; kk=0.001 0.0021 0.0042 0.0079[per_s]; input=table)![model(arrhenius; find=Ea[kJ_mol]; TT=25 35 45 55[degC]; kk=0.001 0.0021 0.0042 0.0079[per_s]; input=table)](img/chem-arrhenius.png)
![model(arrhenius; find=Ea[kJ_mol]; TT=25 35 45 55[degC]; kk=0.001 0.0021 0.0042 0.0079[per_s]; input=table)](img/chem-arrhenius-1.png)
![model(arrhenius; find=Ea[kJ_mol]; TT=25 35 45 55[degC]; kk=0.001 0.0021 0.0042 0.0079[per_s]; input=table)](img/chem-arrhenius-2.png)
model(beer; find=c[mmol_l]; cc=0 0.1 0.2 0.3 0.4[mmol_l]; AA=0.002 0.151 0.299 0.452 0.598[one]; A=0.25[one]; input=calibration; measure=absorbance)![model(beer; find=c[mmol_l]; cc=0 0.1 0.2 0.3 0.4[mmol_l]; AA=0.002 0.151 0.299 0.452 0.598[one]; A=0.25[one]; input=calibration; measure=absorbance)](img/chem-beer.png)
![model(beer; find=c[mmol_l]; cc=0 0.1 0.2 0.3 0.4[mmol_l]; AA=0.002 0.151 0.299 0.452 0.598[one]; A=0.25[one]; input=calibration; measure=absorbance)](img/chem-beer-1.png)
![model(beer; find=c[mmol_l]; cc=0 0.1 0.2 0.3 0.4[mmol_l]; AA=0.002 0.151 0.299 0.452 0.598[one]; A=0.25[one]; input=calibration; measure=absorbance)](img/chem-beer-2.png)
model(diffusion; find=t[h]; D=1.6e-11[m2_s]; cs=1.2[pct]; c0=0.25[pct]; cx=0.8[pct]; x=0.5[mm]; process=carburizing)![model(diffusion; find=t[h]; D=1.6e-11[m2_s]; cs=1.2[pct]; c0=0.25[pct]; cx=0.8[pct]; x=0.5[mm]; process=carburizing)](img/diffusion-carburizing.png)
![model(diffusion; find=t[h]; D=1.6e-11[m2_s]; cs=1.2[pct]; c0=0.25[pct]; cx=0.8[pct]; x=0.5[mm]; process=carburizing)](img/diffusion-carburizing-1.png)
![model(diffusion; find=t[h]; D=1.6e-11[m2_s]; cs=1.2[pct]; c0=0.25[pct]; cx=0.8[pct]; x=0.5[mm]; process=carburizing)](img/diffusion-carburizing-2.png)
model(diffusion; find=c[pct]; D=1.6e-11[m2_s]; cs=1.2[pct]; c0=0.25[pct]; x=0.5[mm]; t=7[h]; process=carburizing)![model(diffusion; find=c[pct]; D=1.6e-11[m2_s]; cs=1.2[pct]; c0=0.25[pct]; x=0.5[mm]; t=7[h]; process=carburizing)](img/diffusion-profile.png)
![model(diffusion; find=c[pct]; D=1.6e-11[m2_s]; cs=1.2[pct]; c0=0.25[pct]; x=0.5[mm]; t=7[h]; process=carburizing)](img/diffusion-profile-1.png)
![model(diffusion; find=c[pct]; D=1.6e-11[m2_s]; cs=1.2[pct]; c0=0.25[pct]; x=0.5[mm]; t=7[h]; process=carburizing)](img/diffusion-profile-2.png)
Known limitations
- pH and titrations assume 25 °C (Kw = 10⁻¹⁴) and dilute solutions – activity coefficients aren't computed.
- Titrations of a monoprotic acid or base by a strong titrant only; polyprotic acids so far only as the pH of a solution.
- A chemical equation isn't recognized from a photo yet – type it into the manual input or the form.