pub fn check(p: &Pendulum) -> Energy
Expand description
Calculate energies of the current state.
The kinetic and the potential energies are computed following the definition.
The (non-dimensional) potential energy is computed with repsect to the quiescent state.
Since I fix the initial condition in crate::simulator::init
, the expected total energy is known a propri.
This value is used to normalise the total value.