# PSL — Physics Simulations Lab · version 3.0

Open **index.html** in Chrome to explore all **37 interactive worlds**. Everything required to run the labs is included, including the 3D libraries. No build, account, installation, or internet connection is needed to play.

Search by topic, browse collections, or save favorites. Open a world to see its controls and a short experiment guide. **Pause lab** freezes the entire workspace; **Restart lab** resets it. Returning to the library or switching worlds releases the previous experiment. History and favorites stay in the browser when local storage is available.

The updated edition is in `Desktop/simulations_updated`. The source folder, `Desktop/simulations`, is preserved. Keep the HTML files and `assets` folder together when copying or sharing. This folder is the current edition; any previously exported ZIP predates the requested-topic expansion.

## Language and notation

The language button shows the selected language and its regional flag. Choose from **18 offline options**: English (US), Spanish (Spain), French, German, Portuguese (Brazil), Italian, Simplified Chinese, Traditional Chinese, Japanese, Korean, Hindi, Arabic, Russian, Ukrainian, Turkish, Indonesian, Vietnamese, and Polish. Your choice follows you into the labs and is saved on this device.

**Intuitive** emphasizes explanations and experiment tips. **Mathematical** also shows equations, modeling assumptions, and numeric Equation lab controls. Mathematical symbols and SI units retain their standard notation. Numeric entry accepts a decimal point or the selected locale's decimal separator, including Arabic digits. Arabic uses a right-to-left interface while plots and formulas preserve their scientific orientation.

Translations are machine-assisted, with reviewed navigation labels, world titles, and selected physics terminology. English remains the reference text; the translations have not had a full native-speaker scientific review. See [LOCALIZATION.md](LOCALIZATION.md) for maintenance details.

## Requested-topic expansion — September 17

Added **12 worlds with 43 experiments** after auditing the existing collection. See [TOPIC_COVERAGE.md](TOPIC_COVERAGE.md) for the complete added/skipped checklist. New worlds cover classical mechanics, orbital flybys, Bernoulli flow, circuits, optics, heat and mixing, quantum states, relativistic kinematics, lensing and gravity waves, astronomy, nuclear physics, and complex systems. Each has controls, pause/step/reset, equations, explicit modeling limits, and numeric Equation lab entry. The original 25 experiment implementations are preserved.

## Earlier September 17 additions

- Homepage stars are about 25% larger.
- Every world now has an **Equation lab** at the bottom. Enter parameter values, choose **Apply values**, then **View experiment** to inspect the result. Fields use the experiment’s units, ranges, and precision, stay synchronized with its controls, and follow the active tab. Invalid edits leave the experiment unchanged.
- Gravity depth and aim, qubit mass, Bell measurement angles, chaos-map growth, GPS daily clock shifts, and the surface path parameter can now be entered directly. Launch settings start a fresh trial where appropriate; other settings update the current experiment.

- The homepage cycles through one live experiment from each of the five categories. Use the arrows, category dots, keyboard arrows, or horizontal touch/trackpad scrolling to browse. Automatic rotation pauses while hovered or focused and follows the animation and reduced-motion settings.
- Sidebar collections start collapsed. Click a section name or its dropdown arrow to reveal its worlds; click again to collapse it.
- **Sound Frequency**, under **Matter & Flow**, lets you change pitch, resonance, and drive strength while a membrane shape responds. Natural-frequency presets, pause/reset, and opt-in audio are included. Motion is slowed and large heights are compressed for visibility.

## What's improved

