You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: models/newton.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@ This model infers what forces govern a simple physical scene from the scene's ob
11
11
12
12
In the observed scene, one particle moves at high speed towards another particle at rest. Inference is over the dynamics that produced the observed trajectory: did collision forces act between the particles, and if so, with what elasticity? The initial velocities are also uncertain. Each hypothesis is evaluated by simulating the scene forward with RK4 and softly conditioning the simulated trajectory to match the observed one at a subsampled set of points, so every MH step integrates the equations of motion anew.
13
13
14
-
The program runs this inference for two scenes: one where the particles truly do not interact, so the moving particle passes straight through the other (the run in the original program), and one where collision forces truly act, so the particles collide almost inelastically. In the first case the posterior concludes that no collision forces were at play, and the elasticity posterior stays at its prior; in the second it concludes that collision forces were present and recovers the true elasticity of 0.1. Expect MCMC to take on the order of ten seconds per scene.
14
+
The program runs this inference for two scenes: one where the particles do not interact, so the moving particle passes through the other, and one where collision forces produce an almost inelastic collision. The first posterior favors no collision force; the second favors collision and recovers elasticity near its true value of 0.1. The short paths and modest MCMC settings keep both examples practical in the browser and in headless checks.
var inferredForces = collision ? [collisionF] : [nullF];
240
240
var mass1 = Math.exp(0.2); // deterministic, as in the original code
@@ -292,10 +292,10 @@ This page was originally written for desktop Church (Bher/Ikarus) and could not
292
292
293
293
- Particle properties are records rather than association lists, and angles are computed with `Math.atan2`, which is equivalent to the original's case analysis.
294
294
- The original parameterized Gaussians by variance (see its `gaussian-lnpdf`); the port keeps the variance parameterization through a helper.
295
-
- The original's `noisy=` soft-equality conditions are folded into a single equivalent `factor`. As in the original's reduced comparison, the condition uses 100 subsampled path points; the original also listed a comparison over the full path.
295
+
- The original's `noisy=` soft-equality conditions are folded into a single equivalent `factor`. The browser model conditions on 50 subsampled path points rather than the full path.
296
296
- The original's `mh-query` returned `(list mass1 mass2)`, but both masses were the deterministic constant `(exp 0.2)`; the port returns the inferred force law and elasticity instead.
297
297
- The original only ran the pass-through scene (its `true-Fl` was the null force); the port also runs the collision scene, which the original's output filenames suggest was the intended experiment.
298
-
- MH settings: 500 burn-in iterations plus 200 samples per scene (the original requested 10 samples).
298
+
- MH settings: 200 burn-in iterations plus 100 samples per scene (the original requested 10 samples).
0 commit comments