A Gibbs-Ensemble Monte Carlo Software Suite implemented in Wolfram

Michael Haring, Thomas Wallek 
Institute of Chemical Engineering & Environmental Technology
Graz University of Technology, Austria

(RowDefault[, (Spacer1), , (Spacer1), ])  #WolframTechConf

ABSTRACT

A Monte Carlo simulation program was implemented entirely in the Wolfram language. Compared to conventional program packages, it offers much more diverse evaluation options (e.g. tracking of convergence behavior, output of intermediate results, etc.) in addition to simpler expandability.

Outline

Motivation

Project Outline

Implementation

Benefits of using Wolfram

Outlook

Motivation

What is Monte Carlo?

Monte Carlo experiments are a class of algorithms that use repeated random sampling to gain numerical results

They use random experiments to solve problems that are actually deterministic in nature

Applied for numerical integration, optimization, and sampling from a probability distribution

What is a Gibbs ensemble?

Molecular simulation of phase equilibria

Application

Fluid phase properties

A supplement to experiments and/or thermodynamic models

Why Wolfram?

Non-monolithic structure & intuitive user communication

E.g., Switch statements for various procedures

Simple expandability

Global variable environment in non-compiled functions

Easy collection of additional data through packages

Templates for code extensions

Diverse visualization options

Project Outline

Key features

OPLS-AA force field

Various combining rules

Improved insertion algorithm for binary mixtures

Continuous Fractional Component (CFC) method

Auto-calibration of transfers

Species choice probability for insertions

Radial Distribution Function & Cavity Correlation Function

Combined analysis of simulations

Application

Research

Mayr N, Haring M, Wallek T
Continuous fractional component Gibbs ensemble Monte Carlo
American Journal of Physics 91, 2023, 235–246.
https://doi.org/10.1119/5.0135841

Mayr N, Haring M, Wallek T
Auto-calibration strategy for the equilibration phase of Gibbs ensemble Monte Carlo simulations
Molecular Simulation 49(11), 2023, 1143-1156.
https://doi.org/10.1080/08927022.2023.2221355

Determination of high-quality Radial Distribution Functions (ongoing)

Teaching

MSc program’s course “Model Development & Simulation”

Availability

https://notebookarchive.org/2022-11-6ger7tx/

Implementation

Structure follows a typical simulation workflow

1 notebook for estimation of starting values

5 separate *.WLS scripts

Several auxiliary packages

Code design

*.WLS scripts for flexible runtime environment (PC & Cluster) and resource-friendliness on GitLab

Mix of compiled functions with delayed functions to speed up evaluation while using non-compilable data types

WVM or external C compiler

Use of the ‘Listable’ attribute of ‘Compile’ to allow both handling of non-tensor objects as well as parallelization

Management of multiple simulators

Benefits of using Wolfram

Estimation of start values

Simulation setup

Dynamic tracking of convergence behavior during run

Analysis

Frenkel plot

Evolution of system quantities

Trial move acceptance rates

Plausibility checks

Radial distribution functions per atom

Extension

Extension of executed simulations that did not equilibrate or had an insufficient number of production cycles

Additional equilibration / production cycles

Optional adjustment of trial move limits

Outlook

Paclet structure

Integration of the simulation environment in existing notebooks

FunctionCompile[]

Changeover to FunctionCompile[] and its consistent use

Thank you ☺

Michael Haring

Niklas Mayr

Sebastian Thaler

Thomas Steiner

Thomas Wallek

https://notebookarchive.org/2022-11-6ger7tx/