[Paper Review] Extending Lagrangian and Hamiltonian Neural Networks with Differentiable Contact Models
This paper proposes a differentiable contact model that extends Lagrangian and Hamiltonian neural networks to handle frictional, elastic, and inelastic contacts with discontinuous state transitions. By integrating convex optimization-based contact mechanics with differentiable physics, the framework enables end-to-end learning of system dynamics and contact properties from trajectory data, achieving high data efficiency and accurate simulation for 2D/3D systems with complex contact behaviors.
The incorporation of appropriate inductive bias plays a critical role in learning dynamics from data. A growing body of work has been exploring ways to enforce energy conservation in the learned dynamics by encoding Lagrangian or Hamiltonian dynamics into the neural network architecture. These existing approaches are based on differential equations, which do not allow discontinuity in the states and thereby limit the class of systems one can learn. However, in reality, most physical systems, such as legged robots and robotic manipulators, involve contacts and collisions, which introduce discontinuities in the states. In this paper, we introduce a differentiable contact model, which can capture contact mechanics: frictionless/frictional, as well as elastic/inelastic. This model can also accommodate inequality constraints, such as limits on the joint angles. The proposed contact model extends the scope of Lagrangian and Hamiltonian neural networks by allowing simultaneous learning of contact and system properties. We demonstrate this framework on a series of challenging 2D and 3D physical systems with different coefficients of restitution and friction. The learned dynamics can be used as a differentiable physics simulator for downstream gradient-based optimization tasks, such as planning and control.
Motivation & Objective
- To address the limitation of existing Lagrangian and Hamiltonian neural networks in modeling physical systems with discontinuous dynamics due to contacts and collisions.
- To develop a differentiable contact model that captures frictional, elastic, and inelastic contact mechanics while enforcing energy conservation during smooth trajectory segments.
- To enable joint learning of system dynamics and unknown contact parameters (e.g., coefficient of restitution, friction) from observed trajectory data.
- To demonstrate the framework as a differentiable physics simulator for downstream gradient-based optimization tasks such as planning and control.
Proposed method
- The contact model formulates contact impulse computation as a convex optimization problem, solving for velocity jumps during contact while enforcing physical constraints like non-negative normal forces and maximum dissipation.
- The optimization problem is made differentiable using recent advances in differentiating through convex solvers, enabling backpropagation through contact events.
- The framework integrates the differentiable contact model into Lagrangian and Hamiltonian neural network architectures, preserving energy conservation during smooth motion phases.
- The system uses Cartesian coordinates for improved learning performance, as shown in prior work, and supports inequality constraints such as joint angle limits.
- The model is trained end-to-end using trajectory data, with loss functions that minimize trajectory prediction error and regularize contact parameters.
- The framework is evaluated on 2D and 3D physical systems, including pendulums, ropes, and robotic manipulators, with varying coefficients of restitution and friction.
Experimental results
Research questions
- RQ1Can a differentiable contact model be integrated into Lagrangian and Hamiltonian neural networks to model discontinuous dynamics caused by contacts and collisions?
- RQ2How well can the framework jointly learn unknown system dynamics and contact properties (e.g., friction, restitution) from limited trajectory data?
- RQ3Does the inclusion of differentiable contact mechanics improve data efficiency and generalization compared to standard neural ODE or baseline models?
- RQ4How does the framework perform under varying contact complexity, such as in systems with multiple or high degrees of freedom?
- RQ5Can the learned model serve as an effective differentiable physics simulator for downstream planning and control tasks?
Key findings
- The proposed CM-CD-CLNN model achieves a trajectory relative error of 1.20e-3 (with 95% CI 2.88e-4) on the rope system with 12,800 training trajectories, significantly outperforming baselines in data efficiency.
- The model maintains low error (1.20e-3) even with only 25 training trajectories, demonstrating strong data efficiency due to strong physics priors.
- The ablation study shows that learning contact parameters (μ and eP) from data yields a mean error of 0.453 for μ and 0.861 for eP, close to the true values of 0.500 and 0.800.
- The model performs best with small networks (3-layer, 256-wide MLP), indicating that the physics inductive bias allows accurate potential energy estimation without over-parameterization.
- In contact-rich scenarios (D=400), the performance gap between the proposed model and baselines is minimal, suggesting potential limitations in highly complex contact configurations.
- The framework successfully enables differentiable simulation, demonstrating utility in downstream planning tasks through gradient-based optimization.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.