data(thermo)
## makeups (nrow = number of elements)
# the composition of a single compound (ncol=1)
makeup("CO2")
# negative coefficients
makeup("C-4O2") # minus four C's
makeup("C-4O-2") # interpreted as having charge -2
makeup("C-4O-2+0") # no charge
# sum the compositions
makeup(c("CO2","CH4"))
# sum with coefficients
makeup(info(c("CO2","CH4")),c(-1,1))
# this one adds up to zero
makeup(c("C6H12O6","C2H5OH","CO2"),c(-1,2,2))
## formulas (ncol = number of elements)
# as a dataframe
makeup("Zn(CH3CH2CH2CH2CO2)2","")
print( m <- makeup(c("HCl","H2O"),"") )
# as a character formula
makeup(makeup(info("glycinium"),""),"")
makeup(m,"")
# C6H12O6
makeup(makeup(makeup("CHO6H11C5"),""),"")
## charged species, electron
# these return the same:
makeup("NH4+")
makeup("NH4Z")
# constitution of the electron
makeup(info("e-"))
# this produce an incorrect makeup for the electron,
# and gives a warning because "e" is not in the
# table of elements.
makeup("e-")
# compositions of made-up compounds
makeup("CHNOS")
makeup("CHNOSZ")
makeup("CHNOSe") # Se is an element
Run the code above in your browser using DataLab