JavaScript Programs for Solving Cubic Equations of State
Here are two JavaScript programs that I wrote back in 2004 for calculating
thermodynamic properties and equilibrium conditions. They are designed to
be educational - rather than just calculating the property, they indicate
how the property is being calculated. Remarkably the programs still work
well and have been used to assist the teaching of thermodynamics in various
Universities around the world as well as Cambridge.
A brief description of these programs was reported in:
P.J. Barrie, "JavaScript programs to calculate thermodynamic properties using cubic equations of state",
Journal of Chemical Education, 82, 958-959 (2005). Please cite this
paper if you get the chance!
The two programs are:
- This program calculates compressibility factor, molar volume, fugacity
coefficient and departure functions using a choice of cubic equations of state.
- Example problems that require use of this
program.
- NOTE: This program works fine with Chrome, Firefox and Safari. I
think it works in Micrsoft Edge, but it did not work in Internet Explorer
verions 7-11 (though it did work in earlier versions of Explorer).
- This program calculates bubble point pressures and temperatures, dew point
pressures and temperatures, and can do isothermal vapour-liquid flash
calculations. The user may choose between three modern equations of state.
- Example problems that require use of this
program.
If the "info" help links don't work:
- If the "info" help links do not open, try holding down the "CTRL" key
while clicking the link. If you are running software that disables all
pop-up windows then you might not be able to read them.
Further information
Further details of the theory of cubic equations of state can be found
in standard thermodynamic text books, such as:
- S.I. Sandler: "Chemical, Biochemical and Engineering Thermodynamics" (4th ed. Wiley, 2006).
- J.R. Elliott and C.T. Lira: "Introductory Chemical Engineering Thermodynamics" (Prentice Hall, 1999).
- J.M. Smith, H.C. van Ness and M.M. Abbott: "Introduction to Chemical Engineering Thermodynamics" (6th ed. McGraw-Hill, 2001).
Patrick J. Barrie, University of Cambridge [updated October 2019]. E-mail: pjb10 followed by @ and then followed by cam.ac.uk