How I develop a calculation
in notebook cells.
I build each calculation in notebook cells. I explain the quantities, write a small part, run it and compare the result with a stated check before continuing. I keep the complete command-line programs available, but the notebooks are the main learning route.
Download the new notebook collection ↓ · Python, Julia and C introductions →
Start with the portrait
In the color portrait lesson, I first read three color channels and check a pixel shuffle. I then define an energy, verify that its minimum is zero, compare one Allen–Cahn and Cahn–Hilliard evolution, and test mean drift. Only after these checks do I save the full animation.
Complete Python examples
Each lesson below contains the code itself. No companion Python script is needed. The results shown on the page come from executed notebook cells. The optional 256³ runs and native VPython windows are separated from the default checks.
- Fourier diffusion: reproduce the full example · Notebook ↓
- Random walks: from molecular steps to diffusion · Notebook ↓
- Chemical and elastic spinodal decomposition · Notebook ↓
- Ising and Potts: reproduce the lattice calculations · Notebook ↓
- A first binary spinodal simulation · Notebook ↓
- My color portrait as an energy minimum · Notebook ↓
- One portrait and two double-well evolution laws · Notebook ↓
- The same starting image with two prescribed minima · Notebook ↓
- Restoration with a fidelity and gradient energy · Notebook ↓
- Reproduce the color portrait and domain movie · Notebook ↓
- Binary phase separation and periodic connectivity · Notebook ↓
- Connected regions, periodic loops, holes and cavities · Notebook ↓
- Three-dimensional labeling, winding and morphology · Notebook ↓
- The 256³ spinodal field, connectivity and display · Notebook ↓
- Prepare the 2D field for the browser turtle · Notebook ↓
- A VPython turtle on verified periodic routes · Notebook ↓
- Both phase networks in VPython · Notebook ↓
Existing step-by-step lessons
I retain the earlier notebooks and their numerical methods. These shorter lessons test one operation before assembling a calculation.
- Hoshen–Kopelman labeling
- Fourier diffusion
- Random walks
- Chemical and elastic phase separation
- Ising and Potts models
- Ternary spinodal decomposition and its color maps
- Structure function and pair correlation
- Elastic equilibrium solvers
- Neural networks and PINNs
- Lab 01: Thermodynamics
What I checked
I executed all 17 new notebooks from fresh kernels. The portrait, 2D spinodal, diffusion and random-walk notebooks run their original full calculations. Monte Carlo runs short 16² checks. The 3D lessons run small exact-mask checks; their full-volume runs remain optional. The native VPython lessons check the saved route data by default; their scene and event loop require an interactive local Jupyter session. These execution checks do not claim numerical convergence.
Website maintenance tools, archive builders and automated test scripts remain ordinary Python files. They are not student calculations. Existing usage terms apply to all notebook code.