Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I have a MATLAB assignment - - have to write a script to find final pressure using the ideal gas law and the van der

I have a MATLAB assignment--have to write a script to find final pressure using the ideal gas law and the van der waals equation of state. I have converted the volume from 1 liter to .001 m^3 and converted 5.536 from bar to 0.5536 kPa. I'm getting a correct result for the ideal gas law but not for van der waals. Correct pressures are 9528.37 kPa for IGL and 7932.743 kPa for van der Waals. Percent difference should be 20.11%. I have cut and pasted my script here.
T=573; % Temperature, T [K]
V=.001; % Volume, V [m^3]
n=2; % moles, n [mol]
a=0.5536; % intermolecular force, a [m^6 Pa mol^-2]
b=3.049e-5; % volume of molecules, b [m^3 mol^-1]
R=8.314; % gas constant, R [kPa m^3 kmol^-1 K^-1]
R=0.08314; % gas constant [L bar mol^-1 k^-1
P_IGL=((n*R*T)/V); % IGL ideal gas law, calculation for pressure, [kPa]
P_vdW=((n*R*T)/(V-(n*b)))-((a*n^2)/V^2); % van der Waals, calculation for pressure, [kPa]
Pdiff=abs((P_vdW-P_IGL)/P_vdW)*100; % percent difference
% Display the results
disp(['Pressure from Ideal Gas Law (IGL): ',num2str(P_IGL), 'kPa']);
disp(['Pressure from van der Waals (vdW): ',num2str(P_vdW), 'kPa']);
disp(['Percent Difference',num2str(Pdiff*100),'%']);

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Current Trends In Database Technology Edbt 2004 Workshops Edbt 2004 Workshops Phd Datax Pim P2panddb And Clustweb Heraklion Crete Greece March 2004 Revised Selected Papers Lncs 3268

Authors: Wolfgang Lindner ,Marco Mesiti ,Can Turker ,Yannis Tzitzikas ,Athena Vakali

2005th Edition

3540233059, 978-3540233053

More Books

Students also viewed these Databases questions

Question

Is it clear what happens if an employee violates the policy?

Answered: 1 week ago