Skip to content

garcfd/python-bounce-trajectory-simulator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

Water Bounce Simulator

Self-contained HTML/JS page for simulating a ball bouncing on water. Open water_bounce.html in any browser — no Python or dependencies required.

What it models

  • 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

Controls

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

Usage

  1. Open water_bounce.html in a browser
  2. Adjust any parameter
  3. Click Run Simulation (or press Enter)
  4. Top chart shows the trajectory with red apex markers; bottom chart shows vx/vy vs position

About

python-bounce-trajectory-simulator

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors