import numpy as np
import matplotlib.pyplot as plt
# Constants for Chloroform
A = 8.08097
B = 1592.864
C = 226.184
# Temperature range (in Celsius)
T = np.linspace(45, 120, 100) # Temperature from 45°C to 120°C
# Antoine equation to calculate Psat (vapor pressure) in mmHg
Psat = 10**(A - B / (C + T))
# Plotting Psat vs Temperature on linear scale
plt.figure(figsize=(12, 6))
# Linear scale plot
plt.subplot(1, 2, 1)
plt.plot(T, Psat, label="Psat vs T", color='b')
plt.xlabel('Temperature (°C)')
plt.ylabel('Vapor Pressure (mmHg)')
plt.title('Vapor Pressure of Chloroform (Linear Scale)')
plt.grid(True)
plt.legend()
# Log scale plot
plt.subplot(1, 2, 2)
plt.plot(T, np.log10(Psat), label="log10(Psat) vs T", color='r')
plt.xlabel('Temperature (°C)')
plt.ylabel('log10(Psat)')
plt.title('Vapor Pressure of Chloroform (Log Scale)')
plt.grid(True)
plt.legend()
# Display the plots
plt.tight_layout()
plt.show()
Click Run or press shift + ENTER to run code