Skip to content
ABSORCION DE GASES
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from shapely.geometry import LineString
# Solubilidad NH3 en H2O expresados como Kg NH3/Kg H2O y presion parcial del NH3 en mmHg a 20 C:
dict_20 = {"Kg_NH3/100_Kg_H2O": [60, 50, 40, 30, 25, 20, 15, 10, 7.5, 5, 4, 3, 2],
"20_C": [945, 686, 470, 298, 227, 166, 114, 69.6, 50.0, 31.7, 24.9, 18.2, 12.0]}
solb_20 = pd.DataFrame(dict_20)
# x representa la fraccion molar del amoniaco en fase liquida, y la fraccion molar del amoniaco en la fase gaseosa:
for lab, row in solb_20.iterrows():
solb_20.loc[lab, "x"] = (row["Kg_NH3/100_Kg_H2O"] / 17) / ((row["Kg_NH3/100_Kg_H2O"] / 17) + (100 / 18))
solb_20.loc[lab, "y_20"] = row["20_C"] / 760
print(solb_20)
c1 = solb_20["Kg_NH3/100_Kg_H2O"]
p1 = solb_20["20_C"]
dic_2 = {"c2": [5, 6, 7, 8], "p2": [69.36, 50.5, 31.3, 10.7]}
df2 = pd.DataFrame(dic_2)
c2 = df2["c2"]
p2 = df2["p2"]
plt.plot(c1, p1, label='Line 1')
plt.plot(c2, p2, label='Line 2')
line_1 = LineString(np.column_stack((c1, p1)))
line_2 = LineString(np.column_stack((c2, p2)))
intersection = line_1.intersection(line_2)
plt.plot(*intersection.xy, "ro", label='Intersection')
plt.legend()
plt.show()
intersection.xy
print(intersection)