From 06a99aadf9c0db602a673c544b9fb432674ee667 Mon Sep 17 00:00:00 2001 From: Ian Bell <ian.bell@nist.gov> Date: Wed, 19 Oct 2022 10:59:37 -0400 Subject: [PATCH] Some docs for estimation of parameters --- doc/source/models/multifluid.ipynb | 44 ++++++++++++++++++++++++++---- 1 file changed, 39 insertions(+), 5 deletions(-) diff --git a/doc/source/models/multifluid.ipynb b/doc/source/models/multifluid.ipynb index f518f1d..e225edf 100644 --- a/doc/source/models/multifluid.ipynb +++ b/doc/source/models/multifluid.ipynb @@ -103,7 +103,7 @@ "source": [ "# By default teqp looks for fluids relative to the set of fluids in ROOT/dev/fluids\n", "# The name (case-sensitive) should match the .json file, without the json extension.\n", - "%timeit model = teqp.build_multifluid_model([\"Methane\", \"Ethane\"], teqp.get_datapath())" + "%timeit model = teqp.build_multifluid_model([\"Methane\"], teqp.get_datapath())" ] }, { @@ -122,7 +122,7 @@ "# And if you provide valid aliases, alias lookup will be used to resolve the name\n", "# But beware, this is rather a lot slower than the above because all fluid files need to be read\n", "# in to build the alias map\n", - "%timeit model = teqp.build_multifluid_model([\"n-C1H4\", \"n-C3H8\"], teqp.get_datapath())" + "%timeit model = teqp.build_multifluid_model([\"n-C1H4\"], teqp.get_datapath())" ] }, { @@ -149,7 +149,8 @@ "# Building this map takes a little while (somewhat faster in C++) due to all the file reads\n", "# If you know your files will not change, good idea to build this alias map yourself.\n", "%timeit aliasmap = teqp.build_alias_map(teqp.get_datapath())\n", - "aliasmap = teqp.build_alias_map(teqp.get_datapath())" + "aliasmap = teqp.build_alias_map(teqp.get_datapath())\n", + "aliasmap" ] }, { @@ -168,7 +169,7 @@ "# Then load the absolute paths from the alias map, \n", "# which will guarantee that you hit exactly what you were looking for,\n", "# resolving aliases as needed\n", - "identifiers = [aliasmap[n] for n in [\"Neon\", \"Hydrogen\"]]\n", + "identifiers = [aliasmap[n] for n in [\"n-C1H4\"]]\n", "%timeit model = teqp.build_multifluid_model(identifiers, teqp.get_datapath())" ] }, @@ -276,9 +277,42 @@ "params, swap_needed = teqp.get_BIPdep(BIP, ['74-82-8','Ethane'])\n", "params" ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Estimation of interaction parameters\n", + "\n", + "Estimation of interaction parameters can be used when no mixture model is present. The ``flags`` keyword argument allows the user to control how estimation is applied. The ``flags`` keyword argument should be a dictionary, with keys of ``\"estimate\"`` to provide the desired estimation scheme as-needed. For now, the only allowed estimation scheme is ``Lorentz-Berthelot``. \n", + "\n", + "If it is desired to force the estimation, the ``\"force-estimate\"`` to force the use of the provided esimation scheme for all binaries, even when one is available. The value associated with ``\"force-estimate\"`` is ignored." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "params, swap_needed = teqp.get_BIPdep(BIP, ['74-82-8','74-84-0'], flags={'force-estimate':'yes', 'estimate': 'Lorentz-Berthelot'})\n", + "params" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# And without the force, the forcing is ignored\n", + "params, swap_needed = teqp.get_BIPdep(BIP, ['74-82-8','74-84-0'], flags={'estimate': 'Lorentz-Berthelot'})\n", + "params" + ] } ], "metadata": { + "celltoolbar": "Edit Metadata", "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", @@ -294,7 +328,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.4" + "version": "3.10.6" } }, "nbformat": 4, -- GitLab