Conservation of angular momentum and energy in the integration of non-linear dynamic equations