1. Home
  2. Explore
  3. Physics
  4. Phase Transitions Simulation

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Phase Transitions Simulation

Speaker 1Speaker 2

Phase Transitions Simulation

9:52
0:00-9:52
  1. Corey

    Alright Simon, so today we're diving into phase transitions—and I'm pretty excited because we get to play with some really cool simulations.

  2. Simon

    Absolutely. And I know the video starts with this liquid vapor model, which looks like a bunch of blue and white pixels bouncing around. But there's some deep physics behind that simple picture.

  3. Corey

    Right, and the first thing we need to get straight is what a phase transition actually is. It's not a chemical reaction—the molecules themselves stay the same. It's all about how they interact. Ice, water, steam—all H2O, but the molecules are arranged differently.

  4. Simon

    Exactly. In ice, they're locked into a rigid structure with long-range order. In water, there's still some order over short distances, and in steam, molecules barely interact at all. And if you look at a phase diagram, you see lines where the behavior changes sharply as you vary temperature and pressure.

  5. Corey

    But here's the thing: that phase diagram isn't just about real water. The simulation we're looking at—the liquid vapor model—has its own phase diagram, and we get to explore it by tuning two parameters: temperature and something called the chemical potential.

  6. Simon

    Why chemical potential instead of pressure? Because in a simulation with a fixed grid, it's easier to let the number of molecules change than to change the volume. And chemical potential is the thermodynamic buddy of molecule count, just like pressure is paired with volume.

  7. Corey

    Makes sense. So we set the temperature and chemical potential, and the simulation shows us the equilibrium state. At high temperatures, the molecules are spread out randomly—that's the gas phase. At low temperatures, they clump into droplets—that's the liquid. And there's even a supercritical region where they vary smoothly.

  8. Simon

    But to really understand how this simulation works—and why these phases emerge—we need to talk about the Boltzmann distribution. It's the most important formula in statistical mechanics, and it tells us the probability of any particular arrangement of molecules.

  9. Corey

    Let's start with why we need randomness at all. I mean, if we knew exactly where every molecule was, we could just simulate Newton's laws, right? But that's impossible for anything with a realistic number of particles—like 10^23 in a glass of water.

  10. Simon

    Right, so we approximate. Instead of tracking every molecule, we treat the microstate—the exact positions and velocities—as random. And the Boltzmann distribution gives us the probability of each microstate: it's proportional to e to the minus energy over temperature.

  11. Corey

    And that formula explains so much. States with higher energy are less likely, but we also have to account for how many microstates have a given energy. That's where entropy comes in—the log of the number of microstates at that energy.

  12. Simon

    So the most likely energy is the one that minimizes something called the free energy: energy minus temperature times entropy. At low temperatures, minimizing free energy is all about minimizing energy. At high temperatures, it's about maximizing entropy.

  13. Corey

    And that competition—energy vs. entropy, mediated by temperature—is what gives rise to different phases. In our simulation, molecules prefer being next to each other, so droplets have low energy. But there are way more gas-like arrangements—high entropy. The temperature decides which wins.

  14. Simon

    Now, where does the Boltzmann distribution actually come from? The video derives it by thinking about a small system in contact with a huge heat bath. The combined system is isolated, so all its microstates are equally likely. Then you count how many heat bath microstates are compatible with a given microstate of the small system.

  15. Corey

    And because the heat bath is huge, its entropy changes linearly with energy, and that linear coefficient is 1 over temperature. So the probability of a microstate ends up being e to the minus E over T, up to a constant.

  16. Simon

    Beautiful. And that derivation also gives us a definition of temperature: it's the thing that equalizes when two systems can exchange energy. In fact, temperature is one over the derivative of entropy with respect to energy. Energy flows from high temperature to low temperature because that increases the total number of microstates.

  17. Corey

    Okay, so we have the distribution. But in practice, we can't just sample all possible microstates—there are too many. So the simulation uses a clever algorithm called Kawasaki dynamics. At each step, it picks two pixels, and if one has a molecule and the other doesn't, it swaps them with a certain probability.

  18. Simon

    That probability comes from the Boltzmann ratio: the chance of swapping is e to the minus (energy difference over temperature) over 1 plus that. And crucially, the energy difference only depends on the eight neighbors of the two pixels, so it's fast to compute. Repeating this many times gives a sample from the Boltzmann distribution.

  19. Corey

    And because we allow molecules to 'teleport' to any empty pixel, the random walk mixes faster. That's why we can see the phase transition in real time, even though the simulation isn't realistic fluid dynamics—it's a Markov chain Monte Carlo method.

  20. Simon

    Now, to get a full phase diagram like H2O's, we need that second parameter. That's chemical potential, which controls the number of molecules. In a grand canonical ensemble, we allow both energy and molecule number to fluctuate by coupling to a reservoir at fixed T and chemical potential.

  21. Corey

    And the Boltzmann distribution gets an extra term: probability is proportional to e to the minus (E - μN) over T. So positive chemical potential favors more molecules. Using this, we can add or remove molecules one pixel at a time, which is even simpler and can be parallelized on a GPU.

  22. Simon

    And when we explore the phase diagram, we see something amazing: at high temperatures, density changes smoothly with chemical potential—that's the supercritical fluid. But below a critical temperature, there's a jump in density as we cross a line—that's the phase transition between liquid and gas.

  23. Corey

    And this is despite our model being incredibly simple: molecules only care if they're next to each other, no kinetic energy, no real motion. Yet it captures the qualitative behavior of real fluids. That's the principle of universality—the macroscopic behavior doesn't depend on all the microscopic details.

  24. Simon

    There's also some really cool behavior near the transition. You see droplets forming, and their shapes change with temperature—they're square at very low T because of the lattice, but rounder closer to the critical point. And there's metastability: if you cross the phase line just a little, the system can stay in the wrong phase for a long time unless a big enough droplet appears.

  25. Corey

    Exactly like supercooled water. And then at the critical point itself, you get fractal-like structures—the system looks the same at all scales. This self-similarity is a big deal and connects to ideas like the critical brain hypothesis.

  26. Simon

    And if you think this model looks familiar, it's essentially the same as the Ising model for magnetism. Blue pixels are spin up, white are spin down. The energy from neighboring pairs is like magnetic alignment, and chemical potential becomes an external magnetic field. So phase transitions in fluids and magnets are two sides of the same coin.

  27. Corey

    There's even a variation—the XY model—where spins can point in any direction. That model has a different kind of phase transition, with vortices that behave like charged particles. It's a whole rabbit hole.

  28. Simon

    And while we can solve these models exactly in two dimensions—like the critical temperature for the Ising model is 1/(2 ln(1+√2))—in three dimensions we only have numerical approximations. Real water is far too complex for a complete mathematical description. But by simplifying, we get deep insights into what's fundamental.

  29. Corey

    And that's exactly what the second video does—it simplifies even further to something we can analyze completely with basic math. I can't wait to see how that works.

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent