Simulating Real Gases in 2D

This Demonstration simulates the effects of intermolecular forces on the pressure and temperature of gas particles enclosed in a spherical container. The interparticle forces are constructed to have a finite range. The time-stepping algorithm that is employed takes advantage of this to reduce the time complexity, which for pairwise forces normally is , to the much more manageable .
In addition to pressure and temperature, you can see some derived thermodynamic quantities as functions of time, represented as curves. For closer inspection, you can select the time interval for display. Time-step selection is automatic. You can set container size to grow or shrink slowly and you can heat or cool the gas. You can switch the forces between particles from one type to another and vary their magnitude and sign.
The initial positions of the particles form a lattice such that the spheres of influence just touch. You control the lattice sites that are occupied by setting a probability. The initial velocities are set with random direction and an absolute value that gives the total system a selected temperature. This enumeration makes clear that many parameters can be set, allowing various kinds of observations being made. The detailed explanations of these parameters are given in the form of annotations that appear as you mouse over them. To read the annotations, you may need to pause the program by unchecking the run box.


  • [Snapshot]
  • [Snapshot]
  • [Snapshot]
  • [Snapshot]
  • [Snapshot]
  • [Snapshot]
  • [Snapshot]
  • [Snapshot]


Snapshot 1: This is the system with the largest number of particles possible for this Demonstration. From the regularly packed initial configuration, a few integration steps were done. Notice the efficiency measure which, when compared with snapshots with fewer particles , shows that the actual computation time per integration step grows even more slowly than .
Snapshot 2: initial state of a compact system that will be heated and will evaporate as seen in the next snapshot
Snapshot 3: the pressure diagram shows that after some heating, particles arrive at the wall and exert forces on it
Snapshot 4: this shows the temperature growth during heating for the process shown in Snapshot 3
Snapshot 5: typical pressure fluctuations
Snapshot 6: Deviation from the ideal gas equation of state for small particle-particle interaction. According to the ideal gas state equation (with the units used here and in 2D) ,the quantity shown here should oscillate around the value 1. The repulsive particle interaction shifts this to values larger than 1.
Snapshot 7: deviation from the ideal gas equation of state for 10-times-stronger particle-particle interaction
Snapshot 8: Condensation by cooling of binding particles in a wall-only container (). There are 25 particles that are distributed over nine positions.
    • Share:

Embed Interactive Demonstration New!

Just copy and paste this snippet of JavaScript code into your website or blog to put the live Demonstration on your site. More details »

Files require Wolfram CDF Player or Mathematica.

Mathematica »
The #1 tool for creating Demonstrations
and anything technical.
Wolfram|Alpha »
Explore anything with the first
computational knowledge engine.
MathWorld »
The web's most extensive
mathematics resource.
Course Assistant Apps »
An app for every course—
right in the palm of your hand.
Wolfram Blog »
Read our views on math,
science, and technology.
Computable Document Format »
The format that makes Demonstrations
(and any information) easy to share and
interact with.
STEM Initiative »
Programs & resources for
educators, schools & students.
Computerbasedmath.org »
Join the initiative for modernizing
math education.
Step-by-Step Solutions »
Walk through homework problems one step at a time, with hints to help along the way.
Wolfram Problem Generator »
Unlimited random practice problems and answers with built-in step-by-step solutions. Practice online or make a printable study sheet.
Wolfram Language »
Knowledge-based programming for everyone.
Powered by Wolfram Mathematica © 2018 Wolfram Demonstrations Project & Contributors  |  Terms of Use  |  Privacy Policy  |  RSS Give us your feedback
Note: To run this Demonstration you need Mathematica 7+ or the free Mathematica Player 7EX
Download or upgrade to Mathematica Player 7EX
I already have Mathematica Player or Mathematica 7+