Next: examples
Up: CHNOSZ examples
Previous: water
subcrt> ## Don't show:
subcrt> data(thermo)
thermo$obigt has 1800 aqueous, 2925 total species
subcrt> ## End Don't show
subcrt> ## properties of species
subcrt> subcrt("water")
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 -62370.65 -63557.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> # calculating at different temperatures
subcrt> subcrt("water",T=seq(0,100,10))
subcrt: 1 species at 11 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 1.00000 0.9998289 45.03529 -56289.50 -68767.75 15.13238 18.01828 18.20559
2 1e+01 1.00000 0.9997402 43.56558 -56443.94 -68586.98 15.78234 18.01988 18.03185
3 2e+01 1.00000 0.9982319 42.19946 -56604.91 -68406.81 16.40767 18.04711 18.01124
4 3e+01 1.00000 0.9956535 40.92791 -56772.02 -68226.70 17.01183 18.09384 18.01160
5 4e+01 1.00000 0.9922098 39.74171 -56945.08 -68046.60 17.59634 18.15664 18.00788
6 5e+01 1.00000 0.9880295 38.63281 -57123.89 -67866.54 18.16234 18.23346 18.00464
7 6e+01 1.00000 0.9831991 37.59415 -57308.27 -67686.48 18.71111 18.32304 18.00972
8 7e+01 1.00000 0.9777800 36.61946 -57498.06 -67506.30 19.24397 18.42460 18.02755
9 8e+01 1.00000 0.9718175 35.70322 -57693.10 -67325.88 19.76223 18.53764 18.05904
10 9e+01 1.00000 0.9653461 34.84052 -57893.26 -67145.08 20.26708 18.66191 18.10308
11 1e+02 1.01322 0.9583926 34.02698 -58098.40 -66963.78 20.75956 18.79731 18.15793
subcrt> # calculating at even increments
subcrt> subcrt("water",T=seq(500,1000,length.out=10),
subcrt+ P=seq(5000,10000,length.out=10))
subcrt: 1 species at 10 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 500.0000 5000.000 0.8760285 18.79959 -66507.32 -58880.39 31.35063 20.56463 16.16781
2 555.5556 5555.556 0.8654972 17.93302 -68000.34 -57864.89 32.27595 20.81486 15.96931
3 611.1111 6111.111 0.8568124 17.18675 -69539.51 -56860.87 33.12421 21.02584 15.76695
4 666.6667 6666.667 0.8497821 16.53864 -71121.37 -55867.36 33.90642 21.19979 15.56827
5 722.2222 7222.222 0.8442069 15.97160 -72742.99 -54883.29 34.63177 21.33979 15.37902
6 777.7778 7777.778 0.8398955 15.47225 -74401.85 -53907.60 35.30791 21.44934 15.20286
7 833.3333 8333.333 0.8366718 15.02998 -76095.79 -52939.27 35.94119 21.53198 15.04167
8 888.8889 8888.889 0.8343802 14.63624 -77822.91 -51977.35 36.53696 21.59112 14.89599
9 944.4444 9444.444 0.8328838 14.28409 -79581.54 -51021.02 37.09966 21.62991 14.76549
10 1000.0000 10000.000 0.8320646 13.96782 -81370.21 -50069.54 37.63302 21.65120 14.64932
subcrt> # calculating on a temperature-pressure grid
subcrt> subcrt("water",T=c(500,1000),P=c(5000,10000),grid="P")
subcrt: 1 species at 4 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 500 5000 0.8760285 18.79959 -66507.32 -58880.39 31.35063 20.56463 16.16781
2 1000 5000 0.6092264 14.47661 -84334.20 -51042.45 39.19692 29.57062 14.91983
3 500 10000 1.0289410 18.16400 -64258.78 -57563.56 30.14555 17.50849 15.21216
4 1000 10000 0.8320646 13.96782 -81370.21 -50069.54 37.63302 21.65120 14.64932
subcrt> # to calculate only selected properties
subcrt> subcrt("water",property=c("G","E"))
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 G E
1 0.01 1.000000 -56289.50 -0.001441834
2 25.00 1.000000 -56687.71 0.004687396
3 50.00 1.000000 -57123.89 0.008336313
4 75.00 1.000000 -57594.93 0.011305255
5 100.00 1.013220 -58098.40 0.014099350
6 125.00 2.320144 -58631.71 0.016974282
7 150.00 4.757169 -59193.26 0.020162709
8 175.00 8.918049 -59781.38 0.023939775
9 200.00 15.536499 -60394.50 0.028691290
10 225.00 25.478603 -61031.25 0.035033012
11 250.00 39.736493 -61690.35 0.044074816
12 275.00 59.431251 -62370.65 0.058105094
13 300.00 85.837843 -63071.13 0.082759476
14 325.00 120.457572 -63790.84 0.136405967
15 350.00 165.211289 -64528.89 0.324943485
subcrt> # the properties of multiple species
subcrt> subcrt(c("glucose","ethanol","CO2"))
subcrt: 3 species at 15 values of T and P (wet)
$species
name formula state ispecies
1770 glucose C6H12O6 aq 1770
112 ethanol C2H5OH aq 112
69 CO2 CO2 aq 69
$out
$out$glucose
T P rho logK G H S V Cp
1 0.01 1.000000 0.9998289 173.91268 -217373.0 -303657.6 57.94307 110.0960 67.00495
2 25.00 1.000000 0.9970614 160.45908 -218905.4 -301670.7 64.89006 112.3803 88.06603
3 50.00 1.000000 0.9880295 149.20560 -220620.9 -299347.6 72.36728 114.0163 96.92799
4 75.00 1.000000 0.9748643 139.68572 -222523.4 -296847.1 79.81780 115.6152 102.89809
5 100.00 1.013220 0.9583926 131.54961 -224610.6 -294206.6 87.13992 117.4675 108.37033
6 125.00 2.320144 0.9390726 124.53290 -226875.8 -291419.9 94.35666 119.8244 114.57459
7 150.00 4.757169 0.9170577 118.43651 -229317.5 -288455.5 101.55804 123.0132 122.69331
8 175.00 8.918049 0.8923427 113.10609 -231935.2 -285247.3 108.89241 127.5389 134.38261
9 200.00 15.536499 0.8647434 108.42168 -234732.0 -281678.4 116.59260 134.2686 152.51168
10 225.00 25.478603 0.8338733 104.29011 -237717.2 -277539.6 125.04220 144.8245 182.78652
11 250.00 39.736493 0.7990719 100.64038 -240910.5 -272432.4 134.93342 162.5468 238.16104
12 275.00 59.431251 0.7592362 97.42215 -244351.2 -265510.6 147.68370 195.2258 353.31619
13 300.00 85.837843 0.7124075 94.60943 -248119.0 -254650.7 166.76355 264.6322 646.05718
14 325.00 120.457572 0.6545772 92.21918 -252399.6 -232809.2 203.46509 452.5063 1711.25099
15 350.00 165.211289 0.5746875 90.40601 -257778.8 -158523.2 323.14500 1322.9173 10657.10627
$out$ethanol
T P rho logK G H S V Cp
1 0.01 1.000000 0.9998289 34.00279 -42500.00 -70209.10 30.43813 55.07924 62.81686
2 25.00 1.000000 0.9970614 31.76118 -43330.00 -68650.00 35.90000 55.14331 62.17949
3 50.00 1.000000 0.9880295 29.95389 -44290.91 -67095.45 40.90686 55.24494 62.23937
4 75.00 1.000000 0.9748643 28.48182 -45372.36 -65536.19 45.55435 55.38740 62.52880
5 100.00 1.013220 0.9583926 27.27279 -46566.14 -63967.66 49.90504 55.58456 62.98048
6 125.00 2.320144 0.9390726 26.27260 -47863.79 -62383.92 54.00844 55.85278 63.63056
7 150.00 4.757169 0.9170577 25.44144 -49259.87 -60779.16 57.90925 56.22997 64.58211
8 175.00 8.918049 0.8923427 24.74841 -50749.05 -59143.26 61.65207 56.77551 66.02582
9 200.00 15.536499 0.8647434 24.16957 -52326.91 -57459.80 65.28732 57.59584 68.32020
10 225.00 25.478603 0.8338733 23.68631 -53990.18 -55700.55 68.88128 58.89490 72.19535
11 250.00 39.736493 0.7990719 23.28422 -55737.20 -53812.85 72.53739 61.09827 79.32006
12 275.00 59.431251 0.7592362 22.95262 -57569.03 -51686.23 76.45058 65.20609 94.17030
13 300.00 85.837843 0.7124075 22.68475 -59492.14 -49045.15 81.07926 74.02376 131.95703
14 325.00 120.457572 0.6545772 22.48000 -61526.71 -44978.60 87.89049 98.10058 269.49638
15 350.00 165.211289 0.5746875 22.35592 -63744.45 -34130.56 105.33174 210.26990 1424.69512
$out$CO2
T P rho logK G H S V Cp
1 0.01 1.000000 0.9998289 73.29142 -91606.76 -100328.21 23.08743 30.27577 66.65869
2 25.00 1.000000 0.9970614 67.61986 -92250.00 -98900.00 28.10000 33.28796 51.09345
3 50.00 1.000000 0.9880295 62.89754 -93002.60 -97692.15 31.99278 34.78578 46.31744
4 75.00 1.000000 0.9748643 58.91003 -93845.38 -96561.05 35.36508 35.73921 44.44646
5 100.00 1.013220 0.9583926 55.50370 -94768.21 -95460.39 38.41842 36.46276 43.73909
6 125.00 2.320144 0.9390726 52.56481 -95763.30 -94367.89 41.24934 37.09777 43.68297
7 150.00 4.757169 0.9170577 50.00811 -96826.01 -93269.40 43.91970 37.74061 44.15483
8 175.00 8.918049 0.8923427 47.76770 -97952.38 -92150.95 46.47874 38.48142 45.23246
9 200.00 15.536499 0.8647434 45.79209 -99139.47 -90994.47 48.97605 39.44172 47.20274
10 225.00 25.478603 0.8338733 44.04063 -100385.48 -89771.76 51.47392 40.82846 50.72891
11 250.00 39.736493 0.7990719 42.48106 -101690.14 -88432.04 54.06884 43.05494 57.37755
12 275.00 59.431251 0.7592362 41.08805 -103055.76 -86870.02 56.94382 47.07750 71.38713
13 300.00 85.837843 0.7124075 39.84265 -104489.77 -84823.97 60.53182 55.56485 107.19221
14 325.00 120.457572 0.6545772 38.73382 -106012.64 -81429.06 66.22352 78.53702 237.71986
15 350.00 165.211289 0.5746875 37.76948 -107693.85 -71600.43 82.03713 185.14818 1334.45989
subcrt> ## input/output in different units
subcrt> nuts(c("K","J"))
nuts: temperature in K
nuts: energy in J
subcrt> subcrt("water")
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 273.16 1.000000 0.9998289 45.03529 -235515.3 -287724.3 63.31387 18.01828 76.17219
2 298.15 1.000000 0.9970614 41.55247 -237181.4 -285837.3 69.92418 18.06830 75.36053
3 323.15 1.000000 0.9880295 38.63281 -239006.4 -283953.6 75.99125 18.23346 75.33141
4 348.15 1.000000 0.9748643 36.15435 -240977.2 -282069.1 81.60828 18.47970 75.48617
5 373.15 1.013220 0.9583926 34.02698 -243083.7 -280176.4 86.85799 18.79731 75.97278
6 398.15 2.320144 0.9390726 32.18315 -245315.1 -278266.7 91.80499 19.18403 76.70671
7 423.15 4.757169 0.9170577 30.57178 -247664.6 -276334.6 96.49970 19.64456 77.68193
8 448.15 8.918049 0.8923427 29.15313 -250125.3 -274372.6 100.98511 20.18866 79.00632
9 473.15 15.536499 0.8647434 27.89596 -252690.6 -272370.0 105.30365 20.83300 80.87185
10 498.15 25.478603 0.8338733 26.77533 -255354.7 -270311.0 109.50017 21.60424 83.55611
11 523.15 39.736493 0.7990719 25.77115 -258112.4 -268173.5 113.62465 22.54515 87.49715
12 548.15 59.431251 0.7592362 24.86701 -260958.8 -265924.7 117.73775 23.72806 93.51769
13 573.15 85.837843 0.7124075 24.04945 -263889.6 -263512.3 121.92477 25.28777 103.50976
14 598.15 120.457572 0.6545772 23.30725 -266900.9 -260836.4 126.33672 27.52189 123.20824
15 623.15 165.211289 0.5746875 22.63103 -269988.9 -257632.2 131.36558 31.34782 182.41621
subcrt> subcrt("water",T=298.15)
subcrt: 1 species at 298.15 K and 1 bar (wet)
$species
name formula state ispecies
1 water H2O liq 1
$out
$out$water
T P rho logK G H S V Cp
1 298.15 1 0.9970614 41.55247 -237181.4 -285837.3 69.92418 18.0683 75.36053
subcrt> nuts(c("cal","C")) # back to defaults
nuts: energy in cal
nuts: temperature in C
subcrt> ## properties of reactions
subcrt> subcrt(c("H2O","H+","k-feldspar","kaolinite","K+","SiO2"),
subcrt+ c(-1,-2,-2,1,2,4))
subcrt: 6 species at 15 values of T and P (wet)
$reaction
coeff name formula state ispecies
1 -1 water H2O liq 1
3 -2 H+ H+ aq 3
1944 -2 k-feldspar K(AlSi3)O8 cr 1944
1949 1 kaolinite Al2Si2O5(OH)4 cr 1949
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.20 101.03791 -44.457604 -941.315278
2 25.00 1.000000 0.9970614 -7.360641 10041.711 24831.76 49.85772 -54.016898 -349.644468
3 50.00 1.000000 0.9880295 -6.136706 9073.958 18785.95 30.28633 -59.012390 -163.137848
4 75.00 1.000000 0.9748643 -5.298797 8441.137 15826.67 21.42919 -62.445955 -83.294427
5 100.00 1.013220 0.9583926 -4.665077 7965.252 14289.69 17.14977 -65.298841 -41.028284
6 125.00 2.320144 0.9390726 -4.151839 7563.877 13502.60 15.09488 -67.968446 -2.087963
7 150.00 4.757169 0.9170577 -3.717503 7197.853 13180.78 14.29127 -70.461110 86.361975
8 175.00 8.918049 0.8923427 -3.339037 6847.025 13315.61 14.55147 -72.057519 343.913588
9 200.00 15.536499 0.8647434 -3.003487 6502.522 14253.61 16.45367 -70.995992 1032.580832
10 225.00 25.478603 0.8338733 -2.704162 6163.823 16983.21 21.73091 -64.522565 2718.729066
11 250.00 39.736493 0.7990719 -2.439021 5838.469 23875.28 34.41154 -46.421202 6703.095916
12 275.00 59.431251 0.7592362 -2.210199 5543.551 40732.66 64.03183 3.915066 16414.453823
13 300.00 85.837843 0.7124075 -2.025097 5310.940 83790.36 136.63917 167.684049 43147.645492
14 325.00 120.457572 0.6545772 -1.903001 5208.424 212781.85 346.58686 838.184188 140794.870272
15 350.00 165.211289 0.5746875 -1.911364 5449.958 826582.32 1317.08804 5358.265184 878251.837630
subcrt> subcrt(c("glucose","ethanol","CO2"),c(-1,2,2))
subcrt: 3 species at 15 values of T and P (wet)
$reaction
coeff name formula state ispecies
1770 -1 glucose C6H12O6 aq 1770
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.67574 -50840.51 -37417.08 49.10806 60.614025 191.94614
2 25.00 1.000000 0.9970614 38.30300 -52254.65 -33429.35 63.10994 64.482264 138.47985
3 50.00 1.000000 0.9880295 36.49726 -53966.18 -30227.56 73.43200 66.045138 120.18563
4 75.00 1.000000 0.9748643 35.09797 -55912.08 -27347.38 82.02106 66.638013 111.05242
5 100.00 1.013220 0.9583926 34.00338 -58058.10 -24649.49 89.50701 66.627164 105.06881
6 125.00 2.320144 0.9390726 33.14193 -60378.42 -22083.69 96.15890 66.076737 100.05246
7 150.00 4.757169 0.9170577 32.46258 -62854.25 -19641.63 102.09987 64.927923 94.78058
8 175.00 8.918049 0.8923427 31.92612 -65467.66 -17341.08 107.36922 62.974911 88.13396
9 200.00 15.536499 0.8647434 31.50165 -68200.80 -15230.09 111.93414 59.806569 78.53419
10 225.00 25.478603 0.8338733 31.16376 -71034.17 -13404.99 115.66820 54.622231 63.06201
11 250.00 39.736493 0.7990719 30.89018 -73944.17 -12057.43 118.27903 45.759630 35.23418
12 275.00 59.431251 0.7592362 30.65919 -76898.42 -11601.90 119.10509 29.341359 -22.20133
13 300.00 85.837843 0.7124075 30.44537 -79844.84 -13087.52 116.45860 -5.455002 -167.75869
14 325.00 120.457572 0.6545772 30.20845 -82679.12 -20006.12 104.76292 -99.231110 -696.81852
15 350.00 165.211289 0.5746875 29.84479 -85097.81 -52938.72 51.59275 -532.081102 -5138.79625
subcrt> # to specify the states
subcrt> subcrt(c("glucose","ethanol","CO2"),c(-1,2,2),c("aq","aq","gas"))
subcrt: 3 species at 15 values of T and P (wet)
$reaction
coeff name formula state ispecies
1770 -1 glucose C6H12O6 aq 1770
112 2 ethanol C2H5OH aq 112
2683 2 carbon dioxide CO2 gas 2683
$out
T P rho logK G H S V Cp
1 0.01 1.000000 0.9998289 42.88396 -53600.56 -25294.51 103.591072 0.06248682 75.394461
2 25.00 1.000000 0.9970614 41.24089 -56262.65 -23731.35 109.079943 -2.09365746 54.050416
3 50.00 1.000000 0.9880295 39.92977 -59041.62 -22491.05 113.078944 -3.52643038 46.102599
4 75.00 1.000000 0.9748643 38.86337 -61910.47 -21400.88 116.330543 -4.84041492 41.362626
5 100.00 1.013220 0.9583926 37.98350 -64853.84 -20417.22 119.060706 -6.29836213 37.338953
6 125.00 2.320144 0.9390726 37.24863 -67860.06 -19536.76 121.346693 -8.11881147 32.899768
7 150.00 4.757169 0.9170577 36.62744 -70918.28 -18781.19 123.190309 -10.55330285 27.087185
8 175.00 8.918049 0.8923427 36.09541 -74017.21 -18197.62 124.535260 -13.98793739 18.639863
9 200.00 15.536499 0.8647434 35.63233 -77143.68 -17871.30 125.252611 -19.07688015 5.415598
10 225.00 25.478603 0.8338733 35.22035 -80280.68 -17955.81 125.094372 -27.03468816 -16.823847
11 250.00 39.736493 0.7990719 34.84206 -83404.08 -18745.10 123.578072 -40.35024694 -57.689057
12 275.00 59.431251 0.7592362 34.47771 -86475.90 -20864.79 119.678920 -64.81364569 -142.904543
13 300.00 85.837843 0.7124075 34.09960 -89428.26 -25887.92 110.845738 -116.58471008 -359.850067
14 325.00 120.457572 0.6545772 33.65607 -92115.09 -39036.39 88.722884 -256.30515718 -1149.757537
15 350.00 165.211289 0.5746875 32.99957 -94093.17 -91061.28 4.850808 -902.37745473 -7785.019792
subcrt> # this warns about an unbalanced reaction
subcrt> subcrt(c("glucose","ethanol"),c(-1,3))
subcrt: 2 species at 15 values of T and P (wet)
subcrt: reaction is not balanced; it is missing this composition:
H O
-6 3
$reaction
coeff name formula state ispecies
1770 -1 glucose C6H12O6 aq 1770
112 3 ethanol C2H5OH aq 112
$out
T P rho logK G H S V Cp
1 0.01 1.000000 0.9998289 -71.90431 89873.01 93030.24 33.371334 55.1417241 121.445623
2 25.00 1.000000 0.9970614 -65.17555 88915.35 95720.65 42.809943 53.0496493 98.472441
3 50.00 1.000000 0.9880295 -59.34394 87748.11 98061.29 50.353308 51.7185056 89.790117
4 75.00 1.000000 0.9748643 -54.24028 86406.33 100238.52 56.845247 50.5469811 84.688295
5 100.00 1.013220 0.9583926 -49.73124 84912.17 102303.62 62.575207 49.2861995 80.571101
6 125.00 2.320144 0.9390726 -45.71509 83284.38 104268.17 67.668654 47.7339641 76.317082
7 150.00 4.757169 0.9170577 -42.11219 81537.89 106118.02 72.169716 45.6766648 71.053023
8 175.00 8.918049 0.8923427 -38.86087 79688.05 107817.55 76.063798 42.7875688 63.694857
9 200.00 15.536499 0.8647434 -35.91296 77751.24 109299.05 79.269353 38.5189620 52.448913
10 225.00 25.478603 0.8338733 -33.23118 75746.61 110437.99 81.601649 31.8602141 33.799537
11 250.00 39.736493 0.7990719 -30.78772 73698.91 110993.80 82.678732 20.7480214 -0.200847
12 275.00 59.431251 0.7592362 -28.56430 71644.07 110451.91 81.668034 0.3924487 -70.805277
13 300.00 85.837843 0.7124075 -26.55518 69642.56 107515.28 76.474225 -42.5609467 -250.186082
14 325.00 120.457572 0.6545772 -24.77918 67819.46 97873.41 60.206369 -158.2045807 -902.761853
15 350.00 165.211289 0.5746875 -23.33826 66545.44 56131.57 -7.149773 -692.1075533 -6383.020912
subcrt> ## auto balancing reactions
subcrt> # the basis species must first be defined
subcrt> basis(c("CO2","H2O","NH3","H2S","O2"))
C H N O S ispecies logact state
CO2 1 0 0 2 0 69 0 aq
H2O 0 2 0 1 0 1 0 liq
NH3 0 3 1 0 0 68 0 aq
H2S 0 2 0 0 1 70 0 aq
O2 0 0 0 2 0 2691 0 gas
subcrt> subcrt(c("glucose","ethanol"),c(-1,3))
subcrt: 2 species at 15 values of T and P (wet)
subcrt: reaction is not balanced; it is missing this composition:
H O
-6 3
subcrt: adding missing composition from basis definition and restarting...
subcrt: 4 species at 15 values of T and P (wet)
$reaction
coeff name formula state ispecies
1770 -1 glucose C6H12O6 aq 1770
112 3 ethanol C2H5OH aq 112
1 -3 water H2O liq 1
2691 3 oxygen O2 gas 2691
$out
T P logK G H S V Cp
1 0.01 1.000000 -209.93296 262394.7 298812.1 133.23504 1.086875 87.520106
2 25.00 1.000000 -189.83296 258978.5 300670.9 139.76010 -1.155239 65.462166
3 50.00 1.000000 -172.74094 255421.1 302190.1 144.65745 -2.981885 57.076512
4 75.00 1.000000 -158.03383 251752.5 303551.6 148.71794 -4.892122 52.097831
5 100.00 1.013220 -145.24246 247990.1 304800.6 152.18424 -7.105723 47.834942
6 125.00 2.320144 -134.01324 244147.2 305941.6 155.14613 -9.818133 43.234516
7 150.00 4.757169 -124.07556 240235.9 306956.0 157.62069 -13.257029 37.433008
8 175.00 8.918049 -115.21916 236268.3 307802.6 159.57029 -17.778402 29.272922
9 200.00 15.536499 -107.27883 232257.7 308405.6 160.88967 -23.980043 16.825833
10 225.00 25.478603 -100.12386 228220.7 308629.0 161.36774 -32.952513 -3.620754
11 250.00 39.736493 -93.65094 224179.4 308215.9 160.59176 -46.887441 -40.326815
12 275.00 59.431251 -87.78020 220167.5 306628.3 157.69006 -70.791722 -115.133994
13 300.00 85.837843 -82.45514 216243.6 302531.4 150.51002 -118.424268 -301.570206
14 325.00 120.457572 -77.65237 212530.9 291543.1 132.05584 -240.770248 -968.165232
15 350.00 165.211289 -73.43842 209398.3 248078.5 62.03525 -786.151009 -6490.776053
subcrt> # a bug in CHNOSZ <0.9 caused the following
subcrt> # to initiate an infinite loop
subcrt> basis(c("H2O","H2S","O2","H+"))
basis: changed basis to H2O H2S O2 H+.
H O S Z ispecies logact state
H2O 2 1 0 0 1 0 liq
H2S 2 0 1 0 70 0 aq
O2 0 2 0 0 2691 0 gas
H+ 1 0 0 1 3 0 aq
subcrt> subcrt(c("HS-","SO4-2"),c(-1,1))
subcrt: 2 species at 15 values of T and P (wet)
subcrt: reaction is not balanced; it is missing this composition:
H Z O
1 1 -4
subcrt: adding missing composition from basis definition and restarting...
subcrt: 4 species at 15 values of T and P (wet)
$reaction
coeff name formula state ispecies
22 -1 HS- HS- aq 22
24 1 SO4-2 SO4-2 aq 24
2691 -2 oxygen O2 gas 2691
3 1 H+ H+ aq 3
$out
T P logK G H S V Cp
1 0.01 1.000000 146.78591 -183467.3 -211836.15 -103.8328 -9.925885 -90.32967
2 25.00 1.000000 132.52027 -180790.0 -213550.00 -109.8580 -7.291868 -55.16446
3 50.00 1.000000 120.37530 -177991.3 -214792.32 -113.8640 -6.637299 -46.12973
4 75.00 1.000000 109.91771 -175102.1 -215914.75 -117.2105 -6.948132 -43.76631
5 100.00 1.013220 100.81437 -172132.6 -217033.23 -120.3130 -7.975710 -36.58167
6 125.00 2.320144 92.81193 -169086.1 -218171.61 -123.2694 -9.491214 18.60207
7 150.00 4.757169 85.71472 -165961.4 -219185.99 -125.7681 -10.564221 268.77809
8 175.00 8.918049 79.36946 -162754.9 -219489.28 -126.5838 -8.016569 1097.12339
9 200.00 15.536499 73.65399 -159460.2 -217515.99 -122.6882 4.941654 3364.57742
10 225.00 25.478603 68.46831 -156065.5 -209629.52 -107.5141 38.942360 8942.65353
11 250.00 39.736493 63.72797 -152550.5 -187541.72 -66.8745 117.446612 22136.71295
12 275.00 59.431251 59.35987 -148884.5 -131302.82 32.0853 315.109359 54305.75318
13 300.00 85.837843 55.29882 -145024.5 14525.94 278.3849 918.227947 142904.32515
14 325.00 120.457572 51.47902 -140895.7 453182.15 993.2018 3293.593523 466924.21124
15 350.00 165.211289 47.78952 -136264.5 2538091.29 4291.6819 18957.662386 2922120.91546
subcrt> # note the next one is a non-reaction
subcrt> # (products same as reactants)
subcrt> subcrt("H2O",1)
subcrt: 1 species at 15 values of T and P (wet)
subcrt: reaction is not balanced; it is missing this composition:
H O
-2 -1
subcrt: balanced reaction, but it is a non-reaction; restarting...
subcrt: 2 species at 15 values of T and P (wet)
$reaction
coeff name formula state ispecies
1 1 water H2O liq 1
2 -1 water H2O liq 1
$out
T P logK G H S V Cp
1 0.01 1.000000 0 0 0 0 0 0
2 25.00 1.000000 0 0 0 0 0 0
3 50.00 1.000000 0 0 0 0 0 0
4 75.00 1.000000 0 0 0 0 0 0
5 100.00 1.013220 0 0 0 0 0 0
6 125.00 2.320144 0 0 0 0 0 0
7 150.00 4.757169 0 0 0 0 0 0
8 175.00 8.918049 0 0 0 0 0 0
9 200.00 15.536499 0 0 0 0 0 0
10 225.00 25.478603 0 0 0 0 0 0
11 250.00 39.736493 0 0 0 0 0 0
12 275.00 59.431251 0 0 0 0 0 0
13 300.00 85.837843 0 0 0 0 0 0
14 325.00 120.457572 0 0 0 0 0 0
15 350.00 165.211289 0 0 0 0 0 0
subcrt> # but this one auto-balances into a reaction
subcrt> # (water to steam)
subcrt> subcrt("H2O",1,"gas")
subcrt: 1 species at 15 values of T and P
subcrt: reaction is not balanced; it is missing this composition:
H O
-2 -1
subcrt: adding missing composition from basis definition and restarting...
subcrt: 2 species at 15 values of T and P (wet)
$reaction
coeff name formula state ispecies
2696 1 steam H2O gas 2696
1 -1 water H2O liq 1
$out
T P logK G H S V Cp
1 0.01 1.000000 -2.29851343 2872.9060 10590.025 28.78056 -18.01828 -8.365347
2 25.00 1.000000 -1.58542852 2162.9115 10381.655 28.05072 -18.06830 -8.434168
3 50.00 1.000000 -0.99438432 1470.3330 10167.594 27.36141 -18.23346 -8.689500
4 75.00 1.000000 -0.49878485 794.5787 9946.790 26.70340 -18.47970 -8.988325
5 100.00 1.013220 -0.07905088 134.9732 9717.501 26.06755 -18.79731 -9.366129
6 125.00 2.320144 0.27968054 -509.5259 9477.595 25.44694 -19.18403 -9.802786
7 150.00 4.757169 0.58835881 -1139.1840 9225.803 24.83650 -19.64456 -10.296919
8 175.00 8.918049 0.85560981 -1754.5123 8960.358 24.23173 -20.18866 -10.874349
9 200.00 15.536499 1.08822734 -2356.0025 8678.676 23.62730 -20.83300 -11.580994
10 225.00 25.478603 1.29162861 -2944.1170 8377.014 23.01658 -21.60424 -12.483222
11 250.00 39.736493 1.47017929 -3519.2798 8050.046 22.39110 -22.54515 -13.685746
12 275.00 59.431251 1.62743189 -4081.8732 7689.976 21.73935 -23.72806 -15.385218
13 300.00 85.837843 1.76630441 -4632.2407 7284.288 21.04354 -25.28777 -18.033855
14 325.00 120.457572 1.88921708 -5170.6988 6809.122 20.26983 -27.52189 -23.002334
15 350.00 165.211289 1.99819710 -5697.5506 6201.186 19.32651 -31.34782 -37.413768
subcrt> # properties of a species and a formation
subcrt> # reaction for that species
subcrt> subcrt("C2H5OH") # species
subcrt: 1 species at 15 values of T and P (wet)
$species
name formula state ispecies
112 ethanol C2H5OH aq 112
$out
$out$ethanol
T P rho logK G H S V Cp
1 0.01 1.000000 0.9998289 34.00279 -42500.00 -70209.10 30.43813 55.07924 62.81686
2 25.00 1.000000 0.9970614 31.76118 -43330.00 -68650.00 35.90000 55.14331 62.17949
3 50.00 1.000000 0.9880295 29.95389 -44290.91 -67095.45 40.90686 55.24494 62.23937
4 75.00 1.000000 0.9748643 28.48182 -45372.36 -65536.19 45.55435 55.38740 62.52880
5 100.00 1.013220 0.9583926 27.27279 -46566.14 -63967.66 49.90504 55.58456 62.98048
6 125.00 2.320144 0.9390726 26.27260 -47863.79 -62383.92 54.00844 55.85278 63.63056
7 150.00 4.757169 0.9170577 25.44144 -49259.87 -60779.16 57.90925 56.22997 64.58211
8 175.00 8.918049 0.8923427 24.74841 -50749.05 -59143.26 61.65207 56.77551 66.02582
9 200.00 15.536499 0.8647434 24.16957 -52326.91 -57459.80 65.28732 57.59584 68.32020
10 225.00 25.478603 0.8338733 23.68631 -53990.18 -55700.55 68.88128 58.89490 72.19535
11 250.00 39.736493 0.7990719 23.28422 -55737.20 -53812.85 72.53739 61.09827 79.32006
12 275.00 59.431251 0.7592362 22.95262 -57569.03 -51686.23 76.45058 65.20609 94.17030
13 300.00 85.837843 0.7124075 22.68475 -59492.14 -49045.15 81.07926 74.02376 131.95703
14 325.00 120.457572 0.6545772 22.48000 -61526.71 -44978.60 87.89049 98.10058 269.49638
15 350.00 165.211289 0.5746875 22.35592 -63744.45 -34130.56 105.33174 210.26990 1424.69512
subcrt> basis("CHNOS")
C H N O S ispecies logact state
CO2 1 0 0 2 0 69 -3 aq
H2O 0 2 0 1 0 1 0 liq
NH3 0 3 1 0 0 68 -4 aq
H2S 0 2 0 0 1 70 -7 aq
O2 0 0 0 2 0 2691 -80 gas
subcrt> subcrt("C2H5OH",1) # reaction
subcrt: 1 species at 15 values of T and P (wet)
subcrt: reaction is not balanced; it is missing this composition:
C H O
-2 -6 -1
subcrt: adding missing composition from basis definition and restarting...
subcrt: 4 species at 15 values of T and P (wet)
$reaction
coeff name formula state ispecies
112 1 ethanol C2H5OH aq 112
69 -2 CO2 CO2 aq 69
1 -3 water H2O liq 1
2691 3 oxygen O2 gas 2691
$out
T P logK G H S V Cp
1 0.01 1.000000 -250.6087 313235.2 336229.2 84.12698 -59.52715 -104.42604
2 25.00 1.000000 -228.1360 311233.1 334100.3 76.65016 -65.63750 -73.01769
3 50.00 1.000000 -209.2382 309387.2 332417.6 71.22545 -69.02702 -63.10912
4 75.00 1.000000 -193.1318 307664.5 330899.0 66.69688 -71.53014 -58.95459
5 100.00 1.013220 -179.2458 306048.2 329450.1 62.67723 -73.73289 -57.23386
6 125.00 2.320144 -167.1552 304525.6 328025.2 58.98723 -75.89487 -56.81794
7 150.00 4.757169 -156.5381 303090.1 326597.6 55.52082 -78.18495 -57.34757
8 175.00 8.918049 -147.1453 301735.9 325143.7 52.20107 -80.75331 -58.86103
9 200.00 15.536499 -138.7805 300458.5 323635.7 48.95553 -83.78661 -61.70836
10 225.00 25.478603 -131.2876 299254.8 322033.9 45.69954 -87.57474 -66.68276
11 250.00 39.736493 -124.5411 298123.5 320273.3 42.31272 -92.64707 -75.56100
12 275.00 59.431251 -118.4394 297065.9 318230.2 38.58497 -100.13308 -92.93267
13 300.00 85.837843 -112.9005 296088.5 315618.9 34.05142 -112.96927 -133.81151
14 325.00 120.457572 -107.8608 295210.0 311549.2 27.29292 -141.53914 -271.34671
15 350.00 165.211289 -103.2832 294496.1 301017.3 10.44249 -254.06991 -1351.97980
subcrt> ## properties of mineral phases
subcrt> # properties of phase species
subcrt> subcrt(c("pyrrhotite","pyrrhotite"),state=c("cr1","cr2"))
subcrt: 2 species at 15 values of T and P
subcrt: some points below T limits for pyrrhotite cr2 (using 999999 for G).
subcrt: some points above T limits for pyrrhotite cr1 (using 999999 for G).
subcrt: some points above T limits for pyrrhotite cr2 (using 999999 for G).
$species
name formula state ispecies
2002 pyrrhotite FeS cr1 2002
2003 pyrrhotite FeS cr2 2003
$out
$out$pyrrhotite
T P logK G H S V Cp
1 0.01 1.000000 18.99174 -23737.73 -24318.15 13.29594 18.2 12.40142
2 25.00 1.000000 17.65373 -24084.00 -24000.00 14.41000 18.2 13.06116
3 50.00 1.000000 16.54077 -24457.79 -23665.22 15.48790 18.2 13.72116
4 75.00 1.000000 15.60432 -24858.14 -23313.94 16.53464 18.2 14.38116
5 100.00 1.013220 14.80847 -25284.30 -22946.16 17.55455 18.2 15.04116
6 125.00 2.320144 14.12608 -25735.09 -22561.88 18.55111 18.2 15.70116
7 150.00 4.757169 -516.47339 999999.00 -22161.10 19.52717 18.2 16.36116
8 175.00 8.918049 -487.66198 999999.00 -21743.83 20.48509 18.2 17.02116
9 200.00 15.536499 -461.89521 999999.00 -21310.05 21.42682 18.2 17.68116
10 225.00 25.478603 -438.71468 999999.00 -20859.77 22.35405 18.2 18.34116
11 250.00 39.736493 -417.74963 999999.00 -20392.99 23.26819 18.2 19.00116
12 275.00 59.431251 -398.69692 999999.00 -19909.71 24.17046 18.2 19.66116
13 300.00 85.837843 -381.30632 999999.00 -19409.93 25.06193 18.2 20.32116
14 325.00 120.457572 -365.36942 999999.00 -18893.65 25.94351 18.2 20.98116
15 350.00 165.211289 -350.71125 999999.00 -18360.87 26.81602 18.2 21.64116
$out$pyrrhotite
T P logK G H S V Cp
1 0.01 1.000000 -800.06486 999999.00 -24186.36 13.33352 18.2 17.4
2 25.00 1.000000 -733.00592 999999.00 -23751.53 14.85670 18.2 17.4
3 50.00 1.000000 -676.29805 999999.00 -23316.53 16.25775 18.2 17.4
4 75.00 1.000000 -627.73436 999999.00 -22881.53 17.55434 18.2 17.4
5 100.00 1.013220 -585.67792 999999.00 -22446.53 18.76098 18.2 17.4
6 125.00 2.320144 -548.90297 999999.00 -22011.53 19.88934 18.2 17.4
7 150.00 4.757169 13.54563 -26227.13 -21576.53 20.94896 18.2 17.4
8 175.00 8.918049 13.05065 -26761.64 -21141.53 21.94774 18.2 17.4
9 200.00 15.536499 12.61870 -27319.37 -20706.53 22.89229 18.2 17.4
10 225.00 25.478603 12.23956 -27898.65 -20271.53 23.78820 18.2 17.4
11 250.00 39.736493 11.90499 -28497.89 -19836.53 24.64022 18.2 17.4
12 275.00 59.431251 11.60830 -29115.56 -19401.53 25.45247 18.2 17.4
13 300.00 85.837843 11.34393 -29750.16 -18966.53 26.22848 18.2 17.4
14 325.00 120.457572 -365.36942 999999.00 -18531.53 26.97136 18.2 17.4
15 350.00 165.211289 -350.71125 999999.00 -18096.53 27.68382 18.2 17.4
subcrt> # properties of the stable phases
subcrt> subcrt("pyrrhotite")
subcrt: 1 species at 15 values of T and P
subcrt: 3 phases for pyrrhotite ... phases 1 2 3 are stable.
$species
name formula state ispecies
2002 pyrrhotite FeS cr* 2002
$out
$out$pyrrhotite
T P logK G H S V Cp state
1 0.01 1.000000 18.99174 -23737.73 -24318.15 13.29594 18.2 12.40142 1
2 25.00 1.000000 17.65373 -24084.00 -24000.00 14.41000 18.2 13.06116 1
3 50.00 1.000000 16.54077 -24457.79 -23665.22 15.48790 18.2 13.72116 1
4 75.00 1.000000 15.60432 -24858.14 -23313.94 16.53464 18.2 14.38116 1
5 100.00 1.013220 14.80847 -25284.30 -22946.16 17.55455 18.2 15.04116 1
6 125.00 2.320144 14.12608 -25735.09 -22561.88 18.55111 18.2 15.70116 1
7 150.00 4.757169 13.54563 -26227.13 -21576.53 20.94896 18.2 17.40000 2
8 175.00 8.918049 13.05065 -26761.64 -21141.53 21.94774 18.2 17.40000 2
9 200.00 15.536499 12.61870 -27319.37 -20706.53 22.89229 18.2 17.40000 2
10 225.00 25.478603 12.23956 -27898.65 -20271.53 23.78820 18.2 17.40000 2
11 250.00 39.736493 11.90499 -28497.89 -19836.53 24.64022 18.2 17.40000 2
12 275.00 59.431251 11.60830 -29115.56 -19401.53 25.45247 18.2 17.40000 2
13 300.00 85.837843 11.34393 -29750.16 -18966.53 26.22848 18.2 17.40000 2
14 325.00 120.457572 11.10731 -30400.19 -18412.10 27.17109 18.2 13.62360 3
15 350.00 165.211289 10.89557 -31067.03 -18070.77 27.73012 18.2 13.68310 3
subcrt> # phase transitions in a reaction
subcrt> subcrt(c("pyrite","pyrrhotite","H2O","H2S","O2"),c(-1,1,-1,1,0.5))
subcrt: 5 species at 15 values of T and P (wet)
subcrt: 3 phases for pyrrhotite ... phases 1 2 3 are stable.
$reaction
coeff name formula state ispecies
1998 -1 pyrite FeS2 cr 1998
2002 1 pyrrhotite FeS cr* 2002
2003 1 water H2O liq 1
2004 1 H2S H2S aq 70
1 -1 oxygen O2 gas 2691
$out
T P rho logK G H S V Cp
1 0.01 1.000000 0.9998289 -52.14735 65178.84 75463.23 36.56399 9.393522 45.80720
2 25.00 1.000000 0.9970614 -47.07641 64223.71 76315.76 39.56222 11.273663 26.59476
3 50.00 1.000000 0.9880295 -42.74887 63210.03 76894.34 41.42886 12.076372 20.67869
4 75.00 1.000000 0.9748643 -39.01730 62155.69 77378.50 42.87304 12.455260 18.39112
5 100.00 1.013220 0.9583926 -35.76625 61068.07 77825.15 44.11233 12.622392 17.49507
6 125.00 2.320144 0.9390726 -32.90754 59951.40 78259.78 45.23830 12.671798 17.32574
7 150.00 4.757169 0.9170577 -30.36388 58790.73 79281.90 47.72319 12.664625 18.70468
8 175.00 8.918049 0.8923427 -28.08221 57585.35 79752.36 48.79914 12.655308 18.86590
9 200.00 15.536499 0.8647434 -26.02982 56354.33 80234.95 49.84053 12.716766 19.64651
10 225.00 25.478603 0.8338733 -24.17246 55098.32 80749.05 50.88988 12.977756 21.46421
11 250.00 39.736493 0.7990719 -22.48198 53816.82 81329.23 52.01284 13.708314 25.39280
12 275.00 59.431251 0.7592362 -20.93457 52507.42 82048.81 53.33721 15.562235 34.45066
13 300.00 85.837843 0.7124075 -19.50912 51163.85 83095.22 55.17429 20.433402 59.15837
14 325.00 120.457572 0.6545772 -18.18444 49769.97 85222.63 58.74730 35.644453 149.83274
15 350.00 165.211289 0.5746875 -16.92864 48269.42 91903.56 69.50981 112.875612 969.81465
$state
T P pyrrhotite
1 0.01 1.000000 1
2 25.00 1.000000 1
3 50.00 1.000000 1
4 75.00 1.000000 1
5 100.00 1.013220 1
6 125.00 2.320144 1
7 150.00 4.757169 2
8 175.00 8.918049 2
9 200.00 15.536499 2
10 225.00 25.478603 2
11 250.00 39.736493 2
12 275.00 59.431251 2
13 300.00 85.837843 2
14 325.00 120.457572 3
15 350.00 165.211289 3
subcrt> ## these produce NAs and warnings
subcrt> # Psat is not defined above the critical point
subcrt> subcrt("alanine",T=seq(0,5000,by=1000))
Warning: water.SUPCRT92: errors calculating 5 of 6 points; for Psat we need T < 647.067 K.
subcrt: 1 species at 6 values of T and P (wet)
Warning: water.SUPCRT92: errors calculating 3 of 6 points; T and/or P are NA, or T < Tfusion@P, T > 2250 degC, or P > 30kb.
$species
name formula state ispecies
1504 alanine C3H7NO2 aq 1504
$out
$out$alanine
T P rho logK G H S V Cp
1 1e-02 1 9.998289e-01 70.30240 -87870.78 -133142.96 36.59025 58.15163 13.35591
2 1e+03 1 1.701990e-04 25.92454 -151024.68 -67118.87 109.31389 -376.79186 49.48560
3 2e+03 1 9.531414e-05 -Inf Inf -35701.13 136.96023 NaN NaN
4 3e+03 1 0.000000e+00 29.26455 -438293.46 13787.63 155.00305 NA NA
5 4e+03 1 0.000000e+00 30.69595 -600186.79 63281.94 168.19814 NA NA
6 5e+03 1 0.000000e+00 32.06898 -773771.13 112778.51 178.60611 NA NA
subcrt> # above the T, P limits for the H2O equations of state
subcrt> subcrt("alanine",T=c(2250,2251),P=c(30000,30001),grid="T")
subcrt: 1 species at 4 values of T and P (wet)
Warning: water.SUPCRT92: errors calculating 3 of 4 points; T and/or P are NA, or T < Tfusion@P, T > 2250 degC, or P > 30kb.
$species
name formula state ispecies
1504 alanine C3H7NO2 aq 1504
$out
$out$alanine
T P rho logK G H S V Cp
1 2250 30000 1.026316 -Inf Inf 21919.72 142.1466 NaN NaN
2 2250 30001 0.000000 24.37980 -281468.9 21921.22 142.1466 NA NA
3 2251 30000 0.000000 24.38258 -281612.6 21969.16 142.1662 NA NA
4 2251 30001 0.000000 24.38245 -281611.1 21970.66 142.1662 NA NA
subcrt> ## No test:
subcrt> ## heat capacity of Fe(cr)
subcrt> # compare calculated values of heat capacity with
subcrt> # values from Robie and Hemingway, 1995, (from which
subcrt> # the parameters in the database were derived)
subcrt> nuts(c("J","K")) # set the units
nuts: energy in J
nuts: temperature in K
subcrt> # we set pressure here otherwise subcrt goes for
subcrt> # Psat (saturation vapor pressure of H2O above
subcrt> # 100 degrees C) which can not be calculated above
subcrt> # the critical point of H2O (~647 K)
subcrt> s <- subcrt("Fe",T=seq(300,1800,20),P=1)
subcrt: 1 species at 76 values of T and P
subcrt: 4 phases for Fe ... phases 1 2 3 4 are stable.
subcrt> plot(s$out[[1]]$T,s$out[[1]]$Cp,type="l",
subcrt+ xlab=axis.label("T"),ylab=axis.label("Cp"))
subcrt> # add points from RH95
subcrt> RH95 <- read.csv(system.file("extdata/cpetc/RH95.csv",package="CHNOSZ"))
subcrt> points(RH95[,1],RH95[,2])
subcrt> title(main=paste("Heat capacity of Fe(cr)\n",
subcrt+ "(points - Robie and Hemingway, 1995)"))
subcrt> # reset the units
subcrt> nuts(c("C","cal"))
nuts: temperature in C
nuts: energy in cal
subcrt> ## Skarn example after Johnson et al., 1992
subcrt> P <- seq(500,5000,500)
subcrt> # this is like the temperature specification used
subcrt> # in the example by Johnson et al., 1992
subcrt> # T <- seq(0,1000,100)
subcrt> # we use this one to avoid warnings at 0 deg C, 5000 bar
subcrt> T <- c(2,seq(100,1000,100))
subcrt> subcrt(c("andradite","carbon dioxide","H2S","Cu+","quartz","calcite",
subcrt+ "chalcopyrite","H+","H2O"),coeff=c(-1,-3,-4,-2,3,3,2,2,3),
subcrt+ state=c("cr","g","aq","aq","cr","cr","cr","aq","liq"),
subcrt+ P=P,T=T,grid="P")
subcrt: 9 species at 110 values of T and P (wet)
subcrt: some points above T limits for andradite cr (ignored).
subcrt: some points above T limits for calcite cr (ignored).
subcrt: 2 phases for quartz ... phases 1 2 are stable.
subcrt: 3 phases for chalcopyrite ... phases 1 2 3 are stable.
$reaction
coeff name formula state ispecies
1825 -1 andradite Ca3Fe2Si3O12 cr 1825
2683 -3 carbon dioxide CO2 gas 2683
70 -4 H2S H2S aq 70
1112 -2 Cu+ Cu+ aq 1112
2005 3 quartz SiO2 cr* 2005
2006 3 calcite CaCO3 cr 1851
1851 3 chalcopyrite CuFeS2 cr* 1860
1860 2 H+ H+ aq 3
1861 2 water H2O liq 1
$out
T P rho logK G H S V Cp
1 2 500 1.02359990 82.3648797 -103697.6352 -144405.9 -137.9678 6.352871e+01 -1.852961e+02
2 100 500 0.98027455 51.5228952 -87971.2924 -155917.1 -174.7271 5.667512e+01 -7.779774e+01
3 200 500 0.89701698 32.1436145 -69590.6387 -164244.5 -194.2460 5.489303e+01 -9.272523e+02
4 300 500 0.77664194 18.9803000 -49776.9907 -220009.3 -292.2200 -1.483232e+02 -2.216627e+04
5 400 500 0.57799120 9.0194783 -27781.1703 -1231387.2 -1783.9406 -9.509096e+03 -5.030550e+05
6 500 500 0.25694656 -0.9573624 3386.8611 -10007360.2 -12944.4489 -2.459231e+05 -2.607833e+06
7 600 500 0.16398650 -7.5626815 30214.9540 -8570506.1 -9847.0612 -3.447928e+05 -8.191978e+05
8 700 500 0.12964454 -13.2476444 58989.6361 -10920710.4 -11279.8033 -5.518065e+05 -1.444715e+06
9 800 500 0.11009099 -19.5535474 96015.9219 -19232011.5 -18007.9839 -1.114154e+06 -4.744135e+06
10 900 500 0.09688301 -28.0901437 150787.3030 -45772238.7 -39142.7068 -2.903831e+06 -2.215964e+07
11 1000 500 0.08711666 -44.5952131 259791.5885 -168827962.1 -132808.3841 -1.140518e+07 -1.827589e+08
12 2 1000 1.04483931 81.7873116 -102970.4753 -144561.8 -135.4149 5.839446e+01 -1.869517e+02
13 100 1000 0.99970469 51.1280788 -87297.1744 -156911.1 -174.9484 5.614202e+01 -7.858621e+01
14 200 1000 0.92370628 31.8079813 -68863.9959 -164613.8 -193.2111 5.873424e+01 -3.719407e+02
15 300 1000 0.82320847 18.6693991 -48961.6341 -189250.0 -237.2092 -2.453389e+01 -7.750134e+03
16 400 1000 0.69257907 9.0027495 -27729.6432 -362350.2 -490.6612 -1.061879e+03 -5.794293e+04
17 500 1000 0.52821136 1.2831023 -4539.2311 -1272804.3 -1634.7838 -9.697314e+03 -3.101138e+05
18 600 1000 0.37392977 -5.3380921 21327.1188 -3367367.7 -3876.0384 -4.396444e+04 -7.210892e+05
19 700 1000 0.28235808 -10.8518738 48321.6537 -5245635.7 -5435.5433 -9.617982e+04 -9.540041e+05
20 800 1000 0.23102723 -15.5417578 76316.3925 -7480180.2 -7037.3557 -1.700093e+05 -1.454540e+06
21 900 1000 0.19845264 -19.6393090 105423.3992 -10773469.1 -9269.5172 -2.827189e+05 -2.521361e+06
22 1000 1000 0.17561269 -23.2164781 135248.7254 -15446806.9 -12235.5553 -4.485504e+05 -4.479933e+06
23 2 1500 1.06375805 81.2527447 -102297.4539 -145205.8 -134.4392 5.439673e+01 -1.878690e+02
24 100 1500 1.01730894 50.7369840 -86629.4108 -157953.4 -175.2821 5.561480e+01 -7.961689e+01
25 200 1500 0.94640664 31.4749650 -68143.0185 -165540.1 -193.3417 5.964298e+01 -1.690846e+02
26 300 1500 0.85760020 18.3666797 -48167.7341 -179894.6 -219.5052 3.062067e+01 -3.479684e+03
27 400 1500 0.75097211 8.7632905 -26992.0782 -250892.8 -323.8257 -3.018970e+02 -2.094497e+04
28 500 1500 0.62961762 1.3010940 -4602.8807 -505282.8 -639.9308 -2.003556e+03 -7.578144e+04
29 600 1500 0.50831911 -4.7339249 18913.3076 -1125779.2 -1304.2148 -7.991073e+03 -1.973237e+05
30 700 1500 0.40972516 -9.7009928 43196.9650 -2065969.9 -2161.2389 -2.089406e+04 -3.567808e+05
31 800 1500 0.34079679 -13.8716229 68115.3466 -3085966.3 -2933.5363 -3.969295e+04 -5.311753e+05
32 900 1500 0.29336526 -17.3532583 93151.9271 -4122353.3 -3588.2436 -6.276906e+04 -7.476535e+05
33 1000 1500 0.25923723 -20.2390654 117903.6623 -5120493.2 -4109.8375 -8.801741e+04 -1.006259e+06
34 2 2000 1.08048340 80.7521207 -101667.1667 -146221.0 -134.6569 5.119917e+01 -1.885809e+02
35 100 2000 1.03348196 50.3495289 -85967.8618 -159034.6 -175.7035 5.510338e+01 -8.043477e+01
36 200 2000 0.96640772 31.1444820 -67427.5257 -166645.2 -193.8386 5.956828e+01 -9.512499e+01
37 300 2000 0.88562644 18.0659200 -47378.9735 -176775.6 -212.6732 5.070957e+01 -1.724449e+03
38 400 2000 0.79265545 8.4953607 -26166.8196 -214338.7 -268.3932 -8.915990e+01 -1.004705e+04
39 500 2000 0.69117683 1.1089070 -3922.9804 -327056.8 -408.2401 -6.904722e+02 -3.144540e+04
40 600 2000 0.58996426 -4.7605816 19019.8084 -568057.3 -663.7739 -2.454085e+03 -7.450101e+04
41 700 2000 0.50024878 -9.4882179 42249.5128 -961535.7 -1023.7159 -6.216508e+03 -1.410250e+05
42 800 2000 0.42869433 -13.4168223 65882.0894 -1425895.5 -1383.0513 -1.197600e+04 -2.187585e+05
43 900 2000 0.37444904 -16.7024537 89658.4217 -1855925.9 -1651.9867 -1.871514e+04 -2.958581e+05
44 1000 2000 0.33328467 -19.4607092 113369.3103 -2186571.3 -1800.5612 -2.514499e+04 -3.643939e+05
45 2 2500 1.09530649 80.2789352 -101071.4248 -147525.1 -135.7994 4.858539e+01 -1.894320e+02
46 100 2500 1.04847948 49.9655833 -85312.3048 -160147.9 -176.1949 5.461235e+01 -8.109752e+01
47 200 2500 0.98442868 30.8164412 -66717.3203 -167800.5 -194.4303 5.920948e+01 -7.293843e+01
48 300 2500 0.90963179 17.7684333 -46598.7966 -176043.2 -209.9903 5.868268e+01 -8.888302e+02
49 400 2500 0.82587445 8.2224715 -25326.2852 -198878.6 -244.3198 -6.444388e+00 -5.447946e+03
50 500 2500 0.73647934 0.8723360 -3086.0633 -259877.4 -320.3813 -2.754196e+02 -1.612232e+04
51 600 2500 0.64765806 -4.9346562 19715.2836 -374951.4 -441.5946 -9.745122e+02 -3.554495e+04
52 700 2500 0.56644119 -9.5742738 42632.7058 -556094.1 -605.8386 -2.343007e+03 -6.500954e+04
53 800 2500 0.49747171 -13.4064900 65831.3539 -768866.1 -769.2704 -4.363281e+03 -1.002120e+05
54 900 2500 0.44158649 -16.6216232 89224.5250 -956291.2 -883.4001 -6.618443e+03 -1.331582e+05
55 1000 2500 0.39699289 -19.3516094 112733.7440 -1078074.0 -928.1332 -8.549750e+03 -1.574942e+05
56 2 3000 1.10860171 79.8284044 -100504.2051 -149059.6 -137.6754 4.640557e+01 -1.905893e+02
57 100 3000 1.06247990 49.5849972 -84662.4839 -161288.2 -176.7432 5.414384e+01 -8.164669e+01
58 200 3000 1.00091814 30.4907319 -66012.1626 -168961.1 -195.0227 5.880140e+01 -7.041906e+01
59 300 3000 0.93082544 17.4743997 -45827.6755 -176360.3 -209.1225 6.173692e+01 -4.624952e+02
60 400 3000 0.85387725 7.9505600 -24488.7622 -191732.8 -232.5930 3.093374e+01 -3.141502e+03
61 500 3000 0.77288539 0.6240693 -2207.7702 -228773.8 -279.2370 -1.041650e+02 -9.196774e+03
62 600 3000 0.69258709 -5.1520540 20583.8466 -290686.2 -344.2663 -4.301994e+02 -1.934641e+04
63 700 3000 0.61802345 -9.7563379 43443.4082 -383045.6 -427.2057 -1.012445e+03 -3.379997e+04
64 800 3000 0.55259242 -13.5515328 66543.5732 -485527.2 -504.4187 -1.806302e+03 -5.033336e+04
65 900 3000 0.49735113 -16.7441587 89882.2930 -568223.3 -551.8065 -2.618060e+03 -6.482806e+04
66 1000 3000 0.45156467 -19.4728148 113439.8319 -611580.8 -561.0233 -3.217085e+03 -7.381127e+04
67 2 3500 1.12072902 79.3969365 -99960.9857 -150781.6 -140.1457 4.455322e+01 -1.921321e+02
68 100 3500 1.07561550 49.2076096 -84018.1242 -162451.3 -177.3379 5.369848e+01 -8.211336e+01
69 200 3500 1.01617732 30.1672528 -65311.8332 -170115.9 -195.5924 5.840679e+01 -7.113502e+01
70 300 3500 0.94992267 17.1836799 -45065.2452 -177166.7 -209.0935 6.264106e+01 -2.409091e+02
71 400 3500 0.87830307 7.6814641 -23659.9119 -188473.0 -226.6264 4.908458e+01 -1.866305e+03
72 500 3500 0.80363761 0.3738764 -1322.6626 -212859.5 -257.7473 -2.272899e+01 -5.570398e+03
73 600 3500 0.72968242 -5.3829542 21506.3549 -248667.2 -295.3835 -1.897888e+02 -1.138207e+04
74 700 3500 0.66033862 -9.9710620 44399.5401 -299660.4 -340.8594 -4.638971e+02 -1.906013e+04
75 800 3500 0.59827127 -13.7512104 67524.0722 -352094.4 -379.5051 -8.025893e+02 -2.715013e+04
76 900 3500 0.54448193 -16.9380639 90923.1720 -389262.2 -398.7834 -1.106102e+03 -3.346953e+04
77 1000 3500 0.49867827 -19.6713804 114596.5859 -402896.7 -396.7645 -1.279369e+03 -3.636767e+04
78 2 4000 1.13198820 78.9818060 -99438.3351 -152658.7 -143.1052 4.295186e+01 -1.941134e+02
79 100 4000 1.08798935 48.8332576 -83378.9476 -163633.7 -177.9707 5.327595e+01 -8.252042e+01
80 200 4000 1.03042040 29.8459054 -64616.1190 -171266.1 -196.1427 5.802834e+01 -7.172074e+01
81 300 4000 0.96738518 16.8960518 -44310.9231 -178200.3 -209.4466 6.259925e+01 -1.296314e+02
82 400 4000 0.90010396 7.4157242 -22841.3984 -187218.6 -223.6236 5.808521e+01 -1.119293e+03
83 500 4000 0.83045585 0.1252544 -443.1124 -204368.0 -245.8513 1.927576e+01 -3.492448e+03
84 600 4000 0.76148818 -5.6168587 22440.8664 -226048.7 -268.7334 -7.109465e+01 -7.025411e+03
85 700 4000 0.69635913 -10.1960384 45401.3237 -256037.6 -295.4194 -2.085057e+02 -1.134463e+04
86 800 4000 0.63726966 -13.9687839 68592.4469 -284636.0 -316.1505 -3.607164e+02 -1.542942e+04
87 900 4000 0.58513830 -17.1543816 92084.3612 -301972.5 -324.0041 -4.738730e+02 -1.808393e+04
88 1000 4000 0.53987890 -19.8914196 115878.4347 -305211.8 -319.7885 -5.099493e+02 -1.860845e+04
89 2 4500 1.14260972 78.5809145 -98933.6115 -154665.8 -146.4715 4.154600e+01 -1.965780e+02
90 100 4500 1.09968504 48.4617812 -82744.6810 -164832.9 -178.6351 5.287541e+01 -8.288357e+01
91 200 4500 1.04380563 29.5266057 -63924.8379 -172413.3 -196.6774 5.766460e+01 -7.220653e+01
92 300 4500 0.98353069 16.6112738 -43564.0753 -179329.4 -209.9534 6.217640e+01 -8.056064e+01
93 400 4500 0.91988547 7.1534079 -22033.4299 -187061.6 -222.2352 6.241549e+01 -6.675137e+02
94 500 4500 0.85436529 -0.1204771 426.2118 -199862.4 -239.0973 4.192595e+01 -2.230311e+03
95 600 4500 0.78947750 -5.8496369 23370.8785 -213383.0 -253.4769 -8.251482e+00 -4.466964e+03
96 700 4500 0.72785142 -10.4225141 46409.7840 -232010.9 -270.1232 -7.953488e+01 -6.999605e+03
97 800 4500 0.67136869 -14.1900397 69678.9033 -248769.3 -282.2512 -1.495826e+02 -9.101465e+03
98 900 4500 0.62087994 -17.3744997 93265.9503 -257514.5 -285.7521 -1.887496e+02 -1.011640e+04
99 1000 4500 0.57641094 -20.1124585 117166.1075 -257841.1 -282.3366 -1.834772e+02 -9.813149e+03
100 2 5000 1.15275733 78.1926025 -98444.7255 -156782.2 -150.1777 4.029515e+01 -1.995563e+02
101 100 5000 1.11077194 48.0930415 -82115.0869 -166046.5 -179.3257 5.249575e+01 -8.321198e+01
102 200 5000 1.05645387 29.2092764 -63237.8229 -173558.6 -197.1991 5.731457e+01 -7.261386e+01
103 300 5000 0.99858803 16.3291150 -42824.0968 -180485.5 -210.4953 6.164870e+01 -6.728608e+01
104 400 5000 0.93805835 6.8944002 -21235.6522 -187523.3 -221.7509 6.426919e+01 -3.913520e+02
105 500 5000 0.87602855 -0.3628699 1283.7251 -197633.9 -235.2733 5.434102e+01 -1.433997e+03
106 600 5000 0.81457739 -6.0796073 24289.6723 -206224.5 -244.5149 2.646486e+01 -2.889878e+03
107 700 5000 0.75593556 -10.6337328 47350.3069 -218466.8 -255.6658 -1.192866e+01 -4.414074e+03
108 800 5000 0.70174792 -14.4093170 70755.6450 -229101.1 -263.4371 -4.278725e+01 -5.510917e+03
109 900 5000 0.65281273 -17.5913704 94430.1077 -234210.3 -265.5169 -5.298501e+01 -5.808200e+03
110 1000 5000 0.60922636 -20.3273514 118417.9767 -234294.3 -263.5691 -3.821740e+01 -5.300806e+03
$state
T P quartz chalcopyrite
1 2 500 1 1
2 100 500 1 1
3 200 500 1 1
4 300 500 1 1
5 400 500 1 1
6 500 500 1 1
7 600 500 2 2
8 700 500 2 3
9 800 500 2 3
10 900 500 2 3
11 1000 500 2 3
12 2 1000 1 1
13 100 1000 1 1
14 200 1000 1 1
15 300 1000 1 1
16 400 1000 1 1
17 500 1000 1 1
18 600 1000 1 2
19 700 1000 2 3
20 800 1000 2 3
21 900 1000 2 3
22 1000 1000 2 3
23 2 1500 1 1
24 100 1500 1 1
25 200 1500 1 1
26 300 1500 1 1
27 400 1500 1 1
28 500 1500 1 1
29 600 1500 1 2
30 700 1500 2 3
31 800 1500 2 3
32 900 1500 2 3
33 1000 1500 2 3
34 2 2000 1 1
35 100 2000 1 1
36 200 2000 1 1
37 300 2000 1 1
38 400 2000 1 1
39 500 2000 1 1
40 600 2000 1 2
41 700 2000 2 3
42 800 2000 2 3
43 900 2000 2 3
44 1000 2000 2 3
45 2 2500 1 1
46 100 2500 1 1
47 200 2500 1 1
48 300 2500 1 1
49 400 2500 1 1
50 500 2500 1 1
51 600 2500 1 2
52 700 2500 2 3
53 800 2500 2 3
54 900 2500 2 3
55 1000 2500 2 3
56 2 3000 1 1
57 100 3000 1 1
58 200 3000 1 1
59 300 3000 1 1
60 400 3000 1 1
61 500 3000 1 1
62 600 3000 1 2
63 700 3000 2 3
64 800 3000 2 3
65 900 3000 2 3
66 1000 3000 2 3
67 2 3500 1 1
68 100 3500 1 1
69 200 3500 1 1
70 300 3500 1 1
71 400 3500 1 1
72 500 3500 1 1
73 600 3500 1 2
74 700 3500 2 3
75 800 3500 2 3
76 900 3500 2 3
77 1000 3500 2 3
78 2 4000 1 1
79 100 4000 1 1
80 200 4000 1 1
81 300 4000 1 1
82 400 4000 1 1
83 500 4000 1 1
84 600 4000 1 2
85 700 4000 2 3
86 800 4000 2 3
87 900 4000 2 3
88 1000 4000 2 3
89 2 4500 1 1
90 100 4500 1 1
91 200 4500 1 1
92 300 4500 1 1
93 400 4500 1 1
94 500 4500 1 1
95 600 4500 1 2
96 700 4500 2 3
97 800 4500 2 3
98 900 4500 2 3
99 1000 4500 2 3
100 2 5000 1 1
101 100 5000 1 1
102 200 5000 1 1
103 300 5000 1 1
104 400 5000 1 1
105 500 5000 1 1
106 600 5000 1 2
107 700 5000 1 3
108 800 5000 2 3
109 900 5000 2 3
110 1000 5000 2 3
subcrt> # the volumes differ from SUPCRT92, at least because CHNOSZ
subcrt> # doesn't have include volume changes for quartz
subcrt> # other differences are from updated properties of species
subcrt> # e.g. Cu+ from Shock et al., 1997
subcrt>
subcrt> ## Standard Gibbs energy of reactions with HCN and
subcrt> ## formaldehyde, after Schulte and Shock, 1995 Fig. 1
subcrt> rxn1 <- subcrt(c("formaldehyde","HCN","H2O","glycolic acid","NH3"),
subcrt+ c(-1,-1,-2,1,1),P=300)
subcrt: 5 species at 15 values of T and P (wet)
subcrt> rxn2 <- subcrt(c("formaldehyde","HCN","H2O","glycine"),
subcrt+ c(-1,-1,-1,1),P=300)
subcrt: 4 species at 15 values of T and P (wet)
subcrt> plot(x=rxn1$out$T,rxn1$out$G/1000,type="l",ylim=c(-40,-10),
subcrt+ xlab=axis.label("T"),ylab=axis.label("DG0r","k"))
subcrt> lines(rxn1$out$T,rxn2$out$G/1000)
subcrt> # write the reactions on the plot
subcrt> text(150,-14,describe(rxn1$reaction,
subcrt+ use.name=c(TRUE,FALSE,FALSE,TRUE,FALSE)))
subcrt> text(200,-35,describe(rxn2$reaction,
subcrt+ use.name=c(TRUE,FALSE,FALSE,TRUE)))
subcrt> title(main=paste("Standard Gibbs energy of reactions",
subcrt+ "after Schulte and Shock, 1995",sep="\n"))
subcrt> ## Calculation of chemical affinities
subcrt> # after LaRowe and Helgeson, 2007
subcrt> # Fig. 3 (a): reduction of nicotinamide adenine
subcrt> # dinucleotide (NAD) coupled to oxidation of glucose
subcrt> # list the available NAD species
subcrt> info("NAD ")
info: no match for NAD .
info: approximately matching species are:
name abbrv formula state
1746 H2NAD(red) H2NAD(red) C21H29N7O14P2 aq
1747 HNAD(red)- HNAD(red)- C21H28N7O14P2- aq
1748 NAD(red)-2 NAD(red)-2 C21H27N7O14P2-2 aq
1749 H2NAD(ox)+ H2NAD(ox)+ C21H28N7O14P2+ aq
1750 HNAD(ox) HNAD(ox) C21H27N7O14P2 aq
1751 NAD(ox)- NAD(ox)- C21H26N7O14P2- aq
1755 H4NADP(red) H4NADP(red) C21H30N7O17P3 aq
1756 H3NADP(red)- H3NADP(red)- C21H29N7O17P3- aq
1757 H2NADP(red)-2 H2NADP(red)-2 C21H28N7O17P3-2 aq
1758 HNADP(red)-3 HNADP(red)-3 C21H27N7O17P3-3 aq
1759 NADP(red)-4 NADP(red)-4 C21H26N7O17P3-4 aq
1760 H4NADP(ox)+ H4NADP(ox)+ C21H29N7O17P3+ aq
1761 H3NADP(ox) H3NADP(ox) C21H28N7O17P3 aq
1762 H2NADP(ox)- H2NADP(ox)- C21H27N7O17P3- aq
1763 HNADP(ox)-2 HNADP(ox)-2 C21H26N7O17P3-2 aq
1764 NADP(ox)-3 NADP(ox)-3 C21H25N7O17P3-3 aq
subcrt> T <- seq(0,120,10)
subcrt> # oxidation of glucose (C6H12O6)
subcrt> basis(c("glucose","H2O","NH3","CO2","H+"),c(-3,0,999,-3,-7))
C H N O Z ispecies logact state
C6H12O6 6 12 0 6 0 1770 -3 aq
H2O 0 2 0 1 0 1 0 liq
NH3 0 3 1 0 0 68 999 aq
CO2 1 0 0 2 0 69 -3 aq
H+ 0 1 0 0 1 3 -7 aq
subcrt> s <- subcrt(c("NAD(ox)-","NAD(red)-2"),c(-12,12),logact=c(0,0),T=T)
subcrt: 2 species at 13 values of T and P (wet)
subcrt: reaction is not balanced; it is missing this composition:
H Z
-12 12
subcrt: adding missing composition from basis definition and restarting...
subcrt: 6 species at 13 values of T and P (wet)
subcrt> # LH07's diagrams are shown per mole of electron (24 e- per 12 NAD)
subcrt> A <- s$out$A/24/1000
subcrt> plot(x=T,y=A,xlim=range(T),ylim=c(1.4,5.4),
subcrt+ xlab=axis.label("T"),ylab=axis.label("A",opt="k"),type="l")
subcrt> text("NAD(ox)-/NAD(red)-2 = 1",x=median(T),y=median(A))
subcrt> # different activity ratio
subcrt> s <- subcrt(c("NAD(ox)-","NAD(red)-2"),c(-12,12),logact=c(1,0),T=T)
subcrt: 2 species at 13 values of T and P (wet)
subcrt: reaction is not balanced; it is missing this composition:
H Z
-12 12
subcrt: adding missing composition from basis definition and restarting...
subcrt: 6 species at 13 values of T and P (wet)
subcrt> A <- s$out$A/24/1000
subcrt> lines(x=T,y=A)
subcrt> text("NAD(ox)-/NAD(red)-2 = 10",x=median(T),y=median(A))
subcrt> # different activity ratio
subcrt> s <- subcrt(c("NAD(ox)-","NAD(red)-2"),c(-12,12),logact=c(0,1),T=T)
subcrt: 2 species at 13 values of T and P (wet)
subcrt: reaction is not balanced; it is missing this composition:
H Z
-12 12
subcrt: adding missing composition from basis definition and restarting...
subcrt: 6 species at 13 values of T and P (wet)
subcrt> A <- s$out$A/24/1000
subcrt> lines(x=T,y=s$out$A/24/1000)
subcrt> text("NAD(ox)-/NAD(red)-2 = 0.1",x=median(T),y=median(A))
subcrt> # this command prints the reaction on the plot
subcrt> text(40,4.5,c2s(s2c(describe(s$reaction,
subcrt+ use.name=c(TRUE,TRUE,FALSE,FALSE,FALSE,FALSE)),
subcrt+ sep="="),sep="\n"))
subcrt> # label the plot
subcrt> title(main=paste("Chemical affinity of NAD reduction",
subcrt+ "after LaRowe and Helgeson, 2007",sep="\n"),
subcrt+ sub=describe(thermo$basis,T=NULL))
subcrt> ### non-ideality calculations -- activity coefficients of
subcrt> ### aqueous species as a function of charge, temperature,
subcrt> ### and ionic strength -- after Alberty, 2003
subcrt> ## p. 16 Table 1.3 apparent pKa of acetic acid with
subcrt> ## changing ionic strength
subcrt> subcrt(c("acetic acid","acetate","H+"),c(-1,1,1),
subcrt+ IS=c(0,0.1,0.25),T=25,property="logK")
subcrt: 3 species at 298.15 K and P (wet)
nonideal: 2 species were nonideal.
$reaction
coeff name formula state ispecies
515 -1 acetic acid C2H4O2 aq 515
540 1 acetate C2H3O2- aq 540
3 1 H+ H+ aq 3
$out
T P logK G loggam IS
1 25 1 -4.757213 6490.000 0.0000000 0.00
2 25 1 -4.542751 6197.421 -0.4938181 0.10
3 25 1 -4.473510 6102.960 -0.6532497 0.25
subcrt> # note that these *apparent* values of G and logK approach
subcrt> # their *standard* counterparts as IS goes to zero.
subcrt> ## p. 95: basis and elemental stoichiometries of species
subcrt> ## (a digression here from the nonideality calculations)
subcrt> # note coefficient of O2 and NH3 will be zero for these species
subcrt> basis(c("ATP-4","H+","H2O","HPO4-2","O2","NH3"))
basis: changed basis to C10H12N5O13P3-4 H+ H2O HPO4-2 O2 NH3.
C H N O P Z ispecies logact state
C10H12N5O13P3-4 10 12 5 13 3 -4 1678 0 aq
H+ 0 1 0 0 0 1 3 0 aq
H2O 0 2 0 1 0 0 1 0 liq
HPO4-2 0 1 0 4 1 -2 20 0 aq
O2 0 0 0 2 0 0 2691 0 gas
NH3 0 3 1 0 0 0 68 0 aq
subcrt> # cf Eq. 5.1-33: (basis composition)
subcrt> species(c("ATP-4","H+","H2O","HPO4-2","ADP-3","HATP-3","HADP-2","H2PO4-"))
C10H12N5O13P3-4 H+ H2O HPO4-2 O2 NH3 ispecies logact state name
1 1 0 0 0 0 0 1678 -3 aq ATP-4
2 0 1 0 0 0 0 3 -3 aq H+
3 0 0 1 0 0 0 1 0 liq water
4 0 0 0 1 0 0 20 -3 aq HPO4-2
5 1 -1 1 -1 0 0 1638 -3 aq ADP-3
6 1 1 0 0 0 0 1679 -3 aq HATP-3
7 1 0 1 -1 0 0 1639 -3 aq HADP-2
8 0 1 0 1 0 0 19 -3 aq H2PO4-
subcrt> lb <- length(basis())
C H N O P Z ispecies logact state
C10H12N5O13P3-4 10 12 5 13 3 -4 1678 0 aq
H+ 0 1 0 0 0 1 3 0 aq
H2O 0 2 0 1 0 0 1 0 liq
HPO4-2 0 1 0 4 1 -2 20 0 aq
O2 0 0 0 2 0 0 2691 0 gas
NH3 0 3 1 0 0 0 68 0 aq
subcrt> # cf Eq. 5.1-32: (elemental composition)
subcrt> as.matrix(species()[,1:lb])
C10H12N5O13P3-4 H+ H2O HPO4-2 O2 NH3
1 1 0 0 0 0 0
2 0 1 0 0 0 0
3 0 0 1 0 0 0
4 0 0 0 1 0 0
5 1 -1 1 -1 0 0
6 1 1 0 0 0 0
7 1 0 1 -1 0 0
8 0 1 0 1 0 0
subcrt> ## p. 273-275: activity coefficient (gamma)
subcrt> ## as a function of ionic strength and temperature
subcrt> ## (as of 20080304, these do look quantitatively different
subcrt> ## from the plots in Alberty's book.)
subcrt> iplotfun <- function(T,col,add=TRUE) {
subcrt+ IS <- seq(0,0.25,0.0025)
subcrt+ s <- subcrt(c("H2PO4-","HADP-2","HATP-3","ATP-4"),IS=IS,grid="IS",T=T)
subcrt+ if(!add) thermo.plot.new(xlim=range(IS),ylim=c(0,1),
subcrt+ xlab=axis.label("IS"),ylab="gamma")
subcrt+ for(i in 1:4) lines(IS,10^s$out[[i]]$loggam,col=col)
subcrt+ }
subcrt> iplotfun(0,"blue",add=FALSE)
subcrt: 4 species at 273.16 K and P (wet)
nonideal: 4 species were nonideal.
subcrt> iplotfun(25,"black")
subcrt: 4 species at 298.15 K and P (wet)
nonideal: 4 species were nonideal.
subcrt> iplotfun(40,"red")
subcrt: 4 species at 313.15 K and P (wet)
nonideal: 4 species were nonideal.
subcrt> title(main=paste("activity coefficient (gamma) of -1,-2,-3,-4",
subcrt+ "charged species at 0, 25, 40 deg C, after Alberty, 2003",
subcrt+ sep="\n"),cex.main=0.95)
subcrt> ## End(No test)
subcrt>
subcrt>
subcrt>
Next: examples
Up: CHNOSZ examples
Previous: water