Motor (top-down)
Swimming trajectory
Run (CCW) Tumble (CW)

Bacterial Flagellar Motor: Run-and-Tumble Motility (2D)

This 2D companion to the 3D bacterial flagellar motor solves the identical "knee-shaped" torque-speed curve against a viscous load line — proton-motive force, engaged stator count and load all feed the same physics — but instead of showing the motor's internal geometry, it uses the motor's solved rotation rate and CW/CCW switching state to drive a genuinely independent second simulation: the cell's own swimming trajectory. During a CCW "run" the flagellar bundle co-rotates and the cell moves in a straight line at a speed set by the motor's solved rotation rate; a CheY-P-triggered switch to CW flings the bundle apart, the cell's translation stalls, and its heading randomizes before the next run sets off in a new direction. The result is a real biased random walk — the run-and-tumble pattern E. coli actually uses for chemotaxis — with the ratio of total path length to net displacement serving as the model's own honest measure of how diffusive or ballistic the walk currently is.