diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 11deb53..fd0cca5 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,9 +2,13 @@ + + - - + + + + - + - + - + + + + - - - @@ -403,7 +407,14 @@ @@ -439,7 +450,8 @@ - @@ -463,10 +475,10 @@ - - + + - + @@ -521,6 +533,10 @@ + + + + diff --git a/data/csvs/PC88A_HCL_NdPrCeLaDySmY.csv b/data/csvs/PC88A_HCL_NdPrCeLaDySmY.csv new file mode 100644 index 0000000..b2646d3 --- /dev/null +++ b/data/csvs/PC88A_HCL_NdPrCeLaDySmY.csv @@ -0,0 +1,216 @@ +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 +Formiga (2016),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 +Formiga (2016),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 +Formiga (2016),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 +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 +Lyon (2016),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 +Lyon (2016),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 +Lyon (2016),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 +Lyon (2016),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 +Liu (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 +Liu (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 +Liu (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 +Liu (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 +Liu (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 +Banda (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 +Banda (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 +Banda (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 +Banda (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 +Banda (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 265abf2..d2ad522 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 - -1376877.154483614 + -1376882.3191117246 558.9824 0.0 @@ -50,7 +50,7 @@ 298.14999999999998 - -4926549.797810851 + -4925566.309854757 1117.965 0.0 @@ -67,7 +67,7 @@ 298.14999999999998 - -4935519.640701385 + -4938249.845712334 1117.965 0.0 @@ -85,7 +85,7 @@ 298.14999999999998 - -4928317.781440989 + -4920387.823199008 1117.965 0.0 @@ -103,7 +103,7 @@ 298.14999999999998 - -4927428.65973482 + -4933548.865580005 1117.965 0.0 @@ -120,7 +120,7 @@ 298.14999999999998 - -4935155.356789877 + -4932560.171447597 1117.965 0.0 @@ -138,7 +138,7 @@ 298.14999999999998 - -4944228.17930387 + -4944840.781582316 1117.965 0.0 @@ -157,7 +157,7 @@ 298.14999999999998 - -4925606.187988869 + -4924696.189921901 1117.965 0.0 @@ -245,10 +245,10 @@ - 0.9335616000781043, 0.0, 0.0, 0.0, 0.0 - 10.555396864028587, 0.0, 0.0, 0.0, 0.0 + 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 + -0.02066999867229882, 0.0, 0.0, 0.0, 0.0 2 0 @@ -261,10 +261,10 @@ - 0.951206693355039, 0.0, 0.0, 0.0, 0.0 - 9.262520235612426, 0.0, 0.0, 0.0, 0.0 + 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 + -0.01963615126026457, 0.0, 0.0, 0.0, 0.0 2 0 @@ -277,10 +277,10 @@ - 0.5362669407654791, 0.0, 0.0, 0.0, 0.0 - 19.878544145607385, 0.0, 0.0, 0.0, 0.0 + 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 + -0.024339999997603376, 0.0, 0.0, 0.0, 0.0 2 0 @@ -293,10 +293,10 @@ - 0.6129504699810289, 0.0, 0.0, 0.0, 0.0 - 5.359936728131316, 0.0, 0.0, 0.0, 0.0 + 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 + -0.019699989216349984, 0.0, 0.0, 0.0, 0.0 2 0 @@ -309,10 +309,10 @@ - 0.3803360903827252, 0.0, 0.0, 0.0, 0.0 - 0.4715334506120701, 0.0, 0.0, 0.0, 0.0 + 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 + -0.02618999999473301, 0.0, 0.0, 0.0, 0.0 2 0 @@ -325,10 +325,10 @@ - 0.8864576562457522, 0.0, 0.0, 0.0, 0.0 - 9.87156845120858, 0.0, 0.0, 0.0, 0.0 + 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 + -0.015467323909969704, 0.0, 0.0, 0.0, 0.0 2 0 @@ -341,10 +341,10 @@ - 0.6989806463779159, 0.0, 0.0, 0.0, 0.0 - 6.8744371885601625, 0.0, 0.0, 0.0, 0.0 + 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 + -0.019920000110321332, 0.0, 0.0, 0.0, 0.0 2 0 diff --git a/docs/Examples/iterative_fitter.py b/docs/Examples/iterative_fitter.py index ce6eb5e..f9d97b6 100644 --- a/docs/Examples/iterative_fitter.py +++ b/docs/Examples/iterative_fitter.py @@ -75,7 +75,7 @@ estimator.set_custom_objects_dict({'lin_param_df': new_lin_param_df}) estimator.set_dependant_params_dict(dependant_params_dict) estimator.update_xml(ext_h0_dict, dependant_params_dict=dependant_params_dict) -eps = 1e-8 +eps = 1e-20 mini_eps = 1e-4 pitzer_guess_dict = {'species': [], 'beta0': [], @@ -105,7 +105,7 @@ i = 0 rel_diff = 1000 obj_diff1 = 1000 obj_diff2 = 1000 -while obj_diff1 > eps and obj_diff2 > eps: +while obj_diff1 > eps or obj_diff2 > eps: i += 1 print(i) best_obj = 1e20 @@ -154,7 +154,7 @@ while obj_diff1 > eps and obj_diff2 > eps: estimator.set_opt_dict(info_dict) estimator.update_custom_objects_dict(info_dict) estimator.update_xml(info_dict) - obj_kwargs = {'species_list': [species], 'epsilon': 1e-100} + obj_kwargs = {'species_list': species_list, 'epsilon': 1e-100} bounds = [(1e-1, 1e1)] * len(info_dict) optimizer_kwargs = {"method": 'l-bfgs-b', "bounds": bounds} @@ -237,7 +237,7 @@ while obj_diff1 > eps and 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_output1.csv') + output_df.to_csv('outputs/iterative_fitter_output4.csv') obj_diff1 = np.abs(output_dict['best_obj'][-1]-output_dict['best_obj'][-2]) if i > 2: obj_diff2 = np.abs( diff --git a/docs/Examples/iterative_fitter_eval_grapher.py b/docs/Examples/iterative_fitter_eval_grapher.py new file mode 100644 index 0000000..aaed7bd --- /dev/null +++ b/docs/Examples/iterative_fitter_eval_grapher.py @@ -0,0 +1,128 @@ +import llepe +import pandas as pd +import numpy as np +import json +import matplotlib as plt +import matplotlib + +font = {'family': 'sans serif', + 'size': 24} +matplotlib.rc('font', **font) +plt.rc('xtick', labelsize=18) +plt.rc('ytick', labelsize=18) + +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/iterative_fitter_output2.csv') +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/" + "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" + "/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 + } +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[-1, :]['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[-1, :][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[-1, :][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 = llepe.LLEPE(**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) +for species in species_list: + save_name = 'outputs/parity_iterative_fitter_{0}_org_eq'.format(species) + 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=True, + save_path=save_name) +# 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/docs/Examples/iterative_fitter_info_dict b/docs/Examples/iterative_fitter_info_dict new file mode 100644 index 0000000..e7fdfd6 --- /dev/null +++ b/docs/Examples/iterative_fitter_info_dict @@ -0,0 +1 @@ +{"(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": null, "lower_attrib_value": null, "input_format": "{0}", "input_value": -1376882.3191117246}, "Nd_slope": {"custom_object_name": "lin_param_df", "function": \ No newline at end of file diff --git a/docs/Examples/iterative_fitter_info_dict.txt b/docs/Examples/iterative_fitter_info_dict.txt new file mode 100644 index 0000000..e69de29 diff --git a/docs/Examples/iterative_fitter_w_mse.py b/docs/Examples/iterative_fitter_w_mse.py new file mode 100644 index 0000000..898d0b1 --- /dev/null +++ b/docs/Examples/iterative_fitter_w_mse.py @@ -0,0 +1,274 @@ +import llepe +import pandas as pd +import numpy as np +import json + + +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 + + +def ext_to_complex(h0, custom_obj_dict, mini_species): + linear_params = custom_obj_dict['lin_param_df'] + mini_row = linear_params[linear_params['species'] == mini_species] + val = mini_row['slope'].values[0] * h0[0] + mini_row['intercept'].values[0] + return val + + +species_list = 'Nd,Pr,Ce,La,Dy,Sm,Y'.split(',') +pitzer_param_list = ['beta0', 'beta1'] +lin_param_list = ['intercept'] +short_info_filename = 'outputs/iterative_fitter_short_info_dict.txt' +with open(short_info_filename) as file: + short_info_dict = json.load(file) +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" +lin_param_df = pd.read_csv("../../data/csvs" + "/zeroes_removed_min_h0_pitzer_lin_params.csv") +new_lin_param_df = lin_param_df.copy() +for ind, row in lin_param_df.iterrows(): + new_lin_param_df.at[ind, 'slope'] = 3 + species = row['species'] + val = short_info_dict['{0}_intercept'.format(species)] + new_lin_param_df.at[ind, 'intercept'] = val +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/temp1.xml', + 'objective_function': llepe.mean_squared_error, + 'custom_objects_dict': {'lin_param_df': new_lin_param_df} + } +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': + short_info_dict['(HA)2(org)_h0']}} +for species in species_list: + for param in pitzer_param_list: + name = "{0}_{1}".format(species, param) + inner_dict = {'upper_element_name': 'binarySaltParameters', + 'upper_attrib_name': 'cation', + 'upper_attrib_value': '{0}+++'.format(species), + 'lower_element_name': param, + 'lower_attrib_name': None, + 'lower_attrib_value': None, + 'input_format': ' {0}, 0.0, 0.0, 0.0, 0.0 ', + 'input_value': + short_info_dict[name]} + info_dict[name] = inner_dict + for param in lin_param_list: + name = "{0}_{1}".format(species, param) + inner_dict = {'custom_object_name': 'lin_param_df', + 'function': mod_lin_param_df, + 'kwargs': {'mini_species': species, + 'mini_lin_param': param}, + 'input_value': short_info_dict[name] + } + +estimator = llepe.LLEPE(**estimator_params) +estimator.update_xml(info_dict, + dependant_params_dict=dependant_params_dict) +estimator.set_dependant_params_dict(dependant_params_dict) +eps = 1e-20 +mini_eps = 1e-4 +pitzer_guess_dict = {'species': [], + 'beta0': [], + 'beta1': []} +for species in species_list: + pitzer_guess_dict['species'].append(species) + for param in pitzer_param_list: + mini_dict = info_dict['{0}_{1}'.format(species, param)] + value = mini_dict['input_value'] + pitzer_guess_dict[param].append(value) +pitzer_guess_df = pd.DataFrame(pitzer_guess_dict) +ext_h0_guess = info_dict['(HA)2(org)_h0']['input_value'] +lin_guess_df = new_lin_param_df.copy() + +ignore_list = [] +optimizer = 'scipy_minimize' +output_dict = {'iter': [0], + 'best_obj': [1e20], + 'rel_diff': [1e20], + 'best_ext_h0': [1e20]} +for species in species_list: + for lin_param in lin_param_list: + output_dict['{0}_{1}'.format(species, lin_param)] = [1e20] + for pitzer_param in pitzer_param_list: + output_dict['{0}_{1}'.format(species, pitzer_param)] = [1e20] +i = 0 +rel_diff = 1000 +obj_diff1 = 1000 +obj_diff2 = 1000 +while obj_diff1 > eps or obj_diff2 > eps: + i += 1 + print(i) + best_obj = 1e20 + best_ext_h0 = 0 + output_dict['iter'].append(i) + for species in species_list: + print(species) + lower_species = species.lower() + 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': ext_h0_guess}} + + 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 + for lin_param in lin_param_list: + if '{0}_{1}'.format(species, lin_param) not in ignore_list: + lin_row = lin_guess_df[lin_guess_df['species'] == species] + inner_dict = {'custom_object_name': 'lin_param_df', + 'function': mod_lin_param_df, + 'kwargs': {'mini_species': species, + 'mini_lin_param': lin_param}, + 'input_value': lin_row[lin_param].values[0] + } + info_dict['{0}_{1}'.format( + species, lin_param)] = inner_dict + estimator.set_opt_dict(info_dict) + estimator.update_custom_objects_dict(info_dict) + estimator.update_xml(info_dict) + obj_kwargs = {'species_list': species_list} + 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 + best_ext_h0 = opt_dict['(HA)2(org)_h0']['input_value'] + + for lin_param in lin_param_list: + if '{0}_{1}'.format(species, lin_param) not in ignore_list: + mini_dict = opt_dict['{0}_{1}'.format(species, lin_param)] + value = mini_dict['input_value'] + output_dict['{0}_{1}'.format(species, lin_param)].append(value) + else: + value = output_dict['{0}_{1}'.format(species, lin_param)][-1] + output_dict['{0}_{1}'.format(species, lin_param)].append(value) + for pitzer_param in pitzer_param_list: + if '{0}_{1}'.format(species, pitzer_param) not in ignore_list: + mini_dict = opt_dict['{0}_{1}'.format(species, pitzer_param)] + value = mini_dict['input_value'] + output_dict['{0}_{1}'.format( + species, pitzer_param)].append(value) + else: + value = output_dict['{0}_{1}'.format( + species, pitzer_param)][-1] + output_dict['{0}_{1}'.format( + species, pitzer_param)].append(value) + estimator.update_custom_objects_dict(info_dict) + estimator.update_xml(opt_dict) + pitzer_guess_dict = {'species': []} + for pitzer_param in pitzer_param_list: + pitzer_guess_dict[pitzer_param] = [] + lin_guess_dict = {'species': []} + for lin_param in lin_param_list: + lin_guess_dict[lin_param] = [] + for species in species_list: + pitzer_guess_dict['species'].append(species) + lin_guess_dict['species'].append(species) + for pitzer_param in pitzer_param_list: + pitzer_str = '{0}_{1}'.format(species, pitzer_param) + 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: + if pitzer_str not in ignore_list: + ignore_list.append(pitzer_str) + for lin_param in lin_param_list: + lin_str = '{0}_{1}'.format(species, lin_param) + value_list = output_dict['{0}_{1}'.format(species, lin_param)] + value = value_list[-1] + lin_guess_dict[lin_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: + if lin_str not in ignore_list: + ignore_list.append(lin_str) + pitzer_guess_df = pd.DataFrame(pitzer_guess_dict) + lin_guess_df = pd.DataFrame(lin_guess_dict) + ext_h0_guess = best_ext_h0 + + output_dict['best_ext_h0'].append(best_ext_h0) + output_dict['best_obj'].append(best_obj) + output_dict['rel_diff'].append(100) + output_df = pd.DataFrame(output_dict) + old_row = output_df.iloc[-2, :].values[4:] + new_row = output_df.iloc[-1, :].values[4:] + rel_diff = np.sum(np.abs(new_row - old_row) / np.abs(old_row)) + 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_w_mse_output.csv') + obj_diff1 = np.abs( + output_dict['best_obj'][-1] - output_dict['best_obj'][-2]) + if i > 2: + obj_diff2 = np.abs( + output_dict['best_obj'][-1] - output_dict['best_obj'][-3]) diff --git a/docs/Examples/outputs/iterative_fitter_info_dict.txt b/docs/Examples/outputs/iterative_fitter_info_dict.txt new file mode 100644 index 0000000..e7fdfd6 --- /dev/null +++ b/docs/Examples/outputs/iterative_fitter_info_dict.txt @@ -0,0 +1 @@ +{"(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": null, "lower_attrib_value": null, "input_format": "{0}", "input_value": -1376882.3191117246}, "Nd_slope": {"custom_object_name": "lin_param_df", "function": \ No newline at end of file diff --git a/docs/Examples/outputs/temp.xml b/docs/Examples/outputs/temp.xml index 265abf2..e292885 100644 --- a/docs/Examples/outputs/temp.xml +++ b/docs/Examples/outputs/temp.xml @@ -33,7 +33,7 @@ 298.14999999999998 - -1376877.154483614 + -1376882.3191117246 558.9824 0.0 @@ -50,7 +50,7 @@ 298.14999999999998 - -4926549.797810851 + -4925566.309854757 1117.965 0.0 @@ -67,7 +67,7 @@ 298.14999999999998 - -4935519.640701385 + -4938249.845712334 1117.965 0.0 @@ -85,7 +85,7 @@ 298.14999999999998 - -4928317.781440989 + -4920387.823199008 1117.965 0.0 @@ -103,7 +103,7 @@ 298.14999999999998 - -4927428.65973482 + -4933548.865580005 1117.965 0.0 @@ -120,7 +120,7 @@ 298.14999999999998 - -4935155.356789877 + -4932560.171447597 1117.965 0.0 @@ -138,7 +138,7 @@ 298.14999999999998 - -4944228.17930387 + -4944840.781582316 1117.965 0.0 @@ -157,7 +157,7 @@ 298.14999999999998 - -4925606.187988869 + -4924696.189921901 1117.965 0.0 @@ -245,10 +245,10 @@ - 0.9335616000781043, 0.0, 0.0, 0.0, 0.0 - 10.555396864028587, 0.0, 0.0, 0.0, 0.0 + 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 + -0.02066999867229882, 0.0, 0.0, 0.0, 0.0 2 0 @@ -261,10 +261,10 @@ - 0.951206693355039, 0.0, 0.0, 0.0, 0.0 - 9.262520235612426, 0.0, 0.0, 0.0, 0.0 + 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 + -0.01963615126026457, 0.0, 0.0, 0.0, 0.0 2 0 @@ -277,10 +277,10 @@ - 0.5362669407654791, 0.0, 0.0, 0.0, 0.0 - 19.878544145607385, 0.0, 0.0, 0.0, 0.0 + 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 + -0.024339999997603376, 0.0, 0.0, 0.0, 0.0 2 0 @@ -293,10 +293,10 @@ - 0.6129504699810289, 0.0, 0.0, 0.0, 0.0 - 5.359936728131316, 0.0, 0.0, 0.0, 0.0 + 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 + -0.019699989216349984, 0.0, 0.0, 0.0, 0.0 2 0 @@ -309,10 +309,10 @@ - 0.3803360903827252, 0.0, 0.0, 0.0, 0.0 - 0.4715334506120701, 0.0, 0.0, 0.0, 0.0 + 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 + -0.02618999999473301, 0.0, 0.0, 0.0, 0.0 2 0 @@ -325,10 +325,10 @@ - 0.8864576562457522, 0.0, 0.0, 0.0, 0.0 - 9.87156845120858, 0.0, 0.0, 0.0, 0.0 + 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 + -0.015467323909969704, 0.0, 0.0, 0.0, 0.0 2 0 @@ -341,10 +341,10 @@ - 0.6989806463779159, 0.0, 0.0, 0.0, 0.0 - 6.8744371885601625, 0.0, 0.0, 0.0, 0.0 + 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 + -0.019920000110321332, 0.0, 0.0, 0.0, 0.0 2 0 diff --git a/llepe/objectives.py b/llepe/objectives.py index c83540e..136b6f9 100644 --- a/llepe/objectives.py +++ b/llepe/objectives.py @@ -57,3 +57,29 @@ def ind_lmse_perturbed_obj(predicted_dict, objectives.append(np.mean(fun1)) objectives = np.array(objectives) return objectives + + +def mean_squared_error(predicted_dict, + measured_df, + species_list): + 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]) + aq_obj = (meas_aq - pred_aq)**2 + org_obj = (meas_org - pred_org)**2 + objs = np.concatenate([aq_obj, org_obj]) + obj = np.mean(objs) + return obj