data(thermo)
## set up a system and calculate
## chemical affinities of formation reactions.
basis(c('SiO2','MgO','H2O','O2'),c(-5,-5,0,999))
species(c('quartz','enstatite','forsterite'))
# chemical affinities (A/2.303RT) at 25 deg C and 1 bar
affinity()
# at higher temperature and pressure
affinity(T=500,P=2000)
# ten different temperatures at one pressure
affinity(T=c(500,1000,10),P=2000)
# at 25 temperatures and pressures
affinity(T=c(500,1000,5),P=c(1000,5000,5))
# as a function of logarithm of activity of MgO
affinity(MgO=c(-10,-5,10))
## equilibrium constants of formation reactions
affinity(property='logK')
# Standard molal Gibbs energies of species,
# dimensionless (-G/2.303RT)
affinity(property='G.species')
# Standard molal Gibbs energies of species,
# user dimensions (default: calories)
affinity(property='G')
## Activity of glycine as a function of those of
## HCN and formaldehyde (200 C, 300 bar)
## After Schulte and Shock, 1995, Fig. 5
# we can define the basis as this:
basis(c('formaldehyde','H2O','HCN','O2'))
species('glycine')
t <- affinity(HCHO=c(-10,-2,9),HCN=c(-18,-2,9),T=200,P=300)
# that gave us *affinities* (dimensionless) for logact(glycine)=-3
# (the default). we can now find the *activities* that
# correspond to affinity=0
logact.glycine <- species()$logact + t$values[[1]]
# note transposition of the z-value matrix in the following command
contour(x=-10:-2,y=seq(-18,-2,by=2),z=t(logact.glycine),
xlab=axis.label('HCHO'),ylab=axis.label('HCN'),
labcex=1,xaxs='i',yaxs='i')
title(main=paste('log activity glycine, after Schulte and Shock, 1995<n>',
describe(x=NULL),', logaH2O = 1'))
### amino acid synthesis at low and high temperatures
### after Amend and Shock, 1998
# select the basis species and species of interest
# and set their activities (first for the 18 degree C case)
basis(c('H2O','CO2','NH4+','H2','H+','H2S'),
rep('aq',6),log10(c(1,1e-4,5e-8,2e-9,5e-9,1e-15)))
species(c('alanine','argininate','asparagine','aspartate','cysteine',
'glutamate','glutamine','glycine','histidine','isoleucine',
'leucine','lysinium','methionine','phenylalanine','proline',
'serine','threonine','tryptophan','tyrosine','valine'),
log10(c(3.9,0.7,1.1,3.3,0.5,3.8,1.0,5.8,1.2,0.7,
0.8,1.0,2.8,0.5,0.5,4.6,5.8,0.6,0.9,2.8)/1e9))
Tc <- 18
T <- convert(Tc,'K')
# converting A (dimensionless) to G of reaction (cal/mol)
# is like converting log K to standard G of reaction
AS98.18 <-
convert(convert(as.numeric(affinity(T=Tc)$values),'G',T=T),'J')/1000
# the 100 degree C case
Tc <- 100
T <- convert(Tc,'K')
basis(c('H2O','CO2','NH4+','H2','H+','H2S'),
log10(c(1,2.2e-3,2.9e-6,3.4e-4,1.9e-6,1.6e-3)))
species(1:20,log10(c(2.8e-9,5.0e-10,7.9e-10,2.4e-9,3.6e-10,
2.7e-9,7.2e-10,4.2e-9,8.6e-10,5.0e-10,
5.7e-10,7.2e-10,2.0e-9,3.6e-10,3.6e-10,
3.3e-9,4.2e-9,4.3e-10,6.5e-10,2.0e-9)))
AS98.100 <-
convert(convert(as.numeric(affinity(T=Tc)$values),'G',T=T),'J')/1000
# the nominal carbon oxidation state
Z.C <- ZC(as.character(thermo$obigt$formula[thermo$species$ispecies]))
# put them together
print(data.frame(T100=AS98.100,T18=AS98.18,Z.C=Z.C))
# values not exactly reproducing AS98 - different amino acid parameters
## affinities of metabolic reactions
## after Amend and Shock, 2001, Fig. 7
# forget species from last example
species(delete=TRUE)
basis(c('CO2','H2','NH3','O2','H2S','H+'))
basis(c('O2','H2'),'aq') # O2 and H2 were gas
species('H2O')
doplot <- function(T) {
res <- 20
t <- affinity(H2=c(-10,0,res),O2=c(-10,0,res),T=T)
T.K <- convert(T,'K') # temperature in Kelvin
t <- convert(t$values[[1]],'G',T.K) # affinities (cal/mol)
t <- convert(t,'J') # affinities (Joule)
contour(x=seq(-10,0,length.out=res),
y=seq(-10,0,length.out=res),z=t(t/1000),
labcex=1,xlab=axis.label('H2'),ylab=axis.label('O2'))
}
layout(matrix(c(1,1,2,3,4,5),ncol=2,byrow=TRUE),heights=c(1,4,4))
T <- c(25,55,100,150)
par(mar=c(0,0,0,0))
plot.new()
text(0.5,0.1,paste(c('H2(aq) + 0.5O2(aq) = H2O(liq)<n><n>',
'after Amend and Shock, 2001')),cex=2)
par(mar=c(3,3,0.5,0.5),cex=1.3,mgp=c(2,1,0))
for(i in 1:length(T)) doplot(T[i])
# this is so the plots in the next examples show up OK
layout(matrix(1))
## continuation of last example, affinity calculations
## in three dimensions
print(affinity(H2=c(-10,0,3),O2=c(-10,0,3),T=c(25,150,4))$values)</n>
<references>Amend, J. P. and Shock, E. L., 1998. Energetics of amino acid synthesis in hydrothermal ecosystems. <em>Science</em>, 281, 1659-1662.
Amend, J. P. and Shock, E. L., 2001. Energetics of overall metabolic reactions of thermophilic and hyperthermophilic Archaea and Bacteria. <em>FEMS Microbiol. Rev.</em>, 25, 175-243.
Kondepudi, D. K. and Prigogine, I., 1998. <em>Modern Thermodynamics: From Heat Engines to Dissipative Structures</em>, John Wiley & Sons, New York, 486 p.
Schulte, M. D. and Shock, E. L., 1995. Thermodynamics of Strecker synthesis in hydrothermal systems. <em>Orig. Life Evol. Biosph.</em>, 25, 161-173.</references>
<keyword>misc</keyword></n></n>
Run the code above in your browser using DataLab