From 159a5c8140d9f5add5c95fb568644e65913229ed Mon Sep 17 00:00:00 2001 From: titusquah <46580668+titusquah@users.noreply.github.com> Date: Tue, 14 Jul 2020 17:02:29 -0600 Subject: [PATCH] added example file to do iterative optimization --- .idea/workspace.xml | 93 ++- data/csvs/may_pitzer_params.csv | 8 + ...zeroes_removed_PC88A_HCL_NdPrCeLaDySmY.csv | 233 ++++++ .../xmls/PC88A_HCL_NdPrCeLaDySmY_w_pitzer.xml | 716 ++++++++++++++++++ data/xmls/twophase.xml | 2 +- docs/Examples/iterative_fitter.py | 194 +++++ llepe/__init__.py | 4 +- llepe/objectives.py | 59 ++ llepe/optimizers.py | 39 + 9 files changed, 1304 insertions(+), 44 deletions(-) create mode 100644 data/csvs/may_pitzer_params.csv create mode 100644 data/csvs/zeroes_removed_PC88A_HCL_NdPrCeLaDySmY.csv create mode 100644 data/xmls/PC88A_HCL_NdPrCeLaDySmY_w_pitzer.xml create mode 100644 docs/Examples/iterative_fitter.py create mode 100644 llepe/objectives.py create mode 100644 llepe/optimizers.py diff --git a/.idea/workspace.xml b/.idea/workspace.xml index c03a66e..7e3bd25 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,8 +2,15 @@ + + + + + + - + + - - + + - + - + - - - - - + + + + + @@ -261,7 +262,14 @@ @@ -284,7 +292,8 @@ - @@ -304,11 +313,11 @@ - + - + @@ -322,30 +331,30 @@ - - + + - - - + + + - - - + + + - - - + + + - + @@ -358,11 +367,11 @@ - + - + @@ -383,11 +392,11 @@ - + - + diff --git a/data/csvs/may_pitzer_params.csv b/data/csvs/may_pitzer_params.csv new file mode 100644 index 0000000..922572d --- /dev/null +++ b/data/csvs/may_pitzer_params.csv @@ -0,0 +1,8 @@ +species,beta0,beta1,Cphi +Ce,0.6005,4.91,-0.02619 +Dy,0.6129,5.359,-0.0197 +La,0.593,5.277,-0.02434 +Nd,0.5877,5.206,-0.01969 +Pr,0.5879,5.448,-0.02067 +Sm,0.5978,5.279,-0.01992 +Y,0.6248,5.66,-0.01563 diff --git a/data/csvs/zeroes_removed_PC88A_HCL_NdPrCeLaDySmY.csv b/data/csvs/zeroes_removed_PC88A_HCL_NdPrCeLaDySmY.csv new file mode 100644 index 0000000..3c4ffc1 --- /dev/null +++ b/data/csvs/zeroes_removed_PC88A_HCL_NdPrCeLaDySmY.csv @@ -0,0 +1,233 @@ +Feed H+[M],Feed H+[M].1,PC88A[M],PC88A[M].1,Feed Nd[M],Xaq Nd,D Nd,Feed Pr[M],Xaq Pr,D Pr,Feed Ce[M],Xaq Ce,D Ce,Feed La[M],Xaq La,D La,Feed Dy[M],Xaq Dy,D Dy,Feed Sm[M],Xaq Sm,D Sm,Feed Y[M],Xaq Y,D Y +0.316227766,0.316227766,1,1,0.038824182,0.036106489,0.075268817,0.011354951,0.010673654,0.063829787,0.104199378,0.102323789,0.018329939,0.046794403,0.046466843,0.007049345,0,0,0,0,0,0,0,0,0 +0.1,0.1,1,1,0.038824182,0.023294509,0.666666667,0.011354951,0.007153619,0.587301587,0.104199378,0.087527477,0.19047619,0.046794403,0.044454683,0.052631579,0,0,0,0,0,0,0,0,0 +0.01,0.01,1,1,0.038824182,0.011647255,2.333333333,0.011354951,0.003860683,1.941176471,0.104199378,0.065645608,0.587301587,0.046794403,0.040711131,0.149425287,0,0,0,0,0,0,0,0,0 +0.01,0.01,1,1,0.08666112,0.05352756,0.619,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.05,0.05,1,1,0.08666112,0.060900295,0.423,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.1,0.1,1,1,0.08666112,0.067916239,0.276,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.3,0.3,1,1,0.08666112,0.084878668,0.021,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.01,0.01,1,1,0.042983916,0.015124531,1.842,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.05,0.05,1,1,0.042983916,0.020410216,1.106,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.1,0.1,1,1,0.042983916,0.026354332,0.631,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.3,0.3,1,1,0.042983916,0.039290599,0.094,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.01,0.01,1,1,0.005546312,3.16E-05,174.668,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.05,0.05,1,1,0.005546312,0.000451912,11.273,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.1,0.1,1,1,0.005546312,0.001558828,2.558,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.3,0.3,1,1,0.005546312,0.005400498,0.027,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.02,0.02,1,1,0.048530227,0.029263727,0.658374793,0.04967791,0.035072604,0.416430595,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.05,0.05,1,1,0.048530227,0.032127011,0.510574018,0.04967791,0.037506822,0.324503311,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.1,0.1,1,1,0.048530227,0.039018303,0.243781095,0.04967791,0.043070748,0.153402537,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.3,0.3,1,1,0.048530227,0.046443428,0.044932079,0.04967791,0.048535318,0.023541453,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.01,0.01,1,1,0.259983361,0.197587354,0.315789474,0.088710553,0.071855548,0.234567901,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.05,0.05,1,1,0.259983361,0.207986689,0.25,0.088710553,0.07540397,0.176470588,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.1,0.1,1,1,0.259983361,0.21578619,0.204819277,0.088710553,0.077178181,0.149425287,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.3,0.3,1,1,0.259983361,0.244384359,0.063829787,0.088710553,0.08338792,0.063829787,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.03,0.03,1,1,0,0,0,0.09296866,0.06556323,0.418,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.05,0.05,1,1,0,0,0,0.09296866,0.066835844,0.391,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.1,0.1,1,1,0,0,0,0.09296866,0.080076365,0.161,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.3,0.3,1,1,0,0,0,0.09296866,0.091957131,0.011,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.03,0.03,1,1,0,0,0,0.047548856,0.02373882,1.003,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.05,0.05,1,1,0,0,0,0.047548856,0.025646632,0.854,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.1,0.1,1,1,0,0,0,0.047548856,0.034988121,0.359,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.3,0.3,1,1,0,0,0,0.047548856,0.045371046,0.048,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.01,0.01,1,1,0,0,0,0.00638716,5.54E-05,114.332,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.05,0.05,1,1,0,0,0,0.00638716,0.000669233,8.544,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.1,0.1,1,1,0,0,0,0.00638716,0.002264147,1.821,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.3,0.3,1,1,0,0,0,0.00638716,0.006323921,0.01,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.25,0.25,1,1,0.1,0.087622932,0.141253754,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.25,0.25,1.5,1.5,0.1,0.07955199,0.257039578,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.25,0.25,2,2,0.1,0.074253556,0.34673685,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.25,0.25,2.5,2.5,0.1,0.071525275,0.398107171,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.25,0.25,3,3,0.1,0.066613942,0.501187234,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.13,0.13,1,1,0.1,0.075124079,0.331131121,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.08,0.08,1,1,0.1,0.065582051,0.52480746,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.03,0.03,1,1,0.1,0.059662917,0.676082975,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.26,0.26,2,2,0.1,0.079923999,0.251188643,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.13,0.13,2,2,0.1,0.061313682,0.630957344,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.08,0.08,2,2,0.1,0.051151089,0.954992586,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.03,0.03,2,2,0.1,0.044837645,1.230268771,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.01,0.01,2,2,0.1,0.041450132,1.412537545,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.26,0.26,3,3,0.1,0.074253556,0.34673685,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.13,0.13,3,3,0.1,0.048273748,1.071519305,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.08,0.08,3,3,0.1,0.040337083,1.479108388,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.03,0.03,3,3,0.1,0.033900091,1.9498446,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.01,0.01,3,3,0.1,0.030387123,2.290867653,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +1.00E-05,1.00E-05,0.1,0.1,0.0227,0.018928042,0.201385664,0.0083,0.007354823,0.128960943,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +1.00E-05,1.00E-05,0.3,0.3,0.0227,0.014333115,0.586527247,0.0083,0.005999476,0.384005473,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +1.00E-05,1.00E-05,0.5,0.5,0.0227,0.010952454,1.076235839,0.0083,0.004805359,0.727926764,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +1.00E-05,1.00E-05,0.7,0.7,0.0227,0.008786058,1.588177405,0.0083,0.003974007,1.089404412,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +1.00E-05,1.00E-05,0.9,0.9,0.0227,0.00700602,2.245762712,0.0083,0.00322327,1.576050934,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +1.00E-05,1.00E-05,0.1,0.1,0.022739878,0.017097653,0.33,0.008303308,0.006642646,0.25,0,0,0,0.054425491,0.050393973,0.08,0,0,0,0,0,0,0,0,0 +1.00E-05,1.00E-05,0.3,0.3,0.022739878,0.013298174,0.71,0.008303308,0.005462702,0.52,0,0,0,0.054425491,0.048594188,0.12,0,0,0,0,0,0,0,0,0 +1.00E-05,1.00E-05,0.5,0.5,0.022739878,0.010932634,1.08,0.008303308,0.004537327,0.83,0,0,0,0.054425491,0.048164151,0.13,0,0,0,0,0,0,0,0,0 +1.00E-05,1.00E-05,0.7,0.7,0.022739878,0.009396644,1.42,0.008303308,0.003972875,1.09,0,0,0,0.054425491,0.047326514,0.15,0,0,0,0,0,0,0,0,0 +1.00E-05,1.00E-05,0.9,0.9,0.022739878,0.008209342,1.77,0.008303308,0.002997584,1.77,0,0,0,0.054425491,0.045735706,0.19,0,0,0,0,0,0,0,0,0 +0.01,0.01,1,1,0,0,0,0,0,0,0.0508008,0.0305,0.6656,0,0,0,0,0,0,0,0,0,0,0,0 +0.01,0.01,1,1,0,0,0,0,0,0,0.09999878,0.0763,0.3106,0,0,0,0,0,0,0,0,0,0,0,0 +0.01,0.01,1,1,0,0,0,0,0,0,0.15009456,0.1232,0.2183,0,0,0,0,0,0,0,0,0,0,0,0 +0.01,0.01,1,1,0,0,0,0,0,0,0.2000068,0.1708,0.171,0,0,0,0,0,0,0,0,0,0,0,0 +0.01,0.01,1,1,0,0,0,0,0,0,0.30001216,0.2672,0.1228,0,0,0,0,0,0,0,0,0,0,0,0 +0.03,0.03,1,1,0,0,0,0,0,0,0.0499975,0.035,0.4285,0,0,0,0,0,0,0,0,0,0,0,0 +0.03,0.03,1,1,0,0,0,0,0,0,0.10000115,0.0785,0.2739,0,0,0,0,0,0,0,0,0,0,0,0 +0.03,0.03,1,1,0,0,0,0,0,0,0.1500032,0.128,0.1719,0,0,0,0,0,0,0,0,0,0,0,0 +0.03,0.03,1,1,0,0,0,0,0,0,0.20000832,0.1752,0.1416,0,0,0,0,0,0,0,0,0,0,0,0 +0.03,0.03,1,1,0,0,0,0,0,0,0.29999816,0.2728,0.0997,0,0,0,0,0,0,0,0,0,0,0,0 +0.05,0.05,1,1,0,0,0,0,0,0,0.05010115,0.0355,0.4113,0,0,0,0,0,0,0,0,0,0,0,0 +0.05,0.05,1,1,0,0,0,0,0,0,0.10000382,0.0826,0.2107,0,0,0,0,0,0,0,0,0,0,0,0 +0.05,0.05,1,1,0,0,0,0,0,0,0.1499967,0.1305,0.1494,0,0,0,0,0,0,0,0,0,0,0,0 +0.05,0.05,1,1,0,0,0,0,0,0,0.2000008,0.178,0.1236,0,0,0,0,0,0,0,0,0,0,0,0 +0.07,0.07,1,1,0,0,0,0,0,0,0.05,0.04,0.25,0,0,0,0,0,0,0,0,0,0,0,0 +0.07,0.07,1,1,0,0,0,0,0,0,0.10029675,0.0865,0.1595,0,0,0,0,0,0,0,0,0,0,0,0 +0.07,0.07,1,1,0,0,0,0,0,0,0.15000153,0.1351,0.1103,0,0,0,0,0,0,0,0,0,0,0,0 +0.07,0.07,1,1,0,0,0,0,0,0,0.20054418,0.1838,0.0911,0,0,0,0,0,0,0,0,0,0,0,0 +0.07,0.07,1,1,0,0,0,0,0,0,0.29999441,0.2753,0.0897,0,0,0,0,0,0,0,0,0,0,0,0 +0.07,0.07,1,1,0,0,0,0,0,0,0.29998992,0.2811,0.0672,0,0,0,0,0,0,0,0,0,0,0,0 +0.1,0.1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0.10000029,0.0221,3.5249,0,0,0,0,0,0 +0.1,0.1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0.15000025,0.0575,1.6087,0,0,0,0,0,0 +0.1,0.1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0.19999582,0.1037,0.9286,0,0,0,0,0,0 +0.1,0.1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0.25000596,0.1494,0.6734,0,0,0,0,0,0 +0.1,0.1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0.30000931,0.1997,0.5023,0,0,0,0,0,0 +0.3,0.3,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0.0500002,0.0106,3.717,0,0,0,0,0,0 +0.3,0.3,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0.09999641,0.0409,1.4449,0,0,0,0,0,0 +0.3,0.3,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0.14999806,0.0802,0.8703,0,0,0,0,0,0 +0.3,0.3,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0.19999448,0.1252,0.5974,0,0,0,0,0,0 +0.3,0.3,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0.29999394,0.2206,0.3599,0,0,0,0,0,0 +0.5,0.5,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0.04999904,0.0221,1.2624,0,0,0,0,0,0 +0.5,0.5,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0.09999996,0.0573,0.7452,0,0,0,0,0,0 +0.5,0.5,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0.15000096,0.0984,0.5244,0,0,0,0,0,0 +0.5,0.5,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0.19999616,0.1414,0.4144,0,0,0,0,0,0 +0.5,0.5,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0.30001016,0.2369,0.2664,0,0,0,0,0,0 +0.7,0.7,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0.04799855,0.0313,0.5335,0,0,0,0,0,0 +0.7,0.7,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0.1000035,0.071,0.4085,0,0,0,0,0,0 +0.7,0.7,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0.15000453,0.1131,0.3263,0,0,0,0,0,0 +0.7,0.7,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0.19980428,0.1586,0.2598,0,0,0,0,0,0 +0.7,0.7,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0.30000123,0.2517,0.1919,0,0,0,0,0,0 +0.0001,0.0001,1,1,0,0,0,0,0,0,0,0,0,0.04999962,0.0363,0.3774,0,0,0,0,0,0,0,0,0 +0.0001,0.0001,1,1,0,0,0,0,0,0,0,0,0,0.09999712,0.0844,0.1848,0,0,0,0,0,0,0,0,0 +0.0001,0.0001,1,1,0,0,0,0,0,0,0,0,0,0.1499944,0.1345,0.1152,0,0,0,0,0,0,0,0,0 +0.0001,0.0001,1,1,0,0,0,0,0,0,0,0,0,0.19999665,0.1835,0.0899,0,0,0,0,0,0,0,0,0 +0.0001,0.0001,1,1,0,0,0,0,0,0,0,0,0,0.24999486,0.2329,0.0734,0,0,0,0,0,0,0,0,0 +0.0001,0.0001,1,1,0,0,0,0,0,0,0,0,0,0.29998637,0.2833,0.0589,0,0,0,0,0,0,0,0,0 +0.01,0.01,1,1,0,0,0,0,0,0,0,0,0,0.0499991,0.0395,0.2658,0,0,0,0,0,0,0,0,0 +0.01,0.01,1,1,0,0,0,0,0,0,0,0,0,0.10000231,0.0881,0.1351,0,0,0,0,0,0,0,0,0 +0.01,0.01,1,1,0,0,0,0,0,0,0,0,0,0.15000091,0.1367,0.0973,0,0,0,0,0,0,0,0,0 +0.01,0.01,1,1,0,0,0,0,0,0,0,0,0,0.20009536,0.1856,0.0781,0,0,0,0,0,0,0,0,0 +0.01,0.01,1,1,0,0,0,0,0,0,0,0,0,0.40540686,0.3846,0.0541,0,0,0,0,0,0,0,0,0 +0.03,0.03,1,1,0,0,0,0,0,0,0,0,0,0.09999756,0.0897,0.1148,0,0,0,0,0,0,0,0,0 +0.03,0.03,1,1,0,0,0,0,0,0,0,0,0,0.15000544,0.1391,0.0784,0,0,0,0,0,0,0,0,0 +0.03,0.03,1,1,0,0,0,0,0,0,0,0,0,0.19999343,0.1883,0.0621,0,0,0,0,0,0,0,0,0 +0.03,0.03,1,1,0,0,0,0,0,0,0,0,0,0.29999853,0.2881,0.0413,0,0,0,0,0,0,0,0,0 +0.04,0.04,1,1,0,0,0,0,0,0,0,0,0,0.05030076,0.0444,0.1329,0,0,0,0,0,0,0,0,0 +0.04,0.04,1,1,0,0,0,0,0,0,0,0,0,0.09999639,0.0919,0.0881,0,0,0,0,0,0,0,0,0 +0.04,0.04,1,1,0,0,0,0,0,0,0,0,0,0.15000408,0.1413,0.0616,0,0,0,0,0,0,0,0,0 +0.04,0.04,1,1,0,0,0,0,0,0,0,0,0,0.20049903,0.1917,0.0459,0,0,0,0,0,0,0,0,0 +0.04,0.04,1,1,0,0,0,0,0,0,0,0,0,0.29948604,0.2883,0.0388,0,0,0,0,0,0,0,0,0 +0.01,0.01,1,1,0.05000119,0.0239,1.0921,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.01,0.01,1,1,0.09999803,0.0683,0.4641,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.01,0.01,1,1,0.1500057,0.117,0.2821,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.01,0.01,1,1,0.200004,0.168,0.1905,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.01,0.01,1,1,0.30001149,0.2637,0.1377,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.05,0.05,1,1,0.03453582,0.0201,0.7182,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.05,0.05,1,1,0.09996185,0.0757,0.3205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.05,0.05,1,1,0.19999308,0.1722,0.1614,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.1,0.1,1,1,0.04999817,0.0389,0.2853,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.1,0.1,1,1,0.1499974,0.133,0.1278,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.1,0.1,1,1,0.19999876,0.1807,0.1068,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.1,0.1,1,1,0.2500032,0.232,0.0776,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.1,0.1,1,1,0.30001216,0.2807,0.0688,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.3,0.3,1,1,0.01996974,0.0189,0.0566,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.3,0.3,1,1,0.04997968,0.0478,0.0456,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.3,0.3,1,1,0.15000144,0.1464,0.0246,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.3,0.3,1,1,0.29998765,0.2957,0.0145,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.5,0.5,1,1,0.04999786,0.0482,0.0373,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.5,0.5,1,1,0.10000096,0.0976,0.0246,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.5,0.5,1,1,0.20000784,0.1968,0.0163,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.01,0.01,1,1,0,0,0,0.04999995,0.0259,0.9305,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.01,0.01,1,1,0,0,0,0.09999925,0.0725,0.3793,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.01,0.01,1,1,0,0,0,0.20000715,0.1673,0.1955,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.01,0.01,1,1,0,0,0,0.29999192,0.2648,0.1329,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.03,0.03,1,1,0,0,0,0.05000109,0.0307,0.6287,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.03,0.03,1,1,0,0,0,0.10009624,0.0776,0.2899,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.03,0.03,1,1,0,0,0,0.20000456,0.1736,0.1521,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.03,0.03,1,1,0,0,0,0.2999997,0.273,0.0989,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.05,0.05,1,1,0,0,0,0.05002915,0.0349,0.4335,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.05,0.05,1,1,0,0,0,0.09997622,0.0809,0.2358,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.05,0.05,1,1,0,0,0,0.14999553,0.1299,0.1547,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.05,0.05,1,1,0,0,0,0.25001088,0.2272,0.1004,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.07,0.07,1,1,0,0,0,0.04999995,0.0385,0.2987,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.07,0.07,1,1,0,0,0,0.09999936,0.0864,0.1574,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.07,0.07,1,1,0,0,0,0.14998624,0.1343,0.1168,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.07,0.07,1,1,0,0,0,0.24999474,0.2334,0.0711,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.1,0.1,1,1,0,0,0,0.0499992,0.0415,0.2048,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.1,0.1,1,1,0,0,0,0.10000199,0.0901,0.1099,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.1,0.1,1,1,0,0,0,0.1999998,0.189,0.0582,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.1,0.1,1,1,0,0,0,0.30000544,0.2888,0.0388,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.01,0.01,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.0500503,0.0115,3.3522,0,0,0 +0.01,0.01,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.0999792,0.048,1.0829,0,0,0 +0.01,0.01,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.1500016,0.0944,0.589,0,0,0 +0.01,0.01,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.24999968,0.1864,0.3412,0,0,0 +0.01,0.01,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.30000263,0.2371,0.2653,0,0,0 +0.05,0.05,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.05032248,0.0156,2.2258,0,0,0 +0.05,0.05,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.10000216,0.0556,0.7986,0,0,0 +0.05,0.05,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.15000255,0.1035,0.4493,0,0,0 +0.05,0.05,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.30392343,0.1997,0.5219,0,0,0 +0.05,0.05,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.30000411,0.2471,0.2141,0,0,0 +0.1,0.1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.04999989,0.0219,1.2831,0,0,0 +0.1,0.1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.09999773,0.0623,0.6051,0,0,0 +0.1,0.1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.15000375,0.1105,0.3575,0,0,0 +0.1,0.1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.2500038,0.2073,0.206,0,0,0 +0.1,0.1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.30061536,0.2572,0.1688,0,0,0 +0.3,0.3,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.0502452,0.0408,0.2315,0,0,0 +0.3,0.3,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.09999592,0.0842,0.1876,0,0,0 +0.3,0.3,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.14999496,0.1334,0.1244,0,0,0 +0.3,0.3,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.1999935,0.1814,0.1025,0,0,0 +0.3,0.3,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.30001088,0.2782,0.0784,0,0,0 +0.1,0.1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.1500005,0.047,2.1915 +0.1,0.1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.19999809,0.0857,1.3337 +0.1,0.1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.2999996,0.1772,0.693 +0.5,0.5,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.05,0.016,2.125 +0.5,0.5,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.1000004,0.0445,1.2472 +0.5,0.5,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.15000048,0.0828,0.8116 +0.5,0.5,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.19999436,0.1214,0.6474 +0.5,0.5,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.29999366,0.2083,0.4402 +1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.04999995,0.0333,0.5015 +1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.09999846,0.0694,0.4409 +1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.15000104,0.1108,0.3538 +1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.19999756,0.1526,0.3106 +1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.29999472,0.2416,0.2417 +1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.25000384,0.1984,0.2601 +1.5,1.5,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.0500013,0.0405,0.2346 +1.5,1.5,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.09999854,0.0838,0.1933 +1.5,1.5,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.19999977,0.1753,0.1409 +2,2,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.09999804,0.0908,0.1013 +2,2,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.19992651,0.1851,0.0801 +2,2,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.30001335,0.2821,0.0635 +1.00E-05,1.00E-05,0.1,0.1,0.022739878,0.018928042,0.201385664,0.008303308,0.007354823,0.128960943,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +1.00E-05,1.00E-05,0.3,0.3,0.022739878,0.014333115,0.586527247,0.008303308,0.005999476,0.384005473,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +1.00E-05,1.00E-05,0.5,0.5,0.022739878,0.010952454,1.076235839,0.008303308,0.004805359,0.727926764,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +1.00E-05,1.00E-05,0.7,0.7,0.022739878,0.008786058,1.588177405,0.008303308,0.003974007,1.089404412,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +1.00E-05,1.00E-05,0.9,0.9,0.022739878,0.00700602,2.245762712,0.008303308,0.00322327,1.576050934,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.01023293,0.01023293,0.1,0.1,0.009359401,0.007999488,0.17,0.003371001,0.003064546,0.1,0.038539496,0.037783819,0.02,0.022461314,0.022020896,0.02,0,0,0,0,0,0,0,0,0 +0.01023293,0.01023293,0.3,0.3,0.009359401,0.006881912,0.36,0.003371001,0.002763116,0.22,0.038539496,0.035357336,0.09,0.022461314,0.021597417,0.04,0,0,0,0,0,0,0,0,0 +0.01023293,0.01023293,0.5,0.5,0.009359401,0.005813293,0.61,0.003371001,0.002340973,0.44,0.038539496,0.032386131,0.19,0.022461314,0.02060671,0.09,0,0,0,0,0,0,0,0,0 +0.01023293,0.01023293,0.7,0.7,0.009359401,0.005638193,0.66,0.003371001,0.002147134,0.57,0.038539496,0.03034606,0.27,0.022461314,0.019877269,0.13,0,0,0,0,0,0,0,0,0 +0.01023293,0.01023293,1,1,0.009359401,0.005005027,0.87,0.003371001,0.001862432,0.81,0.038539496,0.028547775,0.35,0.022461314,0.019702907,0.14,0,0,0,0,0,0,0,0,0 +0.01023293,0.01023293,2,2,0.009359401,0.003109436,2.01,0.003371001,0.001404584,1.4,0.038539496,0.021059834,0.83,0.022461314,0.018261231,0.23,0,0,0,0,0,0,0,0,0 +0.177827941,0.186208714,1,1,0.1,0.087622932,0.141253754,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.177827941,0.190546072,1.5,1.5,0.1,0.07955199,0.257039578,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.177827941,0.19498446,2,2,0.1,0.074253556,0.34673685,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.177827941,0.208929613,2.5,2.5,0.1,0.071525275,0.398107171,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.177827941,0.218776162,3,3,0.1,0.066613942,0.501187234,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.09332543,0.138038426,1,1,0.1,0.075124079,0.331131121,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.057543994,0.112201845,1,1,0.1,0.065582051,0.52480746,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.019498446,0.097723722,1,1,0.1,0.059662917,0.676082975,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.186208714,0.199526231,2,2,0.1,0.079923999,0.251188643,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.09332543,0.144543977,2,2,0.1,0.061313682,0.630957344,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.057543994,0.128824955,2,2,0.1,0.051151089,0.954992586,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.019498446,0.117489755,2,2,0.1,0.044837645,1.230268771,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.007762471,0.114815362,2,2,0.1,0.041450132,1.412537545,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.186208714,0.239883292,3,3,0.1,0.074253556,0.34673685,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.09332543,0.181970086,3,3,0.1,0.048273748,1.071519305,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.057543994,0.147910839,3,3,0.1,0.040337083,1.479108388,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.019498446,0.138038426,3,3,0.1,0.033900091,1.9498446,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0.007762471,0.131825674,3,3,0.1,0.030387123,2.290867653,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 diff --git a/data/xmls/PC88A_HCL_NdPrCeLaDySmY_w_pitzer.xml b/data/xmls/PC88A_HCL_NdPrCeLaDySmY_w_pitzer.xml new file mode 100644 index 0000000..8258e59 --- /dev/null +++ b/data/xmls/PC88A_HCL_NdPrCeLaDySmY_w_pitzer.xml @@ -0,0 +1,716 @@ + + + + + + + Cl O H C P Nd Pr Ce La Dy Y Sm dummy + + + (HA)2(org) dodecane Nd(H(A)2)3(org) Pr(H(A)2)3(org) Ce(H(A)2)3(org) La(H(A)2)3(org) Dy(H(A)2)3(org) Sm(H(A)2)3(org) Y(H(A)2)3(org) + + + 298.15 + 100000.0 + + (HA)2(org): 0.25 + + + + + + + + + + + + + + + + C:16 H:35 O:3 P:1 + + + 298.14999999999998 + -394159.2206164294 + 558.9824 + 0.0 + + + + 0.320974226079 + + + + + + C:48 H:102 O:9 P:3 Nd:1 + + + 298.14999999999998 + + -1978355.2881578554 + 1117.965 + 0.0 + + + + 0.973500071223 + + + + + + C:48 H:102 O:9 P:3 Pr:1 + + + 298.14999999999998 + + -1987389.753778593 + 1117.965 + 0.0 + + + + 0.979936421078 + + + + + + + C:48 H:102 O:9 P:3 Ce:1 + + + 298.14999999999998 + + -1979346.232242925 + 1117.965 + 0.0 + + + + 1.0060487218 + + + + + + + C:48 H:102 O:9 P:3 La:1 + + + 298.14999999999998 + + -1979095.7087687952 + 1117.965 + 0.0 + + + + 0.981485801577 + + + + + + C:48 H:102 O:9 P:3 Dy:1 + + + 298.14999999999998 + + -1979518.3587197603 + 1117.965 + 0.0 + + + + 0.961666360676 + + + + + + + C:48 H:102 O:9 P:3 Y:1 + + + 298.14999999999998 + + -1997266.6892106486 + 1117.965 + 0.0 + + + + 0.958888814485 + + + + + + + + C:48 H:102 O:9 P:3 Sm:1 + + + 298.14999999999998 + + -1976678.5252282412 + 1117.965 + 0.0 + + + + 0.9642 + + + + + + + C:48 H:102 O:9 P:3 Gd:1 + + + 298.14999999999998 + + -4829446.858 + 1117.965 + 0.0 + + + + 0.9642 + + + + + + + dummy:1 + + + + 298.14999999999998 + + 0.0 + 0.0 + 0.0 + + + + 0.227113 + + + + + + + + + + H2O(L) H+ OH- Cl- Nd+++ Pr+++ Ce+++ La+++ Dy+++ Sm+++ Y+++ + + + + 298.15 + 100000.0 + + Cl-: 1.0E-7 + H+: 1.0E-7 + + + + + + + + + + + + 0.177000779, 0.000125778, 0.0, -33.4777082, -0.262214535 + 0.292922504, -0.027938838, 0.0, 3402.47027, 19.7936248 + 0.0, 0.0, 0.0, 0.0, 0.0 + 0.000362, -0.00003036, 0.0, -2.91038E-11, 0.0 + 2 + 12 + + refit of Holmes, H.F., Busey, J.M., Simonson, J.M., Mesmer, R.E., + Archer, D.G., and Wood, R.H., 1987, The enthalpy of dilution of HCl(aq) + to 648 K and 4p MPa. Thermodynamic properties, Journal of Chemical + Thermodynamics, v. 19, p. 863-890. + + + + + 0.5278102798121455, 0.0, 0.0, 0.0, 0.0 + 4.785988176310507, 0.0, 0.0, 0.0, 0.0 + 0.0, 0.0, 0.0, 0.0, 0.0 + -0.020676879473540816, 0.0, 0.0, 0.0, 0.0 + 2 + 0 + + Table S1: Pitzer parameters for osmotic and activity coeff Supp Info. + May, P. M.; Rowland, D.; Hefter, G.; Konigsberger, E. + A generic and updatable Pitzer characterization of aqueous binary electrolyte + solutions at 1 bar and 25 C. + Journal of Chemical and Engineering Data 2011,56, 5066–5077. + + + + + 0.7399759878872492, 0.0, 0.0, 0.0, 0.0 + 7.792458219852443, 0.0, 0.0, 0.0, 0.0 + 0.0, 0.0, 0.0, 0.0, 0.0 + -0.01962062220167151, 0.0, 0.0, 0.0, 0.0 + 2 + 0 + + Table S1: Pitzer parameters for osmotic and activity coeff Supp Info. + May, P. M.; Rowland, D.; Hefter, G.; Konigsberger, E. + A generic and updatable Pitzer characterization of aqueous binary electrolyte + solutions at 1 bar and 25 C. + Journal of Chemical and Engineering Data 2011,56, 5066–5077. + + + + + 0.5899801656939334, 0.0, 0.0, 0.0, 0.0 + 5.2501373713255015, 0.0, 0.0, 0.0, 0.0 + 0.0, 0.0, 0.0, 0.0, 0.0 + -0.024346940036902652, 0.0, 0.0, 0.0, 0.0 + 2 + 0 + + Table S1: Pitzer parameters for osmotic and activity coeff Supp Info. + May, P. M.; Rowland, D.; Hefter, G.; Konigsberger, E. + A generic and updatable Pitzer characterization of aqueous binary electrolyte + solutions at 1 bar and 25 C. + Journal of Chemical and Engineering Data 2011,56, 5066–5077. + + + + + 0.5596867100821611, 0.0, 0.0, 0.0, 0.0 + 10.342085390765986, 0.0, 0.0, 0.0, 0.0 + 0.0, 0.0, 0.0, 0.0, 0.0 + -0.019685111861351003, 0.0, 0.0, 0.0, 0.0 + 2 + 0 + + Table S1: Pitzer parameters for osmotic and activity coeff Supp Info. + May, P. M.; Rowland, D.; Hefter, G.; Konigsberger, E. + A generic and updatable Pitzer characterization of aqueous binary electrolyte + solutions at 1 bar and 25 C. + Journal of Chemical and Engineering Data 2011,56, 5066–5077. + + + + + 0.6810742399099214, 0.0, 0.0, 0.0, 0.0 + 5.317778808636538, 0.0, 0.0, 0.0, 0.0 + 0.0, 0.0, 0.0, 0.0, 0.0 + -0.026217518942691358, 0.0, 0.0, 0.0, 0.0 + 2 + 0 + + Table S1: Pitzer parameters for osmotic and activity coeff Supp Info. + May, P. M.; Rowland, D.; Hefter, G.; Konigsberger, E. + A generic and updatable Pitzer characterization of aqueous binary electrolyte + solutions at 1 bar and 25 C. + Journal of Chemical and Engineering Data 2011,56, 5066–5077. + + + + + 0.8868493033190087, 0.0, 0.0, 0.0, 0.0 + 9.868500461244988, 0.0, 0.0, 0.0, 0.0 + 0.0, 0.0, 0.0, 0.0, 0.0 + -0.03051604910307843, 0.0, 0.0, 0.0, 0.0 + 2 + 0 + + Table S1: Pitzer parameters for osmotic and activity coeff Supp Info. + May, P. M.; Rowland, D.; Hefter, G.; Konigsberger, E. + A generic and updatable Pitzer characterization of aqueous binary electrolyte + solutions at 1 bar and 25 C. + Journal of Chemical and Engineering Data 2011,56, 5066–5077. + + + + + 0.5872950937394924, 0.0, 0.0, 0.0, 0.0 + 6.850703030567289, 0.0, 0.0, 0.0, 0.0 + 0.0, 0.0, 0.0, 0.0, 0.0 + -0.020035536849683018, 0.0, 0.0, 0.0, 0.0 + 2 + 0 + + Table S1: Pitzer parameters for osmotic and activity coeff Supp Info. + May, P. M.; Rowland, D.; Hefter, G.; Konigsberger, E. + A generic and updatable Pitzer characterization of aqueous binary electrolyte + solutions at 1 bar and 25 C. + Journal of Chemical and Engineering Data 2011,56, 5066–5077. + + + + + + + H2O(L) + + + O H Nd Pr Ce La Dy Y Sm C N Cl P E + + + + + + + + + H:2 O:1 + + + + 7.255750050E+01, -6.624454020E-01, 2.561987460E-03, -4.365919230E-06, + 2.781789810E-09, -4.188654990E+04, -2.882801370E+02 + + + + + + 0.018068 + + + + + + OH- + O:1 H:1 + -1 + + + -37595 + -54977 + -2.56 + + + + 0.12527 + 7.38 + 1.8423 + -27821 + 4.15 + -103460 + 172460 + -4.18 + + + ref:G9 + + + + + NO3- + N:1 O:3 + -1 + + + -26507 + -49429 + 35.12 + + + + 0.73161 + 678.24 + -4.6838 + -30594 + 7.7 + -67250 + 109770 + 29.0 + + + ref:G9 + + + + + + + + + + Cl- + Cl:1 + -1 + + + -31379 + -39933 + 13.56 + + + + 0.4032 + 480.1 + 5.563 + -28470 + -4.4 + -57140 + 145600 + 17.79 + + ref:G9 + + + + H+ + H:1 + +1 + + + 0 + 0 + 0 + + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + ref:G9 + + + + + Nd+++ + Nd:1 + +3 + + + -160600 + -166500 + -49.5 + + + + -0.33707 + -1454.52 + 8.3211 + -21777 + 1.6236 + -118344 + 225500 + -43.1 + + + ref:G9 + + + + + Pr+++ + Pr:1 + +3 + + + -162600 + -168800 + -50 + + + + -0.32406 + -1419.98 + 8.1257 + -21920 + -1.1975 + -127511 + 223500 + -42.1 + + + ref:G9 + + + + + + Ce+++ + Ce:1 + +3 + + + -161600 + -167400 + -49 + + + + -0.29292 + -1493.38 + 11.6196 + -21616 + 4.0445 + -108974 + 222510 + -39.8 + + + ref:G9 + + + + + + La+++ + La:1 + +3 + + + -164000 + -169600 + -52 + + + + -0.2788 + -1438.24 + 10.9602 + -21844 + 4.2394 + -106122 + 215720 + -38.6 + + + ref:G9 + + + + + + + Dy+++ + Dy:1 + +3 + + + -158700 + -166500 + -55.2 + + + + -0.30003 + -1510.74 + 11.6879 + -21545 + 9.5076 + -94919 + 237920 + -40.7 + + + ref:G9 + + + + + + Y+++ + Y:1 + +3 + + + -163800 + -170900 + -60 + + + + -0.30140 + -1514.08 + 11.7010 + -21531 + 7.1634 + -103067 + 237920 + -40.8 + + + ref:G9 + + + + + + + Sm+++ + Sm:1 + +3 + + + -159100 + -165200 + -50.7 + + + + -0.32065 + -1561.08 + 11.8857 + -21337 + 1.9385 + -118548 + 229550 + + + ref:G9 + + + + + + + Gd+++ + Gd:1 + +3 + + + -158600 + -164200 + -49.2 + + + + -0.29771 + -1505.06 + 11.6656 + -21568 + 6.5606 + -103474 + 232650 + + + ref:G9 + + + + + + + + + \ No newline at end of file diff --git a/data/xmls/twophase.xml b/data/xmls/twophase.xml index ea2a037..ad31460 100644 --- a/data/xmls/twophase.xml +++ b/data/xmls/twophase.xml @@ -50,7 +50,7 @@ 298.14999999999998 - -4704699.156668724 + -4704699.156668724 1117.965 0.0 diff --git a/docs/Examples/iterative_fitter.py b/docs/Examples/iterative_fitter.py new file mode 100644 index 0000000..7f92952 --- /dev/null +++ b/docs/Examples/iterative_fitter.py @@ -0,0 +1,194 @@ +from scipy.optimize import curve_fit +import llepe +import pandas as pd +import numpy as np +import json + + +def linear(x, a, b): + return a * x + b + + +species_list = 'Nd,Pr,Ce,La,Dy,Sm,Y'.split(',') +pitzer_param_list = ['beta0', 'beta1', 'Cphi'] +meas_pitzer_param_df = pd.read_csv("../../data/csvs/may_pitzer_params.csv") +labeled_data = pd.read_csv("../../data/csvs/" + "zeroes_removed_PC88A_HCL_NdPrCeLaDySmY.csv") +exp_data = labeled_data.drop(labeled_data.columns[0], axis=1) +xml_file = "PC88A_HCL_NdPrCeLaDySmY_w_pitzer.xml" +eps = 1e-4 +mini_eps = 1e-8 +x_guesses = [[-5178500.0, -1459500.0], + [-5178342.857142857, -1460300.0], + [-5178342.857142857, -1459500.0], + [-5178342.857142857, -1458300.0], + [-5178185.714285715, -1459900.0], + [-5178185.714285715, -1459500.0], + [-5178185.714285715, -1459100.0], + [-5178185.714285715, -1458300.0], + [-5178028.571428572, -1459900.0], + [-5178028.571428572, -1459100.0], + [-5178028.571428572, -1458300.0], + [-5177557.142857143, -1459900.0], + [-5177400.0, -1460300.0]] +pitzer_guess_df = meas_pitzer_param_df.copy() +ignore_list = [] +optimizer = 'scipy_minimize' +output_dict = {'iter': [0], + 'best_obj': [1e20], + 'rel_diff': [1e20]} +for species in species_list: + output_dict['{0}_slope'.format(species)] = [1e20] + output_dict['{0}_intercept'.format(species)] = [1e20] + for pitzer_param in pitzer_param_list: + output_dict['{0}_{1}'.format(species, pitzer_param)] = [1e20] +i = 0 +rel_diff = 1000 +while rel_diff > 1e-4: + i += 1 + best_obj = 1e20 + output_dict['iter'].append(i) + for species in species_list: + lower_species = species.lower() + opt_values = { + '(HA)2(org)_h0': [], + '{0}(H(A)2)3(org)_h0'.format(species): [], + 'beta0': [], + 'beta1': [], + 'Cphi': [], + 'obj_value': [], + 'guess': []} + for x_guess in x_guesses: + info_dict = {'(HA)2(org)_h0': {'upper_element_name': 'species', + 'upper_attrib_name': 'name', + 'upper_attrib_value': '(HA)2(org)', + 'lower_element_name': 'h0', + 'lower_attrib_name': None, + 'lower_attrib_value': None, + 'input_format': '{0}', + 'input_value': x_guess[1]}, + '{0}(H(A)2)3(org)_h0'.format(species): { + 'upper_element_name': 'species', + 'upper_attrib_name': 'name', + 'upper_attrib_value': '{0}(H(A)2)3(org)'.format( + species), + 'lower_element_name': 'h0', + 'lower_attrib_name': None, + 'lower_attrib_value': None, + 'input_format': '{0}', + 'input_value': x_guess[0]}, + } + for pitzer_param in pitzer_param_list: + if '{0}_{1}'.format(species, pitzer_param) not in ignore_list: + pitzer_row = pitzer_guess_df[ + pitzer_guess_df['species'] == species] + inner_dict = {'upper_element_name': 'binarySaltParameters', + 'upper_attrib_name': 'cation', + 'upper_attrib_value': + '{0}+++'.format(species), + 'lower_element_name': pitzer_param, + 'lower_attrib_name': None, + 'lower_attrib_value': None, + 'input_format': ' {0}, 0.0, 0.0, 0.0, 0.0 ', + 'input_value': + pitzer_row[pitzer_param].values[0] + } + info_dict['{0}_{1}'.format( + species, pitzer_param)] = inner_dict + llepe_params = { + 'exp_data': exp_data, + 'phases_xml_filename': xml_file, + 'opt_dict': info_dict, + 'phase_names': ['HCl_electrolyte', 'PC88A_liquid'], + 'aq_solvent_name': 'H2O(L)', + 'extractant_name': '(HA)2(org)', + 'diluant_name': 'dodecane', + 'complex_names': ['{0}(H(A)2)3(org)'.format(species)], + 'extracted_species_ion_names': ['{0}+++'.format(species)], + 'aq_solvent_rho': 1000.0, + 'extractant_rho': 960.0, + 'diluant_rho': 750.0, + 'objective_function': llepe.lmse_perturbed_obj, + 'optimizer': optimizer + } + estimator = llepe.LLEPE(**llepe_params) + estimator.update_xml(llepe_params['opt_dict']) + obj_kwargs = {'species_list': [species], 'epsilon': 1e-100} + bounds = [(1e-1, 1e1)] * len(info_dict) + optimizer_kwargs = {"method": 'l-bfgs-b', + "bounds": bounds} + opt_dict, obj_value = estimator.fit( + objective_kwargs=obj_kwargs, + optimizer_kwargs=optimizer_kwargs) + if obj_value < best_obj: + best_obj = obj_value + keys = list(opt_dict.keys()) + info1 = [opt_dict[key]['input_value'] for key in keys] + info1.append(obj_value) + info1.append(x_guess) + opt_values_keys = opt_values.keys() + for ind, key in enumerate(opt_values_keys): + opt_values[key].append(info1[ind]) + opt_value_df = pd.DataFrame(opt_values) + p_opt, p_cov = curve_fit(linear, + opt_value_df['(HA)2(org)_h0'].values, + opt_value_df['{0}(H(A)2)3(org)_h0'.format( + species)].values) + slope, intercept = p_opt + output_dict['{0}_slope'.format(species)].append(slope) + output_dict['{0}_intercept'.format(species)].append(intercept) + min_h0_df = opt_value_df[ + opt_value_df['(HA)2(org)_h0'] + == opt_value_df['(HA)2(org)_h0'].min()] + update_pitzer_dict = {} + for pitzer_param in pitzer_param_list: + key_name = '{0}_{1}'.format(species, pitzer_param) + output_dict[key_name].append(min_h0_df[pitzer_param].values[0]) + + inner_dict = {'upper_element_name': 'binarySaltParameters', + 'upper_attrib_name': 'cation', + 'upper_attrib_value': + '{0}+++'.format(species), + 'lower_element_name': pitzer_param, + 'lower_attrib_name': None, + 'lower_attrib_value': None, + 'input_format': ' {0}, 0.0, 0.0, 0.0, 0.0 ', + 'input_value': + min_h0_df[pitzer_param].values[0] + } + update_pitzer_dict['{0}_{1}'.format( + species, pitzer_param)] = inner_dict + estimator.update_xml(update_pitzer_dict) + + pitzer_guess_dict = {'species': [], + 'beta0': [], + 'beta1': [], + 'Cphi': []} + for species in species_list: + pitzer_guess_dict['species'].append(species) + for pitzer_param in pitzer_param_list: + value_list = output_dict['{0}_{1}'.format(species, pitzer_param)] + value = value_list[-1] + pitzer_guess_dict[pitzer_param].append(value) + if i > 2: + mini_rel_diff1 = np.abs(value_list[-1] + - value_list[-2])/( + np.abs(value_list[-2])) + mini_rel_diff2 = np.abs(value_list[-2] - value_list[-3]) / ( + np.abs(value_list[-3])) + if mini_rel_diff1 < mini_eps and mini_rel_diff2 < mini_eps: + ignore_list.append('{0}_{1}'.format(species, pitzer_param)) + pitzer_guess_df = pd.DataFrame(pitzer_guess_dict) + + output_dict['best_obj'].append(best_obj) + output_df = pd.DataFrame(output_dict) + old_row = output_df.iloc[-2, :].values[3:] + new_row = output_df.iloc[-1, :].values[3:] + rel_diff = np.sum(np.abs(new_row - old_row)/np.abs(old_row)) + output_dict['rel_diff'].append(rel_diff) + output_df = pd.DataFrame(output_dict) + output_df.to_csv('outputs/iterative_fitter_output_df.csv') + + + + diff --git a/llepe/__init__.py b/llepe/__init__.py index a51433c..ebfbbf1 100644 --- a/llepe/__init__.py +++ b/llepe/__init__.py @@ -1,2 +1,4 @@ from .llepe import LLEPE -from .utils import get_xml_value, set_size \ No newline at end of file +from .utils import get_xml_value, set_size +from .optimizers import * +from .objectives import * \ No newline at end of file diff --git a/llepe/objectives.py b/llepe/objectives.py new file mode 100644 index 0000000..c83540e --- /dev/null +++ b/llepe/objectives.py @@ -0,0 +1,59 @@ +import numpy as np +import pandas as pd + + +def lmse_perturbed_obj(predicted_dict, + measured_df, + species_list, + epsilon=1e-100): + meas_aq = np.concatenate([measured_df['{0}_aq_eq'.format(species)].values + for species in species_list]) + pred_aq = np.concatenate([ + predicted_dict['{0}_aq_eq'.format(species)] + for species in species_list]) + + meas_d = np.concatenate([measured_df['{0}_d_eq'.format(species)].values + for species in species_list]) + pred_d = np.concatenate([ + predicted_dict['{0}_d_eq'.format(species)] + for species in species_list]) + + meas_org = meas_aq * meas_d + pred_org = np.concatenate([ + predicted_dict['{0}_org_eq'.format(species)] + for species in species_list]) + + perturbed_pred_d = (pred_org + epsilon) / (pred_aq + epsilon) + perturbed_meas_d = (meas_org + epsilon) / (meas_aq + epsilon) + log_pred_d = np.log10(perturbed_pred_d) + log_meas_d = np.log10(perturbed_meas_d) + + fun4 = (log_meas_d - log_pred_d) ** 2 + obj = np.mean(fun4) + return obj + + +def ind_lmse_perturbed_obj(predicted_dict, + measured_df, + species_list, + epsilon=1e-100): + pred_df = pd.DataFrame(predicted_dict) + objectives = [] + for i in range(len(pred_df)): + pred_aq = pred_df[['{0}_aq_eq'.format(species) + for species in species_list]].values[i] + pred_org = pred_df[['{0}_org_eq'.format(species) + for species in species_list]].values[i] + meas_aq = measured_df[['{0}_aq_eq'.format(species) + for species in species_list]].values[i] + meas_d = measured_df[['{0}_d_eq'.format(species) + for species in species_list]].values[i] + meas_org = meas_aq * meas_d + perturbed_pred_d = (pred_org + epsilon) / (pred_aq + epsilon) + perturbed_meas_d = (meas_org + epsilon) / (meas_aq + epsilon) + log_pred_d = np.log10(perturbed_pred_d) + log_meas_d = np.log10(perturbed_meas_d) + fun1 = (log_meas_d - log_pred_d) ** 2 + objectives.append(np.mean(fun1)) + objectives = np.array(objectives) + return objectives diff --git a/llepe/optimizers.py b/llepe/optimizers.py new file mode 100644 index 0000000..221a069 --- /dev/null +++ b/llepe/optimizers.py @@ -0,0 +1,39 @@ +import scipy.optimize as scipy_opt +from scipy.optimize import minimize +import skopt + +def dual_anneal_optimizer(objective, x_guess): + bounds = [(1e-1, 1e1)] * len(x_guess) + bounds[1] = (1e-1, 2) + res = scipy_opt.dual_annealing(objective, + [(1e-1, 1e1)]*len(x_guess), + x0=x_guess) + est_parameters = res.x + return est_parameters, res.fun + + +def diff_evo_optimizer(objective, x_guess): + bounds = [(1e-1, 1e1)] * len(x_guess) + bounds[1] = (1e-1, 2) + res = scipy_opt.differential_evolution(objective, + bounds) + est_parameters = res.x + return est_parameters, res.fun + + +def forest_lbfgsb_optimizer(objective, x_guess): + x_guess = list(x_guess) + bounds = [(1e-1, 1e1)]*len(x_guess) + bounds[1] = (1e-1, 2) + res = skopt.forest_minimize(objective, + bounds, + random_state=1, + acq_func='LCB', + n_random_starts=30, + x0=x_guess, + xi=1e-4) + x_guess = res.x + optimizer_kwargs = {"method": 'l-bfgs-b', + "bounds": bounds} + res = minimize(objective, x_guess, **optimizer_kwargs) + return res.x, res.fun