The frontend lives in frontend_web/ and is a React + Vite application.
- render the UI
- switch between nonlinear and linear views
- maintain current state, playback, and initial conditions
- send configuration commands to the backend
- draw the pendulum chain and fading tails on a canvas
- record the canvas when requested
The frontend stores:
simulationModenonlinearorlinear
- distribution modes
lengthModemassModeangleMode
- physical parameters
nglengthsmassesinitialAngles
- runtime state
- play or pause
- current time
- nonlinear angles and velocities
- trail history
The nonlinear path is now engine-backed:
- The frontend sends the current setup to the backend.
- The backend forwards it to the native C++ engine.
- The engine integrates the nonlinear equations and streams back world-space bob positions.
- The frontend renders those positions on the canvas.
This path is used when the user selects Nonlinear Sandbox.
The linear path is modal:
- The frontend sends parameters to the backend over WebSocket.
- The backend forwards them to the native engine.
- The native engine solves the modal problem and reconstructs
theta(t)internally over time. - The frontend renders the streamed positions.
This path is used when the user selects Linear Modes.
The canvas renderer draws:
- the ceiling anchor
- rods
- bobs
- colored trajectory tails
Each bob gets its own color and a finite trail length so the screen stays readable.
The interface exposes equal/unequal toggles separately for:
- masses
- lengths
- initial angles
When a quantity is set to equal, only one slider is shown.
When a quantity is set to unequal, per-pendulum sliders are shown.
This keeps the UI compact for symmetric experiments while still supporting fully heterogeneous setups.