[CHNOSZ-commits] r402 - in pkg/CHNOSZ: . demo inst inst/extdata/OBIGT inst/extdata/cpetc man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Feb 20 06:34:32 CET 2019


Author: jedick
Date: 2019-02-20 06:34:30 +0100 (Wed, 20 Feb 2019)
New Revision: 402

Added:
   pkg/CHNOSZ/demo/AkDi.R
   pkg/CHNOSZ/inst/extdata/cpetc/AD03_Fig1a.csv
   pkg/CHNOSZ/inst/extdata/cpetc/AD03_Fig1b.csv
   pkg/CHNOSZ/inst/extdata/cpetc/AD03_Fig1c.csv
   pkg/CHNOSZ/inst/extdata/cpetc/AD03_Fig1d.csv
Modified:
   pkg/CHNOSZ/DESCRIPTION
   pkg/CHNOSZ/demo/00Index
   pkg/CHNOSZ/inst/NEWS
   pkg/CHNOSZ/inst/extdata/OBIGT/AkDi.csv
   pkg/CHNOSZ/man/examples.Rd
   pkg/CHNOSZ/man/extdata.Rd
Log:
add demo/AkDi.R: Henry's constant of dissolved gases


Modified: pkg/CHNOSZ/DESCRIPTION
===================================================================
--- pkg/CHNOSZ/DESCRIPTION	2019-02-20 04:29:44 UTC (rev 401)
+++ pkg/CHNOSZ/DESCRIPTION	2019-02-20 05:34:30 UTC (rev 402)
@@ -1,6 +1,6 @@
 Date: 2019-02-20
 Package: CHNOSZ
