Add realistic heavy-symmetric-top dynamics on the nutation screen - #3
Merged
Merged
Conversation
Screen 1 models a top with the idealized Ω = τ/(Iω) relation, which assumes the axis is handed exactly the steady-precession rate and holds its tilt forever. Screen 2 now integrates the same apparatus from its full Lagrangian instead, so the tilt is a dynamical variable and a released top behaves like a real one: the axis dips, picks up precession, rises again, and its tip traces cusps, loops, or smooth waves depending only on how it was released. Physics (src/common/rigid-body/HeavySymmetricTopPhysics.ts): - Euler-angle equations of motion for a heavy symmetric top, integrated with RK4 at a 0.5 ms internal substep - Turning points from the effective potential, by bisecting the cubic in cos θ - Steady-precession roots and the critical spin below which no steady solution exists, plus the sleeping-top stability criterion - Optional viscous friction (drag on the center of mass, spin friction at the pivot) that damps the nutation and spins the top down until it falls - Inelastic mechanical stop where the axle rests against its mount Screen: - Perspective view of the wheel with the tip path and the two dashed circles bounding the nutation band, drawn via an exact linear projection of the Euler frame (src/common/view/TopProjection.ts) - θ(t) graph with the turning points as reference lines - Controls for spin, release tilt, release mode, and friction, with readouts for the band, both frequencies, and the critical spin - Slow-motion option, since nutation and precession differ by roughly 5× in rate - Live accessible summary and localized strings in en/fr/es Apparatus constants are a demonstration gyroscope wheel: ω_nut · Ω_slow = M g l / I₁ is fixed by the apparatus alone, so the wheel is deliberately large and short-armed to bring both timescales on screen at once. Tests assert the integrator against analytic results — energy and both angular momenta conserved to 6+ decimals over 10 s, exact steady precession at the fixed point, motion confined to and reaching the predicted turning points, and the fast-top nutation frequency I₃ω₃/I₁. Also moves PlayAreaPanel to src/common/view so both screens can use it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01H6aawcC32DhbbRsgmeugbk
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Screen 1 models a top with the idealized Ω = τ/(Iω) relation, which assumes
the axis is handed exactly the steady-precession rate and holds its tilt
forever. Screen 2 now integrates the same apparatus from its full Lagrangian
instead, so the tilt is a dynamical variable and a released top behaves like a
real one: the axis dips, picks up precession, rises again, and its tip traces
cusps, loops, or smooth waves depending only on how it was released.
Physics (src/common/rigid-body/HeavySymmetricTopPhysics.ts):
RK4 at a 0.5 ms internal substep
exists, plus the sleeping-top stability criterion
pivot) that damps the nutation and spins the top down until it falls
Screen:
bounding the nutation band, drawn via an exact linear projection of the
Euler frame (src/common/view/TopProjection.ts)
for the band, both frequencies, and the critical spin
Apparatus constants are a demonstration gyroscope wheel: ω_nut · Ω_slow =
M g l / I₁ is fixed by the apparatus alone, so the wheel is deliberately large
and short-armed to bring both timescales on screen at once.
Tests assert the integrator against analytic results — energy and both angular
momenta conserved to 6+ decimals over 10 s, exact steady precession at the
fixed point, motion confined to and reaching the predicted turning points, and
the fast-top nutation frequency I₃ω₃/I₁.
Also moves PlayAreaPanel to src/common/view so both screens can use it.
Co-Authored-By: Claude Opus 5 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01H6aawcC32DhbbRsgmeugbk