Each marble alternates between two regimes on a single closed loop: a motor-driven elevator that lifts it at a fixed speed, and a free gravity track that it descends (and briefly re-climbs, on the bumps) under its own momentum.
- On the elevator, position advances at the constant motor speed you set — this models the mechanical belt/paddle drive.
- Once released at the top, the marble's speed along the track changes each step by
dv/dt = -g·T_y - friction·v, where T_y is the vertical component of the track's local tangent direction (so descending sections accelerate it, climbing sections slow it) and the friction term is simple rolling drag.
- Reaching the bottom returns the marble to the elevator, closing the loop and counting a lap.
a = -g·sin(θ) - μv, where θ is the track's local slope