### Getting Started
## the 'thermo' object contains thermodynamic data and is also where
## user's settings (definition of chemical system) are stored
data(thermo)
## standard thermodynamic properties of species
subcrt("H2O")
subcrt("alanine")
# names of proteins have an underscore
subcrt("LYSC_CHICK")
# custom temperature range
T <- seq(0, 500, 100)
subcrt("H2O", T=T, P=1000)
# temperature - pressure grid
P <- seq(1000, 4000, 1000)
subcrt("H2O", T=T, P=P, grid="P")
## information about species
# query the database using formulas
info("C6H12O6")
info("SiO2")
# query using names
info("quartz")
si <- info(c("glucose", "mannose"))
# show the equations of state parameters
info(si)
# approximate matches for names or formulas
info("acid ")
info("SiO2 ")
## standard thermodynamic properties of reactions
# fermentation example
info(c("fructose", "ethanol"))
subcrt(c("fructose", "C2H5OH", "CO2"), c(-1, 2, 2))
# weathering example -- also see transfer()
subcrt(c("k-feldspar", "H2O", "H+", "kaolinite", "K+", "SiO2"),
c(-2, -1, -2, 1, 2, 4))
# partial reaction auto-completion is possible
basis(c("SiO2", "H2O", "K+", "H+", "O2"))
subcrt(c("k-feldspar", "kaolinite"), c(-2, 1))
## chemical affinities
# set basis species and their activities or fugacities
basis(c("CO2", "H2O", "O2"), c(-3, 0, -80))
# set species of interest
species(c("CH4", "C2H4O2", "CO2"))
# chemical affinities of formation reactions
# take off $values for complete output
affinity()$values
affinity(O2=c(-90, -60, 4))$values
Run the code above in your browser using DataLab