next up previous
Next: [3] affinity Up: CHNOSZ examples Previous: swap.basis

species

## Don't show: data(thermo)
thermo$obigt: 1809 aqueous, 3368 total species
## End(Don't show) # set up the basis species basis("CHNOS")
C H N O S ispecies logact state CO2 1 0 0 2 0 69 -3 aq H2O 0 2 0 1 0 1 0 liq NH3 0 3 1 0 0 68 -4 aq H2S 0 2 0 0 1 70 -7 aq O2 0 0 0 2 0 3095 -80 gas
# show the formation reactions of some species ispecies <- info(c("glutamic acid","phenylalanine"))
info.character: found glutamic acid(aq), also available in cr info.character: found phenylalanine(aq), also available in cr
species.basis(ispecies)
CO2 H2O NH3 H2S O2 [1,] 5 3 1 0 -4.5 [2,] 9 4 1 0 -10.0
# add, modify, delete species species(c("CO2","NH3")) # aqueous species
CO2 H2O NH3 H2S O2 ispecies logact state name 1 1 0 0 0 0 69 -3 aq CO2 2 0 0 1 0 0 68 -3 aq NH3
species(c("CO2","NH3"),"gas") # gases
CO2 H2O NH3 H2S O2 ispecies logact state name 1 1 0 0 0 0 69 -3 aq CO2 2 0 0 1 0 0 68 -3 aq NH3 3 1 0 0 0 0 3087 0 gas carbon dioxide 4 0 0 1 0 0 3094 0 gas ammonia
# delete the first couple of species species(1:2,delete=TRUE)
CO2 H2O NH3 H2S O2 ispecies logact state name 1 1 0 0 0 0 3087 0 gas carbon dioxide 2 0 0 1 0 0 3094 0 gas ammonia
# modify the logarithms of activities (actually # fugacities) of the remaining species species(1:2,c(-2,-5))
CO2 H2O NH3 H2S O2 ispecies logact state name 1 1 0 0 0 0 3087 -2 gas carbon dioxide 2 0 0 1 0 0 3094 -5 gas ammonia
# set the species to aqueous species(1:2,"aq")
CO2 H2O NH3 H2S O2 ispecies logact state name 1 1 0 0 0 0 69 -2 aq CO2 2 0 0 1 0 0 68 -5 aq NH3
# delete all the species (returns the existing species # definition, then deletes the species) sd <- species(delete=TRUE) # changing the elements in the basis definition # causes species to be deleted basis(c("CaO", "CO2", "H2O", "SiO2", "MgO", "O2"))
C Ca H Mg O Si ispecies logact state CaO 0 1 0 0 1 0 1967 0 cr CO2 1 0 0 0 2 0 69 0 aq H2O 0 0 2 0 1 0 1 0 liq SiO2 0 0 0 0 2 1 72 0 aq MgO 0 0 0 1 1 0 2002 0 cr O2 0 0 0 0 2 0 67 0 aq
species(c("dolomite", "quartz", "calcite", "forsterite"))
CaO CO2 H2O SiO2 MgO O2 ispecies logact state name 1 1 2 0 0 1 0 1901 0 cr dolomite 2 0 0 0 1 0 0 2014 0 cr1 quartz 3 1 1 0 0 0 0 1860 0 cr calcite 4 0 0 0 1 2 0 1929 0 cr forsterite
basis(c("CO2", "H2O", "O2"))
C H O ispecies logact state CO2 1 0 2 69 0 aq H2O 0 2 1 1 0 liq O2 0 0 2 67 0 aq
species() # NULL
NULL


next up previous
Next: [3] affinity Up: CHNOSZ examples Previous: swap.basis