Next: makeup
Up: CHNOSZ examples
Previous: subcrt
nuts> ## Don't show:
nuts> data(thermo)
thermo: loaded 1997 aqueous, 3089 total species to thermo$obigt
thermo: loaded 5264 proteins to thermo$ECO
thermo: loaded 6717 proteins to thermo$SGD
thermo: loaded 4155 localizations and 3570 abundances to thermo$yeastgfp
nuts> ## End Don't show
nuts> ## examples using convert
nuts> # temperature (Kelvin) to degrees C
nuts> convert(273.15,"C")
[1] 0
nuts> # temperature (degrees C) to Kelvin
nuts> convert(100,"K")
[1] 373.15
nuts> # Gibbs energy (cal mol-1) to/from logK
nuts> convert(1000,"logK")
[1] -0.7330067
nuts> convert(1000,"logK",T=373.15)
[1] -0.5856785
nuts> convert(1,"G")
[1] -1364.244
nuts> # Eh (volt) to pe
nuts> convert(-1,"pe")
[1] -16.90445
nuts> convert(-1,"pe",T=373.15)
[1] -13.50680
nuts> # logfO2 to E0 (volt)
nuts> convert(-80,"E0")
subcrt: 4 species at 298.15 K and 1 bar (wet)
[1] -0.3681732
nuts> convert(-80,"E0",pH=5)
subcrt: 4 species at 298.15 K and 1 bar (wet)
[1] -0.2498612
nuts> convert(-80,"E0",pH=5,logaH2O=-5)
subcrt: 4 species at 298.15 K and 1 bar (wet)
[1] -0.1019711
nuts> # calorie to/from joule
nuts> convert(10,"j")
[1] 41.84
nuts> convert(10,"cal")
[1] 2.390057
nuts> # cm3bar to calories
nuts> convert(10,"calories")
[1] 0.2390057
nuts> ## examples showing user unit preference
nuts> nuts("K") # set temperature units
nuts: temperature in K
nuts> nuts("J") # set energy units
nuts: energy in J
nuts> # return the name of the (E)nergy units
nuts> nuts("E")
[1] "J"
nuts> # print names of all units (NULL return)
nuts> nuts()
nuts: temperature in K
nuts: energy in J
nuts: pressure in bar
nuts> # defaults
nuts> nuts("K"); nuts("bar"); nuts("cal")
nuts: temperature in K
nuts: pressure in bar
nuts: energy in cal
Next: makeup
Up: CHNOSZ examples
Previous: subcrt