- One working library for all 25 worlds. Both old homepage filenames redirect to it, including world links.
- **[Time Observatory](time_observatory.html)** adds three experiments in one world: clocks hovering near a black hole, moving near light speed, and held at different heights above Earth. Compare live clocks, use distance/speed presets, pause or add one reference day, and inspect precise clock differences. Playback ranges from one second to one year per real second. [View the preview](previews/time-hole-desktop.png).
- Individual gold/cyan illustrations depict each world's experiment or geometry. Wind Tunnel keeps its original artwork. [Browse the world thumbnails](previews/world-thumbnails.html).
- Manifold Playground groups Curved surfaces, Cubes · 2D–10D, and Knots, with a 3D → 4D untying demonstration and an optional 4D–8D projection/slice explorer. Quantum Cosmos is retired; its former components remain available in the collection.
- Responsive canvas and panel layouts, visible keyboard focus, touch drawing, and onscreen controls for the previously keyboard-only 3D worlds.
- Local Three.js and OrbitControls assets, with their MIT license. The existing r128 version is pinned to preserve compatibility.
- A shared animation scheduler pauses hidden tabs, supports workspace pause, and limits fixed-step loops to 60 updates per second on faster displays. Only the active world runs.
- Reusable 3D buffers, bounded rendering resolution, proper graphics-resource disposal, exact Gaussian surface derivatives, and spatial bins for gas collision searches.
- Fourier audio now follows the waveform, harmonic count, and pitch while playing. Fourier and Chaos Map redraw when their inputs change instead of continuously while idle.
- Wind Tunnel now renders at the display's pixel density, with smooth shaded obstacle contours, interpolated flow colors, antialiased particle streaks, and optional velocity streamlines. Drawing stays aligned at every display size. See [the Retina preview](previews/wind-tunnel-retina.png).
- Wind Tunnel includes Race car, Sports car, Semi-truck, and Jet models, plus local OBJ/STL import. Drag the shaded preview or use Side/Front/Top, rotation, and size controls, then **Apply this view to tunnel**. Models become solid silhouettes in the existing 2D airflow solver. [See the vehicle preview](previews/wind-objects-desktop.png).
- **[Manifold Playground](manifold_playground.html)** now includes a **Cube explorer · 2D–10D**: step from a cube to the tesseract, then the penteract (5-cube), hexeract (6-cube), hepteract (7-cube), octeract (8-cube), enneract (9-cube), and dekeract (10-cube). Compare **Projection** with solid **Slice** views, choose any rotation plane (including X–W and W–V), move hidden-coordinate sliders, and track a vertex. Drag to orbit and scroll or pinch to zoom. Pause rotation to adjust exact angles; **Reset view** restores a centered starting view. **Surface view** returns to the original manifolds. [See the 8D preview](previews/hypercube-8d-desktop.png).
- Corrected gas temperature/reset and histogram scaling, Kerr speed control, three-body substep timing, Zeno measurement scheduling and scrolling, and Roche reset time.

See [CHANGELOG.md](CHANGELOG.md) and [VALIDATION.md](VALIDATION.md) for details.

## Files

| Path | Purpose |
| --- | --- |
| `index.html` | Start here |
| `assets/catalog.js` | World titles, filenames, descriptions, and guides |
| `assets/app.js`, `assets/app.css` | Library and embedded workspace |
| `assets/world-schematics.js` | Individual vector illustrations for the world cards |
| `time_observatory.html`, `assets/time*.js`, `assets/time.css` | Three time-dilation experiments, their clock models, and presentation |
| `assets/wind-models.js`, `assets/wind-objects.js` | Local mesh import, procedural vehicles, orientation preview, and obstacle projection |
| `manifold_playground.html`, `assets/manifold.js`, `assets/hypercube*` | Surface views and the 2D–10D explorer, geometry, and controls |
| `assets/lab-runtime.js`, `assets/lab.css` | Scheduling, loading feedback, and lab presentation |
| `assets/vendor/` | Pinned offline 3D dependencies and license |
| `*.html` | Individual experiments, also usable directly |
| `archive/` | Original homepages, diagnostic page, and incomplete Cosmos snapshot; historical copies, not active pages |
| `tests/` | Browser, scheduling, source, and asset checks |
| `previews/` | Interface screenshots and a linked gallery of all world illustrations |

## Development and testing

For a local HTTP preview, run from this folder:

```sh
python3 -m http.server 8765 --bind 127.0.0.1
```

Open `http://127.0.0.1:8765`. Serving locally gives the browser a consistent origin for history, fullscreen, and optional control matching.

To run the included checks, install Node.js, Python 3, and Google Chrome, then:

```sh
npm ci
npm run check
npm test
```

