Simulating systems: running a system and tuning it live
The third stage. Initialize in the Builder commits the system in a paused state, and Play at the top right, or the Space bar, starts it. Structure is then fixed, and Back to Builder is the route to changing it, but the system’s behaviour in speeds, temperatures, energies and interaction tools remains adjustable while it evolves. This chapter covers the control panel shared by every model, then each model’s own live parameters and interaction tools.
The control panel
After Initialize the Builder card becomes the Simulation control panel, the right-hand panel holding every control for the running system, organised into icon tabs along its lower edge.
| Tab | Contents |
|---|---|
| Simulation (gauge) | Opens first. The System summary at its top, then the model’s live dynamics, which are the bulk of this chapter. The summary shows Name, Lattice size, Lattice coordination number and # of Systems for the Multi-Component Lattice, Lattice size and # of Systems for 2D Ising, # of Systems for the Single Particle, and, for Patchy Discs, a live Box readout together with # of Systems in an ensemble. |
| Compute (chip) | The Compute status card, reporting the engine state and worker count for every model and a cell-list status for Patchy Discs. For the Multi-Component Lattice and Patchy Discs it also holds the Observables card, whose switches turn the heavier observable groups on and off during a run. See Observables. |
| Types & Rules (definition list) | The model’s structure definitions, read-only. Back to Builder is the route to changing them. Colours remain adjustable here, since they are display rather than physics. |
| Machine Learning (network) | The learning layer, at present the cluster graph, for ensembles. |
| Export (tray) | The current system as JSON, ready to copy. See Saving & sharing. |
Hovering a tab lists the sections it contains, and empty tabs are hidden. Sections collapse by clicking their amber headers, and each carries a small [?] link opening the matching section of this guide. Beneath the tab icons sits the live gfx / sim frame-rate readout. gfx is the display rate and sim the rate at which simulation rounds complete. The two are decoupled deliberately, so a heavy ensemble can render at 120 fps while stepping at 10 rounds per second, and a paused simulation reads sim 0. The parenthesis after the sim rate gives the model’s elementary-step throughput across all systems, in Monte-Carlo site attempts, molecular-dynamics steps or Langevin steps per second, for example (154M steps/s). Below one round per second the readout switches to 1 frame / X s rather than rounding to zero.
Display settings are kept separate by design. Everything governing how the active view is drawn, in colours, trails, glow and axes, sits in the floating View Settings window behind the eye icon, and its tools, the paint brushes and the phase-view Pan/Zoom, in Interaction & Paint behind the brush icon. Both are covered per view in Watching systems. All floating windows behave alike. They are dragged by the title bar, stay inside the viewport, move aside as the control panel slides, come to the front when clicked, and close with the cross. Returning to the Launcher or the Builder restores every window to its default position.
Multi-Component Lattice
The lattice model’s live controls sit in the Simulation tab, in three groups covering overall pace, energetics and per-rule dynamics. All take effect immediately.
MC speed
How much simulation is performed per rendered frame, measured in site attempts. The slider is logarithmic, with snap points at 1 site/frame, the slowest setting, useful for observing individual events, and 1 sweep/frame, which is one attempt per lattice site per frame. A new single system starts at the slider midpoint, approximately √(6·N) attempts per frame for a lattice of N sites. A new ensemble starts at the slowest setting.
Auto-tune
The Auto-tune MC speed checkbox directly below the slider hands the setting to the engine, in single and ensemble mode alike, whenever the compiled core is driving the workers. Monte-Carlo stepping runs off the main thread, so the lattice on screen refreshes only when a batch of attempts completes. Raising MC speed buys more attempts per second until the machine is saturated, beyond which the rate stops climbing while the display updates more slowly. Auto-tune finds that point. It is the smallest speed already delivering essentially the maximum attempt rate, and the tuner settles there, re-checking as the system evolves. The slider follows it, dimmed, showing what the engine selected, and dragging it by hand takes control back. The Monte-Carlo kernel is fast, so a small single lattice cannot saturate a frame within the slider’s range and Auto-tune pins it to the maximum, while a large lattice or a large ensemble has a genuine interior optimum. Like MC speed and temperature it is a live setting, off for each new system, and is not stored in a configuration. On the JavaScript engine the checkbox is not shown, since each frame then runs its attempts in full and there is no batch to time.
Measurement rate (ensemble only)
How often the ensemble’s observables are sampled. The slider is the next one below MC speed, with the Auto-tune checkbox and its note in between. Measuring every system’s composition, clustering and correlations is an O(sites) scan per replica, and for large lattices with thousands of replicas that scan, rather than the Monte-Carlo stepping, is what limits the simulation rate. Sampling less often lets the worker pool step at the raw kernel rate between measurements, so large ensembles evolve considerably faster. The phase cloud, its history trail and the cluster-graph learning all refresh at the chosen rate, so the cloud advances in discrete steps rather than continuously. The readout reads 1 / frame, the fastest setting and the default, or 1 / N frames. Two snap points are provided, 1 / frame at the fast end and a 1 / sweep point that moves with the current MC speed. Pairing a high MC speed with a low measurement rate is the way to relax a large ensemble quickly.
Temperature
The Temperature T slider, over 0.2 to 6 with a snap at T = 1, divides every energy in the Metropolis criterion, fields and interactions alike. Hot systems are insensitive to energetic penalties, and cold ones follow their energy landscape closely. T = 1 is the natural reference, since it is the model’s standard form, and is where every new system starts.
Coordination number
The 4 · von Neumann / 8 · Moore selector in the System section chooses whether neighbours means the four orthogonal sites or all eight surrounding ones. It takes effect immediately, applying to facilitation counts, interaction energies, swap directions and the clustering observables, and the phase-space axes and their theoretical envelopes rescale to match. The Ising and Fredrickson–Andersen presets use 4, and the default is 8.
Site fields & Rule Controls
The Site H-Field Controls sub-card carries each type’s energetic bias, in kBT over −10 to +10. A type responds to its field only through a flip rule, which the card notes. Below it, Rule Controls lists every rule read-only, showing its kind glyph and endpoints, with the live controls beside them. These are a slider labelled Rate over 0 to 1 for flips and swaps or Coupling J over −10 to +10 for a Site-Site Interaction, an enable switch, and an Ignore Site Fields & Interactions checkbox, which makes the rule’s success probability exactly its rate, bypassing all energetics. The section ends with the live interaction matrix.
Painting on the lattice
In the Lattice view, clicking or dragging paints sites directly, running or paused. A green square shows the brush and the exact block of sites it will fill, snapped to the lattice and advancing site by site. The brush is measured in whole sites, the smallest being a single site. Its size is set in the Interaction & Paint window, which also holds the Paint site type picker, or by scrolling the mouse or trackpad over the lattice, which grows and shrinks it one ring at a time. Painted sites join the simulation and the statistics immediately.
Painting in phase space (ensemble)
In an ensemble’s phase view the brush paints systems rather than sites, re-seeding the replicas under the cursor at the composition the brush position specifies. The Tool selector in the Interaction section defaults to Pan/Zoom, so it must be switched to Paint before a drag re-seeds anything. Painting requires a site-type fraction on an axis. Two such axes give a circular brush and one gives a stripe along it, while observables such as entropy cannot be painted to and the brush is then unavailable. A Brush size and a Brush density slider set the footprint and how many systems each pass re-seeds, and scrolling resizes the brush. The system selected in the Sampler is exempt. In Paint mode a stationary click selects and a drag paints.
2D Ising
The Ising model’s behaviour is three sliders in the Simulation tab, together with MC speed. Temperature T sets how readily spins flip against their neighbours, and carries snap points at 1 and at the critical temperature Tc for the current coupling. Below the critical point domains coarsen, and above it thermal fluctuation dominates. Coupling J, over −2 to +2, is the neighbour interaction strength, ferromagnetic when positive and antiferromagnetic when negative. Field H, over −3 to +3, is a uniform bias toward up or down. A live Free energy F(m) preview below the sliders shows the mean-field free-energy curve for the current J, H and T, so the double well opening and closing is visible as the parameters move. MC speed uses the same logarithmic map as the lattice model and the same 1 sweep/frame snap, but offers no 1 site/frame snap, and Ising has neither Auto-tune nor a measurement-rate control. In an ensemble the cloud of magnetisation against same-type bond excess maps out the phase diagram as these change. Painting in phase space injects systems at the brushed magnetisation, their vertical position following from the fresh random configuration before it relaxes.
Single Particle
The particle moves under Langevin dynamics, tuned live in the Simulation tab. Temperature, over 0.2 to 4, sets the thermal noise, and Friction γ, over 0 to 3, the damping, from inertial and ballistic at low values to an overdamped crawl at high ones. At γ = 0 the integrator is purely Hamiltonian, with no noise and no relaxation. The Shape selector chooses a Single well, a harmonic trap set by its Frequency ω, or a Double well set by its Separation & Depth and a Left/Right Bias. A live V(q) preview draws the resulting potential. The model’s natural view is the ensemble phase space, where thousands of walkers thermalise into a Boltzmann cloud over position and momentum. Painting in phase space respawns walkers in a disc around the brushed (q, p), from which they evolve back into the distribution.
Patchy Discs & Polymers
Patchy Discs runs a hybrid of molecular dynamics and bond Monte Carlo, and the Simulation tab tunes both.
Motion
Discs move by Langevin dynamics, described in The science. The live controls are Temperature T, over 0.05 to 4 with a snap at T = 1, MD speed, in integration steps per frame over 1 to 1,000, and Friction γ, over 0.1 to 10, from inertial at low values to an overdamped Brownian crawl at high ones. All three reset to their defaults for each new system. Bond stiffness, the spring constant of every bond, both patch bonds and polymer backbones, is part of the design rather than a run setting, so it persists across launches. Its slider appears whenever the design has a patch or a chain.
Thermodynamic ensemble
The Thermodynamic ensemble selector chooses how the box is treated. NVT, the default, holds the box fixed and thermostats the temperature. NPT allows the box to change size, a Martyna–Tobias–Klein barostat expanding or compressing it until the internal pressure matches the target Pressure P, so the discs equilibrate to the density that pressure implies. Raising the pressure compresses them and lowering it allows them to spread. The Barostat coupling τ slider sets the box’s relaxation time, low for a fast piston and high for a slow one. In single-system mode the box side L and, under NPT, the packing fraction φ are shown live in the System section at the top of this tab. In an ensemble each system’s box changes independently, so L and φ are read per system in the Sampler. NPT adds a packing-fraction observable. Both ensembles work in single-system and ensemble mode, and the choice is a live run setting, reset to NVT on each launch and not stored in a configuration.
Rule Controls
Each rule appears read-only, showing its kind and two endpoints, with live controls beside it. The strength ε, in kBT, applies to both kinds, which is the bond well depth for a BOND rule and the Lennard-Jones well depth for an LJ rule. Together with temperature it fixes the equilibrium. Patch–patch rules add an attempt rate, in bind and unbind attempts per MD step per patch, which sets how quickly bonding equilibrates without shifting where it settles. Disc–disc attractions have no attempt rate, being handled directly by the molecular dynamics. An enable switch removes a rule’s interaction mid-run. Up to two live matrices follow, the Patch-bond matrix shown only when some bead type carries a patch and the Disc–disc matrix only once a disc–disc rule exists.
Auto-tune
Auto-tune MD speed, below the MD speed slider, hands the setting to the engine. Steps run off the main thread, so the box on screen refreshes only when a batch completes. Raising MD speed buys more steps per second until the machine is saturated, beyond which the step rate stops growing while the display updates more slowly. Auto-tune finds that point. It is the smallest speed already delivering essentially the maximum step rate, and the tuner settles there, re-checking as the run proceeds, since a box becomes more expensive as it clusters. The slider follows it, dimmed, and dragging it by hand takes control back. It is a live setting, off for each new system, and is not stored in a configuration. It is offered only on the compiled core, since a JavaScript frame has no batch to time. On one reference machine a 1,000-disc box reached roughly 3,200 steps per second at the tuned setting, close to an order of magnitude above the 3 steps per frame default.
Measurement rate (ensemble only)
The slider below Auto-tune sets how often the ensemble’s observables are sampled. Scanning every system’s energy, bonds, contacts and clustering each round is substantial work on top of the dynamics, and for large ensembles that scan, rather than the molecular dynamics, can be the limiting cost. Sampling less often lets the pool step at the raw kernel rate between measurements. The phase cloud, its history trail and the cluster-graph learning all refresh at the chosen rate. The readout reads 1 / frame, the fastest setting and the default, or 1 / N frames. Continuous molecular dynamics has no sweep, so unlike the lattice model the slider carries only the 1 / frame snap. Like MD speed and temperature it is a live setting, reset for each new system and not stored in a configuration.
Chain Controls (polymers only)
When the design contains a bead-spring chain, a Chain Controls card appears with one row per bead type occurring in a chain. Its angular stiffness κ resists bending at a bead of that type. κ = 0 is a freely jointed chain, whose backbone turns without restraint. Raising it stiffens the chain into a worm and then a rod, with a persistence length approaching 2κ/T bonds in the stiff limit, so temperature works against it. Like the rule strengths it takes effect immediately on the running system, re-seeding nothing, and like them it is part of the design and travels with an exported configuration. The backbone bond itself uses the Bond stiffness above, which chains and patch bonds share.
Spawning & deleting
The Interaction & Paint window offers two tools, both acting on a single click. Drags do nothing, so discs cannot be mass-spawned or removed by sweeping. Spawn, the default, inserts exactly one molecule of the selected kind per click, the picker listing the design’s molecules, with thermal velocities and every existing bond left in place. A ring previews the disc that will be placed. For a single-disc molecule that is one disc, and for a bead-spring chain a whole chain, its length drawn as the initial system draws it. For an all-disc design a newcomer dropped onto a crowded spot is first pushed clear of overlap by the same relaxation the seed uses, so it settles in rather than being ejected by the steep repulsion. For a design containing chains that relaxation is skipped, since box-wide displacement would drag backbones through one another. A chain is placed all or nothing. It threads past the discs and bonds already present, and declines if it cannot find a route, which would otherwise leave a crossing the run could never undo. In a tightly packed box there may be no route for a long chain, in which case clicks have no effect. Click on a looser region, or build at a lower packing fraction. Delete removes the disc under the click, which is ringed in red on hover. Its bonds are released, and if it sat mid-chain the chain breaks there rather than closing the gap. While the simulation is paused, and outside full screen, a tip line at the top of the viewport names the current tool’s action.
