diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 12335f7..79caa72 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,10 +2,18 @@ - + + + + - - + + + + + + + - + - + - + - + - - + + - + @@ -442,7 +459,14 @@ @@ -482,7 +506,8 @@ - @@ -506,10 +531,10 @@ - + - + @@ -525,34 +550,34 @@ - + - + - + - + - + - + - + - + @@ -594,11 +619,11 @@ - - + + - - + + diff --git a/data/csvs/no_formiga_or_5_oa_PC88A_HCL_NdPrCeLaDySmY.csv b/data/csvs/no_formiga_or_5_oa_PC88A_HCL_NdPrCeLaDySmY.csv new file mode 100644 index 0000000..aec4ea0 --- /dev/null +++ b/data/csvs/no_formiga_or_5_oa_PC88A_HCL_NdPrCeLaDySmY.csv @@ -0,0 +1,209 @@ +label,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 +Lyon (2016),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 +Lyon (2016),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 +Lyon (2016),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 +Lyon (2016),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 +Banda (2014),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 +Banda (2014),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 +Banda (2014),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 +Banda (2014),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 +Banda (2014),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 +Liu (2014),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 +Liu (2014),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 +Liu (2014),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 +Liu (2014),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 +Liu (2014),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 +Kim (2012),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 +Kim (2012),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 +Kim (2012),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 +Kim (2012),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 +Kim (2012),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 +Kim (2012),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Lyon (2016),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 +Lyon (2016),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 +Lyon (2016),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 +Lyon (2016),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 +Lyon (2016),0.5,0.5,1,1,0.08666112,0.08666112,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +Lyon (2016),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 +Lyon (2016),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 +Lyon (2016),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 +Lyon (2016),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 +Lyon (2016),0.5,0.5,1,1,0.042983916,0.042983916,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +Lyon (2016),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 +Lyon (2016),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 +Lyon (2016),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 +Lyon (2016),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 +Lyon (2016),0.5,0.5,1,1,0.005546312,0.005546312,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +Lee (2005),0.251,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 +Lee (2005),0.251,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 +Lee (2005),0.251,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 +Lee (2005),0.251,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 +Lee (2005),0.251,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 +Lee (2005),0.134,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 +Lee (2005),0.0835,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 +Lee (2005),0.0285,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 +Lee (2005),0.262,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 +Lee (2005),0.134,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 +Lee (2005),0.0835,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 +Lee (2005),0.0285,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 +Lee (2005),0.0114,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 +Lee (2005),0.262,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 +Lee (2005),0.134,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 +Lee (2005),0.0835,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 +Lee (2005),0.0285,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 +Lee (2005),0.0114,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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Lyon (2016),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 +Lyon (2016),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 +Lyon (2016),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 +Lyon (2016),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 +Lyon (2016),0.5,0.5,1,1,0,0,0,0.09296866,0.09296866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +Lyon (2016),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 +Lyon (2016),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 +Lyon (2016),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 +Lyon (2016),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 +Lyon (2016),0.5,0.5,1,1,0,0,0,0.047548856,0.047548856,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +Lyon (2016),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 +Lyon (2016),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 +Lyon (2016),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 +Lyon (2016),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 +Lyon (2016),0.5,0.5,1,1,0,0,0,0.00638716,0.00638716,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 +Li (1987),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 diff --git a/data/xmls/PC88A_HCL_NdPrCeLaDySmY_w_pitzer.xml b/data/xmls/PC88A_HCL_NdPrCeLaDySmY_w_pitzer.xml index b218c2a..79377c5 100644 --- a/data/xmls/PC88A_HCL_NdPrCeLaDySmY_w_pitzer.xml +++ b/data/xmls/PC88A_HCL_NdPrCeLaDySmY_w_pitzer.xml @@ -33,7 +33,7 @@ 298.14999999999998 - -1376882.0784583509 + -1377917.5269485628 558.9824 0.0 @@ -50,7 +50,7 @@ 298.14999999999998 - -4924298.0880370205 + -4929625.060282971 1117.965 0.0 @@ -67,7 +67,7 @@ 298.14999999999998 - -4935685.119723228 + -4941397.084772181 1117.965 0.0 @@ -85,7 +85,7 @@ 298.14999999999998 - -4920369.042961768 + -4932551.489263242 1117.965 0.0 @@ -103,7 +103,7 @@ 298.14999999999998 - -4928639.61964031 + -4935194.142426379 1117.965 0.0 @@ -120,7 +120,7 @@ 298.14999999999998 - -4931991.722599618 + -4935179.480883835 1117.965 0.0 @@ -138,7 +138,7 @@ 298.14999999999998 - -4944682.264585918 + -4947210.070800013 1117.965 0.0 @@ -157,7 +157,7 @@ 298.14999999999998 - -4924669.3217661735 + -4929116.779371853 1117.965 0.0 @@ -245,10 +245,10 @@ - 0.058791091500561485, 0.0, 0.0, 0.0, 0.0 - 0.5448322248125199, 0.0, 0.0, 0.0, 0.0 + 0.058791077174068576, 0.0, 0.0, 0.0, 0.0 + 0.5448320238819658, 0.0, 0.0, 0.0, 0.0 0.0, 0.0, 0.0, 0.0, 0.0 - -0.02066999867229882, 0.0, 0.0, 0.0, 0.0 + -0.02066999867229882, 0.0, 0.0, 0.0, 0.0 2 0 @@ -261,10 +261,10 @@ - 1.213717095858249, 0.0, 0.0, 0.0, 0.0 - 7.7481294675488375, 0.0, 0.0, 0.0, 0.0 + 1.0825315776813356, 0.0, 0.0, 0.0, 0.0 + 6.211262701179254, 0.0, 0.0, 0.0, 0.0 0.0, 0.0, 0.0, 0.0, 0.0 - -0.01963615126026457, 0.0, 0.0, 0.0, 0.0 + -0.01963615126026457, 0.0, 0.0, 0.0, 0.0 2 0 @@ -277,10 +277,10 @@ - 1.0223168335791355, 0.0, 0.0, 0.0, 0.0 - 0.5296306654103653, 0.0, 0.0, 0.0, 0.0 + 0.5930048961782302, 0.0, 0.0, 0.0, 0.0 + 5.2771447352927785, 0.0, 0.0, 0.0, 0.0 0.0, 0.0, 0.0, 0.0, 0.0 - -0.024339999997603376, 0.0, 0.0, 0.0, 0.0 + -0.024339999997603376, 0.0, 0.0, 0.0, 0.0 2 0 @@ -293,10 +293,10 @@ - 0.7646372240575223, 0.0, 0.0, 0.0, 0.0 - 7.849276225207628, 0.0, 0.0, 0.0, 0.0 + 0.5532852863195881, 0.0, 0.0, 0.0, 0.0 + 9.206787175138805, 0.0, 0.0, 0.0, 0.0 0.0, 0.0, 0.0, 0.0, 0.0 - -0.019699989216349984, 0.0, 0.0, 0.0, 0.0 + -0.019699989216349984, 0.0, 0.0, 0.0, 0.0 2 0 @@ -309,10 +309,10 @@ - 0.20352350320923904, 0.0, 0.0, 0.0, 0.0 - 21.120419048363047, 0.0, 0.0, 0.0, 0.0 + 0.6005020116531858, 0.0, 0.0, 0.0, 0.0 + 4.91004437191519, 0.0, 0.0, 0.0, 0.0 0.0, 0.0, 0.0, 0.0, 0.0 - -0.02618999999473301, 0.0, 0.0, 0.0, 0.0 + -0.02618999999473301, 0.0, 0.0, 0.0, 0.0 2 0 @@ -325,10 +325,10 @@ - 0.8852797060008407, 0.0, 0.0, 0.0, 0.0 - 9.334636294454038, 0.0, 0.0, 0.0, 0.0 + 0.8866269789489127, 0.0, 0.0, 0.0, 0.0 + 9.867663759220948, 0.0, 0.0, 0.0, 0.0 0.0, 0.0, 0.0, 0.0, 0.0 - -0.015467323909969704, 0.0, 0.0, 0.0, 0.0 + -0.015467323909969704, 0.0, 0.0, 0.0, 0.0 2 0 @@ -341,10 +341,10 @@ - 0.6989083059080712, 0.0, 0.0, 0.0, 0.0 - 6.877881736471866, 0.0, 0.0, 0.0, 0.0 + 0.5978087860273482, 0.0, 0.0, 0.0, 0.0 + 5.279188095059934, 0.0, 0.0, 0.0, 0.0 0.0, 0.0, 0.0, 0.0, 0.0 - -0.019920000110321332, 0.0, 0.0, 0.0, 0.0 + -0.019920000110321332, 0.0, 0.0, 0.0, 0.0 2 0 diff --git a/data/xmls/test_PC88A_HCL_NdPrCeLaDySmY_w_pitzer.xml b/data/xmls/test_PC88A_HCL_NdPrCeLaDySmY_w_pitzer.xml new file mode 100644 index 0000000..7c47769 --- /dev/null +++ b/data/xmls/test_PC88A_HCL_NdPrCeLaDySmY_w_pitzer.xml @@ -0,0 +1,734 @@ + + + + + + + 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 + 101325.0 + + (HA)2(org): 0.25 + + + + + + + + + + + + + + + + C:16 H:35 O:3 P:1 + + + 298.14999999999998 + -1375274.5395942358 + 558.9824 + 0.0 + + + + 0.320974226079 + + + + + + C:48 H:102 O:9 P:3 Nd:1 + + + 298.14999999999998 + + -4924702.801342797 + 1117.965 + 0.0 + + + + 0.973500071223 + + + + + + C:48 H:102 O:9 P:3 Pr:1 + + + 298.14999999999998 + + -4933297.85118053 + 1117.965 + 0.0 + + + + 0.979936421078 + + + + + + + C:48 H:102 O:9 P:3 Ce:1 + + + 298.14999999999998 + + -4925793.594958098 + 1117.965 + 0.0 + + + + 1.0060487218 + + + + + + + C:48 H:102 O:9 P:3 La:1 + + + 298.14999999999998 + + -4921414.408105163 + 1117.965 + 0.0 + + + + 0.981485801577 + + + + + + C:48 H:102 O:9 P:3 Dy:1 + + + 298.14999999999998 + + -4927250.91118887 + 1117.965 + 0.0 + + + + 0.961666360676 + + + + + + + C:48 H:102 O:9 P:3 Y:1 + + + 298.14999999999998 + + -4939280.834663128 + 1117.965 + 0.0 + + + + 0.958888814485 + + + + + + + + C:48 H:102 O:9 P:3 Sm:1 + + + 298.14999999999998 + + -4921187.817651384 + 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+++ Na+ + + + + 298.15 + 101325.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.41211840588454257, 0.0, 0.0, 0.0, 0.0 + 0.5446957279361009, 0.0, 0.0, 0.0, 0.0 + 0.0, 0.0, 0.0, 0.0, 0.0 + -0.02066999867229882, 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.35663172954569944, 0.0, 0.0, 0.0, 0.0 + 2.9004659704748335, 0.0, 0.0, 0.0, 0.0 + 0.0, 0.0, 0.0, 0.0, 0.0 + -0.01963615126026457, 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.05797526981415538, 0.0, 0.0, 0.0, 0.0 + 16.763625801929546, 0.0, 0.0, 0.0, 0.0 + 0.0, 0.0, 0.0, 0.0, 0.0 + -0.024339999997603376, 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.5534945060571388, 0.0, 0.0, 0.0, 0.0 + 9.205570263716002, 0.0, 0.0, 0.0, 0.0 + 0.0, 0.0, 0.0, 0.0, 0.0 + -0.019699989216349984, 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.05726405599313575, 0.0, 0.0, 0.0, 0.0 + 2.6992201079308558, 0.0, 0.0, 0.0, 0.0 + 0.0, 0.0, 0.0, 0.0, 0.0 + -0.02618999999473301, 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.8866130626375315, 0.0, 0.0, 0.0, 0.0 + 9.867928019371377, 0.0, 0.0, 0.0, 0.0 + 0.0, 0.0, 0.0, 0.0, 0.0 + -0.015467323909969704, 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.5978087854283536, 0.0, 0.0, 0.0, 0.0 + 5.279188087719687, 0.0, 0.0, 0.0, 0.0 + 0.0, 0.0, 0.0, 0.0, 0.0 + -0.019920000110321332, 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 Na + + + + + + + + + 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 E: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 E:1 + -1 + + + -31379 + -39933 + 13.56 + + + + 0.4032 + 480.1 + 5.563 + -28470 + -4.4 + -57140 + 145600 + 17.79 + + ref:G9 + + + + H+ + H:1 E:-1 + +1 + + + 0 + 0 + 0 + + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + ref:G9 + + + + + Nd+++ + Nd:1 E:-3 + +3 + + + -160600 + -166500 + -49.5 + + + + -0.33707 + -1454.52 + 8.3211 + -21777 + 1.6236 + -118344 + 225500 + -43.1 + + + ref:G9 + + + + + Pr+++ + Pr:1 E:-3 + +3 + + + -162600 + -168800 + -50 + + + + -0.32406 + -1419.98 + 8.1257 + -21920 + -1.1975 + -127511 + 223500 + -42.1 + + + ref:G9 + + + + + + Ce+++ + Ce:1 E:-3 + +3 + + + -161600 + -167400 + -49 + + + + -0.29292 + -1493.38 + 11.6196 + -21616 + 4.0445 + -108974 + 222510 + -39.8 + + + ref:G9 + + + + + + La+++ + La:1 E:-3 + +3 + + + -164000 + -169600 + -52 + + + + -0.2788 + -1438.24 + 10.9602 + -21844 + 4.2394 + -106122 + 215720 + -38.6 + + + ref:G9 + + + + + + + Dy+++ + Dy:1 E:-3 + +3 + + + -158700 + -166500 + -55.2 + + + + -0.30003 + -1510.74 + 11.6879 + -21545 + 9.5076 + -94919 + 237920 + -40.7 + + + ref:G9 + + + + + + Y+++ + Y:1 E:-3 + +3 + + + -163800 + -170900 + -60 + + + + -0.30140 + -1514.08 + 11.7010 + -21531 + 7.1634 + -103067 + 237920 + -40.8 + + + ref:G9 + + + + + + + Sm+++ + Sm:1 E:-3 + +3 + + + -159100 + -165200 + -50.7 + + + + -0.32065 + -1561.08 + 11.8857 + -21337 + 1.9385 + -118548 + 229550 + + + ref:G9 + + + + + + + Gd+++ + Gd:1 E:-3 + +3 + + + -158600 + -164200 + -49.2 + + + + -0.29771 + -1505.06 + 11.6656 + -21568 + 6.5606 + -103474 + 232650 + + + ref:G9 + + + + + Na:1 E:-1 + +1 + + + 0.0 + 2 + + -125.5213, -125.5213 + + + 298.15, 333.15 + + + + + 1.3 + + + + + + + \ No newline at end of file diff --git a/docs/Examples/iterative_fitter.py b/docs/Examples/iterative_fitter.py index f9d97b6..a2e2c03 100644 --- a/docs/Examples/iterative_fitter.py +++ b/docs/Examples/iterative_fitter.py @@ -22,7 +22,7 @@ ext_h0_filename = "../../data/jsons/min_h0_guess_ext_h0.txt" with open(ext_h0_filename) as file: ext_h0_dict = json.load(file) labeled_data = pd.read_csv("../../data/csvs/" - "zeroes_removed_PC88A_HCL_NdPrCeLaDySmY.csv") + "multicomponent_PC88A_HCL_NdPrCeLaDySmY.csv") exp_data = labeled_data.drop(labeled_data.columns[0], axis=1) xml_file = "PC88A_HCL_NdPrCeLaDySmY_w_pitzer.xml" lin_param_df = pd.read_csv("../../data/csvs" @@ -237,8 +237,7 @@ while obj_diff1 > eps or obj_diff2 > eps: del(output_dict['rel_diff'][-1]) output_dict['rel_diff'].append(rel_diff) output_df = pd.DataFrame(output_dict) - output_df.to_csv('outputs/iterative_fitter_output4.csv') - obj_diff1 = np.abs(output_dict['best_obj'][-1]-output_dict['best_obj'][-2]) + output_df.to_csv('outputs/iterative_fitter_output_multicomponent.csv') + obj_diff1 = output_dict['best_obj'][-2]-output_dict['best_obj'][-1] if i > 2: - obj_diff2 = np.abs( - output_dict['best_obj'][-1] - output_dict['best_obj'][-3]) + obj_diff2 = output_dict['best_obj'][-3] - output_dict['best_obj'][-1] diff --git a/docs/Examples/iterative_fitter_eval_grapher.py b/docs/Examples/iterative_fitter_eval_grapher.py index 8d997c4..1fca645 100644 --- a/docs/Examples/iterative_fitter_eval_grapher.py +++ b/docs/Examples/iterative_fitter_eval_grapher.py @@ -2,15 +2,30 @@ import llepe import pandas as pd import numpy as np import json -import matplotlib as plt +import matplotlib.pyplot as plt import matplotlib +import re + + +def set_size(w, h, ax=None): + """ w, h: width, height in inches """ + if not ax: + ax = plt.gca() + left = ax.figure.subplotpars.left + right = ax.figure.subplotpars.right + top = ax.figure.subplotpars.top + bottom = ax.figure.subplotpars.bottom + fig_width = float(w) / (right - left) + fig_height = float(h) / (top - bottom) + ax.figure.set_size_inches(fig_width, fig_height) + font = {'family': 'sans serif', 'size': 24} matplotlib.rc('font', **font) -plt.rc('xtick', labelsize=18) -plt.rc('ytick', labelsize=18) -plt.rcParams['lines.linewidth'] = 4 +matplotlib.rc('xtick', labelsize=18) +matplotlib.rc('ytick', labelsize=18) +matplotlib.rcParams['lines.linewidth'] = 4 matplotlib.rcParams['lines.markersize'] = 10 @@ -27,8 +42,8 @@ def mod_lin_param_df(lp_df, input_val, mini_species, mini_lin_param): return new_lp_df -info_df = pd.read_csv('outputs/iterative_fitter_w_mse_output.csv') -test_row = 3 +info_df = pd.read_csv('outputs/iterative_fitter_output4.csv') +test_row = -1 pitzer_params_filename = "../../data/jsons/min_h0_pitzer_params.txt" with open(pitzer_params_filename) as file: pitzer_params_dict = json.load(file) @@ -112,57 +127,146 @@ estimator.set_custom_objects_dict({'lin_param_df': lin_param_df}) estimator.update_custom_objects_dict(info_dict) estimator.update_xml(info_dict, dependant_params_dict=dependant_params_dict) -exp_data = estimator.get_exp_df() -feed_cols = [] -for col in exp_data.columns: - if 'aq_i' in col: - feed_cols.append(col) -exp_data['total_re'] = exp_data[feed_cols].sum(axis=1) -label_list = [] -for index, row in exp_data[feed_cols].iterrows(): - bool_list = list((row > 0).values) - label = '' - for species, el in zip(species_list, bool_list): - if el: - label = '{0}-{1}'.format(label, species) - label = label[1:] - label_list.append(label) -r2s = "" -for species in species_list: - # if species=='La': - # save_name = 'outputs' \ - # '/parity_iterative_fitter_{0}_org_eq'.format(species) - save_name = None - # fig, ax = estimator.parity_plot('{0}_org_eq'.format(species), - # c_data='z_i', - # c_label='Feed total RE ' - # 'molarity (mol/L)', - # print_r_squared=True, - # save_path=save_name) - r2s += str(estimator.r_squared('{0}_org_eq'.format(species))) + ',' - - fig, ax = estimator.parity_plot('{0}_org_eq'.format(species), - data_labels=label_list, - print_r_squared=True, - save_path=save_name) - ax.legend(loc=4) -pred_df = pd.DataFrame(estimator.get_predicted_dict()) -new_cols = [] -for col in pred_df.columns: - new_cols.append("pred_{0}".format(col)) -pred_df.columns = new_cols -new_cols = ['label', - 'h_i', - 'h_eq', - 'z_i', - 'z_eq' - ] -for species in species_list: - new_cols.append("{0}_aq_i".format(species)) - new_cols.append("{0}_aq_eq".format(species)) - new_cols.append("{0}_d_eq".format(species)) -labeled_data.columns = new_cols -total_df = labeled_data.join(pred_df) +compared_value = 'La_org_eq' +plot_title = None +legend = True +predicted_dict = estimator.get_predicted_dict() +exp_df = estimator.get_exp_df() +pred = pd.DataFrame(predicted_dict)[compared_value].fillna(0).values +meas = exp_df[compared_value].fillna(0).values +name_breakdown = re.findall('[^_\W]+', compared_value) +compared_species = name_breakdown[0] +data_labels = list(labeled_data['label']) +if compared_species == 'h': + feed_molarity = exp_df['h_i'].fillna(0).values +elif compared_species == 'z': + feed_molarity = exp_df['z_i'].fillna(0).values +else: + feed_molarity = exp_df[ + '{0}_aq_i'.format(compared_species)].fillna(0).values +combined_df = pd.DataFrame({'pred': pred, + 'meas': meas, + 'label': data_labels, + 'feed_molarity': feed_molarity}) +combined_df = combined_df[(combined_df['feed_molarity'] != 0)] +meas = combined_df['meas'].values +pred = combined_df['pred'].values + +min_data = np.min([pred, meas]) +max_data = np.max([pred, meas]) +min_max_data = np.array([min_data, max_data]) + +if compared_species == 'h': + default_title = '$H^+$ eq. conc. (mol/L)' +elif compared_species == 'z': + default_title = '{0} eq. conc. (mol/L)'.format(extractant_name) +else: + phase = name_breakdown[1] + if phase == 'aq': + extracted_species_charge = extracted_species_charges[ + extracted_species_list.index( + compared_species)] + default_title = '$%s^{%d+}$ eq. conc. (mol/L)' \ + % (compared_species, extracted_species_charge) + elif phase == 'd': + default_title = '{0} distribution ratio'.format( + compared_species) + else: + default_title = '{0} complex eq. conc. (mol/L)'.format( + compared_species) +fig, ax = plt.subplots(figsize=(8, 6)) + +if isinstance(data_labels, list): + # unique_labels = list(set(data_labels)) + unique_labels = ['Li (1987)', + 'Kim (2012)', + 'Formiga (2016)', + 'Banda (2014)', + ] + color_list = ['r', 'g', 'b', 'm'] + marker_list = ['o', 's', 'P', 'X', ] + for ind, label in enumerate(unique_labels): + filtered_data = combined_df[combined_df['label'] == label] + filtered_meas = filtered_data['meas'] + filtered_pred = filtered_data['pred'] + if len(filtered_pred) != 0: + ax.scatter(filtered_meas, + filtered_pred, + label=label, + color=color_list[ind], + marker=marker_list[ind]) + if legend: + ax.legend(loc=4) +ax.plot(min_max_data, min_max_data, color="b", label="") + +ax.text(min_max_data[0], + min_max_data[1] * 0.9, + '$R^2$={0:.2f}'.format(estimator.r_squared(compared_value))) + +ax.set(xlabel='Measured', ylabel='Predicted') +if plot_title is None: + ax.set_title(default_title) +set_size(8, 6) +plt.tight_layout() +plt.show() +# exp_data = estimator.get_exp_df() +# feed_cols = [] +# for col in exp_data.columns: +# if 'aq_i' in col: +# feed_cols.append(col) +# exp_data['total_re'] = exp_data[feed_cols].sum(axis=1) +# label_list = [] +# for index, row in exp_data[feed_cols].iterrows(): +# bool_list = list((row > 0).values) +# label = '' +# for species, el in zip(species_list, bool_list): +# if el: +# label = '{0}-{1}'.format(label, species) +# label = label[1:] +# label_list.append(label) +# r2s = "" +# for species in species_list: +# # if species=='La': +# # save_name = 'outputs' \ +# # '/parity_iterative_fitter_{0}_org_eq'.format(species) +# save_name = None +# fig, ax = estimator.parity_plot('{0}_org_eq'.format(species), +# c_data= +# exp_data['total_re'].values, +# c_label='Feed total RE ' +# 'molarity (mol/L)', +# print_r_squared=False, +# plot_title='') +# ax.plot([0, 0.05], [0, 0.05], c='b') +# ax.text(0.01, 0.04, +# '$R^2$={0:.2f}'.format(estimator.r_squared( +# '{0}_org_eq'.format(species)))) +# ax.set_xlim((0, 0.05)) +# ax.set_ylim((0, 0.05)) +# r2s += str(estimator.r_squared('{0}_org_eq'.format(species))) + ',' +# +# # fig, ax = estimator.parity_plot('{0}_org_eq'.format(species), +# # data_labels=list(labeled_data['label']), +# # print_r_squared=True, +# # save_path=save_name) +# # ax.legend(loc=4) +# pred_df = pd.DataFrame(estimator.get_predicted_dict()) +# new_cols = [] +# for col in pred_df.columns: +# new_cols.append("pred_{0}".format(col)) +# pred_df.columns = new_cols +# new_cols = ['label', +# 'h_i', +# 'h_eq', +# 'z_i', +# 'z_eq' +# ] +# for species in species_list: +# new_cols.append("{0}_aq_i".format(species)) +# new_cols.append("{0}_aq_eq".format(species)) +# new_cols.append("{0}_d_eq".format(species)) +# labeled_data.columns = new_cols +# total_df = labeled_data.join(pred_df) # total_df.to_csv('if_mse_total_df.csv') # short_info_dict = {} # for key, value in info_dict.items(): diff --git a/docs/Examples/iterative_fitter_monitor.py b/docs/Examples/iterative_fitter_monitor.py index c796242..fe2dbd8 100644 --- a/docs/Examples/iterative_fitter_monitor.py +++ b/docs/Examples/iterative_fitter_monitor.py @@ -8,7 +8,7 @@ parameters = 'slope,intercept,beta0,beta1'.split(',') # if go != 'y': # break # plt.close('all') -df = pd.read_csv('outputs/iterative_fitter_output.csv') +df = pd.read_csv('outputs/iterative_fitter_output4.csv') info_cols = {parameter: [] for parameter in parameters} for col in df.columns: for parameter in parameters: @@ -48,4 +48,4 @@ ax.plot(df['iter'].values[1:], ax.set_xlabel('iteration') ax.set_ylabel('Value') plt.tight_layout() -plt.savefig('outputs/rel_diff.png') +# plt.savefig('outputs/rel_diff.png') diff --git a/docs/Examples/outputs/best_obj.png b/docs/Examples/outputs/best_obj.png new file mode 100644 index 0000000..753458e Binary files /dev/null and b/docs/Examples/outputs/best_obj.png differ diff --git a/docs/Examples/outputs/beta0.png b/docs/Examples/outputs/beta0.png new file mode 100644 index 0000000..4ad4ad7 Binary files /dev/null and b/docs/Examples/outputs/beta0.png differ diff --git a/docs/Examples/outputs/beta1.png b/docs/Examples/outputs/beta1.png new file mode 100644 index 0000000..6722264 Binary files /dev/null and b/docs/Examples/outputs/beta1.png differ diff --git a/docs/Examples/outputs/intercept.png b/docs/Examples/outputs/intercept.png new file mode 100644 index 0000000..9f45b32 Binary files /dev/null and b/docs/Examples/outputs/intercept.png differ diff --git a/docs/Examples/outputs/iterative_fitter_output4.csv b/docs/Examples/outputs/iterative_fitter_output4.csv new file mode 100644 index 0000000..1834137 --- /dev/null +++ b/docs/Examples/outputs/iterative_fitter_output4.csv @@ -0,0 +1,13 @@ +,iter,best_obj,rel_diff,best_ext_h0,Nd_intercept,Nd_beta0,Nd_beta1,Pr_intercept,Pr_beta0,Pr_beta1,Ce_intercept,Ce_beta0,Ce_beta1,La_intercept,La_beta0,La_beta1,Dy_intercept,Dy_beta0,Dy_beta1,Sm_intercept,Sm_beta0,Sm_beta1,Y_intercept,Y_beta0,Y_beta1 +0,0,1e+20,1e+20,1e+20,1e+20,1e+20,1e+20,1e+20,1e+20,1e+20,1e+20,1e+20,1e+20,1e+20,1e+20,1e+20,1e+20,1e+20,1e+20,1e+20,1e+20,1e+20,1e+20,1e+20,1e+20 +1,1,0.033647778113830525,21.000000000000057,-1376877.1491014853,-796630.7472372957,0.7459820315595859,7.683962525237933,-808126.331804689,0.05879108393945308,0.5448323469435739,-798601.759258479,0.6005010041816041,4.910031852331482,-802384.4792986697,0.5930046452497859,5.277120552778203,-805107.4528195162,0.6129648575972374,5.360202430370018,-795364.2081485003,0.5978078971541942,5.279174082617606,-814654.8936071004,0.9657036817294907,8.515030539951253 +2,2,0.011371891310485667,1.7809885286134581,-1377917.5261387695,-796507.2063621008,1.282838759795358,6.902804792440243,-808735.3933837808,0.05879108229837919,0.5448322898792433,-798307.3201515124,0.6005010298214011,4.910022284826427,-801912.301008032,0.5930045609171245,5.277127676968026,-801913.8255634321,0.7646294828913005,7.848342595191327,-795363.041378655,0.5978084651250514,5.279183026035014,-813457.4899543246,0.8866269789489127,9.867663759220948 +3,3,0.008641080472189547,0.7095542768622557,-1377917.5261387695,-796048.7760914894,1.0825298224626023,6.211283570154922,-807884.6838503737,0.05879107717406858,0.5448320238819658,-799326.8310861788,0.6005020116531858,4.91004437191519,-801737.4462156398,0.5930048961782302,5.277144735292778,-801426.9157177466,0.5532849580804902,9.206773080251143,-795364.1985261647,0.5978087860273482,5.279188095059933,-813457.4899543246,0.8866269789489127,9.867663759220948 +4,4,0.0077116880626842774,0.001045483581763083,-1377917.5261387695,-796123.8048527003,1.082532056501894,6.21126666931227,-807682.864923159,0.05879107717406858,0.5448320238819658,-798906.4762851987,0.6005020116531858,4.91004437191519,-801602.4497529072,0.5930048961782302,5.277144735292778,-801426.3864333024,0.5532852226657412,9.206784416704208,-795364.1985261647,0.5978087860273482,5.279188095059933,-813457.4899543246,0.8866269789489127,9.867663759220948 +5,5,0.007654988377412918,0.0004889223754199215,-1377917.5269444608,-795978.009332054,1.0825315776813356,6.211262701179254,-807775.0879128327,0.05879107717406858,0.5448320238819658,-798839.9836325685,0.6005020116531858,4.91004437191519,-801517.285745487,0.5930048961782302,5.277144735292778,-801426.9000381464,0.5532852863195881,9.206787175138803,-795364.1985261647,0.5978087860273482,5.279188095059933,-813457.4899543246,0.8866269789489127,9.867663759220948 +6,6,0.007610209179550956,0.0003179015187814805,-1377917.5269997541,-795889.1188724772,1.0825315776813356,6.211262701179254,-807684.2192836072,0.05879107717406858,0.5448320238819658,-798798.9084175534,0.6005020116531858,4.91004437191519,-801483.3687901833,0.5930048961782302,5.277144735292778,-801426.9000381464,0.5532852863195881,9.206787175138803,-795364.1985261647,0.5978087860273482,5.279188095059933,-813457.4899543246,0.8866269789489127,9.867663759220948 +7,7,0.007598843960371909,0.00011070832700715566,-1377917.5269100612,-795897.0467890751,1.0825315776813356,6.211262701179254,-807644.9779835651,0.05879107717406858,0.5448320238819658,-798798.9084175534,0.6005020116531858,4.91004437191519,-801441.5615806901,0.5930048961782302,5.277144735292778,-801426.9000381464,0.5532852863195881,9.206787175138803,-795364.1985261647,0.5978087860273482,5.279188095059933,-813457.4899543246,0.8866269789489127,9.867663759220948 +8,8,0.007598581095870595,3.145446182414225e-05,-1377917.5269485628,-795872.4794372824,1.0825315776813356,6.211262701179254,-807644.5039264921,0.05879107717406858,0.5448320238819658,-798798.9084175534,0.6005020116531858,4.91004437191519,-801441.5615806901,0.5930048961782302,5.277144735292778,-801426.9000381464,0.5532852863195881,9.206787175138803,-795364.1985261647,0.5978087860273482,5.279188095059933,-813457.4899543246,0.8866269789489127,9.867663759220948 +9,9,0.0075985812451889985,0.0,-1377917.5269485628,-795872.4794372824,1.0825315776813356,6.211262701179254,-807644.5039264921,0.05879107717406858,0.5448320238819658,-798798.9084175534,0.6005020116531858,4.91004437191519,-801441.5615806901,0.5930048961782302,5.277144735292778,-801426.9000381464,0.5532852863195881,9.206787175138803,-795364.1985261647,0.5978087860273482,5.279188095059933,-813457.4899543246,0.8866269789489127,9.867663759220948 +10,10,0.0075985812451889985,0.0,-1377917.5269485628,-795872.4794372824,1.0825315776813356,6.211262701179254,-807644.5039264921,0.05879107717406858,0.5448320238819658,-798798.9084175534,0.6005020116531858,4.91004437191519,-801441.5615806901,0.5930048961782302,5.277144735292778,-801426.9000381464,0.5532852863195881,9.206787175138803,-795364.1985261647,0.5978087860273482,5.279188095059933,-813457.4899543246,0.8866269789489127,9.867663759220948 +11,11,0.0075985812451889985,0.0,-1377917.5269485628,-795872.4794372824,1.0825315776813356,6.211262701179254,-807644.5039264921,0.05879107717406858,0.5448320238819658,-798798.9084175534,0.6005020116531858,4.91004437191519,-801441.5615806901,0.5930048961782302,5.277144735292778,-801426.9000381464,0.5532852863195881,9.206787175138803,-795364.1985261647,0.5978087860273482,5.279188095059933,-813457.4899543246,0.8866269789489127,9.867663759220948 diff --git a/docs/Examples/outputs/iterative_fitter_w_mse_output.csv b/docs/Examples/outputs/iterative_fitter_w_mse_output.csv new file mode 100644 index 0000000..2d0944b --- /dev/null +++ b/docs/Examples/outputs/iterative_fitter_w_mse_output.csv @@ -0,0 +1,10 @@ +,iter,best_obj,rel_diff,best_ext_h0,Nd_intercept,Nd_beta0,Nd_beta1,Pr_intercept,Pr_beta0,Pr_beta1,Ce_intercept,Ce_beta0,Ce_beta1,La_intercept,La_beta0,La_beta1,Dy_intercept,Dy_beta0,Dy_beta1,Sm_intercept,Sm_beta0,Sm_beta1,Y_intercept,Y_beta0,Y_beta1 +0,0,1e+20,1e+20,1e+20,1e+20,1e+20,1e+20,1e+20,1e+20,1e+20,1e+20,1e+20,1e+20,1e+20,1e+20,1e+20,1e+20,1e+20,1e+20,1e+20,1e+20,1e+20,1e+20,1e+20,1e+20 +1,1,7.243881311122883e-06,21.000000000000057,-1376882.0784583509,-793959.2365328791,1.213718406400912,7.748153622541222,-805092.317983506,0.05879109101834264,0.5448322349963308,-789740.8658638337,0.2035235053232368,21.120426174002823,-797993.3842652582,1.0223168335791357,0.5296306654103653,-801345.4872245657,0.7646372240575223,7.849276225207628,-794033.3277785552,0.6989082242196476,6.877882016105836,-814036.0292108656,0.8852797060008407,9.334636294454038 +2,2,5.235683016217101e-06,5.0826146693579895e-05,-1376882.0784583509,-793959.2365328791,1.213718406400912,7.748153622541222,-805061.9201482645,0.05879109126451901,0.5448322298014207,-789740.8658638337,0.2035235053232368,21.120426174002823,-797993.3842652582,1.0223168335791357,0.5296306654103653,-801345.4872245657,0.7646372240575223,7.849276225207628,-794023.0863911208,0.6989083059080712,6.877881736471866,-814036.0292108656,0.8852797060008407,9.334636294454038 +3,3,5.234379962639123e-06,0.0004431912247434154,-1376882.0784583509,-793651.8526619686,1.213717095858249,7.748129467548838,-805038.8843481757,0.058791091500561485,0.5448322248125199,-789722.8075867157,0.20352350320923904,21.120419048363047,-797993.3842652582,1.0223168335791357,0.5296306654103653,-801345.4872245657,0.7646372240575223,7.849276225207628,-794023.0863911208,0.6989083059080712,6.877881736471866,-814036.0292108656,0.8852797060008407,9.334636294454038 +4,4,1.0136650760054431e-05,3.4483260160044286e-05,-1376882.0786722435,-793679.2203652804,1.213717095858249,7.748129467548838,-805038.8843481757,0.058791091500561485,0.5448322248125199,-789722.8075867157,0.20352350320923904,21.120419048363047,-797993.3842652582,1.0223168335791357,0.5296306654103653,-801345.4872245657,0.7646372240575223,7.849276225207628,-794023.0863911208,0.6989083059080712,6.877881736471866,-814036.0292108656,0.8852797060008407,9.334636294454038 +5,5,1.0461762551892658e-05,1.3733029030223567e-05,-1376882.079002063,-793690.1199850544,1.213717095858249,7.748129467548838,-805038.8843481757,0.058791091500561485,0.5448322248125199,-789722.8075867157,0.20352350320923904,21.120419048363047,-797993.3842652582,1.0223168335791357,0.5296306654103653,-801345.4872245657,0.7646372240575223,7.849276225207628,-794023.0863911208,0.6989083059080712,6.877881736471866,-814036.0292108656,0.8852797060008407,9.334636294454038 +6,6,1.0461847595183674e-05,0.0,-1376882.079002063,-793690.1199850544,1.213717095858249,7.748129467548838,-805038.8843481757,0.058791091500561485,0.5448322248125199,-789722.8075867157,0.20352350320923904,21.120419048363047,-797993.3842652582,1.0223168335791357,0.5296306654103653,-801345.4872245657,0.7646372240575223,7.849276225207628,-794023.0863911208,0.6989083059080712,6.877881736471866,-814036.0292108656,0.8852797060008407,9.334636294454038 +7,7,1.0568726787700163e-05,0.0,-1376882.079002063,-793690.1199850544,1.213717095858249,7.748129467548838,-805038.8843481757,0.058791091500561485,0.5448322248125199,-789722.8075867157,0.20352350320923904,21.120419048363047,-797993.3842652582,1.0223168335791357,0.5296306654103653,-801345.4872245657,0.7646372240575223,7.849276225207628,-794023.0863911208,0.6989083059080712,6.877881736471866,-814036.0292108656,0.8852797060008407,9.334636294454038 +8,8,1.1654800306565983e-05,0.0,-1376882.079002063,-793690.1199850544,1.213717095858249,7.748129467548838,-805038.8843481757,0.058791091500561485,0.5448322248125199,-789722.8075867157,0.20352350320923904,21.120419048363047,-797993.3842652582,1.0223168335791357,0.5296306654103653,-801345.4872245657,0.7646372240575223,7.849276225207628,-794023.0863911208,0.6989083059080712,6.877881736471866,-814036.0292108656,0.8852797060008407,9.334636294454038 diff --git a/docs/Examples/outputs/multi_only_iterative_fitter_output.csv b/docs/Examples/outputs/multi_only_iterative_fitter_output.csv new file mode 100644 index 0000000..cf2bb87 --- /dev/null +++ b/docs/Examples/outputs/multi_only_iterative_fitter_output.csv @@ -0,0 +1,27 @@ +,iter,best_obj,rel_diff,best_ext_h0,Nd_intercept,Nd_beta0,Nd_beta1,Pr_intercept,Pr_beta0,Pr_beta1,Ce_intercept,Ce_beta0,Ce_beta1,La_intercept,La_beta0,La_beta1,Dy_intercept,Dy_beta0,Dy_beta1,Sm_intercept,Sm_beta0,Sm_beta1,Y_intercept,Y_beta0,Y_beta1 +0,0,1e+20,1e+20,1e+20,1e+20,1e+20,1e+20,1e+20,1e+20,1e+20,1e+20,1e+20,1e+20,1e+20,1e+20,1e+20,1e+20,1e+20,1e+20,1e+20,1e+20,1e+20,1e+20,1e+20,1e+20 +1,1,0.03589758768077916,21.000000000000057,-1376877.1578525545,-796630.7472372957,0.7459820315595859,7.683962525237933,-804949.676541606,0.5878722433097117,5.446965040891874,-799671.8535977869,0.5683138771769763,4.330159786749355,-798281.080974753,0.05929999713109059,14.235546390790574,-805107.4528322341,0.6129648560200409,5.360202416896411,-795364.2084167162,0.5978078969216549,5.279174081605432,-814654.8936058494,0.9657036817607582,8.515030540098573 +2,2,0.020523566039320422,2.5585440673715034,-1377356.1260593878,-797059.9776562914,0.7459837782866834,7.683963804574712,-807474.5742908432,0.412119358146579,0.5446965040891875,-798541.1385153377,0.5683086183011624,4.3301017748512365,-793826.8317553926,0.059179052561110786,19.77323694076803,-801913.8726103224,0.7646416177518945,7.84824568473698,-795363.0419325187,0.59780846432948,5.279183016139414,-813457.2158804197,0.8866130626375315,9.867928019371377 +3,3,0.019477920445525317,7.677982352652354,-1375588.6756908477,-793163.8973856996,0.3209195035432397,13.123168416291694,-808683.1537883538,0.412118699519776,0.5446960424554511,-790111.3963314675,0.05683086183011624,23.89686703927439,-791050.7992598361,0.05905360634622211,29.84340866533762,-801427.30300279,0.5534942813794564,9.205560588460095,-795364.198868676,0.5978087854283536,5.279188087719687,-813457.2158804197,0.8866130626375315,9.867928019371377 +4,4,0.010207128776218969,0.42455280980920035,-1375610.9624283572,-794262.8311628923,0.3216915257810643,13.804909552933434,-808435.0647171926,0.41211840588454257,0.5446957279361009,-790207.5472086382,0.056830829357604154,23.89689998523618,-795480.9739022574,0.05878743947127101,19.151367921508545,-801426.8680903579,0.5534944284911872,9.205566903683641,-795364.198868676,0.5978087854283536,5.279188087719687,-813457.2158804197,0.8866130626375315,9.867928019371377 +5,5,0.014641607256599173,1.6866445651799755,-1375538.6750637838,-798938.0765541978,0.3566318051278,2.900470205622694,-805875.0643270919,0.41211840588454257,0.5446957279361009,-793436.7925485797,0.056742997228693914,13.80172079259027,-796954.8557059788,0.05868227362010503,12.498956039602165,-801427.2924061618,0.5534945060571388,9.205570263716002,-795364.198868676,0.5978087854283536,5.279188087719687,-813457.2158804197,0.8866130626375315,9.867928019371377 +6,6,0.009364477922161399,0.5171670324839205,-1375506.0331521921,-798500.5981007863,0.35663166857868867,2.9004640415749985,-807020.2949058269,0.41211840588454257,0.5446957279361009,-793926.4769803158,0.056743019042837614,13.801790803325336,-794407.3237807738,0.059071074021005275,18.80781812800432,-801427.2924061618,0.5534945060571388,9.205570263716002,-795364.198868676,0.5978087854283536,5.279188087719687,-813457.2158804197,0.8866130626375315,9.867928019371377 +7,7,0.008587420254580813,1.059528868598552,-1375505.5181543154,-798685.9967218107,0.35663172954569944,2.900465970474833,-807454.2257048099,0.41211840588454257,0.5446957279361009,-789725.2952172983,0.05719014118011185,22.726516278088134,-791396.077682103,0.05903562942413778,26.228646183949166,-801427.2924061618,0.5534945060571388,9.205570263716002,-795364.198868676,0.5978087854283536,5.279188087719687,-813457.2158804197,0.8866130626375315,9.867928019371377 +8,8,0.010436904878903537,0.29420985511692826,-1375548.1106216116,-799519.3918074799,0.35663172954569944,2.900465970474833,-808023.7799223613,0.41211840588454257,0.5446957279361009,-786951.389362888,0.05708292450340597,28.34019679365209,-791002.4212304557,0.05887049745806909,27.19304858223857,-801427.2924061618,0.5534945060571388,9.205570263716002,-795364.198868676,0.5978087854283536,5.279188087719687,-813457.2158804197,0.8866130626375315,9.867928019371377 +9,9,0.008122441324296938,0.5056025050774561,-1375532.8964810933,-799252.2437781714,0.35663172954569944,2.900465970474833,-807837.3724848758,0.41211840588454257,0.5446957279361009,-790021.4446221002,0.05689505465396167,23.449630511144804,-795447.5533695783,0.058631276343575414,18.611038118056705,-801427.2924061618,0.5534945060571388,9.205570263716002,-795364.198868676,0.5978087854283536,5.279188087719687,-813457.2158804197,0.8866130626375315,9.867928019371377 +10,10,0.012928748169505148,0.8333232355853131,-1375557.2637008368,-798461.2222513977,0.35663172954569944,2.900465970474833,-806951.4949354676,0.41211840588454257,0.5446957279361009,-795969.4556880995,0.056793906518569214,11.277961619380736,-797714.8073241808,0.05842557708316379,13.092573662989777,-801427.2924061618,0.5534945060571388,9.205570263716002,-795364.198868676,0.5978087854283536,5.279188087719687,-813457.2158804197,0.8866130626375315,9.867928019371377 +11,11,0.007800190819962697,0.36349221067564863,-1375530.569913902,-798291.6222911178,0.35663172954569944,2.900465970474833,-806824.7532982712,0.41211840588454257,0.5446957279361009,-795638.7226937105,0.0567939201459683,11.27792734701911,-795125.0133593426,0.058611088348722154,17.75722543814867,-801427.2924061618,0.5534945060571388,9.205570263716002,-795364.198868676,0.5978087854283536,5.279188087719687,-813457.2158804197,0.8866130626375315,9.867928019371377 +12,12,0.00921314263132423,1.6582390417163946,-1375352.6611008795,-799018.4755125245,0.35663172954569944,2.900465970474833,-807547.1998794067,0.41211840588454257,0.5446957279361009,-789593.3324594139,0.057780238237745564,22.7526002647588,-790289.6353698338,0.05869157014173162,28.5282029237168,-801427.2924061618,0.5534945060571388,9.205570263716002,-795364.198868676,0.5978087854283536,5.279188087719687,-813457.2158804197,0.8866130626375315,9.867928019371377 +13,13,0.0164949043385192,0.5442127617504667,-1375330.196734157,-799860.8096262615,0.35663172954569944,2.900465970474833,-808560.5669803121,0.41211840588454257,0.5446957279361009,-784843.309147467,0.05766909907971607,32.27291103838875,-788888.7517598639,0.058542471191840494,31.701224910845188,-801427.2924061618,0.5534945060571388,9.205570263716002,-795364.198868676,0.5978087854283536,5.279188087719687,-813457.2158804197,0.8866130626375315,9.867928019371377 +14,14,0.010623495713475158,0.602757119120526,-1375351.9855972743,-799632.2232496517,0.35663172954569944,2.900465970474833,-808321.7283717714,0.41211840588454257,0.5446957279361009,-788451.2944893743,0.057453027762948625,26.992114973264634,-795921.9019280333,0.058276332684925714,18.490011381032488,-801427.2924061618,0.5534945060571388,9.205570263716002,-795364.198868676,0.5978087854283536,5.279188087719687,-813457.2158804197,0.8866130626375315,9.867928019371377 +15,15,0.020076787588486848,1.0484920101715856,-1375285.2763873788,-798333.4293311803,0.35663172954569944,2.900465970474833,-806908.9647236438,0.41211840588454257,0.5446957279361009,-799190.3142882502,0.05726405467005661,2.6992114973264636,-795227.311995532,0.05860570542646566,16.240039078247854,-801427.2924061618,0.5534945060571388,9.205570263716002,-795364.198868676,0.5978087854283536,5.279188087719687,-813457.2158804197,0.8866130626375315,9.867928019371377 +16,16,0.007946994350521493,0.0013058079059853106,-1375281.5761035422,-798434.7113981954,0.35663172954569944,2.900465970474833,-806825.5999826461,0.41211840588454257,0.5446957279361009,-799709.74809272,0.05726405662551625,2.6992166442291183,-795558.7828092766,0.05860569942350758,16.24014965075902,-801427.2924061618,0.5534945060571388,9.205570263716002,-795364.198868676,0.5978087854283536,5.279188087719687,-813457.2158804197,0.8866130626375315,9.867928019371377 +17,17,0.00786340427833731,0.06642675860532837,-1375281.5757328654,-798645.9616186575,0.35663172954569944,2.900465970474833,-807277.1206417971,0.41211840588454257,0.5446957279361009,-799564.0986061025,0.05726405599313575,2.6992201079308553,-795074.773177479,0.058327655804418455,17.215637464507253,-801427.2924061618,0.5534945060571388,9.205570263716002,-795364.198868676,0.5978087854283536,5.279188087719687,-813457.2158804197,0.8866130626375315,9.867928019371377 +18,18,0.007639301074559701,0.03358010063393503,-1375274.53927792,-798757.6626722564,0.35663172954569944,2.900465970474833,-807442.731414953,0.41211840588454257,0.5446957279361009,-799932.191263451,0.05726405599313575,2.6992201079308553,-795454.173437478,0.05797530586210222,16.76361227782182,-801427.2924061618,0.5534945060571388,9.205570263716002,-795364.198868676,0.5978087854283536,5.279188087719687,-813457.2158804197,0.8866130626375315,9.867928019371377 +19,19,0.007567810584575274,0.00032734971823157984,-1375274.5400305095,-798776.6132373732,0.35663172954569944,2.900465970474833,-807407.5175994666,0.41211840588454257,0.5446957279361009,-799839.5141766575,0.05726405599313575,2.6992201079308553,-795567.5444104999,0.05797527817732809,16.763631654115574,-801427.2924061618,0.5534945060571388,9.205570263716002,-795364.198868676,0.5978087854283536,5.279188087719687,-813457.2158804197,0.8866130626375315,9.867928019371377 +20,20,0.007559522636647893,0.0003284988853867459,-1375274.539920735,-798878.7031945293,0.35663172954569944,2.900465970474833,-807474.2323978223,0.41211840588454257,0.5446957279361009,-799918.231712956,0.05726405599313575,2.6992201079308553,-795552.3072518674,0.05797526981415537,16.763625801929546,-801427.2924061618,0.5534945060571388,9.205570263716002,-795364.198868676,0.5978087854283536,5.279188087719687,-813457.2158804197,0.8866130626375315,9.867928019371377 +21,21,0.007557017666936972,0.00011741201128258779,-1375274.5398505423,-798875.2254308723,0.35663172954569944,2.900465970474833,-807474.2323978223,0.41211840588454257,0.5446957279361009,-799969.9761753903,0.05726405599313575,2.6992201079308553,-795590.7893224553,0.05797526981415537,16.763625801929546,-801427.2924061618,0.5534945060571388,9.205570263716002,-795364.198868676,0.5978087854283536,5.279188087719687,-813457.2158804197,0.8866130626375315,9.867928019371377 +22,22,0.007557912174965889,4.953375811471988e-06,-1375274.5395942358,-798879.1825600903,0.35663172954569944,2.900465970474833,-807474.2323978223,0.41211840588454257,0.5446957279361009,-799969.9761753903,0.05726405599313575,2.6992201079308553,-795590.7893224553,0.05797526981415537,16.763625801929546,-801427.2924061618,0.5534945060571388,9.205570263716002,-795364.198868676,0.5978087854283536,5.279188087719687,-813457.2158804197,0.8866130626375315,9.867928019371377 +23,23,0.007557925434292841,0.0,-1375274.5395942358,-798879.1825600903,0.35663172954569944,2.900465970474833,-807474.2323978223,0.41211840588454257,0.5446957279361009,-799969.9761753903,0.05726405599313575,2.6992201079308553,-795590.7893224553,0.05797526981415537,16.763625801929546,-801427.2924061618,0.5534945060571388,9.205570263716002,-795364.198868676,0.5978087854283536,5.279188087719687,-813457.2158804197,0.8866130626375315,9.867928019371377 +24,24,0.007557925434292841,0.0,-1375274.5395942358,-798879.1825600903,0.35663172954569944,2.900465970474833,-807474.2323978223,0.41211840588454257,0.5446957279361009,-799969.9761753903,0.05726405599313575,2.6992201079308553,-795590.7893224553,0.05797526981415537,16.763625801929546,-801427.2924061618,0.5534945060571388,9.205570263716002,-795364.198868676,0.5978087854283536,5.279188087719687,-813457.2158804197,0.8866130626375315,9.867928019371377 +25,25,0.007557925434292841,0.0,-1375274.5395942358,-798879.1825600903,0.35663172954569944,2.900465970474833,-807474.2323978223,0.41211840588454257,0.5446957279361009,-799969.9761753903,0.05726405599313575,2.6992201079308553,-795590.7893224553,0.05797526981415537,16.763625801929546,-801427.2924061618,0.5534945060571388,9.205570263716002,-795364.198868676,0.5978087854283536,5.279188087719687,-813457.2158804197,0.8866130626375315,9.867928019371377 diff --git a/docs/Examples/outputs/slope.png b/docs/Examples/outputs/slope.png new file mode 100644 index 0000000..f0763a3 Binary files /dev/null and b/docs/Examples/outputs/slope.png differ diff --git a/docs/Examples/outputs/temp.xml b/docs/Examples/outputs/temp.xml index b218c2a..79377c5 100644 --- a/docs/Examples/outputs/temp.xml +++ b/docs/Examples/outputs/temp.xml @@ -33,7 +33,7 @@ 298.14999999999998 - -1376882.0784583509 + -1377917.5269485628 558.9824 0.0 @@ -50,7 +50,7 @@ 298.14999999999998 - -4924298.0880370205 + -4929625.060282971 1117.965 0.0 @@ -67,7 +67,7 @@ 298.14999999999998 - -4935685.119723228 + -4941397.084772181 1117.965 0.0 @@ -85,7 +85,7 @@ 298.14999999999998 - -4920369.042961768 + -4932551.489263242 1117.965 0.0 @@ -103,7 +103,7 @@ 298.14999999999998 - -4928639.61964031 + -4935194.142426379 1117.965 0.0 @@ -120,7 +120,7 @@ 298.14999999999998 - -4931991.722599618 + -4935179.480883835 1117.965 0.0 @@ -138,7 +138,7 @@ 298.14999999999998 - -4944682.264585918 + -4947210.070800013 1117.965 0.0 @@ -157,7 +157,7 @@ 298.14999999999998 - -4924669.3217661735 + -4929116.779371853 1117.965 0.0 @@ -245,10 +245,10 @@ - 0.058791091500561485, 0.0, 0.0, 0.0, 0.0 - 0.5448322248125199, 0.0, 0.0, 0.0, 0.0 + 0.058791077174068576, 0.0, 0.0, 0.0, 0.0 + 0.5448320238819658, 0.0, 0.0, 0.0, 0.0 0.0, 0.0, 0.0, 0.0, 0.0 - -0.02066999867229882, 0.0, 0.0, 0.0, 0.0 + -0.02066999867229882, 0.0, 0.0, 0.0, 0.0 2 0 @@ -261,10 +261,10 @@ - 1.213717095858249, 0.0, 0.0, 0.0, 0.0 - 7.7481294675488375, 0.0, 0.0, 0.0, 0.0 + 1.0825315776813356, 0.0, 0.0, 0.0, 0.0 + 6.211262701179254, 0.0, 0.0, 0.0, 0.0 0.0, 0.0, 0.0, 0.0, 0.0 - -0.01963615126026457, 0.0, 0.0, 0.0, 0.0 + -0.01963615126026457, 0.0, 0.0, 0.0, 0.0 2 0 @@ -277,10 +277,10 @@ - 1.0223168335791355, 0.0, 0.0, 0.0, 0.0 - 0.5296306654103653, 0.0, 0.0, 0.0, 0.0 + 0.5930048961782302, 0.0, 0.0, 0.0, 0.0 + 5.2771447352927785, 0.0, 0.0, 0.0, 0.0 0.0, 0.0, 0.0, 0.0, 0.0 - -0.024339999997603376, 0.0, 0.0, 0.0, 0.0 + -0.024339999997603376, 0.0, 0.0, 0.0, 0.0 2 0 @@ -293,10 +293,10 @@ - 0.7646372240575223, 0.0, 0.0, 0.0, 0.0 - 7.849276225207628, 0.0, 0.0, 0.0, 0.0 + 0.5532852863195881, 0.0, 0.0, 0.0, 0.0 + 9.206787175138805, 0.0, 0.0, 0.0, 0.0 0.0, 0.0, 0.0, 0.0, 0.0 - -0.019699989216349984, 0.0, 0.0, 0.0, 0.0 + -0.019699989216349984, 0.0, 0.0, 0.0, 0.0 2 0 @@ -309,10 +309,10 @@ - 0.20352350320923904, 0.0, 0.0, 0.0, 0.0 - 21.120419048363047, 0.0, 0.0, 0.0, 0.0 + 0.6005020116531858, 0.0, 0.0, 0.0, 0.0 + 4.91004437191519, 0.0, 0.0, 0.0, 0.0 0.0, 0.0, 0.0, 0.0, 0.0 - -0.02618999999473301, 0.0, 0.0, 0.0, 0.0 + -0.02618999999473301, 0.0, 0.0, 0.0, 0.0 2 0 @@ -325,10 +325,10 @@ - 0.8852797060008407, 0.0, 0.0, 0.0, 0.0 - 9.334636294454038, 0.0, 0.0, 0.0, 0.0 + 0.8866269789489127, 0.0, 0.0, 0.0, 0.0 + 9.867663759220948, 0.0, 0.0, 0.0, 0.0 0.0, 0.0, 0.0, 0.0, 0.0 - -0.015467323909969704, 0.0, 0.0, 0.0, 0.0 + -0.015467323909969704, 0.0, 0.0, 0.0, 0.0 2 0 @@ -341,10 +341,10 @@ - 0.6989083059080712, 0.0, 0.0, 0.0, 0.0 - 6.877881736471866, 0.0, 0.0, 0.0, 0.0 + 0.5978087860273482, 0.0, 0.0, 0.0, 0.0 + 5.279188095059934, 0.0, 0.0, 0.0, 0.0 0.0, 0.0, 0.0, 0.0, 0.0 - -0.019920000110321332, 0.0, 0.0, 0.0, 0.0 + -0.019920000110321332, 0.0, 0.0, 0.0, 0.0 2 0 diff --git a/docs/Examples/outputs/temp1.xml b/docs/Examples/outputs/temp1.xml new file mode 100644 index 0000000..d2ad522 --- /dev/null +++ b/docs/Examples/outputs/temp1.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 + -1376882.3191117246 + 558.9824 + 0.0 + + + + 0.320974226079 + + + + + + C:48 H:102 O:9 P:3 Nd:1 + + + 298.14999999999998 + + -4925566.309854757 + 1117.965 + 0.0 + + + + 0.973500071223 + + + + + + C:48 H:102 O:9 P:3 Pr:1 + + + 298.14999999999998 + + -4938249.845712334 + 1117.965 + 0.0 + + + + 0.979936421078 + + + + + + + C:48 H:102 O:9 P:3 Ce:1 + + + 298.14999999999998 + + -4920387.823199008 + 1117.965 + 0.0 + + + + 1.0060487218 + + + + + + + C:48 H:102 O:9 P:3 La:1 + + + 298.14999999999998 + + -4933548.865580005 + 1117.965 + 0.0 + + + + 0.981485801577 + + + + + + C:48 H:102 O:9 P:3 Dy:1 + + + 298.14999999999998 + + -4932560.171447597 + 1117.965 + 0.0 + + + + 0.961666360676 + + + + + + + C:48 H:102 O:9 P:3 Y:1 + + + 298.14999999999998 + + -4944840.781582316 + 1117.965 + 0.0 + + + + 0.958888814485 + + + + + + + + C:48 H:102 O:9 P:3 Sm:1 + + + 298.14999999999998 + + -4924696.189921901 + 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.05879108748614492, 0.0, 0.0, 0.0, 0.0 + 0.5448324180244323, 0.0, 0.0, 0.0, 0.0 + 0.0, 0.0, 0.0, 0.0, 0.0 + -0.02066999867229882, 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. + + + + + 1.2137222016802447, 0.0, 0.0, 0.0, 0.0 + 7.748226963005033, 0.0, 0.0, 0.0, 0.0 + 0.0, 0.0, 0.0, 0.0, 0.0 + -0.01963615126026457, 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. + + + + + 1.022316535866388, 0.0, 0.0, 0.0, 0.0 + 0.5296311209773129, 0.0, 0.0, 0.0, 0.0 + 0.0, 0.0, 0.0, 0.0, 0.0 + -0.024339999997603376, 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.7646397332938777, 0.0, 0.0, 0.0, 0.0 + 7.849320590516409, 0.0, 0.0, 0.0, 0.0 + 0.0, 0.0, 0.0, 0.0, 0.0 + -0.019699989216349984, 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.2035235053232368, 0.0, 0.0, 0.0, 0.0 + 21.120426174002823, 0.0, 0.0, 0.0, 0.0 + 0.0, 0.0, 0.0, 0.0, 0.0 + -0.02618999999473301, 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.8852802073165494, 0.0, 0.0, 0.0, 0.0 + 9.334653075341238, 0.0, 0.0, 0.0, 0.0 + 0.0, 0.0, 0.0, 0.0, 0.0 + -0.015467323909969704, 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.6989081585234721, 0.0, 0.0, 0.0, 0.0 + 6.877882600430561, 0.0, 0.0, 0.0, 0.0 + 0.0, 0.0, 0.0, 0.0, 0.0 + -0.019920000110321332, 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/docs/Examples/test_eval.py b/docs/Examples/test_eval.py new file mode 100644 index 0000000..b5c84b0 --- /dev/null +++ b/docs/Examples/test_eval.py @@ -0,0 +1,330 @@ +# This file tests adding 0.1 M NaCl to the feed. +import llepe +import pandas as pd +import numpy as np +import json +import matplotlib as plt +import matplotlib +import cantera as ct + + +class ModLLEPE(llepe.LLEPE): + def __init__(self, + exp_data, + phases_xml_filename, + phase_names, + aq_solvent_name, + extractant_name, + diluant_name, + complex_names, + extracted_species_ion_names, + extracted_species_list=None, + aq_solvent_rho=None, + extractant_rho=None, + diluant_rho=None, + opt_dict=None, + objective_function='Log-MSE', + optimizer='scipy_minimize', + temp_xml_file_path=None, + dependant_params_dict=None, + custom_objects_dict=None, + nacl_molarity=0): + self.nacl_molarity = nacl_molarity + super().__init__(exp_data, + phases_xml_filename, + phase_names, + aq_solvent_name, + extractant_name, + diluant_name, + complex_names, + extracted_species_ion_names, + extracted_species_list, + aq_solvent_rho, + extractant_rho, + diluant_rho, + opt_dict, + objective_function, + optimizer, + temp_xml_file_path, + dependant_params_dict, + custom_objects_dict) + + + def set_in_moles(self, feed_vol): + """Function that initializes mole fractions to input feed_vol + + This function is called at initialization + + Sets in_moles to a pd.DataFrame containing initial mole fractions + + Columns for species and rows for different experiments + + This function also calls update_predicted_dict + + :param feed_vol: (float) feed volume of mixture (L) + """ + phases_copy = self._phases.copy() + exp_df = self._exp_df.copy() + solvent_name = self._aq_solvent_name + extractant_name = self._extractant_name + diluant_name = self._diluant_name + solvent_rho = self._aq_solvent_rho + extractant_rho = self._extractant_rho + diluant_rho = self._diluant_rho + extracted_species_names = self._extracted_species_ion_names + extracted_species_list = self._extracted_species_list + + mixed = ct.Mixture(phases_copy) + aq_ind = None + solvent_ind = None + for ind, phase in enumerate(phases_copy): + if solvent_name in phase.species_names: + aq_ind = ind + solvent_ind = phase.species_names.index(solvent_name) + if aq_ind is None: + raise Exception('Solvent "{0}" not found \ + in xml file'.format(solvent_name)) + + if aq_ind == 0: + org_ind = 1 + else: + org_ind = 0 + self._aq_ind = aq_ind + self._org_ind = org_ind + extractant_ind = phases_copy[org_ind].species_names.index( + extractant_name) + diluant_ind = phases_copy[org_ind].species_names.index( + diluant_name) + + extracted_species_ind_list = [ + phases_copy[aq_ind].species_names.index( + extracted_species_name) + for extracted_species_name in extracted_species_names] + extracted_species_charges = np.array( + [phases_copy[aq_ind].species( + extracted_species_ind).charge + for extracted_species_ind in extracted_species_ind_list]) + self._extracted_species_charges = extracted_species_charges + + mix_aq = mixed.phase(aq_ind) + mix_org = mixed.phase(org_ind) + solvent_mw = mix_aq.molecular_weights[solvent_ind] # g/mol + extractant_mw = mix_org.molecular_weights[extractant_ind] + diluant_mw = mix_org.molecular_weights[diluant_ind] + if solvent_rho is None: + solvent_rho = mix_aq(aq_ind).partial_molar_volumes[ + solvent_ind] / solvent_mw * 1e6 # g/L + self._aq_solvent_rho = solvent_rho + if extractant_rho is None: + extractant_rho = mix_org(org_ind).partial_molar_volumes[ + extractant_ind] / extractant_mw * 1e6 + self._extractant_rho = extractant_rho + if diluant_rho is None: + diluant_rho = mix_org(org_ind).partial_molar_volumes[ + extractant_ind] / extractant_mw * 1e6 + self._diluant_rho = diluant_rho + + in_moles_data = [] + aq_phase_solvent_moles = feed_vol * solvent_rho / solvent_mw + for index, row in exp_df.iterrows(): + h_plus_moles = feed_vol * row['h_i'] + hydroxide_ions = 0 + extracted_species_moles = np.array( + [feed_vol * row['{0}_aq_i'.format( + extracted_species)] + for extracted_species in extracted_species_list]) + extracted_species_charge_sum = np.sum( + extracted_species_charges * extracted_species_moles) + chlorine_moles = extracted_species_charge_sum + h_plus_moles + extractant_moles = feed_vol * row['z_i'] + extractant_vol = extractant_moles * extractant_mw / extractant_rho + diluant_vol = feed_vol - extractant_vol + diluant_moles = diluant_vol * diluant_rho / diluant_mw + complex_moles = np.zeros(len(extracted_species_list)) + + species_moles_aq = [aq_phase_solvent_moles, + h_plus_moles, + hydroxide_ions, + chlorine_moles] + species_moles_aq.extend(list(extracted_species_moles)) + species_moles_aq.append(self.nacl_molarity * feed_vol) + species_moles_aq[3] += self.nacl_molarity * feed_vol + species_moles_org = [extractant_moles, diluant_moles] + species_moles_org.extend(list(complex_moles)) + if aq_ind == 0: + species_moles = species_moles_aq + species_moles_org + else: + species_moles = species_moles_org + species_moles_aq + in_moles_data.append(species_moles) + + self._in_moles = pd.DataFrame( + in_moles_data, columns=mixed.species_names) + self.update_predicted_dict() + return None + + +font = {'family': 'sans serif', + 'size': 24} +matplotlib.rc('font', **font) +plt.rc('xtick', labelsize=18) +plt.rc('ytick', labelsize=18) +plt.rcParams['lines.linewidth'] = 4 +matplotlib.rcParams['lines.markersize'] = 10 + + +def ext_to_complex(h0, custom_obj_dict, mini_species): + linear_params = custom_obj_dict['lin_param_df'] + row = linear_params[linear_params['species'] == mini_species] + return row['slope'].values[0] * h0[0] + row['intercept'].values[0] + + +def mod_lin_param_df(lp_df, input_val, mini_species, mini_lin_param): + new_lp_df = lp_df.copy() + index = new_lp_df.index[new_lp_df['species'] == mini_species].tolist()[0] + new_lp_df.at[index, mini_lin_param] = input_val + return new_lp_df + + +info_df = pd.read_csv('outputs/multi_only_iterative_fitter_output.csv') +test_row = -1 +pitzer_params_filename = "../../data/jsons/min_h0_pitzer_params.txt" +with open(pitzer_params_filename) as file: + pitzer_params_dict = json.load(file) +pitzer_params_df = pd.DataFrame(pitzer_params_dict) +species_list = 'Nd,Pr,Ce,La,Dy,Sm,Y'.split(',') +pitzer_param_list = ['beta0', 'beta1'] +labeled_data = pd.read_csv("../../data/csvs/" + "no_formiga_or_5_oa_PC88A_HCL_NdPrCeLaDySmY.csv") +labeled_data = labeled_data.sort_values(['Feed Pr[M]', 'Feed Ce[M]'], + ascending=True) +exp_data = labeled_data.drop(labeled_data.columns[0], axis=1) +xml_file = "test_PC88A_HCL_NdPrCeLaDySmY_w_pitzer.xml" +lin_param_df = pd.read_csv("../../data/csvs" + "/zeroes_removed_min_h0_pitzer_lin_params.csv") +estimator_params = {'exp_data': exp_data, + 'phases_xml_filename': xml_file, + '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) + for species in species_list], + 'extracted_species_ion_names': ['{0}+++'.format(species) + for species in + species_list], + 'aq_solvent_rho': 1000.0, + 'extractant_rho': 960.0, + 'diluant_rho': 750.0, + 'temp_xml_file_path': 'outputs/temp.xml', + 'objective_function': llepe.lmse_perturbed_obj, + 'nacl_molarity': 0 + } +dependant_params_dict = {} +for species, complex_name in zip(species_list, + estimator_params['complex_names']): + inner_dict = {'upper_element_name': 'species', + 'upper_attrib_name': 'name', + 'upper_attrib_value': complex_name, + 'lower_element_name': 'h0', + 'lower_attrib_name': None, + 'lower_attrib_value': None, + 'input_format': '{0}', + 'function': ext_to_complex, + 'kwargs': {"mini_species": species}, + 'independent_params': '(HA)2(org)_h0'} + dependant_params_dict['{0}_h0'.format(complex_name)] = inner_dict +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': + info_df.iloc[test_row, :]['best_ext_h0']}} +for species in species_list: + for pitzer_param in pitzer_param_list: + pitzer_str = "{0}_{1}".format(species, pitzer_param) + value = info_df.iloc[test_row, :][pitzer_str] + pitzer_params_dict[pitzer_str]['input_value'] = value + lin_str = "{0}_slope".format(species) + inner_dict = {'custom_object_name': 'lin_param_df', + 'function': mod_lin_param_df, + 'kwargs': {'mini_species': species, + 'mini_lin_param': 'slope'}, + 'input_value': 3 + } + info_dict[lin_str] = inner_dict + lin_str = "{0}_intercept".format(species) + value = info_df.iloc[test_row, :][lin_str] + inner_dict = {'custom_object_name': 'lin_param_df', + 'function': mod_lin_param_df, + 'kwargs': {'mini_species': species, + 'mini_lin_param': 'intercept'}, + 'input_value': value + } + info_dict[lin_str] = inner_dict + +info_dict.update(pitzer_params_dict) +estimator = ModLLEPE(**estimator_params) +estimator.set_custom_objects_dict({'lin_param_df': lin_param_df}) +estimator.update_custom_objects_dict(info_dict) +estimator.update_xml(info_dict, + dependant_params_dict=dependant_params_dict) +exp_data = estimator.get_exp_df() +feed_cols = [] +for col in exp_data.columns: + if 'aq_i' in col: + feed_cols.append(col) +exp_data['total_re'] = exp_data[feed_cols].sum(axis=1) +label_list = [] +for index, row in exp_data[feed_cols].iterrows(): + bool_list = list((row > 0).values) + label = '' + for species, el in zip(species_list, bool_list): + if el: + label = '{0}-{1}'.format(label, species) + label = label[1:] + label_list.append(label) +r2s = "" +for species in species_list: + # if species=='La': + # save_name = 'outputs' \ + # '/parity_iterative_fitter_{0}_org_eq'.format(species) + save_name = None + # fig, ax = estimator.parity_plot('{0}_org_eq'.format(species), + # c_data='z_i', + # c_label='Feed total RE ' + # 'molarity (mol/L)', + # print_r_squared=True, + # save_path=save_name) + r2s += str(estimator.r_squared('{0}_org_eq'.format(species))) + ',' + + fig, ax = estimator.parity_plot('{0}_org_eq'.format(species), + data_labels=list(labeled_data['label']), + print_r_squared=True, + save_path=save_name) + ax.legend(loc=4) +pred_df = pd.DataFrame(estimator.get_predicted_dict()) +new_cols = [] +for col in pred_df.columns: + new_cols.append("pred_{0}".format(col)) +pred_df.columns = new_cols +new_cols = ['label', + 'h_i', + 'h_eq', + 'z_i', + 'z_eq' + ] +for species in species_list: + new_cols.append("{0}_aq_i".format(species)) + new_cols.append("{0}_aq_eq".format(species)) + new_cols.append("{0}_d_eq".format(species)) +labeled_data.columns = new_cols +total_df = labeled_data.join(pred_df) +# total_df.to_csv('if_mse_total_df.csv') +# short_info_dict = {} +# for key, value in info_dict.items(): +# short_info_dict[key] = value['input_value'] +# with open("outputs/iterative_fitter_short_info_dict.txt", 'w') as file: +# json.dump(short_info_dict, file) diff --git a/llepe/llepe.py b/llepe/llepe.py index 7a12f67..d07dae7 100644 --- a/llepe/llepe.py +++ b/llepe/llepe.py @@ -26,7 +26,7 @@ class LLEPE: must be the same order as they appear in the xml, complex_names and extracted_species_ion_names. - For example, say in exp_csv_filename's csv, ES_1 is Nd ES_2 is Pr, + For example, say in exp_data, ES_1 is Nd ES_2 is Pr, and .. code-block:: python @@ -37,7 +37,7 @@ class LLEPE: Then: - The csvs column ordering must be: + The exp_data column ordering must be (names do not matter): [h_i, h_eq, z_i, z_eq, Nd_aq_i, Nd_aq_eq, Nd_d_eq, Pr_aq_i, Pr_aq_eq, Pr_d_eq] @@ -372,6 +372,7 @@ class LLEPE: self._predicted_dict = None self.update_predicted_dict() + # TODO: move scipy_minimize to optimizers @staticmethod def scipy_minimize(objective, x_guess, optimizer_kwargs=None): """ The default optimizer for LLEPE @@ -406,6 +407,7 @@ class LLEPE: est_parameters = res.x return est_parameters, res.fun + # TODO: move log_mean_squared_error to objectives def log_mean_squared_error(self, predicted_dict, meas_df): """Default objective function for LLEPE @@ -685,6 +687,11 @@ class LLEPE: self._diluant_rho = diluant_rho return None + # TODO: Change input DataFrame structure to contain information about + # other species like NaCl + # TODO: Change DataFrame structure to contain info about O/A ratio + # TODO: Generalize code to more than just org and aq phase (3+ phases) + # TODO: Handle multiple electrolytes ie. NO3- with Cl- def set_in_moles(self, feed_vol): """Function that initializes mole fractions to input feed_vol @@ -768,7 +775,7 @@ class LLEPE: for extracted_species in extracted_species_list]) extracted_species_charge_sum = np.sum( extracted_species_charges * extracted_species_moles) - chlorine_moles = extracted_species_charge_sum + h_plus_moles + anion_moles = extracted_species_charge_sum + h_plus_moles extractant_moles = feed_vol * row['z_i'] extractant_vol = extractant_moles * extractant_mw / extractant_rho diluant_vol = feed_vol - extractant_vol @@ -778,7 +785,7 @@ class LLEPE: species_moles_aq = [aq_phase_solvent_moles, h_plus_moles, hydroxide_ions, - chlorine_moles] + anion_moles] species_moles_aq.extend(list(extracted_species_moles)) species_moles_org = [extractant_moles, diluant_moles] species_moles_org.extend(list(complex_moles)) @@ -927,6 +934,10 @@ class LLEPE: self._custom_objects_dict = custom_objects_dict return None + # TODO: Change DataFrame strucutre to contain info whether to set + # equilibrium pH to measured value. Will be useful for saponification + # TODO: Find way to add saponification to model. + # Maybe use fsolve to match experimental equilibrium pH def update_predicted_dict(self, phases_xml_filename=None, phase_names=None): @@ -1342,7 +1353,9 @@ class LLEPE: filtered_meas = filtered_data['meas'] filtered_pred = filtered_data['pred'] if len(filtered_pred) != 0: - ax.scatter(filtered_meas, filtered_pred, label=label) + ax.scatter(filtered_meas, + filtered_pred, + label=label) if legend: ax.legend(loc='best') @@ -1427,6 +1440,8 @@ class LLEPE: z_label=None, c_label=None): """ + THis is for plotting 3d scatter plots. + We suggest use matplotlib's ax.scatter to make 3d plots. :param x_data: (list) list of data for x axis :param y_data: (list) list of data for y axis diff --git a/llepe/optimizers.py b/llepe/optimizers.py index 49d3646..14db2af 100644 --- a/llepe/optimizers.py +++ b/llepe/optimizers.py @@ -1,12 +1,12 @@ 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), + [(1e-1, 1e1)] * len(x_guess), x0=x_guess) est_parameters = res.x return est_parameters, res.fun @@ -19,21 +19,3 @@ def diff_evo_optimizer(objective, x_guess): 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