Docs

Forces and motion

Keep annotations and animation tied to one physical solution.

PhysLoom separates what is solved from what is shown. Entities, relations, and parameters define the model first; show and drive then select projections for the reader.

Show solved results

show force
show tension
show displacement
show force_diagram

force places force vectors in the main scene; force_diagram produces a separate free-body diagram. Vector direction and magnitude come from the solution rather than renderer guesses.

When a diagram becomes crowded, keep only what the current explanation needs. Hiding tension or weight does not change the model; it only reduces visual noise.

Request motion

drive names an observation target and a motion intent:

drive R.free displacement=1m duration=2s

displacement=1m is the physical observation window. duration=2s defines real duration only for a scene that allows prescribed motion. playback=3s changes screen playback speed without changing physical time.

For a process that the model can derive, prefer a phase:

drive R phase=release displacement=0.5m playback=3s
drive planet phase=period playback=5s
drive electron phase=transit playback=3s

The compiler selects a domain-specific motion compiler. If none matches, it should report an error instead of playing a generic translation that merely looks plausible.

Animation shares physical state

Body position, rope segment length, spring extension, velocity vectors, and readouts must sample the same MotionClip. At every paused frame, geometry, values, and forces remain consistent.

If a model only supports a static solution, removing drive still produces the static diagram. Do not use hand-authored keyframes to hide a missing physical solver.

A complete example

scene moving_pulley {
  support ceiling
  body load mass=20kg
  pulley M attached to load
  pulley F fixed to ceiling
  rope R path anchor(ceiling) -> around(M) -> around(F) -> handle

  show tension displacement force_diagram
  drive R.free displacement=1m duration=3s
}

This source declares one rope path. Static tangent points, mechanical advantage, load displacement, free-end motion, and the force diagram should all be projections of that path.