Pressure measurements in molecular dynamics¶
When molecules or atoms are confined to a box they produce a pressure due to the exchange of momentum with the walls. If the normal velocity is ${\bf n}\cdot {\bf v}$ with ${\bf n}$ the wall normal, each collision with the wall exchanges momentum $I= 2 m\, {\bf n}\cdot {\bf v} $. The time average of this quantity is $L P$, where $L$ is the side of the box and $P$ is the pressure. Each call to md_step()
should calculate the time average of the force during a single call, and return the result to the calling function.
It is probably best to work with the particle mass $m=1$, at least to start the programming.