Energy- and Quadratic Invariants-Preserving Integrators Based upon Gauss Collocation Formulae