From 7014888fa3c4c47c2f6c3a6d0e172ef14bf4870e Mon Sep 17 00:00:00 2001 From: Flecksey <49657259+Flecksey@users.noreply.github.com> Date: Wed, 4 Mar 2026 13:22:23 -0500 Subject: [PATCH 1/4] Add files via upload Modified title of diagram to indicate the pressure --- TxyNotebook.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/TxyNotebook.py b/TxyNotebook.py index b1de67f..7811a32 100644 --- a/TxyNotebook.py +++ b/TxyNotebook.py @@ -1,3 +1,16 @@ +# /// script +# requires-python = ">=3.13" +# dependencies = [ +# "beautifulsoup4>=4.14.3", +# "marimo>=0.19.10", +# "matplotlib>=3.10.8", +# "numpy>=2.4.2", +# "pyzmq>=27.1.0", +# "requests>=2.32.5", +# "scipy>=1.17.1", +# ] +# /// + import marimo __generated_with = "0.19.11" @@ -101,7 +114,7 @@ def resfun(T): plt.plot(x_prop, T_soln, label='X_prop') plt.xlabel('$x_{prop}$, $y_{prop}$') plt.ylabel('Temperature (K)') - plt.title('T-x-y of propane and toluene') + plt.title('T-x-y of propane and toluene at 1.01325 bar') plt.legend(loc='upper right') return From 644ed0dda0d3b3840fb50756c24d8d62f3366fa0 Mon Sep 17 00:00:00 2001 From: ashleyl0pez Date: Wed, 4 Mar 2026 17:22:56 -0500 Subject: [PATCH 2/4] Replace toluene with benzene as the second component --- TxyNotebook.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TxyNotebook.py b/TxyNotebook.py index b1de67f..fa5c7a5 100644 --- a/TxyNotebook.py +++ b/TxyNotebook.py @@ -81,8 +81,8 @@ def _(fsolve, get_antoine_coefficient, np, plt, raoult_law_kvalue): P = 1.01325 # Pressure in bar Tguess = 350 # K propane = get_antoine_coefficient('propane', Tguess) - toluene = get_antoine_coefficient('toluene', Tguess) - antoineCoefs = np.array([propane[0:3], toluene[0:3]]) + benzene = get_antoine_coefficient('benzene', Tguess) #changing the title to match toluene -> benzene + antoineCoefs = np.array([propane[0:3], benzene[0:3]]) T_soln = [] x_prop = np.linspace(0, 1) y_prop = [] From 6193ebfc4093b004cf9dd7c9806584e76d529028 Mon Sep 17 00:00:00 2001 From: Flecksey <49657259+Flecksey@users.noreply.github.com> Date: Wed, 4 Mar 2026 20:57:33 -0500 Subject: [PATCH 3/4] Update title of plot to say benzene instead of toluene --- TxyNotebook.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TxyNotebook.py b/TxyNotebook.py index fa5c7a5..20e3488 100644 --- a/TxyNotebook.py +++ b/TxyNotebook.py @@ -101,7 +101,7 @@ def resfun(T): plt.plot(x_prop, T_soln, label='X_prop') plt.xlabel('$x_{prop}$, $y_{prop}$') plt.ylabel('Temperature (K)') - plt.title('T-x-y of propane and toluene') + plt.title('T-x-y of propane and benzene') plt.legend(loc='upper right') return From f527a9089f69104df9c8e93c6bc0ab4918fb9ffd Mon Sep 17 00:00:00 2001 From: Maaike Swaters Date: Wed, 4 Mar 2026 22:13:01 -0500 Subject: [PATCH 4/4] make curve smoother --- TxyNotebook.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/TxyNotebook.py b/TxyNotebook.py index 3de4de3..d943b25 100644 --- a/TxyNotebook.py +++ b/TxyNotebook.py @@ -97,7 +97,7 @@ def _(fsolve, get_antoine_coefficient, np, plt, raoult_law_kvalue): benzene = get_antoine_coefficient('benzene', Tguess) #changing the title to match toluene -> benzene antoineCoefs = np.array([propane[0:3], benzene[0:3]]) T_soln = [] - x_prop = np.linspace(0, 1) + x_prop = np.linspace(0, 1, 50) #make curve smoother y_prop = [] for z_prop in x_prop: z = [z_prop, 1 - z_prop] @@ -110,6 +110,8 @@ def resfun(T): K = raoult_law_kvalue(T, P, antoineCoefs) y = K * z y_prop.append(y[0]) + + plt.plot(y_prop, T_soln, label='Y_prop') plt.plot(x_prop, T_soln, label='X_prop') plt.xlabel('$x_{prop}$, $y_{prop}$')