  Gaussian process regression is increasingly applied for learning unknown
dynamical systems. In particular, the implicit quantification of the
uncertainty of the learned model makes it a promising approach for
safety-critical applications. When using Gaussian process regression to learn
unknown systems, a commonly considered approach consists of learning the
residual dynamics after applying some generic discretization technique, which
might however disregard properties of the underlying physical system.
Variational integrators are a less common yet promising approach to
discretization, as they retain physical properties of the underlying system,
such as energy conservation and satisfaction of explicit kinematic constraints.
In this work, we present a novel structure-preserving learning-based modelling
approach that combines a variational integrator for the nominal dynamics of a
mechanical system and learning residual dynamics with Gaussian process
regression. We extend our approach to systems with known kinematic constraints
and provide formal bounds on the prediction uncertainty. The simulative
evaluation of the proposed method shows desirable energy conservation
properties in accordance with general theoretical results and demonstrates
exact constraint satisfaction for constrained dynamical systems.
