{ "cells": [ { "cell_type": "markdown", "id": "d4e67406", "metadata": {}, "source": [ "# Multfluid mutant\n", "\n", "These adapted multifluid models are used for fitting departure functions. The pure fluids remain fixed while you can adjust the mixture model, both the interaction parameters as well as the departure function terms" ] }, { "cell_type": "code", "execution_count": 1, "id": "3579cfa2", "metadata": { "execution": { "iopub.execute_input": "2024-10-29T15:24:14.702192Z", "iopub.status.busy": "2024-10-29T15:24:14.701751Z", "iopub.status.idle": "2024-10-29T15:24:14.781703Z", "shell.execute_reply": "2024-10-29T15:24:14.781004Z" } }, "outputs": [ { "data": { "text/plain": [ "'0.21.0'" ] }, "execution_count": 1, "metadata": {}, "output_type": "execute_result" } ], "source": [ "import teqp, numpy as np\n", "teqp.__version__" ] }, { "cell_type": "code", "execution_count": 2, "id": "ee024418", "metadata": { "execution": { "iopub.execute_input": "2024-10-29T15:24:14.785511Z", "iopub.status.busy": "2024-10-29T15:24:14.784524Z", "iopub.status.idle": "2024-10-29T15:24:14.857839Z", "shell.execute_reply": "2024-10-29T15:24:14.857278Z" } }, "outputs": [], "source": [ "basemodel = teqp.build_multifluid_model(['Nitrogen','Ethane'], teqp.get_datapath())\n", "s = {\n", " \"0\": {\n", " \"1\": {\n", " \"BIP\": {\n", " \"betaT\": 1.1,\n", " \"gammaT\": 0.9,\n", " \"betaV\": 1.05,\n", " \"gammaV\": 1.3,\n", " \"Fij\": 1.0\n", " },\n", " \"departure\":{\n", " \"type\": \"none\"\n", " }\n", " }\n", " }\n", "}\n", "mutant = teqp.build_multifluid_mutant(basemodel, s)" ] }, { "cell_type": "code", "execution_count": 3, "id": "1eeef8db", "metadata": { "execution": { "iopub.execute_input": "2024-10-29T15:24:14.860008Z", "iopub.status.busy": "2024-10-29T15:24:14.859566Z", "iopub.status.idle": "2024-10-29T15:24:18.068140Z", "shell.execute_reply": "2024-10-29T15:24:18.067482Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "31.4 μs ± 2.63 μs per loop (mean ± std. dev. of 7 runs, 10,000 loops each)\n" ] } ], "source": [ "%timeit teqp.build_multifluid_mutant(basemodel, s)" ] }, { "cell_type": "code", "execution_count": 4, "id": "53af2daf", "metadata": { "execution": { "iopub.execute_input": "2024-10-29T15:24:18.070337Z", "iopub.status.busy": "2024-10-29T15:24:18.070095Z", "iopub.status.idle": "2024-10-29T15:24:18.074757Z", "shell.execute_reply": "2024-10-29T15:24:18.074212Z" } }, "outputs": [ { "data": { "text/plain": [ "-0.0001751718403989357" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "mutant.get_Ar01(300, 3.0, np.array([0.5, 0.5]))" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.11.10" } }, "nbformat": 4, "nbformat_minor": 5 }