Methane NVT Monte Carlo
A custom Metropolis solver for estimating methane pressure and energy across liquid and gas states.
Six state points
From random moves to thermodynamic averages
Each cycle proposes one molecular translation, evaluates its energy change and accepts or rejects it using the Metropolis criterion.
Initialize
Generate a cubic periodic box from molecule count, density and methane molar mass.
Propose
Select one molecule and apply a uniformly distributed three-dimensional displacement.
Accept
Keep energy-lowering moves and probabilistically accept unfavourable moves.
Sample
Record virial pressure and total energy after decorrelated move intervals.
One algorithm, different phase behaviour
Dense liquid configurations require short trial moves, while the dilute gas remains highly accepting even for much larger moves.
Equilibrated and decorrelated observables
Pressure and energy were sampled only after equilibration, with spacing and block averaging chosen from correlation behaviour.
Each production run begins after 50 moves per molecule.
Remaining dependence is handled with block averaging using blocks of ten samples.
Pressure and energy correlations fall below 0.05 at the selected spacing.
Six state points, two methane phases
Virial pressure, ideal-gas contribution and analytic tail corrections were evaluated at 200, 300 and 400 K.
Gas · 1.6430 ± 0.0019 bar
Gas · 2.4787 ± 0.0023 bar
Gas · 3.3121 ± 0.0025 bar
A reusable solver for molecular thermodynamics
The project produced a complete NVT Monte Carlo workflow from trial-move mechanics to uncertainty-aware pressure results.
It combined periodic molecular interactions, analytic tail corrections, virial pressure, equilibration checks, correlation analysis and block averaging in one reproducible model.