Molecular Dynamics Simulator Back
Molecular Simulation

Molecular Dynamics Simulator

Simulate N particles interacting via the Lennard-Jones potential with Verlet integration. Slide the temperature to watch gas, liquid, and solid phase transitions unfold in real time.

Parameters

Controls

Gas Phase
Results
Kinetic Temperature T*
Kinetic Energy
Potential Energy
Total Energy
Particle Simulation (blue=cold → red=hot)
Energy History
Theory & Key Formulas
$$V(r)=4\varepsilon\left[\left(\frac{\sigma}{r}\right)^{12}-\left(\frac{\sigma}{r}\right)^{6}\right]$$

Equilibrium: rmin = 21/6σ ≈ 1.122σ

What is Molecular Dynamics?

🙋
What exactly is this simulator showing? I see particles bouncing around, but what's the Lennard-Jones potential doing?
🎓
Basically, it's simulating how atoms or molecules interact. The Lennard-Jones potential is the rulebook for those interactions. It says particles repel each other strongly when too close (like bumping into someone), but attract when at a comfortable distance. Try moving the "Temperature" slider up and down—you'll see how particle speed, which is directly related to temperature, changes the whole system's behavior.
🙋
Wait, really? So the attraction is what makes things stick together to form a liquid or solid? How does that work?
🎓
Exactly! At low temperatures, the particles don't have enough kinetic energy to escape that attractive "well" in the potential. They get trapped near each other, forming a condensed phase. In practice, you can see this in the simulator. Set the temperature very low, and the particles will clump into an ordered solid or a dense droplet. Now, crank the "Number of Particles" up while keeping temperature low—you'll see a larger, more complex solid structure form.
🙋
That makes sense. But the potential has a repulsive part too, right? What happens if I change the parameters for that?
🎓
Great question. The repulsive part comes from the $(\sigma/r)^{12}$ term and defines how "hard" the particles are. The parameter $\sigma$ sets the effective particle diameter. A common case is comparing argon gas to a larger molecule. In the simulator, if you could adjust $\sigma$ (imagine it's linked to the "Particle Size" visual), making it larger would mean particles can't get as close, which would change the density of the liquid or solid phase you observe at a given temperature.

Physical Model & Key Equations

The core of this simulation is the Lennard-Jones 12-6 potential, which models the interaction between a pair of neutral atoms or molecules. It combines a short-range repulsion (from overlapping electron clouds) and a longer-range attraction (from van der Waals or dispersion forces).

$$V(r)=4\varepsilon\left[\left(\frac{\sigma}{r}\right)^{12}-\left(\frac{\sigma}{r}\right)^{6}\right]$$

$V(r)$: Potential energy between two particles.
$r$: Distance between particle centers.
$\varepsilon$: Depth of the potential well, defining the strength of the interaction.
$\sigma$: Distance at which the inter-particle potential is zero. Effectively sets the particle size.

The force on each particle is derived from the negative gradient of the potential. This is what the simulator calculates at every time step to update particle velocities and positions, following Newton's second law.

$$\vec{F}(r) = -\nabla V(r) = 24\varepsilon \left[ 2\left(\frac{\sigma}{r}\right)^{12}- \left(\frac{\sigma}{r}\right)^{6}\right] \frac{\vec{r}}{r^2}$$

$\vec{F}(r)$: Force vector acting between two particles.
The term in brackets switches sign. When positive, the force is repulsive; when negative, it's attractive. The equilibrium distance $r_{min}= 2^{1/6}\sigma$ is where this force is zero.

Frequently Asked Questions

The temperature slider allows you to adjust the total kinetic energy (particle velocity) of the system. At low temperatures, particles align in an orderly manner to form a solid phase (crystal); at medium temperatures, they become a fluid liquid phase; and at high temperatures, they move freely as a gas phase. You can observe these changes in real time.
In the current version, the number of particles is fixed. However, by changing the initial arrangement of particles or the temperature, you can reproduce different states—gas, liquid, or solid—with the same number of particles. Increasing the number of particles would raise the computational load, so it is set with performance in mind.
It is a model that represents the force between particles depending on distance. At short distances, there is a strong repulsive force (to prevent collisions); at medium distances, a weak attractive force (for cohesion); and at long distances, the force is nearly zero. This simple formula simulates the van der Waals forces between molecules.
If the temperature is too high, particle velocities become too large, causing the movement amount to exceed the calculation time step. In such cases, lower the temperature slider slightly, or reload the browser to return to the initial state.

Real-World Applications

Material Science & Nanotechnology: Researchers use MD simulations with LJ potentials to study the properties of novel materials, like the thermal conductivity of nanowires or the strength of metallic glasses. It helps predict behavior before expensive physical experiments.

Drug Discovery & Biophysics: While more complex force fields are used for proteins, the principles are the same. Simulating how a candidate drug molecule binds to a protein target involves calculating forces similar to LJ to see if it "sticks" in the right place.

Chemical Engineering & Fluid Dynamics: MD simulations model the behavior of liquids and gases in extreme conditions (e.g., supercritical fluids) or in confined spaces (like in porous catalysts), where traditional fluid equations break down.

CAE & Multiscale Modeling: In Computer-Aided Engineering, MD provides fundamental property data (like viscosity, diffusion coefficients) that feed into larger-scale continuum simulations (CFD, FEA). This bridges the atomic and macro scales for more accurate product design.

Common Misconceptions and Points to Note

First, it's crucial that you do not mistake the simulation results for actual experimental data. This simulator reproduces the world of a simplified model—the Lennard-Jones (LJ) potential. For instance, to accurately reproduce the phase transitions of water, you would need a more complex force model that accounts for the polarity (separation of positive and negative charges) of water molecules. Think of the LJ model as an "entry point" for understanding the behavior of noble gas atoms like argon.

Next, a common pitfall in parameter settings is using extreme values. For example, if you suddenly lower the temperature close to 0K (absolute zero), the particles will barely move, making the simulation appear "frozen." Conversely, setting ε (the strength of attraction) to an extremely high value can cause particles to clump together rigidly, obscuring the "process" of phase transition. A good technique is to start from the default values and make gradual changes (e.g., adjusting temperature by 10% or ε by a factor of 1.2) to observe their effects.

Finally, be wary of the assumption that "more particles are always better." While using hundreds to thousands of particles makes the bulk behavior of liquids or solids clearer, it also increases computational load. In practice, balancing required precision with computational resources is key. For example, when studying the aggregation of nanoparticles, tracking the detailed behavior of just a few dozen particles might be more fundamental. Use this tool to vary the particle count and develop a sense for the minimum number needed to capture the essence of the phenomenon.

How to Use

  1. Set particle count (nMDNum) between 50 and 500 particles using the n-slider
  2. Adjust temperature (tempMDNum) from 0.5 K to 3.0 K via temp-slider to control kinetic energy and phase transitions
  3. Modify epsilon (epsMDNum) from 0.1 to 1.0 using eps-slider to change Lennard-Jones potential well depth and intermolecular attraction strength
  4. Click simulate to observe real-time particle behavior, phase changes, and radial distribution function evolution

Worked Example

Configure 200 argon-equivalent particles with epsilon=0.238 kcal/mol, initial temperature=1.2 K. At low T, particles form crystalline lattice structure with density ~1.3 g/cm³ (solid phase). Increase temperature to 2.1 K: particles gain kinetic energy, lattice breaks apart into liquid with flowing motion and coordination number ~9. Further increase to 2.8 K produces gas phase with particles freely moving across simulation box. Observe pressure changes from ~5 atm (solid) to ~15 atm (gas) as ensemble transitions occur.

Practical Notes