Tutorials & Guides

New to LAMMPS? A Beginner's Guide to Molecular Dynamics

A hands-on, step-by-step guide to building atomic structures and running your first molecular dynamics simulations in LAMMPS, with OVITO for visualization. Five worked systems, from a graphene sheet to a liquid droplet on a surface.

Molecular dynamics (MD) simulates how atoms move. You place atoms in a box, choose a model for the forces between them (the interatomic potential), and then step Newton’s equations of motion forward in time, a fraction of a femtosecond per step. From those trajectories you can measure things like temperature, pressure, structure, wetting, and heat flow.

The hardest part for most beginners isn’t the physics; it’s getting the first structure built and the first simulation running. This guide focuses on exactly that.

This guide was converted from my lecture materials into a website by AI. How it was made ↓

Who this is for

Students and researchers who have heard of MD and want to run it, but have never written a LAMMPS input script. You don’t need any programming experience. If you can edit a text file and type a command into a terminal, you can follow along.

What you will build

Each system introduces a few new ideas, so it’s best to go in order. Every chapter follows the same pattern: what we are building, the idea behind it, the commands that are new, how to run and visualize it, and a few things to try on your own.

Before you start

You need three free programs:

SoftwareWhat it doesGet it
LAMMPSThe MD simulator that reads your input script and runs the simulationlammps.org (Windows installers, conda, or build from source)
OVITOVisualizes the atoms, makes images and movies, and can convert file formatsovito.org (the free Basic version is enough)
A text editorFor writing input scriptsAny editor works; VS Code is a comfortable choice

Other tools you may come across: VMD (visualization), Avogadro (graphical structure builder), Atomsk and EMC (command-line structure builders), and commercial packages such as Materials Studio and MedeA.

Download the scripts with the All scripts button above. Each system is in its own folder, together with the potential file it needs.

About this guide

This guide is based on a two-part guest lecture I delivered in MAE 720: Molecular Level Modeling for Engineering Applications at North Carolina State University in Fall 2025.

The lecture and its materials are my own: the slides, the code notes, the LAMMPS input scripts, and the simulation movies. Converting these lecture materials into this website was done by AI. Working from the lecture recording’s transcript, the slides, the code notes and the scripts, the AI wrote the chapter text and drew the diagrams. The scripts on this site are the same as in the code notes, and each one was run in LAMMPS to check that it works. The written explanations may still contain minor mistakes.

If you spot an error or something unclear, please let me know.