Differentiable Physics Simulations with Contacts: Do They Have Correct Gradients w.r.t. Position, Velocity and Control?

Yaofeng Desmond Zhong, Jiequn Han, Georgia Olympia Brikis
7/8/2022
cs.LGcs.AIcs.RO

Official code: DesmondZhong/diff_sim_grads (54 stars, PyTorch, last commit 2022-11-10).

Abstract

In recent years, an increasing amount of work has focused on differentiable physics simulation and has produced a set of open source projects such as Tiny Differentiable Simulator, Nimble Physics, diffTaichi, Brax, Warp, Dojo and DiffCoSim. By making physics simulations end-to-end differentiable, we can perform gradient-based optimization and learning tasks. A majority of differentiable simulators consider collisions and contacts between objects, but they use different contact models for differentiability. In this paper, we overview four kinds of differentiable contact formulations - linear complementarity problems (LCP), convex optimization models, compliant models and position-based dynamics (PBD). We analyze and compare the gradients calculated by these models and show that the gradients are not always correct. We also demonstrate their ability to learn an optimal control strategy by comparing the learned strategies with the optimal strategy in an analytical form. The codebase to reproduce the experiment results is available at https://github.com/DesmondZhong/diff_sim_grads.

View on arXivView PDF

Code Implementations(1)

PyTorch

We compare the gradients calculated by different differentiable contact model implementations.

544Shell, PythonJul 8, 20223 years agoNOASSERTION
differentiable-simulationdynamical-systemsoptimal-controlpytorchtaichi+1 more

Similar Papers

Cite this paper

@article{zhong2022differentiable,
  title  = {Differentiable Physics Simulations with Contacts: Do They Have Correct Gradients w.r.t. Position, Velocity and Control?},
  author = {Yaofeng Desmond Zhong and Jiequn Han and Georgia Olympia Brikis},
  year   = {2022},
  eprint = {2207.05060},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2207.05060v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2207.05060.svg)](https://codeofpaper.com/paper/2207.05060)

Discussion