-Version: 1.2.0-9
+Version: 1.2.0-10
 Title: Thermodynamic Calculations and Diagrams for Geochemistry
 Authors at R: c(
     person("Jeffrey", "Dick", , "j3ffdick at gmail.com", role = c("aut", "cre"),

Modified: pkg/CHNOSZ/demo/00Index
===================================================================
--- pkg/CHNOSZ/demo/00Index	2019-02-20 04:29:44 UTC (rev 401)
+++ pkg/CHNOSZ/demo/00Index	2019-02-20 05:34:30 UTC (rev 402)
@@ -27,3 +27,4 @@
 go-IU           Diagrams using thermodynamic data in the SUPCRTBL compilation
 carboxylase     Rank abundance distribution for RuBisCO and acetyl-CoA carboxylase
 bison           Average oxidation state of carbon in proteins for phyla at Bison Pool
+AkDi            Henry's constant of dissolved gases

Added: pkg/CHNOSZ/demo/AkDi.R
===================================================================
--- pkg/CHNOSZ/demo/AkDi.R	                        (rev 0)
+++ pkg/CHNOSZ/demo/AkDi.R	2019-02-20 05:34:30 UTC (rev 402)
@@ -0,0 +1,80 @@
+# CHNOSZ/demo/AkDi.R
+# calculations using the Akinfiev-Diamond model 20190220
+# after Fig. 1 of Akinfiev and Diamond, 2003
+
+# function to plot natural logarithm of Henry's constant
+lines.KH <- function(name = "CO2", T = 1:373, P = "Psat", HKF = FALSE, altH2S = FALSE) {
+  # use AkDi or HKF model?
+  if(!HKF) add.obigt("AkDi")
+  # use alternative parameters for H2S? (AD03 Table 1)
+  if(altH2S) mod.obigt("H2S", state="aq", a=-11.2303, b=12.6104, c=-0.2102)
+  # get properties of aq - gas reaction
+  sres <- subcrt(c(name, name), c("aq", "gas"), c(-1, 1), T = T, P = P)
+  # calculate natural logarithm of Henry's constant in mole-fraction units
+  ln_KH <- log(1000/18.0153) + log(10) * sres$out$logK
+  # plot with units of reciprocal temperature (1000/K)
+  TK <- convert(T, "K")
+  lty <- 1
+  if(altH2S) lty <- 2
+  if(HKF) lty <- 3
+  if(HKF) col <- "red" else col <- "black"
+  lines(1000/TK, ln_KH, lty = lty, col = col)
+  reset()
+}
+
+# set up plot
+par(mfrow=c(2, 2))
+ylab <- quote(ln~italic(K[H]))
+xlab <- quote(1000 / list(italic(T), K))
+
+# CO2 (Fig. 1a of AD03)
+plot(0, 0, xlim=c(1, 4), ylim=c(4, 10), xlab=xlab, ylab=ylab)
+lines.KH("CO2", 1:373, "Psat")
+lines.KH("CO2", seq(100, 650, 10), 500)
+lines.KH("CO2", 1:373, "Psat", HKF = TRUE)
+lines.KH("CO2", seq(100, 650, 10), 500, HKF = TRUE)
+dat <- read.csv(system.file("extdata/cpetc/AD03_Fig1a.csv", package="CHNOSZ"))
+points(dat$x, dat$y, pch=dat$pch)
+text(3.5, 7.8, quote(italic(P)[sat]))
+text(3.05, 9.2, "500 bar")
+legend("bottom", c("Data (AD03, Fig. 1a)", "AkDi model", "HKF model"), lty=c(0, 1, 3), pch=c(1, NA, NA), col=c(1, 1, 2), bty="n")
+title(main=syslab(c("CO2", "H2O"), dash = " - "))
+
+# H2 (Fig. 1b of AD03)
+plot(0, 0, xlim=c(1, 4), ylim=c(8, 12), xlab=xlab, ylab=ylab)
+lines.KH("H2", 1:373, "Psat")
+lines.KH("H2", seq(100, 650, 10), 1000)
+lines.KH("H2", 1:373, "Psat", HKF = TRUE)
+lines.KH("H2", seq(100, 650, 10), 1000, HKF = TRUE)
+text(3.4, 11.4, quote(italic(P)[sat]))
+text(1.5, 11, "1000 bar")
+dat <- read.csv(system.file("extdata/cpetc/AD03_Fig1b.csv", package="CHNOSZ"))
+points(dat$x, dat$y, pch=dat$pch)
+legend("bottomright", c("Data (AD03, Fig. 1b)", "AkDi model", "HKF model"), lty=c(0, 1, 3), pch=c(1, NA, NA), col=c(1, 1, 2), bty="n")
+title(main=syslab(c("H2", "H2O"), dash = " - "))
+
+# H2S (Fig. 1c of AD03)
+plot(0, 0, xlim=c(1, 4), ylim=c(4, 9), xlab=xlab, ylab=ylab)
+lines.KH("H2S", 1:373, "Psat")
+lines.KH("H2S", seq(100, 650, 10), 1000)
+lines.KH("H2S", 1:373, "Psat", altH2S = TRUE)
+lines.KH("H2S", seq(100, 650, 10), 1000, altH2S = TRUE)
+lines.KH("H2S", 1:373, "Psat", HKF = TRUE)
+lines.KH("H2S", seq(100, 650, 10), 1000, HKF = TRUE)
+dat <- read.csv(system.file("extdata/cpetc/AD03_Fig1c.csv", package="CHNOSZ"))
+points(dat$x, dat$y, pch=dat$pch)
+text(3.4, 6.9, quote(italic(P)[sat]))
+text(3.1, 8.6, "1000 bar")
+legend("bottom", c("Data (AD03, Fig. 1c)", "AkDi model", "AkDi model (alt. H2S)", "HKF model"), lty=c(0, 1, 2, 3), pch=c(1, NA, NA, NA), col=c(1, 1, 1, 2), bty="n")
+title(main=syslab(c("H2S", "H2O"), dash = " - "))
+
+# CH4 (Fig. 1d of AD03)
+plot(0, 0, xlim=c(1.5, 4), ylim=c(8, 12), xlab=xlab, ylab=ylab)
+lines.KH("CH4", 1:350, "Psat")
+lines.KH("CH4", 1:350, "Psat", HKF = TRUE)
+dat <- read.csv(system.file("extdata/cpetc/AD03_Fig1d.csv", package="CHNOSZ"))
+points(dat$x, dat$y, pch=dat$pch)
+text(3.4, 11, quote(italic(P)[sat]))
+legend("bottomright", c("Data (AD03, Fig. 1d)", "AkDi model", "HKF model"), lty=c(0, 1, 3), pch=c(1, NA, NA), col=c(1, 1, 2), bty="n")
+title(main=syslab(c("CH4", "H2O"), dash = " - "))
+

Modified: pkg/CHNOSZ/inst/NEWS
===================================================================
--- pkg/CHNOSZ/inst/NEWS	2019-02-20 04:29:44 UTC (rev 401)
+++ pkg/CHNOSZ/inst/NEWS	2019-02-20 05:34:30 UTC (rev 402)
@@ -1,5 +1,5 @@
-CHANGES IN CHNOSZ 1.2.0-9 (2019-02-20)
---------------------------------------
+CHANGES IN CHNOSZ 1.2.0-10 (2019-02-20)
+---------------------------------------
 
 CRAN COMPLIANCE
 
@@ -20,7 +20,7 @@
 
 - Add AkDi() to calculate thermodynamic properties of aqueous
   nonelectrolytes using the Akinfiev-Diamond model. Thanks to Evgeniy
-  Bastrakov for guidance and advice.
+  Bastrakov for guidance.
 
 THERMODYNAMIC DATA
 
@@ -42,6 +42,9 @@
   revised HKF model, and note presence of resulting discontinuities (see
   man/examples.Rd).
 
+- Add demo/AkDi.R showing calculations of Henry's constant of dissolved
+  gases, after Figure 1 of Akinfiev and Diamond, 2003.
+
 OTHER CHANGES
 
 - In describe.reaction(), change equals sign to reaction double arrow.

Modified: pkg/CHNOSZ/inst/extdata/OBIGT/AkDi.csv
===================================================================
--- pkg/CHNOSZ/inst/extdata/OBIGT/AkDi.csv	2019-02-20 04:29:44 UTC (rev 401)
+++ pkg/CHNOSZ/inst/extdata/OBIGT/AkDi.csv	2019-02-20 05:34:30 UTC (rev 402)
@@ -1,6 +1,6 @@
 name,abbrv,formula,state,ref1,ref2,date,G,H,S,Cp,V,a1.a,a2.b,a3.c,a4.d,c1.e,c2.f,omega.lambda,z.T
 Ar,NA,Ar,aq,AD03,NA,20.Feb.19,NA,NA,NA,NA,NA,-8.5139,11.921,0.0733,NA,NA,NA,NA,NA
-H2S,NA,H2S,aq,AD03,NA,20.Feb.19,NA,NA,NA,NA,NA,-11.2303,12.6104,-0.2102,NA,NA,NA,NA,NA
+H2S,NA,H2S,aq,AD03,NA,20.Feb.19,NA,NA,NA,NA,NA,-13.4046,13.8582,-0.2029,NA,NA,NA,NA,NA
 O2,NA,O2,aq,AD03,NA,20.Feb.19,NA,NA,NA,NA,NA,-9.754,12.9411,0.026,NA,NA,NA,NA,NA
 N2,NA,N2,aq,AD03,NA,20.Feb.19,NA,NA,NA,NA,NA,-11.538,14.6278,-0.032,NA,NA,NA,NA,NA
 NH3,NA,NH3,aq,AD03,NA,20.Feb.19,NA,NA,NA,NA,NA,-4.7245,4.9782,-0.0955,NA,NA,NA,NA,NA

Added: pkg/CHNOSZ/inst/extdata/cpetc/AD03_Fig1a.csv
===================================================================
--- pkg/CHNOSZ/inst/extdata/cpetc/AD03_Fig1a.csv	                        (rev 0)
+++ pkg/CHNOSZ/inst/extdata/cpetc/AD03_Fig1a.csv	2019-02-20 05:34:30 UTC (rev 402)
@@ -0,0 +1,69 @@
+x,y,pch
+1.67,7.577,24
+1.742,7.861,24
+1.909,8.341,24
+2.11,8.657,24
+2.361,8.744,24
+2.678,8.541,24
+1.567,7.348,1
+1.606,7.608,1
+1.642,7.789,1
+1.687,7.931,1
+1.726,8.057,1
+1.773,8.176,1
+1.823,8.27,1
+1.87,8.373,1
+1.929,8.452,1
+1.987,8.523,1
+2.043,8.586,1
+2.11,8.649,1
+2.177,8.681,1
+2.255,8.72,1
+2.333,8.729,1
+2.416,8.713,1
+2.508,8.698,1
+2.609,8.643,1
+2.712,8.549,1
+2.837,8.407,1
+2.871,8.337,1
+2.913,8.274,1
+2.955,8.203,1
+2.996,8.124,1
+3.044,8.054,1
+3.097,7.959,1
+3.139,7.873,1
+3.194,7.763,1
+3.242,7.653,1
+3.295,7.535,1
+3.351,7.401,1
+3.409,7.26,1
+3.465,7.126,1
+3.527,6.953,1
+3.588,6.772,1
+3.658,6.575,1
+2.291,8.673,5
+2.352,8.674,5
+2.411,8.689,5
+2.467,8.666,5
+2.528,8.643,5
+2.598,8.596,5
+2.667,8.556,5
+2.737,8.478,5
+2.818,8.376,5
+2.896,8.282,5
+2.985,8.132,5
+3.075,7.967,5
+3.169,7.771,5
+3.278,7.574,5
+3.387,7.307,5
+3.504,7.016,5
+3.63,6.693,5
+1.147,6.449,18
+1.219,6.505,18
+1.3,6.702,18
+1.386,7.237,18
+1.483,7.915,18
+1.544,8.506,18
+1.562,7.136,0
+1.584,7.372,0
+1.606,7.498,0

Added: pkg/CHNOSZ/inst/extdata/cpetc/AD03_Fig1b.csv
===================================================================
--- pkg/CHNOSZ/inst/extdata/cpetc/AD03_Fig1b.csv	                        (rev 0)
+++ pkg/CHNOSZ/inst/extdata/cpetc/AD03_Fig1b.csv	2019-02-20 05:34:30 UTC (rev 402)
@@ -0,0 +1,43 @@
+x,y,pch
+1.313,8.754,2
+1.313,8.77,2
+1.371,9.011,2
+1.448,9.362,2
+1.591,9.713,2
+1.671,9.912,2
+1.759,10.153,2
+1.575,8.219,5
+1.623,8.806,5
+1.686,9.231,5
+1.714,9.314,5
+1.771,9.451,5
+1.838,9.733,5
+1.84,9.812,5
+1.904,9.995,5
+2.013,10.242,5
+2.107,10.467,5
+2.129,10.603,5
+2.175,10.582,5
+2.258,10.76,5
+2.335,10.86,5
+2.387,10.938,5
+2.406,10.938,5
+2.507,11.053,5
+2.554,11.106,5
+2.59,11.074,5
+2.656,11.221,5
+2.771,11.226,5
+2.864,11.236,5
+2.858,11.267,5
+2.949,11.267,5
+3.033,11.251,5
+3.138,11.262,5
+2.913,11.21,1
+3.006,11.22,1
+3.091,11.225,1
+3.192,11.204,1
+3.299,11.177,1
+3.359,11.141,1
+3.417,11.114,1
+3.537,11.046,1
+3.666,10.925,1

Added: pkg/CHNOSZ/inst/extdata/cpetc/AD03_Fig1c.csv
===================================================================
--- pkg/CHNOSZ/inst/extdata/cpetc/AD03_Fig1c.csv	                        (rev 0)
+++ pkg/CHNOSZ/inst/extdata/cpetc/AD03_Fig1c.csv	2019-02-20 05:34:30 UTC (rev 402)
@@ -0,0 +1,89 @@
+x,y,pch
+1.282,7.566,25
+1.304,7.614,25
+1.393,7.906,25
+1.476,8.175,25
+1.479,8.112,25
+1.546,8.184,25
+1.654,8.548,25
+1.651,8.429,25
+1.732,8.627,25
+1.732,8.493,25
+1.599,7.222,0
+1.619,7.294,0
+1.646,7.404,0
+1.682,7.444,0
+1.716,7.492,0
+1.766,7.547,0
+1.785,7.603,0
+1.816,7.619,0
+1.835,7.619,0
+1.863,7.619,0
+1.885,7.619,0
+1.922,7.596,0
+1.961,7.596,0
+1.999,7.605,0
+2.038,7.597,0
+2.072,7.605,0
+2.105,7.606,0
+2.141,7.582,0
+2.166,7.575,0
+2.2,7.567,0
+2.239,7.552,0
+2.28,7.529,0
+2.303,7.466,0
+2.35,7.506,0
+2.392,7.506,0
+2.433,7.483,0
+2.458,7.42,0
+2.517,7.444,0
+2.567,7.421,0
+2.6,7.398,0
+2.634,7.414,0
+2.678,7.382,0
+2.695,7.32,0
+2.742,7.312,0
+2.745,7.241,0
+2.806,7.218,0
+2.851,7.195,0
+2.92,7.14,0
+2.912,7.038,0
+2.995,7.094,0
+3.048,7.023,0
+3.054,6.866,0
+3.101,6.795,0
+3.148,6.717,0
+1.663,7.184,23
+1.744,7.389,23
+1.688,7.018,1
+1.719,6.979,1
+1.752,7.098,1
+1.769,7.169,1
+1.816,7.311,1
+1.863,7.391,1
+1.902,7.493,1
+1.947,7.525,1
+1.988,7.565,1
+2.041,7.574,1
+2.041,7.708,1
+2.091,7.669,1
+2.133,7.638,1
+2.155,7.59,1
+2.272,7.584,1
+2.342,7.576,1
+2.419,7.554,1
+2.408,7.506,1
+2.675,7.312,1
+2.792,7.194,1
+3.001,6.936,1
+3.193,6.607,1
+3.246,6.528,1
+3.371,6.285,1
+3.396,6.199,1
+3.402,6.096,2
+3.301,6.395,2
+3.357,6.301,2
+3.468,6.034,2
+3.527,5.893,2
+3.594,5.728,2
+3.661,5.586,2

Added: pkg/CHNOSZ/inst/extdata/cpetc/AD03_Fig1d.csv
===================================================================
--- pkg/CHNOSZ/inst/extdata/cpetc/AD03_Fig1d.csv	                        (rev 0)
+++ pkg/CHNOSZ/inst/extdata/cpetc/AD03_Fig1d.csv	2019-02-20 05:34:30 UTC (rev 402)
@@ -0,0 +1,30 @@
+x,y,pch
+2.253,10.668,2
+2.435,10.867,2
+2.649,11.051,2
+2.907,11.04,2
+3.219,10.76,2
+3.354,10.597,2
+1.931,10.164,5
+2.113,10.569,5
+2.323,10.826,5
+2.576,11.051,5
+2.597,11.062,5
+3.001,11.008,5
+3.363,10.623,5
+1.749,9.539,1
+1.81,9.723,1
+1.876,9.907,1
+1.949,10.091,1
+2.029,10.285,1
+2.113,10.479,1
+2.207,10.663,1
+2.31,10.831,1
+2.419,10.973,1
+2.544,11.083,1
+2.681,11.14,1
+2.834,11.145,1
+3.005,11.066,1
+3.197,10.886,1
+3.413,10.576,1
+3.66,10.102,1

Modified: pkg/CHNOSZ/man/examples.Rd
===================================================================
--- pkg/CHNOSZ/man/examples.Rd	2019-02-20 04:29:44 UTC (rev 401)
+++ pkg/CHNOSZ/man/examples.Rd	2019-02-20 05:34:30 UTC (rev 402)
@@ -59,6 +59,7 @@
     \code{go-IU} \tab Diagrams using thermodynamic data in the SUPCRTBL compilation (Zimmer et al., 2016) \cr
     \code{carboxylase} \tab Rank abundance distribution for RuBisCO and acetyl-CoA carboxylase \cr
     \code{bison} \tab Average oxidation state of carbon in proteins for phyla at Bison Pool (Dick and Shock, 2013) \cr
+    \code{AkDi} \tab Henry's constant of dissolved gases (Akinfiev and Diamond, 2003) \cr
   }
 
 For either function, if \code{save.png} is TRUE, the plots are saved in \code{\link{png}} files whose names begin with the names of the help topics or demos.
@@ -82,6 +83,8 @@
 }
 
 \references{
+Akinfiev, N. N. and Diamond, L. W. (2003) Thermodynamic description of aqueous nonelectrolytes at infinite dilution over a wide range of state parameters. \emph{Geochim. Cosmochim. Acta} \bold{67}, 613--629. \url{https://doi.org/10.1016/S0016-7037(02)01141-9}
+
 Akinfiev, N. N. and Zotov, A. V. (2001) Thermodynamic description of chloride, hydrosulfide, and hydroxo complexes of Ag(I), Cu(I), and Au(I) at temperatures of 25-500\degC and pressures of 1-2000 bar. \emph{Geochem. Int.} \bold{39}, 990--1006. \url{http://pleiades.online/cgi-perl/search.pl/?type=abstract&name=geochem&number=10&year=1&page=990}
 
 Aksu, S. and Doyle, F. M. (2001) Electrochemistry of copper in aqueous glycine solutions. \emph{J. Electrochem. Soc.} \bold{148}, B51--B57. \url{https://doi.org/10.1149/1.1344532}

Modified: pkg/CHNOSZ/man/extdata.Rd
===================================================================
--- pkg/CHNOSZ/man/extdata.Rd	2019-02-20 04:29:44 UTC (rev 401)
+++ pkg/CHNOSZ/man/extdata.Rd	2019-02-20 05:34:30 UTC (rev 402)
@@ -45,6 +45,7 @@
     \item \code{SS98_Fig5a.csv}, \code{SS98_Fig5b.csv} Values of logarithm of fugacity of \O2 and pH as a function of temperature for mixing of seawater and hydrothermal fluid, digitized from Figs. 5a and b of Shock and Schulte, 1998. See the vignette \code{anintro.Rmd} for an example that uses this file.
     \item \code{rubisco.csv} UniProt IDs for Rubisco, ranges of optimal growth temperature of organisms, domain and name of organisms, and URL of reference for growth temperature, from Dick, 2014. See the vignette \code{anintro.Rmd} for an example that uses this file.
     \item \code{bluered.txt} Blue - light grey - red color palette, computed using \CRANpkg{colorspace}\code{::diverge_hcl(1000,} \code{c = 100, l = c(50, 90), power = 1)}. This is used by \code{\link{ZC.col}}.
+    \item \code{AD03_Fig1?.csv} Experimental data points digitized from Figure 1 of Akinfiev and Diamond, 2003, used in \code{\link{demos}("AkDi")}.
   }
 
   Files in \code{fasta} contain protein sequences:
@@ -112,6 +113,8 @@
 }
 
 \references{
+Akinfiev, N. N. and Diamond, L. W. (2003) Thermodynamic description of aqueous nonelectrolytes at infinite dilution over a wide range of state parameters. \emph{Geochim. Cosmochim. Acta} \bold{67}, 613--629. \url{https://doi.org/10.1016/S0016-7037(02)01141-9}
+
 Amend, J. P. and Helgeson, H. C. (1997) Calculation of the standard molal thermodynamic properties of aqueous biomolecules at elevated temperatures and pressures. Part 1. L-\alpha-amino acids. \emph{J. Chem. Soc., Faraday Trans.} \bold{93}, 1927--1941. \url{https://doi.org/10.1039/A608126F}
 
 Bazarkina, E. F., Zotov, A. V. and Akinfiev, N. N. (2010) Pressure-dependent stability of cadmium chloride complexes: Potentiometric measurements at 1–1000 bar and 25°C. \emph{Geol. Ore Deposits} \bold{52}, 167--178. \url{https://doi.org/10.1134/S1075701510020054}



More information about the CHNOSZ-commits mailing list