Next: basis
Up: CHNOSZ examples
Previous: examples
makeup> ## Don't show:
makeup> data(thermo)
thermo$obigt has 1800 aqueous, 2925 total species
makeup> ## End Don't show
makeup> ## makeups (nrow = number of elements)
makeup> # the composition of a single compound (ncol=1)
makeup> makeup("CO2")
count
C 1
O 2
makeup> # negative coefficients
makeup> makeup("C-4O2") # minus four C's
count
C -4
O 2
makeup> makeup("C-4O-2") # interpreted as having charge -2
count
C -4
O 1
Z -2
makeup> makeup("C-4O-2+0") # no charge
count
C -4
O -2
makeup> # sum the compositions
makeup> makeup(c("CO2","CH4"))
count
C 2
O 2
H 4
makeup> # sum with coefficients
makeup> makeup(info(c("CO2","CH4")),c(-1,1))
info: CO2 matches these species:
name abbrv formula state ref1
69 CO2 carbon dioxide CO2 aq SSW01
2683 carbon dioxide CO2 CO2 gas WEP+82
info: CH4 (methane) available in aq, liq, gas.
info: 69 refers to CO2 aq (SSW01, SHS89, 11.Oct.07)
info: 80 refers to methane aq (SH90, 31.Aug.87)
count
C 0
O -2
H 4
makeup> # this one adds up to zero
makeup> makeup(c("C6H12O6","C2H5OH","CO2"),c(-1,2,2))
count
C 0
H 0
O 0
makeup> ## formulas (ncol = number of elements)
makeup> # as a dataframe
makeup> makeup("Zn(CH3CH2CH2CH2CO2)2","")
Zn C H O
1 10 18 4
makeup> print( m <- makeup(c("HCl","H2O"),"") )
H Cl O
3 1 1
makeup> # as a character formula
makeup> makeup(makeup(info("glycinium"),""),"")
info: 1517 refers to glycinium, C2H6NO2+ aq (AH97b, DLH06, 25.Aug.06)
[1] "C2H6NO2+1"
makeup> makeup(m,"")
[1] "H3ClO"
makeup> # C6H12O6
makeup> makeup(makeup(makeup("CHO6H11C5"),""),"")
[1] "C6H12O6"
makeup> ## charged species, electron
makeup> # these return the same:
makeup> makeup("NH4+")
count
N 1
H 4
Z 1
makeup> makeup("NH4Z")
count
N 1
H 4
Z 1
makeup> # constitution of the electron
makeup> makeup(info("e-"))
info: 2 refers to e-, Z-1 aq (NA, 28.Oct.06)
count
Z -1
makeup> # this produce an incorrect makeup for the electron,
makeup> # and gives a warning because "e" is not in the
makeup> # table of elements.
makeup> makeup("e-")
count
e 1
Z -1
makeup> # compositions of made-up compounds
makeup> makeup("CHNOS")
count
C 1
H 1
N 1
O 1
S 1
makeup> makeup("CHNOSZ")
count
C 1
H 1
N 1
O 1
S 1
Z 1
makeup> makeup("CHNOSe") # Se is an element
count
C 1
H 1
N 1
O 1
Se 1
Next: basis
Up: CHNOSZ examples
Previous: examples