mirror of https://github.com/ANL-CEEESA/LLEPE
parent
ac8067baf4
commit
159a5c8140
|
|
@ -0,0 +1,716 @@
|
||||
<ctml>
|
||||
<validate reactions="yes" species="yes" />
|
||||
|
||||
|
||||
<phase dim="3" id="PC88A_liquid">
|
||||
<elementArray datasrc="elementz.xml">
|
||||
Cl O H C P Nd Pr Ce La Dy Y Sm dummy
|
||||
</elementArray>
|
||||
<speciesArray datasrc="#species_PC88A_liquid">
|
||||
(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)
|
||||
</speciesArray>
|
||||
<state>
|
||||
<temperature units="K"> 298.15 </temperature>
|
||||
<pressure units="Pa"> 100000.0 </pressure>
|
||||
<soluteMolalities>
|
||||
(HA)2(org): 0.25
|
||||
</soluteMolalities>
|
||||
</state>
|
||||
<thermo model="IdealSolidSolution">
|
||||
<standardConc model="molar_volume" />
|
||||
</thermo>
|
||||
<standardConc model="molar_volume" />
|
||||
<transport model="None" />
|
||||
<kinetics model="none" />
|
||||
</phase>
|
||||
|
||||
|
||||
<speciesData id="species_PC88A_liquid">
|
||||
|
||||
|
||||
<species name="(HA)2(org)">
|
||||
<atomArray> C:16 H:35 O:3 P:1 </atomArray>
|
||||
<thermo>
|
||||
<const_cp Tmax="300.0" Tmin="298.0">
|
||||
<t0 units="K">298.14999999999998</t0>
|
||||
<h0 units="J/mol" updated="Updated at 9:15 7-14-2020">-394159.2206164294</h0>
|
||||
<s0 units="J/mol/K"> 558.9824 </s0>
|
||||
<cp0 units="J/mol/K"> 0.0</cp0>
|
||||
</const_cp>
|
||||
</thermo>
|
||||
<standardState model="constant_incompressible">
|
||||
<molarVolume updated="Updated at 21:02:32">0.320974226079</molarVolume>
|
||||
</standardState>
|
||||
</species>
|
||||
|
||||
|
||||
<species name="Nd(H(A)2)3(org)">
|
||||
<atomArray> C:48 H:102 O:9 P:3 Nd:1 </atomArray>
|
||||
<thermo>
|
||||
<const_cp Tmax="300.0" Tmin="298.0">
|
||||
<t0 units="K">298.14999999999998</t0>
|
||||
|
||||
<h0 units="J/mol" updated="Updated at 9:15 7-14-2020">-1978355.2881578554</h0>
|
||||
<s0 units="J/mol/K"> 1117.965 </s0>
|
||||
<cp0 units="J/mol/K">0.0</cp0>
|
||||
</const_cp>
|
||||
</thermo>
|
||||
<standardState model="constant_incompressible">
|
||||
<molarVolume updated="Updated at 21:02:32">0.973500071223</molarVolume>
|
||||
</standardState>
|
||||
</species>
|
||||
|
||||
|
||||
<species name="Pr(H(A)2)3(org)">
|
||||
<atomArray> C:48 H:102 O:9 P:3 Pr:1 </atomArray>
|
||||
<thermo>
|
||||
<const_cp Tmax="300.0" Tmin="298.0">
|
||||
<t0 units="K">298.14999999999998</t0>
|
||||
|
||||
<h0 units="J/mol" updated="Updated at 9:15 7-14-2020">-1987389.753778593</h0>
|
||||
<s0 units="J/mol/K"> 1117.965 </s0>
|
||||
<cp0 units="J/mol/K">0.0</cp0>
|
||||
</const_cp>
|
||||
</thermo>
|
||||
<standardState model="constant_incompressible">
|
||||
<molarVolume updated="Updated at 21:02:32">0.979936421078</molarVolume>
|
||||
</standardState>
|
||||
</species>
|
||||
|
||||
|
||||
|
||||
<species name="Ce(H(A)2)3(org)">
|
||||
<atomArray> C:48 H:102 O:9 P:3 Ce:1 </atomArray>
|
||||
<thermo>
|
||||
<const_cp Tmax="300.0" Tmin="298.0">
|
||||
<t0 units="K">298.14999999999998</t0>
|
||||
|
||||
<h0 units="J/mol" updated="Updated at 9:15 7-14-2020">-1979346.232242925</h0>
|
||||
<s0 units="J/mol/K"> 1117.965 </s0>
|
||||
<cp0 units="J/mol/K">0.0</cp0>
|
||||
</const_cp>
|
||||
</thermo>
|
||||
<standardState model="constant_incompressible">
|
||||
<molarVolume updated="Updated at 21:02:32">1.0060487218</molarVolume>
|
||||
</standardState>
|
||||
</species>
|
||||
|
||||
|
||||
|
||||
<species name="La(H(A)2)3(org)">
|
||||
<atomArray> C:48 H:102 O:9 P:3 La:1 </atomArray>
|
||||
<thermo>
|
||||
<const_cp Tmax="300.0" Tmin="298.0">
|
||||
<t0 units="K">298.14999999999998</t0>
|
||||
|
||||
<h0 units="J/mol" updated="Updated at 9:15 7-14-2020">-1979095.7087687952</h0>
|
||||
<s0 units="J/mol/K"> 1117.965 </s0>
|
||||
<cp0 units="J/mol/K">0.0</cp0>
|
||||
</const_cp>
|
||||
</thermo>
|
||||
<standardState model="constant_incompressible">
|
||||
<molarVolume updated="Updated at 21:02:32">0.981485801577</molarVolume>
|
||||
</standardState>
|
||||
</species>
|
||||
|
||||
|
||||
<species name="Dy(H(A)2)3(org)">
|
||||
<atomArray> C:48 H:102 O:9 P:3 Dy:1 </atomArray>
|
||||
<thermo>
|
||||
<const_cp Tmax="300.0" Tmin="298.0">
|
||||
<t0 units="K">298.14999999999998</t0>
|
||||
|
||||
<h0 units="J/mol" updated="Updated at 9:15 7-14-2020">-1979518.3587197603</h0>
|
||||
<s0 units="J/mol/K"> 1117.965 </s0>
|
||||
<cp0 units="J/mol/K">0.0</cp0>
|
||||
</const_cp>
|
||||
</thermo>
|
||||
<standardState model="constant_incompressible">
|
||||
<molarVolume updated="Updated at 21:02:32">0.961666360676</molarVolume>
|
||||
</standardState>
|
||||
</species>
|
||||
|
||||
|
||||
|
||||
<species name="Y(H(A)2)3(org)">
|
||||
<atomArray> C:48 H:102 O:9 P:3 Y:1 </atomArray>
|
||||
<thermo>
|
||||
<const_cp Tmax="300.0" Tmin="298.0">
|
||||
<t0 units="K">298.14999999999998</t0>
|
||||
|
||||
<h0 units="J/mol" updated="Updated at 9:15 7-14-2020">-1997266.6892106486</h0>
|
||||
<s0 units="J/mol/K"> 1117.965 </s0>
|
||||
<cp0 units="J/mol/K">0.0</cp0>
|
||||
</const_cp>
|
||||
</thermo>
|
||||
<standardState model="constant_incompressible">
|
||||
<molarVolume updated="Updated at 21:02:32">0.958888814485</molarVolume>
|
||||
</standardState>
|
||||
</species>
|
||||
|
||||
|
||||
|
||||
|
||||
<species name="Sm(H(A)2)3(org)">
|
||||
<atomArray> C:48 H:102 O:9 P:3 Sm:1 </atomArray>
|
||||
<thermo>
|
||||
<const_cp Tmax="300.0" Tmin="298.0">
|
||||
<t0 units="K">298.14999999999998</t0>
|
||||
|
||||
<h0 units="J/mol" updated="Updated at 9:15 7-14-2020">-1976678.5252282412</h0>
|
||||
<s0 units="J/mol/K"> 1117.965 </s0>
|
||||
<cp0 units="J/mol/K">0.0</cp0>
|
||||
</const_cp>
|
||||
</thermo>
|
||||
<standardState model="constant_incompressible">
|
||||
<molarVolume> 0.9642 </molarVolume>
|
||||
</standardState>
|
||||
</species>
|
||||
|
||||
|
||||
|
||||
<species name="Gd(H(A)2)3(org)">
|
||||
<atomArray> C:48 H:102 O:9 P:3 Gd:1 </atomArray>
|
||||
<thermo>
|
||||
<const_cp Tmax="300.0" Tmin="298.0">
|
||||
<t0 units="K">298.14999999999998</t0>
|
||||
|
||||
<h0 units="J/mol" updated="yep">-4829446.858</h0>
|
||||
<s0 units="J/mol/K"> 1117.965 </s0>
|
||||
<cp0 units="J/mol/K">0.0</cp0>
|
||||
</const_cp>
|
||||
</thermo>
|
||||
<standardState model="constant_incompressible">
|
||||
<molarVolume>0.9642</molarVolume>
|
||||
</standardState>
|
||||
</species>
|
||||
|
||||
|
||||
|
||||
<species name="dodecane">
|
||||
<atomArray> dummy:1 </atomArray>
|
||||
|
||||
<thermo>
|
||||
<const_cp Tmax="300.0" Tmin="298.0">
|
||||
<t0 units="K">298.14999999999998</t0>
|
||||
|
||||
<h0 units="J/mol"> 0.0 </h0>
|
||||
<s0 units="J/mol/K"> 0.0 </s0>
|
||||
<cp0 units="J/mol/K">0.0</cp0>
|
||||
</const_cp>
|
||||
</thermo>
|
||||
<standardState model="constant_incompressible">
|
||||
<molarVolume> 0.227113 </molarVolume>
|
||||
</standardState>
|
||||
</species>
|
||||
|
||||
</speciesData>
|
||||
|
||||
|
||||
|
||||
<phase dim="3" id="HCl_electrolyte">
|
||||
<speciesArray datasrc="#species_waterSolution">
|
||||
H2O(L) H+ OH- Cl- Nd+++ Pr+++ Ce+++ La+++ Dy+++ Sm+++ Y+++
|
||||
</speciesArray>
|
||||
|
||||
<state>
|
||||
<temperature units="K"> 298.15 </temperature>
|
||||
<pressure units="Pa"> 100000.0 </pressure>
|
||||
<soluteMolalities>
|
||||
Cl-: 1.0E-7
|
||||
H+: 1.0E-7
|
||||
</soluteMolalities>
|
||||
</state>
|
||||
|
||||
<thermo model="HMW">
|
||||
<standardConc model="solvent_volume" />
|
||||
<activityCoefficients TempModel="complex1" model="Pitzer">
|
||||
|
||||
<A_Debye model="water" />
|
||||
<ionicRadius default="3.042843" units="Angstroms">
|
||||
</ionicRadius>
|
||||
<binarySaltParameters anion="Cl-" cation="H+">
|
||||
<beta0> 0.177000779, 0.000125778, 0.0, -33.4777082, -0.262214535 </beta0>
|
||||
<beta1> 0.292922504, -0.027938838, 0.0, 3402.47027, 19.7936248 </beta1>
|
||||
<beta2> 0.0, 0.0, 0.0, 0.0, 0.0 </beta2>
|
||||
<Cphi> 0.000362, -0.00003036, 0.0, -2.91038E-11, 0.0 </Cphi>
|
||||
<Alpha1> 2 </Alpha1>
|
||||
<Alpha2> 12 </Alpha2>
|
||||
<source>
|
||||
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.
|
||||
</source>
|
||||
</binarySaltParameters>
|
||||
|
||||
<binarySaltParameters anion="Cl-" cation="Pr+++">
|
||||
<beta0 updated="Updated at 9:15 7-14-2020"> 0.5278102798121455, 0.0, 0.0, 0.0, 0.0 </beta0>
|
||||
<beta1 updated="Updated at 9:15 7-14-2020"> 4.785988176310507, 0.0, 0.0, 0.0, 0.0 </beta1>
|
||||
<beta2> 0.0, 0.0, 0.0, 0.0, 0.0 </beta2>
|
||||
<Cphi updated="Updated at 9:15 7-14-2020"> -0.020676879473540816, 0.0, 0.0, 0.0, 0.0 </Cphi>
|
||||
<Alpha1> 2 </Alpha1>
|
||||
<Alpha2> 0 </Alpha2>
|
||||
<source>
|
||||
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.
|
||||
</source>
|
||||
</binarySaltParameters>
|
||||
|
||||
<binarySaltParameters anion="Cl-" cation="Nd+++">
|
||||
<beta0 updated="Updated at 9:15 7-14-2020"> 0.7399759878872492, 0.0, 0.0, 0.0, 0.0 </beta0>
|
||||
<beta1 updated="Updated at 9:15 7-14-2020"> 7.792458219852443, 0.0, 0.0, 0.0, 0.0 </beta1>
|
||||
<beta2> 0.0, 0.0, 0.0, 0.0, 0.0 </beta2>
|
||||
<Cphi updated="Updated at 9:15 7-14-2020"> -0.01962062220167151, 0.0, 0.0, 0.0, 0.0 </Cphi>
|
||||
<Alpha1> 2 </Alpha1>
|
||||
<Alpha2> 0 </Alpha2>
|
||||
<source>
|
||||
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.
|
||||
</source>
|
||||
</binarySaltParameters>
|
||||
|
||||
<binarySaltParameters anion="Cl-" cation="La+++">
|
||||
<beta0 updated="Updated at 9:15 7-14-2020"> 0.5899801656939334, 0.0, 0.0, 0.0, 0.0 </beta0>
|
||||
<beta1 updated="Updated at 9:15 7-14-2020"> 5.2501373713255015, 0.0, 0.0, 0.0, 0.0 </beta1>
|
||||
<beta2> 0.0, 0.0, 0.0, 0.0, 0.0 </beta2>
|
||||
<Cphi updated="Updated at 9:15 7-14-2020"> -0.024346940036902652, 0.0, 0.0, 0.0, 0.0 </Cphi>
|
||||
<Alpha1> 2 </Alpha1>
|
||||
<Alpha2> 0 </Alpha2>
|
||||
<source>
|
||||
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.
|
||||
</source>
|
||||
</binarySaltParameters>
|
||||
|
||||
<binarySaltParameters anion="Cl-" cation="Dy+++">
|
||||
<beta0 updated="Updated at 9:15 7-14-2020"> 0.5596867100821611, 0.0, 0.0, 0.0, 0.0 </beta0>
|
||||
<beta1 updated="Updated at 9:15 7-14-2020"> 10.342085390765986, 0.0, 0.0, 0.0, 0.0 </beta1>
|
||||
<beta2> 0.0, 0.0, 0.0, 0.0, 0.0 </beta2>
|
||||
<Cphi updated="Updated at 9:15 7-14-2020"> -0.019685111861351003, 0.0, 0.0, 0.0, 0.0 </Cphi>
|
||||
<Alpha1> 2 </Alpha1>
|
||||
<Alpha2> 0 </Alpha2>
|
||||
<source>
|
||||
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.
|
||||
</source>
|
||||
</binarySaltParameters>
|
||||
|
||||
<binarySaltParameters anion="Cl-" cation="Ce+++">
|
||||
<beta0 updated="Updated at 9:15 7-14-2020"> 0.6810742399099214, 0.0, 0.0, 0.0, 0.0 </beta0>
|
||||
<beta1 updated="Updated at 9:15 7-14-2020"> 5.317778808636538, 0.0, 0.0, 0.0, 0.0 </beta1>
|
||||
<beta2> 0.0, 0.0, 0.0, 0.0, 0.0 </beta2>
|
||||
<Cphi updated="Updated at 9:15 7-14-2020"> -0.026217518942691358, 0.0, 0.0, 0.0, 0.0 </Cphi>
|
||||
<Alpha1> 2 </Alpha1>
|
||||
<Alpha2> 0 </Alpha2>
|
||||
<source>
|
||||
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.
|
||||
</source>
|
||||
</binarySaltParameters>
|
||||
|
||||
<binarySaltParameters anion="Cl-" cation="Y+++">
|
||||
<beta0 updated="Updated at 9:15 7-14-2020"> 0.8868493033190087, 0.0, 0.0, 0.0, 0.0 </beta0>
|
||||
<beta1 updated="Updated at 9:15 7-14-2020"> 9.868500461244988, 0.0, 0.0, 0.0, 0.0 </beta1>
|
||||
<beta2> 0.0, 0.0, 0.0, 0.0, 0.0 </beta2>
|
||||
<Cphi updated="Updated at 9:15 7-14-2020"> -0.03051604910307843, 0.0, 0.0, 0.0, 0.0 </Cphi>
|
||||
<Alpha1> 2 </Alpha1>
|
||||
<Alpha2> 0 </Alpha2>
|
||||
<source>
|
||||
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.
|
||||
</source>
|
||||
</binarySaltParameters>
|
||||
|
||||
<binarySaltParameters anion="Cl-" cation="Sm+++">
|
||||
<beta0 updated="Updated at 9:15 7-14-2020"> 0.5872950937394924, 0.0, 0.0, 0.0, 0.0 </beta0>
|
||||
<beta1 updated="Updated at 9:15 7-14-2020"> 6.850703030567289, 0.0, 0.0, 0.0, 0.0 </beta1>
|
||||
<beta2> 0.0, 0.0, 0.0, 0.0, 0.0 </beta2>
|
||||
<Cphi updated="Updated at 9:15 7-14-2020"> -0.020035536849683018, 0.0, 0.0, 0.0, 0.0 </Cphi>
|
||||
<Alpha1> 2 </Alpha1>
|
||||
<Alpha2> 0 </Alpha2>
|
||||
<source>
|
||||
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.
|
||||
</source>
|
||||
</binarySaltParameters>
|
||||
|
||||
|
||||
|
||||
</activityCoefficients>
|
||||
<solvent> H2O(L) </solvent>
|
||||
</thermo>
|
||||
|
||||
<elementArray datasrc="elementz.xml"> O H Nd Pr Ce La Dy Y Sm C N Cl P E </elementArray>
|
||||
<kinetics model="none">
|
||||
</kinetics>
|
||||
</phase>
|
||||
|
||||
<speciesData id="species_waterSolution">
|
||||
|
||||
<species name="H2O(L)">
|
||||
|
||||
<atomArray>H:2 O:1 </atomArray>
|
||||
<thermo>
|
||||
<NASA P0="100000.0" Tmax="600.0" Tmin="273.14999999999998">
|
||||
<floatArray name="coeffs" size="7">
|
||||
7.255750050E+01, -6.624454020E-01, 2.561987460E-03, -4.365919230E-06,
|
||||
2.781789810E-09, -4.188654990E+04, -2.882801370E+02
|
||||
</floatArray>
|
||||
</NASA>
|
||||
</thermo>
|
||||
<standardState model="waterPDSS">
|
||||
|
||||
<molarVolume> 0.018068 </molarVolume>
|
||||
</standardState>
|
||||
</species>
|
||||
|
||||
|
||||
<species name="OH-">
|
||||
<speciesChemFormula> OH- </speciesChemFormula>
|
||||
<atomArray> O:1 H:1 </atomArray>
|
||||
<charge> -1 </charge>
|
||||
<thermo model="HKFT">
|
||||
<HKFT Pref="1 atm" Tmax="625.15" Tmin="298.15">
|
||||
<DG0_f_Pr_Tr units="cal/gmol"> -37595 </DG0_f_Pr_Tr>
|
||||
<DH0_f_Pr_Tr units="cal/gmol"> -54977 </DH0_f_Pr_Tr>
|
||||
<S0_Pr_Tr units="cal/gmol/K"> -2.56 </S0_Pr_Tr>
|
||||
</HKFT>
|
||||
</thermo>
|
||||
<standardState model="HKFT">
|
||||
<a1 units="cal/gmol/bar"> 0.12527 </a1>
|
||||
<a2 units="cal/gmol"> 7.38 </a2>
|
||||
<a3 units="cal-K/gmol/bar"> 1.8423 </a3>
|
||||
<a4 units="cal-K/gmol"> -27821 </a4>
|
||||
<c1 units="cal/gmol/K"> 4.15 </c1>
|
||||
<c2 units="cal-K/gmol"> -103460 </c2>
|
||||
<omega_Pr_Tr units="cal/gmol"> 172460 </omega_Pr_Tr>
|
||||
<molarVolume units="cm3/mol"> -4.18 </molarVolume>
|
||||
</standardState>
|
||||
<source>
|
||||
ref:G9
|
||||
</source>
|
||||
</species>
|
||||
|
||||
<species name="NO3-">
|
||||
<speciesChemFormula> NO3- </speciesChemFormula>
|
||||
<atomArray> N:1 O:3 </atomArray>
|
||||
<charge> -1 </charge>
|
||||
<thermo model="HKFT">
|
||||
<HKFT Pref="1 atm" Tmax="625.15" Tmin="298.15">
|
||||
<DG0_f_Pr_Tr units="cal/gmol"> -26507 </DG0_f_Pr_Tr>
|
||||
<DH0_f_Pr_Tr units="cal/gmol"> -49429 </DH0_f_Pr_Tr>
|
||||
<S0_Pr_Tr units="cal/gmol/K"> 35.12 </S0_Pr_Tr>
|
||||
</HKFT>
|
||||
</thermo>
|
||||
<standardState model="HKFT">
|
||||
<a1 units="cal/gmol/bar"> 0.73161 </a1>
|
||||
<a2 units="cal/gmol"> 678.24 </a2>
|
||||
<a3 units="cal-K/gmol/bar"> -4.6838 </a3>
|
||||
<a4 units="cal-K/gmol"> -30594 </a4>
|
||||
<c1 units="cal/gmol/K"> 7.7 </c1>
|
||||
<c2 units="cal-K/gmol"> -67250 </c2>
|
||||
<omega_Pr_Tr units="cal/gmol"> 109770 </omega_Pr_Tr>
|
||||
<molarVolume units="cm3/mol"> 29.0 </molarVolume>
|
||||
</standardState>
|
||||
<source>
|
||||
ref:G9
|
||||
</source>
|
||||
</species>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<species name="Cl-">
|
||||
<speciesChemFormula> Cl- </speciesChemFormula>
|
||||
<atomArray> Cl:1 </atomArray>
|
||||
<charge> -1 </charge>
|
||||
<thermo model="HKFT">
|
||||
<HKFT Pref="1 atm" Tmax="625.15" Tmin="273.15">
|
||||
<DG0_f_Pr_Tr units="cal/gmol"> -31379 </DG0_f_Pr_Tr>
|
||||
<DH0_f_Pr_TR units="cal/gmol"> -39933 </DH0_f_Pr_TR>
|
||||
<S0_Pr_Tr units="cal/gmol/K"> 13.56 </S0_Pr_Tr>
|
||||
</HKFT>
|
||||
</thermo>
|
||||
<standardState model="HKFT">
|
||||
<a1 units="cal/mol/bar"> 0.4032 </a1>
|
||||
<a2 units="cal/mol"> 480.1 </a2>
|
||||
<a3 units="cal-K/mol/bar"> 5.563 </a3>
|
||||
<a4 units="cal-K/mol"> -28470 </a4>
|
||||
<c1 units="cal/mol/K"> -4.4 </c1>
|
||||
<c2 units="cal-K/mol"> -57140 </c2>
|
||||
<omega_Pr_Tr units="cal/mol"> 145600 </omega_Pr_Tr>
|
||||
<molarVolume units="cm3/mol"> 17.79 </molarVolume>
|
||||
</standardState>
|
||||
<source> ref:G9 </source>
|
||||
</species>
|
||||
|
||||
<species name="H+">
|
||||
<speciesChemFormula> H+ </speciesChemFormula>
|
||||
<atomArray> H:1 </atomArray>
|
||||
<charge> +1 </charge>
|
||||
<thermo model="HKFT">
|
||||
<HKFT Pref="1 atm" Tmax="625.15" Tmin="273.15">
|
||||
<DG0_f_Pr_Tr units="cal/gmol"> 0 </DG0_f_Pr_Tr>
|
||||
<DH0_f_Pr_TR units="cal/gmol"> 0 </DH0_f_Pr_TR>
|
||||
<S0_Pr_Tr units="cal/gmol/K"> 0 </S0_Pr_Tr>
|
||||
</HKFT>
|
||||
</thermo>
|
||||
<standardState model="HKFT">
|
||||
<a1 units="cal/mol/bar"> 0 </a1>
|
||||
<a2 units="cal/mol"> 0 </a2>
|
||||
<a3 units="cal-K/mol/bar"> 0 </a3>
|
||||
<a4 units="cal-K/mol"> 0 </a4>
|
||||
<c1 units="cal/mol/K"> 0 </c1>
|
||||
<c2 units="cal-K/mol"> 0 </c2>
|
||||
<omega_Pr_Tr units="cal/mol"> 0 </omega_Pr_Tr>
|
||||
<molarVolume units="cm3/mol"> 0 </molarVolume>
|
||||
</standardState>
|
||||
<source> ref:G9 </source>
|
||||
</species>
|
||||
|
||||
|
||||
<species name="Nd+++">
|
||||
<speciesChemFormula> Nd+++ </speciesChemFormula>
|
||||
<atomArray> Nd:1 </atomArray>
|
||||
<charge> +3 </charge>
|
||||
<thermo model="HKFT">
|
||||
<HKFT Pref="1 atm" Tmax="625.15" Tmin="298.15">
|
||||
<DG0_f_Pr_Tr units="cal/gmol"> -160600 </DG0_f_Pr_Tr>
|
||||
<DH0_f_Pr_Tr units="cal/gmol"> -166500 </DH0_f_Pr_Tr>
|
||||
<S0_Pr_Tr units="cal/gmol/K"> -49.5 </S0_Pr_Tr>
|
||||
</HKFT>
|
||||
</thermo>
|
||||
<standardState model="HKFT">
|
||||
<a1 units="cal/gmol/bar"> -0.33707 </a1>
|
||||
<a2 units="cal/gmol"> -1454.52 </a2>
|
||||
<a3 units="cal-K/gmol/bar"> 8.3211 </a3>
|
||||
<a4 units="cal-K/gmol"> -21777 </a4>
|
||||
<c1 units="cal/gmol/K"> 1.6236 </c1>
|
||||
<c2 units="cal-K/gmol"> -118344 </c2>
|
||||
<omega_Pr_Tr units="cal/gmol"> 225500 </omega_Pr_Tr>
|
||||
<molarVolume units="cm3/mol"> -43.1 </molarVolume>
|
||||
</standardState>
|
||||
<source>
|
||||
ref:G9
|
||||
</source>
|
||||
</species>
|
||||
|
||||
<species name="Pr+++">
|
||||
<speciesChemFormula> Pr+++ </speciesChemFormula>
|
||||
<atomArray> Pr:1 </atomArray>
|
||||
<charge> +3 </charge>
|
||||
<thermo model="HKFT">
|
||||
<HKFT Pref="1 atm" Tmax="625.15" Tmin="298.15">
|
||||
<DG0_f_Pr_Tr units="cal/gmol"> -162600 </DG0_f_Pr_Tr>
|
||||
<DH0_f_Pr_Tr units="cal/gmol"> -168800 </DH0_f_Pr_Tr>
|
||||
<S0_Pr_Tr units="cal/gmol/K"> -50 </S0_Pr_Tr>
|
||||
</HKFT>
|
||||
</thermo>
|
||||
<standardState model="HKFT">
|
||||
<a1 units="cal/gmol/bar"> -0.32406 </a1>
|
||||
<a2 units="cal/gmol"> -1419.98 </a2>
|
||||
<a3 units="cal-K/gmol/bar"> 8.1257 </a3>
|
||||
<a4 units="cal-K/gmol"> -21920 </a4>
|
||||
<c1 units="cal/gmol/K"> -1.1975 </c1>
|
||||
<c2 units="cal-K/gmol"> -127511 </c2>
|
||||
<omega_Pr_Tr units="cal/gmol"> 223500 </omega_Pr_Tr>
|
||||
<molarVolume units="cm3/mol"> -42.1 </molarVolume>
|
||||
</standardState>
|
||||
<source>
|
||||
ref:G9
|
||||
</source>
|
||||
</species>
|
||||
|
||||
|
||||
<species name="Ce+++">
|
||||
<speciesChemFormula> Ce+++ </speciesChemFormula>
|
||||
<atomArray> Ce:1 </atomArray>
|
||||
<charge> +3 </charge>
|
||||
<thermo model="HKFT">
|
||||
<HKFT Pref="1 atm" Tmax="625.15" Tmin="298.15">
|
||||
<DG0_f_Pr_Tr units="cal/gmol"> -161600 </DG0_f_Pr_Tr>
|
||||
<DH0_f_Pr_Tr units="cal/gmol"> -167400 </DH0_f_Pr_Tr>
|
||||
<S0_Pr_Tr units="cal/gmol/K"> -49 </S0_Pr_Tr>
|
||||
</HKFT>
|
||||
</thermo>
|
||||
<standardState model="HKFT">
|
||||
<a1 units="cal/gmol/bar"> -0.29292 </a1>
|
||||
<a2 units="cal/gmol"> -1493.38 </a2>
|
||||
<a3 units="cal-K/gmol/bar"> 11.6196 </a3>
|
||||
<a4 units="cal-K/gmol"> -21616 </a4>
|
||||
<c1 units="cal/gmol/K"> 4.0445 </c1>
|
||||
<c2 units="cal-K/gmol"> -108974 </c2>
|
||||
<omega_Pr_Tr units="cal/gmol"> 222510 </omega_Pr_Tr>
|
||||
<molarVolume units="cm3/mol"> -39.8 </molarVolume>
|
||||
</standardState>
|
||||
<source>
|
||||
ref:G9
|
||||
</source>
|
||||
</species>
|
||||
|
||||
|
||||
<species name="La+++">
|
||||
<speciesChemFormula> La+++ </speciesChemFormula>
|
||||
<atomArray> La:1 </atomArray>
|
||||
<charge> +3 </charge>
|
||||
<thermo model="HKFT">
|
||||
<HKFT Pref="1 atm" Tmax="625.15" Tmin="298.15">
|
||||
<DG0_f_Pr_Tr units="cal/gmol"> -164000 </DG0_f_Pr_Tr>
|
||||
<DH0_f_Pr_Tr units="cal/gmol"> -169600 </DH0_f_Pr_Tr>
|
||||
<S0_Pr_Tr units="cal/gmol/K"> -52 </S0_Pr_Tr>
|
||||
</HKFT>
|
||||
</thermo>
|
||||
<standardState model="HKFT">
|
||||
<a1 units="cal/gmol/bar"> -0.2788 </a1>
|
||||
<a2 units="cal/gmol"> -1438.24 </a2>
|
||||
<a3 units="cal-K/gmol/bar"> 10.9602 </a3>
|
||||
<a4 units="cal-K/gmol"> -21844 </a4>
|
||||
<c1 units="cal/gmol/K"> 4.2394 </c1>
|
||||
<c2 units="cal-K/gmol"> -106122 </c2>
|
||||
<omega_Pr_Tr units="cal/gmol"> 215720 </omega_Pr_Tr>
|
||||
<molarVolume units="cm3/mol"> -38.6 </molarVolume>
|
||||
</standardState>
|
||||
<source>
|
||||
ref:G9
|
||||
</source>
|
||||
</species>
|
||||
|
||||
|
||||
|
||||
<species name="Dy+++">
|
||||
<speciesChemFormula> Dy+++ </speciesChemFormula>
|
||||
<atomArray> Dy:1 </atomArray>
|
||||
<charge> +3 </charge>
|
||||
<thermo model="HKFT">
|
||||
<HKFT Pref="1 atm" Tmax="625.15" Tmin="298.15">
|
||||
<DG0_f_Pr_Tr units="cal/gmol"> -158700 </DG0_f_Pr_Tr>
|
||||
<DH0_f_Pr_Tr units="cal/gmol"> -166500 </DH0_f_Pr_Tr>
|
||||
<S0_Pr_Tr units="cal/gmol/K"> -55.2 </S0_Pr_Tr>
|
||||
</HKFT>
|
||||
</thermo>
|
||||
<standardState model="HKFT">
|
||||
<a1 units="cal/gmol/bar"> -0.30003 </a1>
|
||||
<a2 units="cal/gmol"> -1510.74 </a2>
|
||||
<a3 units="cal-K/gmol/bar"> 11.6879 </a3>
|
||||
<a4 units="cal-K/gmol"> -21545 </a4>
|
||||
<c1 units="cal/gmol/K"> 9.5076 </c1>
|
||||
<c2 units="cal-K/gmol"> -94919 </c2>
|
||||
<omega_Pr_Tr units="cal/gmol"> 237920 </omega_Pr_Tr>
|
||||
<molarVolume units="cm3/mol"> -40.7 </molarVolume>
|
||||
</standardState>
|
||||
<source>
|
||||
ref:G9
|
||||
</source>
|
||||
</species>
|
||||
|
||||
|
||||
<species name="Y+++">
|
||||
<speciesChemFormula> Y+++ </speciesChemFormula>
|
||||
<atomArray> Y:1 </atomArray>
|
||||
<charge> +3 </charge>
|
||||
<thermo model="HKFT">
|
||||
<HKFT Pref="1 atm" Tmax="625.15" Tmin="298.15">
|
||||
<DG0_f_Pr_Tr units="cal/gmol"> -163800 </DG0_f_Pr_Tr>
|
||||
<DH0_f_Pr_Tr units="cal/gmol"> -170900 </DH0_f_Pr_Tr>
|
||||
<S0_Pr_Tr units="cal/gmol/K"> -60 </S0_Pr_Tr>
|
||||
</HKFT>
|
||||
</thermo>
|
||||
<standardState model="HKFT">
|
||||
<a1 units="cal/gmol/bar"> -0.30140 </a1>
|
||||
<a2 units="cal/gmol"> -1514.08 </a2>
|
||||
<a3 units="cal-K/gmol/bar"> 11.7010 </a3>
|
||||
<a4 units="cal-K/gmol"> -21531 </a4>
|
||||
<c1 units="cal/gmol/K"> 7.1634 </c1>
|
||||
<c2 units="cal-K/gmol"> -103067 </c2>
|
||||
<omega_Pr_Tr units="cal/gmol"> 237920 </omega_Pr_Tr>
|
||||
<molarVolume units="cm3/mol"> -40.8 </molarVolume>
|
||||
</standardState>
|
||||
<source>
|
||||
ref:G9
|
||||
</source>
|
||||
</species>
|
||||
|
||||
|
||||
|
||||
<species name="Sm+++">
|
||||
<speciesChemFormula> Sm+++ </speciesChemFormula>
|
||||
<atomArray> Sm:1 </atomArray>
|
||||
<charge> +3 </charge>
|
||||
<thermo model="HKFT">
|
||||
<HKFT Pref="1 atm" Tmax="625.15" Tmin="298.15">
|
||||
<DG0_f_Pr_Tr units="cal/gmol"> -159100 </DG0_f_Pr_Tr>
|
||||
<DH0_f_Pr_Tr units="cal/gmol"> -165200 </DH0_f_Pr_Tr>
|
||||
<S0_Pr_Tr units="cal/gmol/K"> -50.7 </S0_Pr_Tr>
|
||||
</HKFT>
|
||||
</thermo>
|
||||
<standardState model="HKFT">
|
||||
<a1 units="cal/gmol/bar"> -0.32065 </a1>
|
||||
<a2 units="cal/gmol"> -1561.08 </a2>
|
||||
<a3 units="cal-K/gmol/bar"> 11.8857 </a3>
|
||||
<a4 units="cal-K/gmol"> -21337 </a4>
|
||||
<c1 units="cal/gmol/K"> 1.9385 </c1>
|
||||
<c2 units="cal-K/gmol"> -118548 </c2>
|
||||
<omega_Pr_Tr units="cal/gmol"> 229550 </omega_Pr_Tr>
|
||||
</standardState>
|
||||
<source>
|
||||
ref:G9
|
||||
</source>
|
||||
</species>
|
||||
|
||||
|
||||
|
||||
<species name="Gd+++">
|
||||
<speciesChemFormula> Gd+++ </speciesChemFormula>
|
||||
<atomArray> Gd:1 </atomArray>
|
||||
<charge> +3 </charge>
|
||||
<thermo model="HKFT">
|
||||
<HKFT Pref="1 atm" Tmax="625.15" Tmin="298.15">
|
||||
<DG0_f_Pr_Tr units="cal/gmol"> -158600 </DG0_f_Pr_Tr>
|
||||
<DH0_f_Pr_Tr units="cal/gmol"> -164200 </DH0_f_Pr_Tr>
|
||||
<S0_Pr_Tr units="cal/gmol/K"> -49.2 </S0_Pr_Tr>
|
||||
</HKFT>
|
||||
</thermo>
|
||||
<standardState model="HKFT">
|
||||
<a1 units="cal/gmol/bar"> -0.29771 </a1>
|
||||
<a2 units="cal/gmol"> -1505.06 </a2>
|
||||
<a3 units="cal-K/gmol/bar"> 11.6656 </a3>
|
||||
<a4 units="cal-K/gmol"> -21568 </a4>
|
||||
<c1 units="cal/gmol/K"> 6.5606 </c1>
|
||||
<c2 units="cal-K/gmol"> -103474 </c2>
|
||||
<omega_Pr_Tr units="cal/gmol"> 232650 </omega_Pr_Tr>
|
||||
</standardState>
|
||||
<source>
|
||||
ref:G9
|
||||
</source>
|
||||
</species>
|
||||
|
||||
|
||||
|
||||
|
||||
</speciesData>
|
||||
|
||||
</ctml>
|
@ -0,0 +1,194 @@
|
||||
from scipy.optimize import curve_fit
|
||||
import llepe
|
||||
import pandas as pd
|
||||
import numpy as np
|
||||
import json
|
||||
|
||||
|
||||
def linear(x, a, b):
|
||||
return a * x + b
|
||||
|
||||
|
||||
species_list = 'Nd,Pr,Ce,La,Dy,Sm,Y'.split(',')
|
||||
pitzer_param_list = ['beta0', 'beta1', 'Cphi']
|
||||
meas_pitzer_param_df = pd.read_csv("../../data/csvs/may_pitzer_params.csv")
|
||||
labeled_data = pd.read_csv("../../data/csvs/"
|
||||
"zeroes_removed_PC88A_HCL_NdPrCeLaDySmY.csv")
|
||||
exp_data = labeled_data.drop(labeled_data.columns[0], axis=1)
|
||||
xml_file = "PC88A_HCL_NdPrCeLaDySmY_w_pitzer.xml"
|
||||
eps = 1e-4
|
||||
mini_eps = 1e-8
|
||||
x_guesses = [[-5178500.0, -1459500.0],
|
||||
[-5178342.857142857, -1460300.0],
|
||||
[-5178342.857142857, -1459500.0],
|
||||
[-5178342.857142857, -1458300.0],
|
||||
[-5178185.714285715, -1459900.0],
|
||||
[-5178185.714285715, -1459500.0],
|
||||
[-5178185.714285715, -1459100.0],
|
||||
[-5178185.714285715, -1458300.0],
|
||||
[-5178028.571428572, -1459900.0],
|
||||
[-5178028.571428572, -1459100.0],
|
||||
[-5178028.571428572, -1458300.0],
|
||||
[-5177557.142857143, -1459900.0],
|
||||
[-5177400.0, -1460300.0]]
|
||||
pitzer_guess_df = meas_pitzer_param_df.copy()
|
||||
ignore_list = []
|
||||
optimizer = 'scipy_minimize'
|
||||
output_dict = {'iter': [0],
|
||||
'best_obj': [1e20],
|
||||
'rel_diff': [1e20]}
|
||||
for species in species_list:
|
||||
output_dict['{0}_slope'.format(species)] = [1e20]
|
||||
output_dict['{0}_intercept'.format(species)] = [1e20]
|
||||
for pitzer_param in pitzer_param_list:
|
||||
output_dict['{0}_{1}'.format(species, pitzer_param)] = [1e20]
|
||||
i = 0
|
||||
rel_diff = 1000
|
||||
while rel_diff > 1e-4:
|
||||
i += 1
|
||||
best_obj = 1e20
|
||||
output_dict['iter'].append(i)
|
||||
for species in species_list:
|
||||
lower_species = species.lower()
|
||||
opt_values = {
|
||||
'(HA)2(org)_h0': [],
|
||||
'{0}(H(A)2)3(org)_h0'.format(species): [],
|
||||
'beta0': [],
|
||||
'beta1': [],
|
||||
'Cphi': [],
|
||||
'obj_value': [],
|
||||
'guess': []}
|
||||
for x_guess in x_guesses:
|
||||
info_dict = {'(HA)2(org)_h0': {'upper_element_name': 'species',
|
||||
'upper_attrib_name': 'name',
|
||||
'upper_attrib_value': '(HA)2(org)',
|
||||
'lower_element_name': 'h0',
|
||||
'lower_attrib_name': None,
|
||||
'lower_attrib_value': None,
|
||||
'input_format': '{0}',
|
||||
'input_value': x_guess[1]},
|
||||
'{0}(H(A)2)3(org)_h0'.format(species): {
|
||||
'upper_element_name': 'species',
|
||||
'upper_attrib_name': 'name',
|
||||
'upper_attrib_value': '{0}(H(A)2)3(org)'.format(
|
||||
species),
|
||||
'lower_element_name': 'h0',
|
||||
'lower_attrib_name': None,
|
||||
'lower_attrib_value': None,
|
||||
'input_format': '{0}',
|
||||
'input_value': x_guess[0]},
|
||||
}
|
||||
for pitzer_param in pitzer_param_list:
|
||||
if '{0}_{1}'.format(species, pitzer_param) not in ignore_list:
|
||||
pitzer_row = pitzer_guess_df[
|
||||
pitzer_guess_df['species'] == species]
|
||||
inner_dict = {'upper_element_name': 'binarySaltParameters',
|
||||
'upper_attrib_name': 'cation',
|
||||
'upper_attrib_value':
|
||||
'{0}+++'.format(species),
|
||||
'lower_element_name': pitzer_param,
|
||||
'lower_attrib_name': None,
|
||||
'lower_attrib_value': None,
|
||||
'input_format': ' {0}, 0.0, 0.0, 0.0, 0.0 ',
|
||||
'input_value':
|
||||
pitzer_row[pitzer_param].values[0]
|
||||
}
|
||||
info_dict['{0}_{1}'.format(
|
||||
species, pitzer_param)] = inner_dict
|
||||
llepe_params = {
|
||||
'exp_data': exp_data,
|
||||
'phases_xml_filename': xml_file,
|
||||
'opt_dict': info_dict,
|
||||
'phase_names': ['HCl_electrolyte', 'PC88A_liquid'],
|
||||
'aq_solvent_name': 'H2O(L)',
|
||||
'extractant_name': '(HA)2(org)',
|
||||
'diluant_name': 'dodecane',
|
||||
'complex_names': ['{0}(H(A)2)3(org)'.format(species)],
|
||||
'extracted_species_ion_names': ['{0}+++'.format(species)],
|
||||
'aq_solvent_rho': 1000.0,
|
||||
'extractant_rho': 960.0,
|
||||
'diluant_rho': 750.0,
|
||||
'objective_function': llepe.lmse_perturbed_obj,
|
||||
'optimizer': optimizer
|
||||
}
|
||||
estimator = llepe.LLEPE(**llepe_params)
|
||||
estimator.update_xml(llepe_params['opt_dict'])
|
||||
obj_kwargs = {'species_list': [species], 'epsilon': 1e-100}
|
||||
bounds = [(1e-1, 1e1)] * len(info_dict)
|
||||
optimizer_kwargs = {"method": 'l-bfgs-b',
|
||||
"bounds": bounds}
|
||||
opt_dict, obj_value = estimator.fit(
|
||||
objective_kwargs=obj_kwargs,
|
||||
optimizer_kwargs=optimizer_kwargs)
|
||||
if obj_value < best_obj:
|
||||
best_obj = obj_value
|
||||
keys = list(opt_dict.keys())
|
||||
info1 = [opt_dict[key]['input_value'] for key in keys]
|
||||
info1.append(obj_value)
|
||||
info1.append(x_guess)
|
||||
opt_values_keys = opt_values.keys()
|
||||
for ind, key in enumerate(opt_values_keys):
|
||||
opt_values[key].append(info1[ind])
|
||||
opt_value_df = pd.DataFrame(opt_values)
|
||||
p_opt, p_cov = curve_fit(linear,
|
||||
opt_value_df['(HA)2(org)_h0'].values,
|
||||
opt_value_df['{0}(H(A)2)3(org)_h0'.format(
|
||||
species)].values)
|
||||
slope, intercept = p_opt
|
||||
output_dict['{0}_slope'.format(species)].append(slope)
|
||||
output_dict['{0}_intercept'.format(species)].append(intercept)
|
||||
min_h0_df = opt_value_df[
|
||||
opt_value_df['(HA)2(org)_h0']
|
||||
== opt_value_df['(HA)2(org)_h0'].min()]
|
||||
update_pitzer_dict = {}
|
||||
for pitzer_param in pitzer_param_list:
|
||||
key_name = '{0}_{1}'.format(species, pitzer_param)
|
||||
output_dict[key_name].append(min_h0_df[pitzer_param].values[0])
|
||||
|
||||
inner_dict = {'upper_element_name': 'binarySaltParameters',
|
||||
'upper_attrib_name': 'cation',
|
||||
'upper_attrib_value':
|
||||
'{0}+++'.format(species),
|
||||
'lower_element_name': pitzer_param,
|
||||
'lower_attrib_name': None,
|
||||
'lower_attrib_value': None,
|
||||
'input_format': ' {0}, 0.0, 0.0, 0.0, 0.0 ',
|
||||
'input_value':
|
||||
min_h0_df[pitzer_param].values[0]
|
||||
}
|
||||
update_pitzer_dict['{0}_{1}'.format(
|
||||
species, pitzer_param)] = inner_dict
|
||||
estimator.update_xml(update_pitzer_dict)
|
||||
|
||||
pitzer_guess_dict = {'species': [],
|
||||
'beta0': [],
|
||||
'beta1': [],
|
||||
'Cphi': []}
|
||||
for species in species_list:
|
||||
pitzer_guess_dict['species'].append(species)
|
||||
for pitzer_param in pitzer_param_list:
|
||||
value_list = output_dict['{0}_{1}'.format(species, pitzer_param)]
|
||||
value = value_list[-1]
|
||||
pitzer_guess_dict[pitzer_param].append(value)
|
||||
if i > 2:
|
||||
mini_rel_diff1 = np.abs(value_list[-1]
|
||||
- value_list[-2])/(
|
||||
np.abs(value_list[-2]))
|
||||
mini_rel_diff2 = np.abs(value_list[-2] - value_list[-3]) / (
|
||||
np.abs(value_list[-3]))
|
||||
if mini_rel_diff1 < mini_eps and mini_rel_diff2 < mini_eps:
|
||||
ignore_list.append('{0}_{1}'.format(species, pitzer_param))
|
||||
pitzer_guess_df = pd.DataFrame(pitzer_guess_dict)
|
||||
|
||||
output_dict['best_obj'].append(best_obj)
|
||||
output_df = pd.DataFrame(output_dict)
|
||||
old_row = output_df.iloc[-2, :].values[3:]
|
||||
new_row = output_df.iloc[-1, :].values[3:]
|
||||
rel_diff = np.sum(np.abs(new_row - old_row)/np.abs(old_row))
|
||||
output_dict['rel_diff'].append(rel_diff)
|
||||
output_df = pd.DataFrame(output_dict)
|
||||
output_df.to_csv('outputs/iterative_fitter_output_df.csv')
|
||||
|
||||
|
||||
|
||||
|
@ -1,2 +1,4 @@
|
||||
from .llepe import LLEPE
|
||||
from .utils import get_xml_value, set_size
|
||||
from .optimizers import *
|
||||
from .objectives import *
|
@ -0,0 +1,59 @@
|
||||
import numpy as np
|
||||
import pandas as pd
|
||||
|
||||
|
||||
def lmse_perturbed_obj(predicted_dict,
|
||||
measured_df,
|
||||
species_list,
|
||||
epsilon=1e-100):
|
||||
meas_aq = np.concatenate([measured_df['{0}_aq_eq'.format(species)].values
|
||||
for species in species_list])
|
||||
pred_aq = np.concatenate([
|
||||
predicted_dict['{0}_aq_eq'.format(species)]
|
||||
for species in species_list])
|
||||
|
||||
meas_d = np.concatenate([measured_df['{0}_d_eq'.format(species)].values
|
||||
for species in species_list])
|
||||
pred_d = np.concatenate([
|
||||
predicted_dict['{0}_d_eq'.format(species)]
|
||||
for species in species_list])
|
||||
|
||||
meas_org = meas_aq * meas_d
|
||||
pred_org = np.concatenate([
|
||||
predicted_dict['{0}_org_eq'.format(species)]
|
||||
for species in species_list])
|
||||
|
||||
perturbed_pred_d = (pred_org + epsilon) / (pred_aq + epsilon)
|
||||
perturbed_meas_d = (meas_org + epsilon) / (meas_aq + epsilon)
|
||||
log_pred_d = np.log10(perturbed_pred_d)
|
||||
log_meas_d = np.log10(perturbed_meas_d)
|
||||
|
||||
fun4 = (log_meas_d - log_pred_d) ** 2
|
||||
obj = np.mean(fun4)
|
||||
return obj
|
||||
|
||||
|
||||
def ind_lmse_perturbed_obj(predicted_dict,
|
||||
measured_df,
|
||||
species_list,
|
||||
epsilon=1e-100):
|
||||
pred_df = pd.DataFrame(predicted_dict)
|
||||
objectives = []
|
||||
for i in range(len(pred_df)):
|
||||
pred_aq = pred_df[['{0}_aq_eq'.format(species)
|
||||
for species in species_list]].values[i]
|
||||
pred_org = pred_df[['{0}_org_eq'.format(species)
|
||||
for species in species_list]].values[i]
|
||||
meas_aq = measured_df[['{0}_aq_eq'.format(species)
|
||||
for species in species_list]].values[i]
|
||||
meas_d = measured_df[['{0}_d_eq'.format(species)
|
||||
for species in species_list]].values[i]
|
||||
meas_org = meas_aq * meas_d
|
||||
perturbed_pred_d = (pred_org + epsilon) / (pred_aq + epsilon)
|
||||
perturbed_meas_d = (meas_org + epsilon) / (meas_aq + epsilon)
|
||||
log_pred_d = np.log10(perturbed_pred_d)
|
||||
log_meas_d = np.log10(perturbed_meas_d)
|
||||
fun1 = (log_meas_d - log_pred_d) ** 2
|
||||
objectives.append(np.mean(fun1))
|
||||
objectives = np.array(objectives)
|
||||
return objectives
|
@ -0,0 +1,39 @@
|
||||
import scipy.optimize as scipy_opt
|
||||
from scipy.optimize import minimize
|
||||
import skopt
|
||||
|
||||
def dual_anneal_optimizer(objective, x_guess):
|
||||
bounds = [(1e-1, 1e1)] * len(x_guess)
|
||||
bounds[1] = (1e-1, 2)
|
||||
res = scipy_opt.dual_annealing(objective,
|
||||
[(1e-1, 1e1)]*len(x_guess),
|
||||
x0=x_guess)
|
||||
est_parameters = res.x
|
||||
return est_parameters, res.fun
|
||||
|
||||
|
||||
def diff_evo_optimizer(objective, x_guess):
|
||||
bounds = [(1e-1, 1e1)] * len(x_guess)
|
||||
bounds[1] = (1e-1, 2)
|
||||
res = scipy_opt.differential_evolution(objective,
|
||||
bounds)
|
||||
est_parameters = res.x
|
||||
return est_parameters, res.fun
|
||||
|
||||
|
||||
def forest_lbfgsb_optimizer(objective, x_guess):
|
||||
x_guess = list(x_guess)
|
||||
bounds = [(1e-1, 1e1)]*len(x_guess)
|
||||
bounds[1] = (1e-1, 2)
|
||||
res = skopt.forest_minimize(objective,
|
||||
bounds,
|
||||
random_state=1,
|
||||
acq_func='LCB',
|
||||
n_random_starts=30,
|
||||
x0=x_guess,
|
||||
xi=1e-4)
|
||||
x_guess = res.x
|
||||
optimizer_kwargs = {"method": 'l-bfgs-b',
|
||||
"bounds": bounds}
|
||||
res = minimize(objective, x_guess, **optimizer_kwargs)
|
||||
return res.x, res.fun
|
Loading…
Reference in new issue