data(thermo)
## properties of species
subcrt('water')
# calculating at different temperatures
subcrt('water',T=seq(0,100,10))
# calculating at even increments
subcrt('water',T=seq(500,1000,length.out=10),
P=seq(5000,10000,length.out=10))
# calculating on a temperature-pressure grid
subcrt('water',T=c(500,1000),P=c(5000,10000),grid='P')
# to calculate only selected properties
subcrt('water',property=c('G','E'))
# the properties of multiple species
subcrt(c('glucose','ethanol','CO2'))
## input/output in different units
nuts(c('K','J'))
subcrt('water')
subcrt('water',T=298.15)
nuts(c('cal','C'))
## properties of reactions
subcrt(c('H2O','H+','k-feldspar','kaolinite','K+','SiO2'),
c(-1,-2,-2,1,2,4))
subcrt(c('glucose','ethanol','CO2'),c(-1,2,2))
# the states are specified
subcrt(c('glucose','ethanol','CO2'),c(-1,2,2),c('aq','aq','gas'))
# this warns about an unbalanced reaction
subcrt(c('glucose','ethanol'),c(-1,1))
## auto balancing reactions
basis(c('CO2','H2O','NH3','H2S','O2'))
subcrt(c('glucose','ethanol'),'aq',c(-1,3))
# properties of a species and a formation
# reaction for that species
subcrt('C2H5OH') # species
basis('CHNOS')
subcrt('C2H5OH',1) # reaction
## properties of mineral phases
subcrt(c('pyrrhotite','pyrrhotite'),state=c('cr1','cr2'))
# calculation of phase transitions of mineral
subcrt('pyrrhotite')
# phase transitions in a reaction
subcrt(c('pyrite','pyrrhotite','H2O','H2S','O2'),c(-1,1,-1,1,0.5))
## heat capacity of Fe(cr)
# compare calculated values of heat capacity with
# values from Robie and Hemingway, 1995, (from which
# the parameters in the database were derived)
nuts(c('J','K')) # set the units
# we set pressure here otherwise subcrt goes for
# Psat (saturation vapor pressure of H2O above
# 100 degrees C) which can not be calculated above
# the critical point of H2O (~647 K)
t <- subcrt('Fe',T=seq(300,1800,50),P=1)
plot(t$out[[1]]$T,t$out[[1]]$Cp,type='l',
xlab=axis.label('T'),ylab=axis.label('Cp'))
# add points from RH95
RH95 <- thermo$expt$RH95
points(RH95[,1],RH95[,2])
title(main=paste('Heat capacity of Fe(cr)<n>',
'(points - Robie and Hemingway, 1995)'))
# reset the units
nuts(c('C','cal'))
## these produce NAs and warnings
# above the limits for calculating Psat
subcrt('alanine',T=seq(0,5000,by=1000))
# above the T, P limits for the H2O equations of state
subcrt('alanine',T=c(2250,2251),P=c(30000,30001),grid='T')
## Skarn example after Johnson et al., 1992
P <- seq(500,5000,500)
# this is like the temperature specification used
# in the example by Johnson et al., 1992
# T <- seq(0,1000,100)
# we use this one to avoid warnings at 0 deg C, 5000 bar
T <- c(2,seq(100,1000,100))
subcrt(c('andradite','carbon dioxide','H2S','Cu+','quartz','calcite',
'chalcopyrite','H+','H2O'),coeff=c(-1,-3,-4,-2,3,3,2,2,3),
state=c('cr','g','aq','aq','cr','cr','cr','aq','liq'),
P=P,T=T,grid='P')
## Standard Gibbs energy of reactions with HCN and
## formaldehyde after Schulte and Shock, 1995 Fig. 2
rxn1 <- subcrt(c('formaldehyde','HCN','H2O','glycolic acid','NH3'),
c(-1,-1,-2,1,1),P=300)
rxn2 <- subcrt(c('formaldehyde','HCN','H2O','glycine'),
c(-1,-1,-1,1),P=300)
plot(x=rxn1$out$T,rxn1$out$G/1000,type='l',ylim=c(-40,-10),
xlab=axis.label('T'),ylab=axis.label('DG0r','k'))
lines(rxn1$out$T,rxn2$out$G/1000)
# write the reactions on the plot
text(150,-14,describe(rxn1$reaction,
use.name=c(TRUE,FALSE,FALSE,TRUE,FALSE)))
text(200,-35,describe(rxn2$reaction,
use.name=c(TRUE,FALSE,FALSE,TRUE)))
title(main=paste('Standard Gibbs energy of reactions<n>',
'after Schulte and Shock, 1995'))
## Calculation of chemical affinities
# after LaRowe and Helgeson, 2007
# Fig. 3 (a): reduction of nicotinamide adenine
# dinucleotide (NAD) coupled to oxidation of glucose
# list the available NAD species
info('NAD ')
T <- seq(0,120,10)
# oxidation of glucose (C6H12O6)
basis(c('glucose','H2O','NH3','CO2','H+'),c(-3,0,999,-3,-7))
t <- subcrt(c('NAD(ox)-','NAD(red)-2'),c(-12,12),logact=c(0,0),T=T)
# LH07's diagrams are shown per mole of electron (24 e- per 12 NAD)
A <- t$out$A/24/1000
plot(x=T,y=A,xlim=range(T),ylim=c(1.4,5.4),
xlab=axis.label('T'),ylab=axis.label('A',opt='k'),type='l')
text('NAD(ox)-/NAD(red)-2 = 1',x=median(T),y=median(A))
# different activity ratio
t <- subcrt(c('NAD(ox)-','NAD(red)-2'),c(-12,12),logact=c(1,0),T=T)
A <- t$out$A/24/1000
lines(x=T,y=A)
text('NAD(ox)-/NAD(red)-2 = 10',x=median(T),y=median(A))
# different activity ratio
t <- subcrt(c('NAD(ox)-','NAD(red)-2'),c(-12,12),logact=c(0,1),T=T)
A <- t$out$A/24/1000
lines(x=T,y=t$out$A/24/1000)
text('NAD(ox)-/NAD(red)-2 = 0.1',x=median(T),y=median(A))
# this command prints the reaction on the plot
text(40,4.5,c2s(s2c(describe(t$reaction,
use.name=c(TRUE,TRUE,FALSE,FALSE,FALSE,FALSE)),
sep='=',move.sep=TRUE),sep='<n>'))
# label the plot
title(main=paste('Chemical affinity of NAD reduction',
'after LaRowe and Helgeson, 2007',sep='<n>'),
sub=describe(thermo$basis,T=NULL))
###
### non-ideality calculations -- activity coefficients of
### aqueous species as a function of charge, temperature,
### and ionic strength -- after Alberty, 2003
##
## p. 16 Table 1.3 apparent pKa of acetic acid with
## changing ionic strength
subcrt(c('acetic acid','acetate','H+'),c(-1,1,1),
IS=c(0,0.1,0.25),T=25,property='logK')
# note that these *apparent* values of G and logK approach
# their *standard* counterparts as IS goes to zero.
##
## p. 95: basis and elemental stoichiometries of species
## (a digression here from the nonideality calculations)
# note coefficient of O2 and NH3 will be zero for these species
basis(c('ATP-4','H+','H2O','HPO4-2','O2','NH3'))
# cf Eq. 5.1-33: (basis composition)
species(c('ATP-4','H+','H2O','HPO4-2','ADP-3','HATP-3','HADP-2','H2PO4-'))
lb <- length(basis())
# cf Eq. 5.1-32: (elemental composition)
as.matrix(species()[,1:lb]) ##
## p. 273-275: activity coefficient (gamma)
## as a function of ionic strength and temperature
## (as of 20080304, these do look quantitatively different
## from the plots in Alberty's book.)
iplotfun <- function(T,col,add=TRUE) {
IS <- seq(0,0.25,0.0025)
s <- subcrt(c('H2PO4-','HADP-2','HATP-3','ATP-4'),IS=IS,grid='IS',T=T)
if(!add) thermo.plot.new(xlim=range(IS),ylim=c(0,1),
xlab=axis.label('IS'),ylab='gamma')
for(i in 1:4) lines(IS,10^s$out[[i]]$loggam,col=col)
}
iplotfun(0,'blue',add=FALSE)
iplotfun(25,'black')
iplotfun(40,'red')
title(main=paste('activity coefficient (gamma) of -1,-2,-3,-4',
'charged species at 0, 25, 40 deg C, after Alberty, 2003',sep='<n>'))</n>
<references>Alberty, R. A., 2003. <em>Thermodynamics of Biochemical Reactions.</em> John Wiley & Sons, Hoboken, New Jersey, 397 p.
Johnson, J. W., Oelkers, E. H. and Helgeson, H. C., 1992. SUPCRT92: A software package for calculating the standard molal thermodynamic properties of minerals, gases, aqueous species, and reactions from 1 to 5000 bar and 0 to 1000$^{\circ}$C. <em>Comp. Geosci.</em>, 18, 899-947.
LaRowe, D. E. and Helgeson, H. C., 2007. Quantifying the energetics of metabolic reactions in diverse biogeochemical systems: electron flow and ATP synthesis. <em>Geobiology</em>, 5, 153-168.
Schulte, M. D. and Shock, E. L., 1995. Thermodynamics of Strecker synthesis in hydrothermal systems. <em>Orig. Life Evol. Biosph.</em>, 25, 161-173.
Shock, E. L., Oelkers, E. H., Johnson, J. W., Sverjensky, D. A. and Helgeson, H. C., 1992. Calculation of the thermodynamic properties of aqueous species at high pressures and temperatures: Effective electrostatic radii, dissociation constants and standard partial molal properties to 1000 $^{\circ}$C and 5 kbar. <em>J. Chem. Soc. Faraday Trans.</em>, 88, 803-826.
Shock, E. L. et al., 1998. slop98.dat (computer data file). <url>http://geopig.asu.edu/supcrt92_data/slop98.dat</url>, accessed on 2005-11-05.</references>
<keyword>misc</keyword></n></n></n></n>
Run the code above in your browser using DataLab