This study evaluates structure-preserving neural network architectures for learning holonomically constrained mechanical dynamics in Cartesian coordinates. In contrast to methods using reduced coordinates, the full ambient phase space R2n is retained with explicit algebraic constraints Ci(q)=0 to provide a test bed for constraint-aware learning. The Constraint-Aware Hamiltonian Neural Network (CA-HNN) is proposed, which augments the standard HNN with a dedicated multiplier network λϕ(q,p) for Lagrange multipliers and a composite loss function evaluated on predicted rollouts. The theoretical framework is grounded in the geometry of constrained Hamiltonian systems: the extended phase space R2n+m carries a degenerate antisymmetric structure where an m-dimensional kernel encodes constraint directions, while the symplectic structure emerges on the 2(n−m)-dimensional reduced manifold Σ. It is proven that the physical Hamiltonian is conserved on the constraint surface under augmented flow. Benchmarks on a pendulum (C=x2+y2−l2), double pendulum, and bead on a parabola (C=y−x2) demonstrate that CA-HNN reduces constraint violations ∥C(q)∥ by 5× to 2400× compared to standard HNNs. While the best energy conservation is achieved by PINNs, these findings clarify the roles of architectural inductive bias, constraint augmentation, and soft physics regularization.
Rojas-Valdivia et al. (Thu,) studied this question.