The first command downloads development tools; the experiments themselves do not need them. The browser suite uses installed Chrome and starts a local server if one is not already running. To use a Playwright-managed Chromium instead, install it with `npx playwright install chromium` and set `PLAYWRIGHT_CHANNEL=chromium`.

## Model notes

The cube explorer uses vertices at ±1 in each original coordinate, with one edge for each pair differing in exactly one coordinate. Dimensions 2 through 10 have 4, 8, 16, 32, 64, 128, 256, 512, and 1024 vertices respectively. Plane rotations compose in selector order; only the selected plane auto-rotates. Flat diagram uses two orthonormal screen vectors after rotation; optional 3D perspective projects from the last coordinate down to W, keeping each perspective eye outside the current bounding sphere. Screen crossings do not imply intersections in the original space. Slice fixes all hidden coordinates simultaneously and intersects the solid hypercube with that 3D space using its rotated half-space constraints. A section can be empty or shrink to a face, line, or point at a boundary; geometric comparisons use floating-point tolerances. Gold follows the selected original vertex. In Slice mode, a faint wireframe ghost shows its XYZ location when it is outside the section. Reset keeps the chosen dimension and pause state, clears plane angles and hidden-coordinate offsets, selects vertex 0, and restores the flat projection and camera with vertex highlighting off. Background: [Wolfram MathWorld's hypercube geometry](https://mathworld.wolfram.com/Hypercube.html).

Wind Tunnel accepts mesh geometry in OBJ and ASCII/binary STL files, up to 20 MB and 100,000 triangles. OBJ files can use positive or negative vertex indices and polygon faces; materials and textures are ignored, and external references are never downloaded. Files are processed locally. Import previews are applied explicitly; applying a model replaces the current obstacle and restarts the flow. Built-in vehicles apply immediately. Side/Front/Top refer to model axes, so differently oriented exports may need rotation. A model keeps the same scale when rotated; its enclosing sphere fits safely inside the tunnel. Mesh units are normalized, so size is relative to the tunnel rather than meters. Hold size, inflow, and viscosity fixed to compare orientations. The scene projects a complete mesh silhouette, including openings visible through it, into a 240 × 100 lattice. Small details may fall below that grid's resolution. This is 2D airflow around a silhouette, not a 3D flow solver or a calibrated vehicle drag/lift prediction. The models float in the tunnel; no rolling ground or moving wheels are simulated. The Reynolds readout uses the projected obstacle height in lattice units.

Time Observatory compares stationary Schwarzschild clocks in its black-hole and Earth experiments, and uses the Lorentz time-dilation factor for uniform motion. The black-hole reference is the far-away limit, while Earth's reference is a surface clock. Earth's experiment isolates gravity and excludes orbital motion; its GPS-height result is not the net rate of a GPS satellite. The normal-speed preset uses 250 m/s. One-meter clock differences are accumulated separately from elapsed time to preserve precision. The model notes in each experiment explain the assumptions, drawing scales, and reference frame. Background: [JILA's Schwarzschild geometry](https://jila.colorado.edu/~ajsh/courses/bh/schwp.html), [UT Austin's moving clocks](https://farside.ph.utexas.edu/teaching/355/Surveyhtml/node131.html), and [NIST's clock experiments](https://www.nist.gov/atomic-clocks/a-powerful-tool-for-science/putting-einstein-test).

These are teaching models with finite grids, simplified geometry, and numerical approximations. The tests verify software behavior and selected physical invariants, not the scientific accuracy of every experiment. On slow devices, demanding fluid and wave experiments may run more slowly; lower their simulation-speed controls.

The black-hole view starts at zero spin in Quantum Cosmos; the spin control lets you explore the rotating case. The curved-surface ant is an analogy, and the knot is a projection into fewer dimensions. [David Tong's general-relativity lectures](https://www.damtp.cam.ac.uk/user/tong/gr/grhtml/S6.html) provide background on photon trajectories and black holes.

The Bell lab's bound applies to local hidden-variable models under the test's assumptions; finite samples fluctuate. See the [2022 Nobel Physics background](https://www.nobelprize.org/prizes/physics/2022/popular-information/). The Zeno lab illustrates suppression of transitions, rather than a halt in time; see [Wayne Itano's review at NIST](https://www.nist.gov/publications/quantum-zeno-paradox-42-years).


### Manifold Playground: surfaces, cubes, and knots

The Manifold consolidation brought the collection to 23 worlds; Electromagnetic Fields adds the 24th. Quantum Cosmos has been retired, and the standalone knot has joined Manifold Playground as its third tab. Old Cosmos links return to the library; old knot links open the Knots tab. Existing knot favorites and visit history are mapped to Manifold Playground.

The Knots tab starts paused at a trefoil in XYZ. Play performs a 3D → 4D → 3D deformation to a circle. Scrub the progress or peek toward W; choose Midway for a useful comparison. Explore 4D–8D adds all rotation planes and Projection/Slice modes, with independent hidden-coordinate offsets and explicit slice thickness. Zero thickness approximates a true slice using the sampled polyline; positive thickness retains portions inside every hidden-coordinate band. The faint guide is the whole loop in XYZ, not a slice result.

The curve's Y and W coordinates distinguish every parameter in the interior deformation, giving an explicit injectivity argument in the model notes. Extra coordinates add smooth bends to this same loop; they do not create a new knot type for every ambient dimension. Its displayed tube thickness is illustrative. Reset view clears angles, peek and slice offsets, returns to Projection and the default camera, and preserves the selected dimension and deformation progress. Re-tie returns progress to zero and pauses it. Inactive tabs retain state and suspend their animation. The knot's equations and implementation limits appear in its own disclosure.


## Electromagnetic Fields

The new Particles & Fields world has three experiment tabs: Charges & electric fields, Currents & magnetic fields, and Induction & waves. Arrange up to six charges, inspect potential contours, release a test charge, compare wire/loop/coil fields, or launch a particle in uniform B. Move a magnet through a coil to record flux and voltage. The Waves view evolves a 2D Maxwell field with pulses, a continuous source, a conducting screen, and optional absorbing edges.

Every view has equations, units, numerical methods, assumptions, and reference links under **Equations & model notes**. The high-density canvas uses the collection's shared grid and Observatory-style cards. Static source edits recompute static fields; only the Waves view models finite-speed field propagation. Everything works offline except opening the optional references.

## Experiment discovery and investigation

The homepage indexes 73 experiment entries in 37 collections. Time Observatory groups Black-hole clock rates, Time dilation, and Clocks above Earth as three selectable tabs. Subject and mathematical-level filters combine with search. Favorites retain their existing collection-level meaning. Four learning paths connect related experiments. Prediction notes are stored locally per experiment. The language menu retains all 18 offline locales.

Each experiment includes control-setting links, visible measurement CSV snapshots, and a downloadable discrepancy report. These tools do not serialize trajectories, arbitrary painted geometry, or random outcomes. See model-guide.html for methods, assumptions, references, accessibility limits, and the version history.

Catalog thumbnails run the actual experiment canvas and solver. Only visible cards mount previews; leaving view unloads them. The motion control and reduced-motion preference pause previews. No screenshot or decorative schematic is used as a thumbnail fallback. Static equilibrium diagrams still render their actual model state. Run `node tests/live-previews.cjs` to check all catalog preview routes in Chrome.

Live homepage demonstrations launch available trial controls and replay finite examples. Static models cycle or sweep a labeled input through the actual renderer; these changes are preview demonstrations rather than new equations of motion. The CMB preview varies display gain and the Mandelbrot preview selects a boundary and cycles zoom levels. Automation pauses with the shared runtime. Run `npx playwright test tests/preview-motion.spec.js` for motion, pause/resume, replay, and standalone-default regressions.

## Focused teaching labs — September 18

Four existing experiments now use shorter teaching flows; their filenames and catalog IDs remain stable:

- **Pattern Formation** (formerly Turing Patterns): spots, stripes, and splitting presets; a concentration legend; repeatable numbered seeds; separate repeat/new-seed controls. The Gray–Scott solver now uses a 0.25 model-time update to avoid unstable evolution found during preset testing. Reset clears elapsed updates.
- **Gas Motion & Temperature** (formerly The Gas Box): temperature/speed and Brownian-motion views of the same particles. A labeled, responsive chart compares measured speeds with a fitted two-dimensional equilibrium distribution. Gravity is an optional extension, not a dissipative settling model.
- **Build a Wave** (formerly Fourier Sandbox): starts with one harmonic and links component waves, reconstruction, and a numbered amplitude spectrum. Optional sound compares the selected reconstruction with a 40-harmonic reference; neither is calibrated audio. Drawing is in the middle plot.
- **Order & Chaos** (formerly Chaos Map): sequence, nearby-start comparison, and full-map views, with behavior presets, play/step/restart, labeled axes, and an optional cobweb. Saved settings retain the selected teaching view.

Prediction prompts are collapsible in these four standalone labs. Model notes and numeric Equation lab controls remain available. New explanatory copy uses English as its reference and falls back to English where a locale has no matching translation.

## Hypercube comparison diagrams — September 18

The cube explorer now starts with a cyan 2D orthographic diagram, alongside a selectable 2D–10D comparison grid inspired by the supplied reference. Vertices and edges retain the same n-cube topology. Each diagram uses a deterministic orthonormal screen basis and a uniform display scale; the small cards are individually fitted, not a shared size scale. Crossing lines do not create vertices.

Select “Show two copies + connecting edges” to distinguish the two lower-dimensional copies and highlight the new direction in gold. Flat-view dragging rotates the selected coordinate plane and pauses automatic rotation; scroll/pinch changes zoom. Optional 3D perspective keeps camera orbit, and Slice retains the existing solid 3D section model for dimensions 3–8. A 2D square has no 3D slice option.

## Curvature & Geodesics — September 18

Curved surfaces now has three lessons: Locally flat, Geodesic paths, and Measure curvature. Choose a plane, sphere, cylinder, saddle, torus, or wavy surface. Pick a starting point directly or enter surface coordinates; adjust launch direction, launch/pause/step, and compare up to four trails. Camera orbit is independent, with optional marker following.

The gold tangent disk and cyan surface samples show measured normal deviation as patch radius changes. Curvature uses analytic derivatives and an orthonormal tangent frame. Paths use constrained RK4 integration at unit model speed; they stop at the displayed boundary or length 20. These lessons describe surface geometry, not general-relativistic spacetime. Implementation lives in `assets/surface-model.js` and `assets/surface-explorer.js`.

## Quantum lab accuracy upgrades — September 18

- **Quantum Tunnel:** Crank–Nicolson evolution with fixed density scaling; independent barrier and packet controls; separate left/right absorption accounting; a Gaussian-spectrum rectangular-barrier benchmark. Late-time estimates assume scattering has separated.
- **Double Slit Lab:** shared finite-aperture Fresnel amplitudes for intensity and detection sampling; one/two slit controls, screen distance, partial coherence, conditional which-path outcomes, and normalized predicted counts. The near-slit region is omitted; large-angle accuracy remains limited by the paraxial approximation.
- **Bell Game:** explicitly a spin-singlet model, with visibility/noise, a local strategy reaching S = 2, predicted correlations, per-setting local frequencies, and conservative fixed-sample Hoeffding intervals.
- **Quantum Zeno Effect:** fixed-duration single and ensemble trials, compared with exact population and all-zero survival predictions. Measurements remain ideal and instantaneous.

The shared pure models live in `assets/quantum-models.js`. Run `node --test tests/quantum-models.test.js` and `npx playwright test tests/quantum-upgrades.spec.js` for targeted checks. Background demonstrations use the actual controls and solvers, with replay for finite runs.

References: [Crank–Nicolson and Schrödinger evolution](https://research.physics.illinois.edu/electronicstructure/498cqm/lnotes/lec5.html), [probability amplitudes](https://www.feynmanlectures.caltech.edu/III_03.html), [CHSH](https://quantum.cloud.ibm.com/docs/en/tutorials/chsh-inequality), and [Zeno survival](https://arxiv.org/abs/quant-ph/9605008).

## Orbital, relativity, scattering, and detector upgrades — September 18

Eight experiments now distinguish numerical diagnostics from model assumptions:

- GPS derives weak-field clock rates from circular-orbit altitude and fits x, y, and clock bias from six pseudoranges. Equal satellite offsets fit mainly into receiver clock bias.
- Gold Foil initializes/extrapolates Coulomb asymptotes and compares an area-sampled beam's differential cross section with Rutherford theory.
- Three-Body retains the restricted experiment, adds Jacobi/forbidden-region diagnostics, and offers a separate full interacting figure-eight/perturbed system.
- Roche uses a relaxed 123-particle 3D aggregate, contacts, spin, optional breakable bonds, and self-bound remnant estimation. A magnified moon view complements the orbit view.
- Kerr uses adaptive error control, asymptotic launch quadrature, null-constraint diagnostics, and a smaller capture cutoff that stays inside the near-extremal prograde photon orbit.
- Wormhole preserves speed and angular momentum numerically without rescaling velocity, and compares sampled/predicted minimum radius.
- Twin Paradox adds finite acceleration, integrated proper time, and separate simultaneity/received-clock readouts.
- Ring Collider restores the original accelerator ring and detector views, with counter-rotating beams, launch/dump controls, an energy ramp, collision slow motion, and figurative event logs. Animation uses the shared pause/step clock.

Models are in `assets/dynamics-models.js` and `assets/roche-model.js`. The material law and detector response are educational approximations; this is not validated rock mechanics or an operational GPS/collider simulator. Read each lab's model notes for its domain, units, cutoffs, and omitted effects.

Reference background: [NIST GPS relativity](https://www.nist.gov/publications/global-positioning-system-receivers-and-relativity), [adaptive gravitational integration](https://pyodide.hanno-rein.de/integrators/ias15/), [twin journeys](https://www.einstein-online.info/en/spotlight/twins/), [CMS track curvature](https://cmsexperiment.web.cern.ch/news/enhancing-muon-compact-muon-solenoid), and [ATLAS missing momentum](https://atlas-public.web.cern.ch/updates/briefing/chasing-invisible). The implementation uses its own adaptive RK4 step-doubling integrator, not REBOUND.

## Bell, Gravity, and Light Factory rebuild — September 18

Three labs now use explicit quantitative experiments:

- **Bell Game:** entangled and mixed preparations, optimized spin measurement axes, independent detector losses/errors, all-trial CHSH with anytime confidence bounds, marginal predictions, seeded replay, and count exports.
- **Curved-Space Gravity:** Schwarzschild matter/light geodesics replace the Gaussian ant analogy. Explore precession, photon capture, and infall with adaptive integration, conserved-quantity diagnostics, proper/coordinate time, and an independent orbital benchmark.
- **Light Factory:** causal Liénard–Wiechert E and B replace delayed radial lines. Separate velocity/radiation fields, move a probe, inspect waveforms and relativistic radiation patterns, and export numeric fields.

All three include model equations, units, reference links, limitations, and desktop/phone controls. Read [ACCURACY_REPORT.md](ACCURACY_REPORT.md) for methods and verification. The new models are in `assets/precision-models.js`; their interface is in `assets/fundamental-labs.js`. Earlier dated descriptions of these three labs describe their superseded versions.

## Qubit Box replacement — September 18

The approved Qubit Box preview is now the main `qubit_box.html` experiment. It connects position density, Bloch geometry, density matrices, and Z/X/Y measurements. Population, phase, and coherence controls prepare fresh states; ensemble batches sample a frozen state independently. Playback defaults to 4× and supports 1×–8×. The library thumbnail loops the real evolution and honors workspace pause. The original HTML is preserved in `backups/qubit-box-20260918/qubit_box.html`; the separate concept preview remains available.

Production code lives in `assets/qubit-box-model.js`, `assets/qubit-box.js`, and `assets/qubit-box.css`. Mass, ħ, and box length are fixed to one; the old mass-only Equation lab entry is replaced with state-preparation controls. The model includes no position collapse or environmental decoherence.
