Protons in a square (2D)

Simulation of the motion of protons.
Concepted and developed by Henrik Somogyi, 2022

                protons.

Your browser does not support the HTML 5 Canvas

Users Guide

This animation mimics the motion of protons in a square-shaped area, all in 2 dimension (2D). The protons repulse (when farther) each other. Repulsion force is inverse proportional with square of distance. Protons bounce back from the sides (without loss of motion energy). The initial proton speeds are zero. Initial proton location is random (uniform distribution). When friction is on, then each proton loses a proportional part of its motion energy by time. Total sum of motion energy is displayed. Friction on/off as well.

Watch how the protons want to catch an edge position, but not all of them manages it. The rest remains in the middle.

Button "Cool down" : when pressed, each proton loses a fix percentage from its motion energy.
Button "Warmp up" : when pressed, each proton gains a fix percentage from its motion energy.
Button "Reset" : when pressed, each proton gets to a random start position, with zero speed.
Button "Friction" : toggles if friction is on or off.
Input field "Protons" : the number of protons. Applied upon next "reset".