|
|
|
@ -4,53 +4,88 @@
|
|
|
|
|
"cell_type": "markdown",
|
|
|
|
|
"metadata": {},
|
|
|
|
|
"source": [
|
|
|
|
|
"# REEPS Tutorial - Getting started\n",
|
|
|
|
|
"# LLEPE Tutorial - Getting started\n",
|
|
|
|
|
"## Introduction\n",
|
|
|
|
|
"In this notebook, you will learn how to use REEPS to fit thermodynamic parameters to experimental data and explore how well the parameters fit.\n",
|
|
|
|
|
"In this notebook, you will learn how to use LLEPE to fit thermodynamic parameters to experimental data and explore how well the parameters fit.\n",
|
|
|
|
|
"## Installation\n",
|
|
|
|
|
"Create a conda environment with the following command. The environment name in this example is \"thermo_env\". <br/> \n",
|
|
|
|
|
"```$ conda create --name thermo_env python=3.7```<br/>\n",
|
|
|
|
|
"Then run the following line to activate the environment"
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"cell_type": "markdown",
|
|
|
|
|
"metadata": {},
|
|
|
|
|
"source": [
|
|
|
|
|
"```$ conda activate thermo_env```"
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"cell_type": "markdown",
|
|
|
|
|
"metadata": {},
|
|
|
|
|
"source": [
|
|
|
|
|
"In your terminal run<br/>\n",
|
|
|
|
|
"```$ git clone https://xgitlab.cels.anl.gov/summer-2020/parameter-estimation.git```<br/>\n",
|
|
|
|
|
"Navigate into the folder with <br/>\n",
|
|
|
|
|
"```$ cd parameter-estimation```<br/>\n",
|
|
|
|
|
"And run <br/>\n",
|
|
|
|
|
"```pip install -e.```<br/>\n",
|
|
|
|
|
"\n"
|
|
|
|
|
"```pip install -e.```<br/>"
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"cell_type": "markdown",
|
|
|
|
|
"metadata": {},
|
|
|
|
|
"source": [
|
|
|
|
|
"## Import and instantiate REEPS"
|
|
|
|
|
"## Import and instantiate LLEPE"
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"cell_type": "markdown",
|
|
|
|
|
"metadata": {},
|
|
|
|
|
"source": [
|
|
|
|
|
"First, you will need to import the package and instantiate REEPS with a few parameters."
|
|
|
|
|
"First, you will need to import the package and instantiate LLEPE with a few parameters."
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"cell_type": "code",
|
|
|
|
|
"execution_count": 1,
|
|
|
|
|
"metadata": {},
|
|
|
|
|
"outputs": [],
|
|
|
|
|
"outputs": [
|
|
|
|
|
{
|
|
|
|
|
"ename": "ModuleNotFoundError",
|
|
|
|
|
"evalue": "No module named 'llepe'",
|
|
|
|
|
"output_type": "error",
|
|
|
|
|
"traceback": [
|
|
|
|
|
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
|
|
|
|
|
"\u001b[0;31mModuleNotFoundError\u001b[0m Traceback (most recent call last)",
|
|
|
|
|
"\u001b[0;32m<ipython-input-1-2c8cdd51efc7>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0;32mfrom\u001b[0m \u001b[0mllepe\u001b[0m \u001b[0;32mimport\u001b[0m \u001b[0mLLEPE\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 2\u001b[0m opt_dict = {'Nd(H(A)2)3(org)_h0': {'upper_element_name': 'species',\n\u001b[1;32m 3\u001b[0m \u001b[0;34m'upper_attrib_name'\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0;34m'name'\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 4\u001b[0m \u001b[0;34m'upper_attrib_value'\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0;34m'Nd(H(A)2)3(org)'\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 5\u001b[0m \u001b[0;34m'lower_element_name'\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0;34m'h0'\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
|
|
|
|
"\u001b[0;31mModuleNotFoundError\u001b[0m: No module named 'llepe'"
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
"source": [
|
|
|
|
|
"from reeps import REEPS\n",
|
|
|
|
|
"searcher_parameters = {'exp_csv_filename': '../../data/csvs/Nd_exp_data.csv',\n",
|
|
|
|
|
"from llepe import LLEPE\n",
|
|
|
|
|
"opt_dict = {'Nd(H(A)2)3(org)_h0': {'upper_element_name': 'species',\n",
|
|
|
|
|
" 'upper_attrib_name': 'name',\n",
|
|
|
|
|
" 'upper_attrib_value': 'Nd(H(A)2)3(org)',\n",
|
|
|
|
|
" 'lower_element_name': 'h0',\n",
|
|
|
|
|
" 'lower_attrib_name': None,\n",
|
|
|
|
|
" 'lower_attrib_value': None,\n",
|
|
|
|
|
" 'input_format': '{0}',\n",
|
|
|
|
|
" 'input_value': -4.7e6}}\n",
|
|
|
|
|
"llepe_parameters = {'exp_csv_filename': '../../data/csvs/Nd_exp_data.csv',\n",
|
|
|
|
|
" 'phases_xml_filename': '../../data/xmls/twophase.xml',\n",
|
|
|
|
|
" 'opt_dict': {'Nd(H(A)2)3(org)': {'h0': -4.7e6}},\n",
|
|
|
|
|
" 'opt_dict': opt_dict,\n",
|
|
|
|
|
" 'phase_names': ['HCl_electrolyte', 'PC88A_liquid'],\n",
|
|
|
|
|
" 'aq_solvent_name': 'H2O(L)',\n",
|
|
|
|
|
" 'extractant_name': '(HA)2(org)',\n",
|
|
|
|
|
" 'diluant_name': 'dodecane',\n",
|
|
|
|
|
" 'complex_names': ['Nd(H(A)2)3(org)'],\n",
|
|
|
|
|
" 'rare_earth_ion_names': ['Nd+++'],\n",
|
|
|
|
|
" 'extracted_species_ion_names': ['Nd+++'],\n",
|
|
|
|
|
" 'aq_solvent_rho': 1000.0,\n",
|
|
|
|
|
" 'extractant_rho': 960.0,\n",
|
|
|
|
|
" 'diluant_rho': 750.0}\n",
|
|
|
|
|
"searcher = REEPS(**searcher_parameters)"
|
|
|
|
|
"estimator = LLEPE(**llepe_parameters)"
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
@ -72,7 +107,7 @@
|
|
|
|
|
"metadata": {},
|
|
|
|
|
"source": [
|
|
|
|
|
"exp_csv_filename is the file name for the csv containing experimental data. <br/>\n",
|
|
|
|
|
"Let us get the pandas dataframe created by REEPS."
|
|
|
|
|
"Let us get the pandas dataframe created by LLEPE."
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
@ -188,7 +223,7 @@
|
|
|
|
|
"metadata": {},
|
|
|
|
|
"source": [
|
|
|
|
|
"The rows are for experiments, and the columns are for the measured quantaties. <br/>\n",
|
|
|
|
|
"REEPS is looking for the ordering of these columns so it is important your experimental file has this ordering. Column names do not matter.<br/>\n",
|
|
|
|
|
"LLEPE is looking for the ordering of these columns so it is important your experimental file has this ordering. Column names do not matter.<br/>\n",
|
|
|
|
|
"Below is a table explaining the meaning of the column headers and the needed column order.<br/>\n",
|
|
|
|
|
"If you have more than one rare earth element, append the data to the end in the same order (aq_i, aq_eq, d_eq)"
|
|
|
|
|
]
|
|
|
|
@ -522,7 +557,7 @@
|
|
|
|
|
"name": "python",
|
|
|
|
|
"nbconvert_exporter": "python",
|
|
|
|
|
"pygments_lexer": "ipython3",
|
|
|
|
|
"version": "3.7.7"
|
|
|
|
|
"version": "3.7.5"
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"nbformat": 4,
|
|
|
|
|