We often need to estimate the pressures and volumes of a gas in a container. The van der Waals equation is often used for this purpose. It is
where the term b is a correction for the volume of the molecules, and the term is a correction for molecular attractions. The gas constant is R, the absolute temperature is T, and the gas specific volume is . The value of R is the same for all gases; it is R = 0.08206 L-atm/mol-K. The values of a and b depend on the type of gas. Some values are given in the following table. Write a user-defined function using the switch structure that computes the pressure P on the basis of the van der Waals equation. The function’s input arguments should be T, , and a string variable containing the name of a gas listed in the table. Test your function for chlorine (Cl2) for T = 300 K and = 20 L/mol
Gas | a (L2-atm/mol2) | b (L/mol) |
Helium, He | 0.0341 | 0.0237 |
Hydrogen, H2 | 0.244 | 0.0266 |
Oxygen, O2 | 1.36 | 0.0318 |
Chlorine, Cl2 | 6.49 | 0.0562 |
Carbon dioxide, CO2 | 3.59 | 0.0427 |
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.