Ten moles in five litres: 39.98 bar against 49.89 bar
The defaults describe 10 mol of gas squeezed into 5 L at 300 K, with van der Waals constants a = 3.64 L²·bar/mol² and b = 0.0427 L/mol. Those constants are the textbook values for carbon dioxide, so the default is really a question about CO2 in a small, strong cylinder.
The ideal gas law says the pressure should be 49.89 bar. The van der Waals equation says 39.98 bar. The ratio between them, 0.8, is shown as the compressibility factor Z, and the real-gas pressure is also converted to 579.93 psi.
A Z of 0.8 means the gas exerts about a fifth less pressure than an ideal gas would in the same space. For CO2 under these conditions that is not a small correction you can round away. If you sized a regulator, a relief valve or a fill quantity on the ideal figure, you would be off by roughly 10 bar.
The rest of this guide walks through where each of those numbers comes from, how each input pushes the gap wider or narrower, and where the van der Waals model itself stops being trustworthy.
Working the van der Waals equation by hand
The page uses the gas constant in litre-bar units, about 0.08314 L·bar/(mol·K). With those units you can type moles, litres and kelvin straight in and get bar out.
Ideal first. Multiply 10 mol by 0.08314 and by 300 K, then divide by 5 L, and the ideal pressure is 49.89 bar. Keep the product nRT on your calculator, because the real-gas step reuses it.
Now the real-gas version, which has two parts. The repulsion term replaces V with V minus nb. Ten moles times 0.0427 is 0.427 L, so the free volume is 4.573 L, and dividing nRT by 4.573 instead of 5 gives about 54.55 bar. That is higher than the ideal value, because the molecules themselves take up space and the rest of the gas is pushed into less room.
The attraction term is a times (n/V) squared. Here n/V is 2 mol/L, squared that is 4, and 3.64 times 4 is 14.56 bar. Subtract it: 54.55 minus 14.56 leaves 39.98 bar, matching the calculator.
Seen this way, the default result is a contest between the two corrections. Excluded volume adds about 4.7 bar, attraction removes about 14.6 bar, and attraction wins comfortably. That is typical of CO2 near room temperature.
What the a and b constants physically mean
The constant a measures how strongly molecules pull on each other. Those attractions slow molecules as they approach the container wall, so they hit it with less force and the pressure drops. Gases with large, polarizable molecules have large a values. CO2, at 3.64, is far stickier than nitrogen or helium.
The constant b is the volume a mole of molecules occupies as if they were hard spheres. It reduces the space available for motion. It matters most when the gas is dense, because then nb becomes a noticeable share of the container.
Swapping in nitrogen's constants shows how much the gas identity matters. With a = 1.37 and b = 0.0387 and everything else at default, the van der Waals pressure is 48.59 bar and Z is 0.97. Nitrogen in the same cylinder at the same temperature is very close to ideal, while CO2 is 20% below it.
Setting both constants to zero turns the van der Waals equation back into the ideal gas law. The calculator then returns 49.89 bar on both lines and Z of 1, a handy sanity check that you are reading the outputs correctly.
How moles, volume and temperature change Z
Moles and volume act together through the molar density n/V. The preset scenarios hold volume at 5 L and vary the amount of gas. At 6 mol the real pressure is 26.31 bar against 29.93 bar ideal, Z of 0.88. At 15 mol it is 53.06 bar against 74.83 bar ideal, Z of 0.71. Packing more gas into the same space makes the attraction term grow with the square of density, so the gap widens quickly.
Volume behaves the same way in reverse. At 50 L with the default 10 mol, the van der Waals pressure is 4.89 bar against 4.99 bar ideal and Z is 0.98. Spread thin, the molecules rarely interact and the ideal law works well.
Squeeze the same 10 mol into 1 L and Z falls to 0.29: the ideal law predicts about three and a half times the 71.31 bar that van der Waals gives. That is a sign the model is being pushed into territory where real CO2 would no longer behave as a simple gas, as the next section explains.
Temperature works against attraction. Running the default 50 K colder drops Z to 0.74, and a much hotter setting lifts it toward 0.92. Hot molecules move fast enough that brief attractions matter less.
Where the model breaks: CO2 near its critical point
Carbon dioxide has a critical temperature of about 31 °C, only a few kelvin above the default 300 K. Below that temperature, compressed CO2 can condense to a liquid. The van der Waals equation does produce a liquid-like branch, but in the two-phase region it returns a smooth curve with an unphysical wiggle instead of the flat line real CO2 follows while it condenses.
So at high densities near 300 K, the calculator gives a number that is a model output, not a measurement. The 1 L case above, with 10 mol of CO2, sits in exactly that zone. For design work at those conditions, use measured property tables or a modern equation of state.
At very high densities, the opposite failure appears. With the default 10 mol in a volume close to nb, the free volume V minus nb shrinks toward zero and the repulsion term shoots up, so Z climbs well above 1. That is the physics of molecules being crushed together, but the simple hard-sphere b term is a crude description of it.
Van der Waals is best treated as a teaching model and a first estimate. It captures the direction of real-gas behaviour well and the size of it only roughly.
Inputs the van der Waals check rejects
Every input must be positive, and the volume must be larger than n times b. With the default 10 mol and b = 0.0427, the molecules alone occupy 0.427 L, so a volume of 0.4 L returns an input error explaining that the equation has no physical answer there. That is the right response: the molecules simply would not fit.
Just above that limit the equation still answers, but the numbers grow fast. At 0.5 L the free volume is only 0.073 L, the repulsion term dominates and Z reaches 3.93. Treat results where n times b is a large share of V as a sign the simple hard-sphere model is being stretched, and check them against real property data.
Units also need care. The constant a must be in L²·bar/mol² and b in L/mol. Tables in SI units give a in Pa·m⁶/mol² and b in m³/mol, and some older tables use atmospheres. Mixing them gives pressures that are off by large factors with no warning.
Temperature must be in kelvin. Typing 27 for room temperature in Celsius will drive Z far below 1 and produce nonsense.
Reading the compressibility factor as a design check
Z is the single most useful output for practical work. Below 1, attraction dominates and the gas is easier to compress than the ideal law suggests. Above 1, repulsion dominates and it is harder.
In practice Z tells you how much gas really fits in a vessel. On the default, the same cylinder at the same pressure would hold more CO2 than the ideal law predicts, because each mole contributes less pressure. If you fill to a target pressure, more gas goes in than ideal arithmetic predicts. If you fill a set amount of gas, the pressure ends up lower than the ideal figure.
A quick rule: when Z is between 0.95 and 1.05, the ideal law is usually good enough for rough sizing. Outside that range, the correction is large enough to change a decision, and the further from 1 you are, the more you should check the result against real property data.
The psi line, 579.93 psi on the default, is a straight unit conversion of the van der Waals result. It is there for gauges and fittings rated in imperial units and adds no new physics.
Using the calculator for homework and lab prep
For chemistry coursework, the most common task is to compare ideal and real pressures for a given gas and explain the difference. Enter the constants from your textbook's table, set moles, volume and temperature from the problem, and compare the two pressure lines and Z.
Then repeat the hand calculation from earlier with your own numbers. The two terms, repulsion and attraction, are easy to compute separately, and showing them explains why Z is above or below 1 better than the final pressure alone.
For lab work, the calculator helps decide whether an ideal-gas assumption is safe for a given setup. If Z on your conditions is close to 1, the simpler law will do. If it is far from 1, as it is for CO2 at the defaults, say so in your write-up and use the corrected value.
Remember that textbook constants vary slightly between sources. A small change in a or b moves the answer a little, so match the table your course uses.