Self-contained HTML/JS page for simulating a ball bouncing on water. Open water_bounce.html in any browser — no Python or dependencies required.
- Gravity — constant downward pull
- Buoyancy — upward force proportional to submerged volume
- Water incompressibility (spring k·depth) — stores impact energy and returns it, producing the bounce
- Water viscosity (damper -c·vy·sr) — dissipates energy each bounce
- Horizontal drag (-½ρ·Cd·A·vx·|vx|) — slows the ball laterally during each water contact
| Section | Parameter | Default |
|---|---|---|
| Initial conditions | ux (horizontal speed) | 10 m/s |
| uy (vertical speed) | 0 m/s | |
| Release height | 10 m | |
| Ball properties | Mass | 500 kg |
| Radius | 0.5 m | |
| Drag coefficient Cd | 0.5 | |
| Water force model | Stiffness k | 1,500,000 N/m |
| Damping c | 10,000 N·s/m | |
| Simulation | Time | 20 s |
- Open water_bounce.html in a browser
- Adjust any parameter
- Click Run Simulation (or press Enter)
- Top chart shows the trajectory with red apex markers; bottom chart shows vx/vy vs position