Question: Write code in python to create graphs that answers part D below using the data in the table below. I have also included my code

Write code in python to create graphs that answers part D below using the data in the table below. I have also included my code for ideal molar volume vs. mole fraction of substance added below.
For each of the three mixtures, provide plots of the following:
d. Partial molar volume vs. mole fraction of substance added
Plot 3d on a separate graph for each mixture. You will have two curves for each graph (e.g. for the IPA-Hexane mixture, you will have both the IPA and Hexane partial molar volumes plotted vs. the mole fraction of IPA). Hint: To plot the partial molar volumes, you need to find the slope of the ideal molar volume.
import numpy as np
import matplotlib.pyplot as plt
# Data for the mixtures
mixtures_data ={
'Mixture 1': {'x': np.array([1,0.98,0.96,0.94,0.92,.91]),
'V_ideal': np.array([18.02,17.92,19.33,20.01,20.71,21.4])},
'Mixture 2': {'x': np.array([1,0.8,0.6,0.4,0.2,0]),
'V_ideal': np.array([18.02,29.75,41.67,53.99,65.03,76.92])},
'Mixture 3': {'x': np.array([1,0.8,0.6,0.4,0.2,0]),
'V_ideal': np.array([129.87,120,108.96,98.46,86.92,76.34])}
}
# Plotting ideal molar volumes for each mixture
for mixture, data in mixtures_data.items():
plt.figure(figsize=(10,6))
# Plot ideal molar volume
plt.plot(data['x'], data['V_ideal'], label='Ideal Molar Volume', marker='o')
plt.xlabel('Mole Fraction of Substance Added')
plt.ylabel('Molar Volume (cm^3/mol)')
plt.title(f'Mixture {mixture}: Ideal, Actual, and Excess Molar Volumes')
plt.legend()
plt.grid(True)
plt.show()
 Write code in python to create graphs that answers part D

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Chemical Engineering Questions!