diff --git a/TxyNotebook.py b/TxyNotebook.py index b1de67f..d943b25 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" @@ -81,10 +94,10 @@ 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) + x_prop = np.linspace(0, 1, 50) #make curve smoother y_prop = [] for z_prop in x_prop: z = [z_prop, 1 - z_prop] @@ -97,11 +110,13 @@ 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}$') plt.ylabel('Temperature (K)') - plt.title('T-x-y of propane and toluene') + plt.title('T-x-y of propane and benzene at 1.01325 bar') plt.legend(loc='upper right') return