% Homework 3 problem from Yates , Johnson 1.13 clc; clear; % Enter the data % Volumes relative to the volume at 0 C and 1 kg/cm^2: Vrel=[1.0238 , 0.9823 , 0.9530 , 0.9087 , 0.8792 , 0.8551 , 0.8354; 1.0610 , 1.0096 , 0.9763 , 0.9271 , 0.8947 , 0.8687 , 0.8476]; % The pressures in kg/cm^2 P=[1 , 500 , 1000 , 2000 , 3000 , 4000 , 5000 ]; % Convert the pressures to Pa using g=9.81 m/s^2: P=P.*(9.81*1e4); % The density of liquid MeOH at 20 C and 1 kg/cm^2: rho_ref = 0.7914; % Molecular weight of methanol MW = 32.04; % Compute the reference volume in m^3/mol Vref = MW/rho_ref*1e-6 % Correct for the reference being 0 C: Vref= % Now compute the actual volumes in m^3/mol V= dVdT = plot(P,dVdT, '-o', 'LineWidth', 2); xlabel('P (Pa)') ylabel('\Delta V/\Delta T') % Use the trapezoidal rule to integrate the data and compare with the % rectangular rule: rect=0.0; trap=0.0; for n=1:6 rect=rect+dVdT(n)*(P(n+1)-P(n)); trap=trap+((dVdT(n+1)+dVdT(n))/2)*(P(n+1)-P(n)); end DS1=-rect DS2=-trap