E-Code

Real gas: van der Waals, Redlich-Kwong — a TI-84 Plus CE program

By E-Code · updated

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.

StepValue
You enter
Menuoption 1
Input 1304.13
Input 27.377
Input 3350
Input 45
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

Related programs

All TI-84 Plus CE engineering programs · All TI-84 Plus CE programs