The 3D version of this sim scripts the shearing motion directly (a sawtooth for stick-slip, a sine wave for smooth sliding) and reads off a friction coefficient from a fitted formula. This 2D companion computes the same confined-layer physics a genuinely different way: friction is never scripted — it emerges from numerically integrating the real overdamped Prandtl‑Tomlinson equation that textbooks and AFM/SFA experiments use to explain nanoscale stick-slip:
γ ẋ = k(x_stage − x) − dU/dx, U(x) = −U₀(n)·cos(2πx/σ)
x_stage(t) = v·t (spring-driven stage, RK4-integrated)
U₀(n) = U₀,max · e^(−(n−1)/2.6) (corrugation screened by n confined layers)
η = 4π²·U₀(n) / (k·σ²) (Tomlinson parameter)
η is the single number that decides everything: when η < 1 the tip's equilibrium position is single-valued in x_stage, so it slides smoothly and reversibly with almost no dissipation. When η > 1 the potential develops a region with two stable equilibria at once — the tip lags behind elastically ("stick"), then loses stability and snaps forward ("slip") once the spring force overcomes the local energy barrier. That snap is irreversible: energy is dumped into lattice vibrations, which is friction. This is not an animation choice — it is the same bifurcation (a saddle-node in the tip's force balance) that produces the sawtooth atomic stick-slip traces measured by real AFM and Surface Forces Apparatus experiments.
Because more confined layers screen the substrate corrugation the tip actually feels, U₀(n) — and hence η — falls as the film thickens, exactly mirroring the 3D sim's claim that thick films lubricate smoothly while a squeezed-down monolayer locks into boundary lubrication. Standalone Node verification (reported below) confirms η crosses 1 near n≈3–4 layers with these parameters, and that the RK4 integration genuinely produces intermittent high-speed slip pulses (stick-slip) above that threshold and near-constant velocity (smooth sliding) below it — a result of the dynamics, not a scripted regime switch.
- Plate gap D — sets the confined layer count n = round(D/σ), which sets how strongly the substrate corrugation is screened.
- Molecule diameter σ — sets both the solvation-force wavelength and the spatial period of the Prandtl-Tomlinson lattice potential.
- Stage drive speed — how fast the spring's anchor point is dragged; the hysteresis loop panel traces the resulting force-vs-position curve live.