Make a function which will calculate the pressure of a gas using Van der Waals Equation: The Van der Waals function will have arguments: temperature (T) in Kelvin,molar volume (Vm) in L/mole,critical temperature (Tc) in Kelvin andcritical pressure (Pc) in atm.(Tc and Pc are characteristics of the substance.) Within the function also define the gas constant R= 0.08206 L·atm/mole·K. The Van der Waals equation to calculate the pressure, P is: Where Within the function, create variables a, b and Vc, and calculate the value for each prior to calculating P. Using the MATLAB editor, make a script m-file for the following: Calculate the pressure withTemperatures over the range 255 to 315 K at intervals of 2 K, and Vm = 25.35 L/mole, Consider two substances:For ammonia: Tc = 141.15 K and Pc = 111.5 atm.For carbon dioxide: Tc = 241.9 K and Pc = 73.0 atm. Make a table with temperature in column 1, pressure for carbon dioxide in column 2 and pressure for ammonia in column 3, and write the table to a file.
Make a function which will calculate the pressure of a gas using Van der Waals Equation:
The Van der Waals function will have arguments:
temperature (T) in Kelvin,
molar volume (Vm) in L/mole,
critical temperature (Tc) in Kelvin and
critical pressure (Pc) in atm.
(Tc and Pc are characteristics of the substance.)
Within the function also define the gas constant R= 0.08206 L·atm/mole·K.
The Van der Waals equation to calculate the pressure, P is:
Where
Within the function, create variables a, b and Vc, and calculate the value for each prior to calculating P.
Using the MATLAB editor, make a script m-file for the following:
Calculate the pressure with
Temperatures over the range 255 to 315 K at intervals of 2 K, and Vm = 25.35 L/mole,
Consider two substances:
For ammonia: Tc = 141.15 K and Pc = 111.5 atm.
For carbon dioxide: Tc = 241.9 K and Pc = 73.0 atm.
Make a table with temperature in column 1, pressure for carbon dioxide in column 2 and pressure for ammonia in column 3, and write the table to a file.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps