Real gas: van der Waals, Redlich-Kwong — a TI-84 Plus CE program
REALGAS is a TI-BASIC program for the TI-84 Plus CE. Molar volume and compressibility factor from a cubic equation of state (Newton's method from the ideal-gas volume; bisection when that stalls, e.g. for a liquid-like state), compared with the ideal-gas value.
What it asks for and what it shows
It asks for 4 values at its prompts, after you pick option 1 from its menu. In the example below it shows V L/MOL, Z, V IDEAL, ERR %, A, B.
Example run
One of its oracle test cases: “CO2, van der Waals”. The inputs are typed in order, and the results are the values the case expects on the screen.
| Step | Value |
|---|---|
| You enter | |
| Menu | option 1 |
| Input 1 | 304.13 |
| Input 2 | 7.377 |
| Input 3 | 350 |
| Input 4 | 5 |
| The screen shows | |
V L/MOL= | 0.4882046599 |
Z= | 0.8388217742 |
V IDEAL= | 0.5820123833 |
ERR %= | 19.21483571 |
A= | 0.365671321 |
B= | 0.04284732134 |
How it's checked
7 test cases, each checked against an independent method. Replayed key by key on a virtual TI-84 Plus CE, they make 51 checks.
How E-Code checks every program
Run it or put it on your calculator
- Open the library in the TI-84 Plus CE calculator and pick “Real gas: van der Waals, Redlich-Kwong” (REALGAS).
- Put it on your own calculator with a computer and a USB cable, or type it in by hand.
Related programs
- Air-standard Otto, Diesel, Brayton
- Polytropic process, ideal gas
- Entropy generation, lost work
- Chemical equilibrium: N2O4 <-> 2NO2
- RC circuit charging transient
All TI-84 Plus CE engineering programs · All TI-84 Plus CE programs