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.
翻译:近年来,越来越多的工作侧重于不同的物理模拟,并产生了一套开放源码项目,如微小可辨别模拟器、Nimble物理、diffTaichi、Brax、Warp、Dojo和DiffCoSim。通过使物理模拟最终到终端可辨别,我们可以执行基于梯度的优化和学习任务。大多数不同的模拟器考虑物体之间的碰撞和接触,但它们使用不同的接触模型来区分。在本文中,我们概述了四种不同的接触配方 -- -- 线性互补问题(LCP)、粘合优化模型、兼容性模型和基于位置的动态(PBD)。我们分析和比较了这些模型所计算的梯度,并表明梯度并不总是正确。我们还展示了它们通过分析形式比较所学战略与最佳战略学习最佳控制战略的能力。复制实验结果的代码库见https://github.com/DesmondZhong/diff_sim_grads。