Another example (with some comments copied too). Click on the canvas to reset the balls.
simulate forces
https://ellie-app.com/5N6XgFp7kYZa1
this was translated from
https://p5js.org/examples/simulate-forces.html
I found it amusing when I changed the liquid to fill the center third of the canvas. The physics works well.