Skip to content

feat: add aerodynamic drag to physics model - #1

Merged
cloudygreybeard merged 2 commits into
mainfrom
feat/aerodynamic-drag
Aug 1, 2026
Merged

cloudygreybeard merged 2 commits into
mainfrom
feat/aerodynamic-drag

Conversation

@cloudygreybeard

Copy link
Copy Markdown
Owner

Summary

  • Adds a velocity-dependent drag term to the equation of motion, modelling aerodynamic resistance on the spinning wheel
  • The combined deceleration is now dv/dt = -alpha_c - (gamma/m) * v, where alpha_c is the Coulomb term and gamma/m is the drag term
  • Resolves the runaway behaviour where a light wheel (e.g. mass=0.1, friction=0.01) would spin for 350+ seconds under pure Coulomb friction
  • New --drag flag (default 0.1); set to 0 for pure Coulomb friction
  • Delay schedule computed by numerical bisection when drag > 0; closed-form Coulomb expression used when drag = 0
  • README extended with sections 2.2 (aerodynamic drag) and updated 2.3 (discrete delay schedule), including equations (5)-(9) and worked examples

Test plan

  • All 31 tests pass with race detector
  • New tests: drag monotonicity, drag reduces ticks, light wheel stops faster at same v0, drag narrows mass gap, prevents runaway, zero drag falls back to Coulomb, first delay approximates 1/v0
  • Smoke tested: mass=0.1 friction=0.01 completes in ~8s (was 350s+)
  • go vet and lints clean

Add a velocity-dependent drag term to the equation of motion:

  dv/dt = -alpha_c - (gamma/m) * v

This resolves the counter-intuitive behaviour where a light wheel with
low friction would spin for arbitrarily long (mass cancelled from the
pure Coulomb deceleration). With drag, a lighter wheel at high velocity
experiences proportionally greater braking, bounding the animation to a
reasonable duration.

The delay schedule is now computed by numerical bisection of the
position-time integral, which involves both exponential and linear
terms. When drag is zero, the closed-form Coulomb expression is used.

New flag: --drag (default 0.1, set to 0 for pure Coulomb friction).
@cloudygreybeard
cloudygreybeard merged commit e340856 into main Aug 1, 2026
3 checks passed
@cloudygreybeard
cloudygreybeard deleted the feat/aerodynamic-drag branch August 1, 2026 05:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant