next up previous
Next: thermo Up: CHNOSZ examples Previous: CHNOSZ examples

CHNOSZ-package

R Under development (unstable) (2015-06-01 r68455) -- "Unsuffered Consequences"
Copyright (C) 2015 The R Foundation for Statistical Computing
Platform: x86_64-slackware-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

options(width=108) library(CHNOSZ)
CHNOSZ version 1.0.5 (2015-05-19) Please run data(thermo) to create the "thermo" object
data(thermo)
data(thermo): attached environment "CHNOSZ" thermo$obigt: 1809 aqueous, 3368 total species
system.time(examples(do.png=TRUE)) ### Getting Started ## the 'thermo' object contains thermodynamic data and is also where ## user's settings (definition of chemical system) are stored data(thermo)
thermo$obigt: 1809 aqueous, 3368 total species
## standard thermodynamic properties of species subcrt("H2O")
info.character: found H2O(liq), also available in gas subcrt: 1 species at 15 values of T and P (wet) $species name formula state ispecies 1 water H2O liq 1 $out $out$water T P rho logK G H S V Cp 1 0.01 1.000000 0.9998289 45.03529 -56289.50 -68767.75 15.13238 18.01828 18.20559 2 25.00 1.000000 0.9970614 41.55247 -56687.71 -68316.76 16.71228 18.06830 18.01160 3 50.00 1.000000 0.9880295 38.63281 -57123.89 -67866.54 18.16234 18.23346 18.00464 4 75.00 1.000000 0.9748643 36.15435 -57594.93 -67416.13 19.50485 18.47970 18.04163 5 100.00 1.013220 0.9583926 34.02698 -58098.40 -66963.78 20.75956 18.79731 18.15793 6 125.00 2.320144 0.9390726 32.18315 -58631.71 -66507.34 21.94192 19.18403 18.33334 7 150.00 4.757169 0.9170577 30.57178 -59193.26 -66045.55 23.06398 19.64456 18.56643 8 175.00 8.918049 0.8923427 29.15313 -59781.38 -65576.63 24.13602 20.18866 18.88296 9 200.00 15.536499 0.8647434 27.89596 -60394.50 -65097.99 25.16818 20.83300 19.32884 10 225.00 25.478603 0.8338733 26.77533 -61031.25 -64605.89 26.17117 21.60424 19.97039 11 250.00 39.736493 0.7990719 25.77115 -61690.35 -64095.00 27.15694 22.54515 20.91232 12 275.00 59.431251 0.7592362 24.86701 -62301.65 -62867.52 28.14000 23.72806 22.35126 13 300.00 85.837843 0.7124075 24.04945 -63071.13 -62980.94 29.14072 25.28777 24.73943 14 325.00 120.457572 0.6545772 23.30725 -63790.84 -62341.39 30.19520 27.52189 29.44748 15 350.00 165.211289 0.5746875 22.63103 -64528.89 -61575.58 31.39713 31.34782 43.59852
subcrt("alanine")
info.character: found alanine(aq), also available in cr subcrt: 1 species at 15 values of T and P (wet) $species name formula state ispecies 1504 alanine C3H7NO2 aq 1504 $out $out$alanine T P rho logK G H S V Cp 1 0.01 1.000000 0.9998289 70.30240 -87870.78 -133143.0 36.59025 58.15163 13.28691 2 25.00 1.000000 0.9970614 65.09832 -88810.00 -132500.0 38.83000 60.44989 33.63547 3 50.00 1.000000 0.9880295 60.74360 -89817.71 -131567.5 41.83000 61.47819 39.95193 4 75.00 1.000000 0.9748643 57.06243 -90902.11 -130532.1 44.91490 62.00512 42.52415 5 100.00 1.013220 0.9583926 53.91911 -92062.64 -129453.2 47.90722 62.25878 43.62247 6 125.00 2.320144 0.9390726 51.20954 -93294.24 -128286.5 50.74951 62.31853 43.93543 7 150.00 4.757169 0.9170577 48.85487 -94593.11 -127255.5 53.42020 62.19875 43.66337 8 175.00 8.918049 0.8923427 46.79312 -95953.92 -126166.7 55.90616 61.87009 42.77390 9 200.00 15.536499 0.8647434 44.97516 -97301.83 -125105.3 58.19021 61.25002 41.02070 10 225.00 25.478603 0.8338733 43.36142 -98837.31 -124096.1 60.23970 60.16335 37.79811 11 250.00 39.736493 0.7990719 41.91942 -100345.70 -123184.4 61.98685 58.23514 31.65498 12 275.00 59.431251 0.7592362 40.62173 -101886.14 -122466.1 63.28058 54.58032 18.65083 13 300.00 85.837843 0.7124075 39.44393 -103444.11 -122181.7 63.73470 46.71705 -14.64596 14 325.00 120.457572 0.6545772 38.36121 -104992.85 -123133.0 62.06967 25.31938 -136.10771 15 350.00 165.211289 0.5746875 37.33653 -106459.36 -130048.2 50.83581 -73.97749 -1156.84047
# names of proteins have an underscore subcrt("LYSC_CHICK")
aa2eos: found LYSC_CHICK (C613H959N193O185S10, 129 residues) subcrt: 1 species at 15 values of T and P (wet) $species name formula state ispecies 3369 LYSC_CHICK C613H959N193O185S10 aq 3369 $out $out$LYSC_CHICK T P rho logK G H S V Cp 1 0.01 1.000000 0.9998289 3217.694 -4021787 -10423733 3684.406 10049.21 4409.319 2 25.00 1.000000 0.9970614 3019.795 -4119738 -10283083 4175.860 10420.95 6415.518 3 50.00 1.000000 0.9880295 2861.386 -4230950 -10113250 4722.506 10600.23 7073.981 4 75.00 1.000000 0.9748643 2734.284 -4286794 -9932209 5261.992 10708.15 7376.581 5 100.00 1.013220 0.9583926 2631.960 -4493864 -9745475 5779.892 10782.93 7548.444 6 125.00 2.320144 0.9390726 2549.241 -4644242 -9554920 6273.262 10840.94 7665.198 7 150.00 4.757169 0.9170577 2482.359 -4806358 -9361481 6742.892 10891.15 7760.881 8 175.00 8.918049 0.8923427 2428.309 -4979487 -9165264 7190.897 10940.05 7856.945 9 200.00 15.536499 0.8647434 2384.733 -5162925 -8965847 7620.111 10994.29 7974.628 10 225.00 25.478603 0.8338733 2349.762 -5356010 -8762181 8034.140 11063.40 8146.453 11 250.00 39.736493 0.7990719 2321.913 -5558139 -8552157 8438.039 11165.02 8439.891 12 275.00 59.431251 0.7592362 2300.011 -5768815 -8331338 8840.380 11338.89 9030.924 13 300.00 85.837843 0.7124075 2283.166 -5987602 -8088790 9259.928 11694.88 10513.444 14 325.00 120.457572 0.6545772 2270.819 -6215126 -7788738 9754.686 12644.61 15882.325 15 350.00 165.211289 0.5746875 2263.184 -6453120 -7222044 8584.664 17027.35 60917.017
# custom temperature range T <- seq(0, 500, 100) subcrt("H2O", T=T, P=1000)
info.character: found H2O(liq), also available in gas subcrt: 1 species at 6 values of T and P (wet) $species name formula state ispecies 1 water H2O liq 1 $out $out$water T P rho logK G H S V Cp 1 1e-02 1000 1.0453039 44.69896 -55869.12 -68357.26 15.09618 17.23441 16.83217 2 1e+02 1000 0.9997047 33.76984 -57659.35 -66636.81 20.45920 18.02052 17.39197 3 2e+02 1000 0.9230163 27.67746 -59921.46 -64877.46 24.63450 19.50317 17.82843 4 3e+02 1000 0.8232085 23.85604 -62563.91 -63049.14 28.13676 21.88413 18.90798 5 4e+02 1000 0.6925791 21.27795 -65538.85 -61056.82 31.33601 26.01176 21.14435 6 5e+02 1000 0.5282114 19.45590 -68829.13 -58794.93 34.46421 34.10604 23.92897
# temperature - pressure grid P <- seq(1000, 4000, 1000) subcrt("H2O", T=T, P=P, grid="P")
info.character: found H2O(liq), also available in gas subcrt: 1 species at 24 values of T and P (wet) $species name formula state ispecies 1 water H2O liq 1 $out $out$water T P rho logK G H S V Cp 1 0 1000 1.0453039 44.70060 -55869.12 -68357.26 15.09618 17.23441 16.83217 2 100 1000 0.9997047 33.76984 -57659.35 -66636.81 20.45920 18.02052 17.39197 3 200 1000 0.9230163 27.67746 -59921.46 -64877.46 24.63450 19.50317 17.82843 4 300 1000 0.8232085 23.85604 -62563.91 -63049.14 28.13676 21.88413 18.90798 5 400 1000 0.6925791 21.27795 -65538.85 -61056.82 31.33601 26.01176 21.14435 6 500 1000 0.5282114 19.45590 -68829.13 -58794.93 34.46421 34.10604 23.92897 7 0 2000 1.0811283 44.37678 -55464.39 -67982.69 14.98576 16.66333 16.30348 8 100 2000 1.0334820 33.52187 -57235.96 -66308.09 20.20549 17.43156 16.91712 9 200 2000 0.9664077 27.46718 -59466.20 -64605.61 24.24685 18.64141 17.10929 10 300 2000 0.8856264 23.66428 -62061.00 -62879.52 27.55524 20.34176 17.48122 11 400 2000 0.7926555 21.09085 -64962.58 -61098.54 30.41795 22.72766 18.15935 12 500 2000 0.6911768 19.25955 -68134.50 -59252.24 32.97429 26.06453 18.69974 13 0 3000 1.1091248 44.06233 -55071.38 -67618.58 14.87997 16.24272 15.55743 14 100 3000 1.0624799 33.28130 -56825.20 -65981.48 19.97998 16.95580 16.59773 15 200 3000 1.0009181 27.26508 -59028.65 -64315.32 23.93563 17.99867 16.67637 16 300 3000 0.9308254 23.48365 -61587.30 -62644.80 27.13829 19.35400 16.77910 17 400 3000 0.8538773 20.92133 -64440.43 -60952.19 29.85969 21.09811 17.08586 18 500 3000 0.7728854 19.09379 -67548.09 -59230.72 32.24365 23.30902 17.30423 19 0 4000 1.1322377 43.75500 -54687.25 -67251.91 14.81606 15.91115 14.29720 20 100 4000 1.0879893 33.04680 -56424.82 -65657.47 19.77532 16.55825 16.36203 21 200 4000 1.0304204 27.06931 -58604.82 -64016.37 23.67170 17.48335 16.38994 22 300 4000 0.9673852 23.31074 -61133.84 -62381.24 26.80696 18.62257 16.34873 23 400 4000 0.9001040 20.76205 -63949.83 -60739.96 29.44616 20.01458 16.49248 24 500 4000 0.8304559 18.94215 -67011.63 -59083.92 31.73966 21.69315 16.60454
## information about species # query the database using formulas info("C6H12O6")
info.character: found C6H12O6(aq), also available in aq, aq, aq, aq [1] 1757
info("SiO2")
info.character: found SiO2(aq), also available in cr, cr, cr1, cr2, cr1, cr2, cr, cr, cr1, cr2 [1] 72
# query using names info("quartz")
info.character: found quartz(cr1), also available in cr2 [1] 2014
si <- info(c("glucose", "mannose")) # show the equations of state parameters info(si)
checkEOS: Cp of glucose aq (1757) differs by 1.31 cal K-1 mol-1 from tabulated value checkEOS: Cp of mannose aq (1758) differs by 1.46 cal K-1 mol-1 from tabulated value name abbrv formula state ref1 ref2 date G H S Cp V a1 1757 glucose glucose C6H12O6 aq AP01 <NA> 24.Aug.06 -218905.4 -301670.7 64.89006 86.75908 112.2 2.552581 1758 mannose mannose C6H12O6 aq AP01 <NA> 24.Aug.06 -217731.8 -300827.0 63.79063 81.26195 111.9 2.684034 a2 a3 a4 c1 c2 omega Z 1757 310.70746 12.380497 -48757.17 89.72275 -78871.89 -157743.8 0 1758 47.80115 1.720841 -27485.66 91.32409 -113049.71 -157743.8 0
# approximate matches for names or formulas info("acid ")
info.approx: 'acid ' is ambiguous; has approximate matches to 68 species (showing first 25) [1] "a-aminobutyric acid" "formic acid" "acetic acid" "propanoic acid" [5] "n-butanoic acid" "n-pentanoic acid" "n-hexanoic acid" "n-heptanoic acid" [9] "n-octanoic acid" "n-nonanoic acid" "n-decanoic acid" "n-undecanoic acid" [13] "n-dodecanoic acid" "n-benzoic acid" "o-toluic acid" "m-toluic acid" [17] "p-toluic acid" "oxalic acid" "malonic acid" "succinic acid" [21] "glutaric acid" "adipic acid" "pimelic acid" "suberic acid" [25] "azelaic acid" [1] NA
info("SiO2 ")
info.approx: 'SiO2 ' is ambiguous; has approximate matches to 11 species: [1] "SiO2" "amorphous silica" "chalcedony" "coesite" [5] "coesite" "cristobalite" "cristobalite" "cristobalite,alpha" [9] "cristobalite,beta" "quartz" "quartz" [1] NA
## standard thermodynamic properties of reactions # fermentation example info(c("fructose", "ethanol"))
info.character: found ethanol(aq), also available in liq, gas [1] 1760 112
subcrt(c("fructose", "C2H5OH", "CO2"), c(-1, 2, 2))
info.character: found C2H5OH(aq), also available in liq, gas info.character: found CO2(aq), also available in gas subcrt: 3 species at 15 values of T and P (wet) $reaction coeff name formula state ispecies 1760 -1 fructose C6H12O6 aq 1760 112 2 ethanol C2H5OH aq 112 69 2 CO2 CO2 aq 69 $out T P rho logK G H S V Cp 1 0.01 1.000000 0.9998289 40.79714 -50992.24 -38436.07 45.93751 64.261634 223.33955 2 25.00 1.000000 0.9970614 38.37133 -52347.86 -34100.96 61.16020 65.523658 141.11965 3 50.00 1.000000 0.9880295 36.52677 -54009.82 -30966.84 71.28302 65.849077 113.53657 4 75.00 1.000000 0.9748643 35.08676 -55894.22 -28310.43 79.20700 65.719460 100.27915 5 100.00 1.013220 0.9583926 33.94576 -57959.72 -25911.74 85.86387 65.235001 92.11170 6 125.00 2.320144 0.9390726 33.03192 -60178.01 -23687.24 91.63104 64.350720 85.80120 7 150.00 4.757169 0.9170577 32.29489 -62529.57 -21612.47 96.67782 62.954445 79.69983 8 175.00 8.918049 0.8923427 31.69639 -64996.57 -19696.39 101.06504 60.811585 72.48989 9 200.00 15.536499 0.8647434 31.20643 -67561.65 -17981.84 104.77001 57.494249 62.49019 10 225.00 25.478603 0.8338733 30.80044 -70206.01 -16561.90 107.67084 52.191504 46.72387 11 250.00 39.736493 0.7990719 30.45682 -72906.80 -15626.11 109.47685 43.234586 18.67343 12 275.00 59.431251 0.7592362 30.15445 -75632.44 -15587.53 109.52666 26.741892 -38.93461 13 300.00 85.837843 0.7124075 29.86838 -78331.65 -17494.30 106.13186 -8.111717 -184.62838 14 325.00 120.457572 0.6545772 29.55875 -80900.91 -24837.55 93.71476 -101.929630 -713.79793 15 350.00 165.211289 0.5746875 29.12223 -83037.55 -58197.87 39.84884 -534.806956 -5155.86522
# weathering example -- also see transfer() subcrt(c("k-feldspar", "H2O", "H+", "kaolinite", "K+", "SiO2"), c(-2, -1, -2, 1, 2, 4))
info.character: found H2O(liq), also available in gas info.character: found SiO2(aq), also available in cr, cr, cr1, cr2, cr1, cr2, cr, cr, cr1, cr2 subcrt: 6 species at 15 values of T and P (wet) $reaction coeff name formula state ispecies 1953 -2 k-feldspar K(AlSi3)O8 cr 1953 1 -1 water H2O liq 1 3 -2 H+ H+ aq 3 1958 1 kaolinite Al2Si2O5(OH)4 cr 1958 6 2 K+ K+ aq 6 72 4 SiO2 SiO2 aq 72 $out T P rho logK G H S V Cp 1 0.01 1.000000 0.9998289 -9.451752 11813.720 39338.2001 101.037908 -44.45760 -941.315278 2 25.00 1.000000 0.9970614 -7.360641 10041.711 24831.7553 49.857720 -54.01690 -349.644469 3 50.00 1.000000 0.9880295 -6.136706 9073.958 18785.9482 30.286323 -59.01240 -163.141374 4 75.00 1.000000 0.9748643 -5.298797 8441.137 15826.5800 21.428921 -62.44680 -83.488468 5 100.00 1.013220 0.9583926 -4.665077 7965.252 14287.7248 17.144501 -65.31326 -43.880256 6 125.00 2.320144 0.9390726 -4.151839 7563.877 13483.8390 15.047763 -68.08975 -22.842309 7 150.00 4.757169 0.9170577 -3.717503 7197.853 13070.3223 14.030222 -71.12250 -11.993008 8 175.00 8.918049 0.8923427 -3.339037 6847.025 12844.9084 13.501163 -74.74984 -7.903078 9 200.00 15.536499 0.8647434 -3.003487 6502.522 12651.2416 13.067065 -79.46467 -10.251158 10 225.00 25.478603 0.8338733 -2.704162 6163.823 12316.6809 12.363201 -86.27006 -20.738785 11 250.00 39.736493 0.7990719 -2.439021 5838.469 11610.2462 10.966953 -97.24159 -43.800069 12 275.00 59.431251 0.7592362 -2.210199 5543.551 10165.2552 8.267154 -116.71119 -91.071487 13 300.00 85.837843 0.7124075 -2.025097 5310.940 7209.9258 3.025926 -155.04184 -202.796812 14 325.00 120.457572 0.6545772 -1.903001 5208.424 247.5404 -8.732556 -246.90325 -584.941499 15 350.00 165.211289 0.5746875 -1.911364 5449.958 -24848.5653 -49.245722 -616.91895 -3449.033414
# partial reaction auto-completion is possible basis(c("SiO2", "H2O", "K+", "H+", "O2"))
H K O Si Z ispecies logact state SiO2 0 0 2 1 0 72 0 aq H2O 2 0 1 0 0 1 0 liq K+ 0 1 0 0 1 6 0 aq H+ 1 0 0 0 1 3 0 aq O2 0 0 2 0 0 67 0 aq
subcrt(c("k-feldspar", "kaolinite"), c(-2, 1))
subcrt: 2 species at 15 values of T and P subcrt: reaction is not balanced; it is missing this composition: H K O Si -4 2 7 4 subcrt: adding missing composition from basis definition and restarting... subcrt: 6 species at 15 values of T and P (wet) $reaction coeff name formula state ispecies 1953 -2 k-feldspar K(AlSi3)O8 cr 1953 1958 1 kaolinite Al2Si2O5(OH)4 cr 1958 72 4 SiO2 SiO2 aq 72 1 -1 water H2O liq 1 6 2 K+ K+ aq 6 3 -2 H+ H+ aq 3 $out T P logK G H S V Cp 1 0.01 1.000000 -9.451752 11813.720 39338.2001 101.037908 -44.45760 -941.315278 2 25.00 1.000000 -7.360641 10041.711 24831.7553 49.857720 -54.01690 -349.644469 3 50.00 1.000000 -6.136706 9073.958 18785.9482 30.286323 -59.01240 -163.141374 4 75.00 1.000000 -5.298797 8441.137 15826.5800 21.428921 -62.44680 -83.488468 5 100.00 1.013220 -4.665077 7965.252 14287.7248 17.144501 -65.31326 -43.880256 6 125.00 2.320144 -4.151839 7563.877 13483.8390 15.047763 -68.08975 -22.842309 7 150.00 4.757169 -3.717503 7197.853 13070.3223 14.030222 -71.12250 -11.993008 8 175.00 8.918049 -3.339037 6847.025 12844.9084 13.501163 -74.74984 -7.903078 9 200.00 15.536499 -3.003487 6502.522 12651.2416 13.067065 -79.46467 -10.251158 10 225.00 25.478603 -2.704162 6163.823 12316.6809 12.363201 -86.27006 -20.738785 11 250.00 39.736493 -2.439021 5838.469 11610.2462 10.966953 -97.24159 -43.800069 12 275.00 59.431251 -2.210199 5543.551 10165.2552 8.267154 -116.71119 -91.071487 13 300.00 85.837843 -2.025097 5310.940 7209.9258 3.025926 -155.04184 -202.796812 14 325.00 120.457572 -1.903001 5208.424 247.5404 -8.732556 -246.90325 -584.941499 15 350.00 165.211289 -1.911364 5449.958 -24848.5653 -49.245722 -616.91895 -3449.033414
## chemical affinities # set basis species and their activities or fugacities basis(c("CO2", "H2O", "O2"), c(-3, 0, -80))
C H O ispecies logact state CO2 1 0 2 69 -3 aq H2O 0 2 1 1 0 liq O2 0 0 2 67 -80 aq
# set species of interest species(c("CH4", "C2H4O2", "CO2"))
CO2 H2O O2 ispecies logact state name 1 1 2 -2 80 -3 aq methane 2 2 2 -2 515 -3 aq acetic acid 3 1 0 0 69 -3 aq CO2
# chemical affinities of formation reactions # take off $values for complete output affinity()$values
energy.args: temperature is 25 C energy.args: pressure is Psat subcrt: 6 species at 298.15 K and 1 bar (wet) $`80` [1] 9.514156 $`515` [1] 2.318426 $`69` [1] 0
affinity(O2=c(-90, -60, 4))$values
energy.args: temperature is 25 C energy.args: pressure is Psat energy.args: variable 1 is log_a(O2) at 4 values from -90 to -60 subcrt: 6 species at 298.15 K and 1 bar (wet) $`80` [1] 29.514156 9.514156 -10.485844 -30.485844 $`515` [1] 22.318426 2.318426 -17.681574 -37.681574 $`69` [1] 0 0 0 0


next up previous
Next: thermo Up: CHNOSZ examples Previous: CHNOSZ examples