{ "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": "2025-10-15T23:11:47.752910Z", "iopub.status.busy": "2025-10-15T23:11:47.752798Z", "iopub.status.idle": "2025-10-15T23:11:47.802451Z", "shell.execute_reply": "2025-10-15T23:11:47.801987Z" } }, "outputs": [ { "data": { "text/plain": [ "'0.23.1'" ] }, "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": "2025-10-15T23:11:47.804120Z", "iopub.status.busy": "2025-10-15T23:11:47.803929Z", "iopub.status.idle": "2025-10-15T23:11:47.840061Z", "shell.execute_reply": "2025-10-15T23:11:47.839167Z" } }, "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": "2025-10-15T23:11:47.841522Z", "iopub.status.busy": "2025-10-15T23:11:47.841384Z", "iopub.status.idle": "2025-10-15T23:11:50.222833Z", "shell.execute_reply": "2025-10-15T23:11:50.222307Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "21.1 μs ± 3.98 μ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": "2025-10-15T23:11:50.224607Z", "iopub.status.busy": "2025-10-15T23:11:50.224477Z", "iopub.status.idle": "2025-10-15T23:11:50.228505Z", "shell.execute_reply": "2025-10-15T23:11:50.227872Z" } }, "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.14" } }, "nbformat": 4, "nbformat_minor": 5 }