Dynamics
SuperDex Physics advances mechanical systems by stable implicit time integration of their equations of motion. This page introduces the continuous system dynamics, describes SuperDex Physics' unified implicit time integration, and discusses how problem structure can often be exploited to formulate the implicit equations as an optimization problem within each step.
System Dynamics
Much of the dynamics simulated by SuperDex Physics can be expressed in the framework of classical Lagrangian mechanics, although it needs to be augmented with additional non-conservative forces to include dissipative mechanisms.
Let be the generalized configuration and its generalized velocity. When is a vector space, tangent-space increments can be added directly. Rotations, articulated poses, and rod frames instead lie on nonlinear configuration manifolds, so SuperDex Physics applies increments in a tangent space and maps them back to with type-specific updates.
Define the Lagrangian
where is kinetic energy and is the total conservative potential. The Euler–Lagrange equations are
where contains nonconservative generalized forces. When dissipative forces derive from a dissipation potential ,
and the equations can be written as
Here, collects forces not represented by or . Depending on the system, the total conservative potential can include elastic, gravitational, contact, constraint, and applied-load terms. The actor pages define the forms of , , and used by each model.
Time Integration
SuperDex Physics advances differential variables governed by
with a unified family of implicit multistep and Runge–Kutta methods. Each method first combines completed-step states, then solves one or more implicit stages. Backward Euler is the default. Kennedy and Carpenter (2016) provide a detailed review of diagonally implicit Runge–Kutta methods, which the reader may find helpful for additional background information.
Unified Formulation
A multistep method uses states from multiple completed time steps, whereas a multistage method evaluates one or more intermediate stage states within the current time step. The formulation below combines both structures: the coefficients and define the -step structure, while the coefficients defining the -stage structure are canonically expressed as a so-called Butcher tableau , to facilitate the algebraic definitions below. Readers interested in a high-level conceptual overview of implicit integration may consider substituting and into these formulas to recover the simplest case of backward Euler. The full list of supported methods is given in the Available Methods section below.
Define the multistep base state
where the first coefficient multiplies the most recent completed state . Let denote the full time-step size. Stage is
and the completed step is
Lowercase denotes the ODE state at a completed time step, whereas uppercase and denote the stage-start and stage-end states within the current step. SuperDex Physics reconstructs from completed-step history, solves the stage states sequentially, and combines them to produce . Although these states may coincide for particular methods, they have distinct roles in the general formulation.
For a mechanical system, the first-order ODE state is , where is generalized configuration and is generalized velocity. Correspondingly, and contain the stage-start and stage-end mechanical states. Thus, SuperDex Physics solves stage as a backward-Euler-like problem over the stage duration .
Stages are solved sequentially. Accordingly, SuperDex Physics supports lower-triangular with positive diagonal entries. Explicit stages and fully coupled implicit Runge–Kutta methods are not supported.
Stage-State Reconstruction
SuperDex Physics stores stage-end states rather than the slopes . Define
The states needed by later stages and by the completed step can then be reconstructed as
Here, is entry of row . For variables in vector spaces, these are ordinary weighted differences. For rotations and other manifold-valued configurations, SuperDex Physics applies the analogous type-specific difference and update operations.
Mechanical Variables
Although the general stage state contains both configuration and velocity, SuperDex Physics can use alone as the nonlinear unknown. Given the stage-start state , it reconstructs the stage-end velocity and acceleration as
These are stage-local differences: the reference is the reconstructed stage-start state, not necessarily the state at the beginning of the full time step. For manifold-valued configurations, SuperDex Physics replaces the subtractions above with the analogous type-specific difference and tangent-space operations. Other rates used in dissipative terms (e.g., strain-rates for viscoelasticity, rates of constraint residuals for constraint damping, etc.) are also formulated as stage-local differences, to facilitate the use of optimization techniques to solve the implicit stage problem, as discussed further in the section on Incremental Potential Form below.
Implicit Stage Problem
At each implicit stage , SuperDex Physics treats the stage-start state as fixed and solves for the configuration component of the stage-end state . The velocity and acceleration components are reconstructed from using the stage-local relations above. Substituting these relations into the discretized equations of motion produces the nonlinear stage residual
The arguments after the semicolon are fixed data for the stage. SuperDex Physics solves this equation with a Newton-like method, using the residual derivative
This residual equation is the general form of the abstract implicit stage solve represented earlier by together with .
Incremental Potential Form
The implicit stage problem to solve at each step is a system of nonlinear algebraic equations. The solution of arbitrary nonlinear systems is challenging, and typically relies on iterative algorithms like Newton's method, which are not guaranteed to converge unless specific conditions are met. However, additional techniques are available for solving optimization problems, where the residual is the gradient of some scalar potential. This is not guaranteed to be the case for arbitrary choices of configuration-dependent or , but it does hold for many nontrivial systems. When the stage residual is the gradient of a potential, that potential is referred to as the "incremental potential", to distinguish it clearly from the physical potential energy of the continuous problem. Gast et al. (2015) provide background on the general concept of incremental potential integration, using backward Euler as a representative implicit integrator. We now provide a brief introduction in the notation of the current page.
Consider a mechanical system whose configuration space is a vector space and for which . Suppose its kinetic energy and dissipation potential have the forms
Here, the symmetric positive-definite, constant matrix maps generalized velocity to generalized momentum and is called the mass matrix; the velocity-only dependence of will ensure that its discrete contribution has the intended gradient. Using for the stage-end configuration unknown, define
The incremental potential is
where . Its gradient is
The implicit stage equation is therefore the stationarity condition for . The factor multiplying is essential: the chain rule converts its configuration gradient into without an extra time-step factor. In this exact case,
The assumptions above can be relaxed only when the resulting discrete terms remain integrable. A configuration-dependent kinetic energy, such as , produces additional inertial terms through the full Euler–Lagrange operator and does not reduce to the quadratic inertial term shown above.
Similarly, a continuous dissipation potential can depend on configuration as well as velocity, , with dissipative force at fixed and . Directly inserting such an into the discrete objective generally gives
The additional configuration derivative is not part of the original dissipative force. An equivalent incremental potential therefore exists only if this extra term vanishes, belongs to the intended discrete model, or is avoided by explicitly evaluating the configuration-dependent coefficients and holding them fixed during the stage. Any force in must likewise derive from a potential that can be absorbed into ; otherwise it precludes an exact incremental-potential form.
When these conditions do not hold, the residual remains the authoritative discrete equation. SuperDex Physics may still assemble a scalar merit for line search, or use a symmetric, fitted, or positive-semidefinite approximation to the exact residual derivative. Important departures from this simple vector-space setting include:
- State-dependent dissipation can be potential-derived when its coefficients are fixed during the stage. Contact friction, for example, can evaluate selected normals or normal-force magnitudes explicitly to recover an integrable stage model.
- Some formulations, such as Newton–Euler rigid inertia, provide a residual without an exact incremental potential of this form.
Actor pages specialize this structure by defining their kinetic, conservative, and dissipative terms and documenting any problem-specific explicit evaluations or approximations.
Available Methods
The Coefficients column lists and the Butcher tableau .
| Method | Steps | Stages | Order | Stability or structure | Coefficients |
|---|---|---|---|---|---|
BackwardEuler (BDF1, DIRK11) | 1 | 1 | 1 | L-stable | ; ; |
BDF2 | 2 | 1 | 2 | A-stable | ; ; |
BDF3 | 3 | 1 | 3 | Not A-stable | ; ; |
DIRK22 | 1 | 2 | 2 | L-stable | ; ; |
DIRK23 | 1 | 2 | 3 | A-stable, not L-stable | ; ; |
DIRK33 | 1 | 3 | 3 | L-stable | ; ; |
SymplecticDIRK12 (implicit midpoint) | 1 | 1 | 2 | A-stable, symplectic | ; ; |
SymplecticDIRK22 | 1 | 2 | 2 | A-stable, symplectic | ; ; |
The DIRK constants are
BDF2 starts with backward Euler until two completed states are available. BDF3 starts with backward Euler, switches to BDF2 when two completed states are available, and switches to BDF3 when three are available.
Comparison and Recommendations
The default integration method is BackwardEuler. This provides maximum stability and is often useful in cases such as:
- Setting up new scenes without fully calibrating all parameters. The heavy numerical dissipation from backward Euler can compensate for incomplete specification of physical dissipation mechanisms.
- Running interactive teleoperation simulations, where only qualitative accuracy is required, but maximum robustness is needed with large, variable time-step sizes and noisy forces coming from user inputs.
For scenarios where quantitative accuracy is desired, BDF2 is recommended. In most human-scale robotics applications, this should be sufficiently accurate to render time-discretization error secondary to errors coming from spatial discretization of deformable bodies or contact surfaces, approximate algebraic solution of the implicit step problem, or inherent modeling error in the continuous problem statement. However, one should keep the following considerations in mind when using BDF2:
- The higher accuracy of this time integrator will often highlight under-specification of physical damping mechanisms. Any stiffness-like term contributing to should have a corresponding dissipative contribution to to control oscillation. Specifically:
- Objects may bounce excessively without setting normal contact damping in rigid collisions or including viscoelastic stiffness damping in deformable actors' material parameters.
- Compliant constraints and articulated joint limits should have nonzero damping to control oscillation and bouncing.
- Pose controllers should have nonzero derivative control.
- Formal second-order accuracy depends on a constant time-step size. The method remains stable with arbitrary dynamic time-stepping, but is no longer expected to converge at its full order of accuracy.
Integrators other than BackwardEuler and BDF2 are recommended only for special situations that are uncommon in typical robotics applications. E.g., a symplectic integrator may be preferred if long-time energy conservation is important, but most real object-manipulation scenarios include too much physical dissipation for the benefits of symplectic integration to be evident.
Choosing a Time-Step Size
Choose a time-step size that resolves the dynamics of interest. For A-stable integration methods, including L-stable methods, the time-step size is not limited by the stiffness-driven linear-stability restrictions of explicit or semi-implicit methods. Consequently, SuperDex Physics can use substantially larger stable time steps than physics engines based on explicit or semi-implicit integration. This is particularly valuable for stiff systems, such as stiff or nearly incompressible soft bodies, thin shells and slender rods with widely separated deformation scales, and scenes with stiff contact or constraints. This ability to take fewer steps per simulated second often improves simulation performance and real-time factor.
Time steps of 10–25 ms (40–100 physics steps per simulated second) run robustly in most scenes, including complex contact-rich and deformable simulations. This is a practical starting range, not a guarantee. Smaller steps may still be required to resolve fast motion, accurately capture short-duration contact dynamics without excessive numerical dissipation, resolve dynamics associated with small geometric or discretization length scales, or improve nonlinear-solver convergence.
Examples
- Damping Parameter Sweep: demonstrates use of a higher-order time integrator with physical dissipation mechanisms active. Python example:
examples/example_damping_sweep.py.
Related Concepts
References
- T. F. Gast, C. Schroeder, A. Stomakhin, C. Jiang, and J. M. Teran, Optimization Integrator for Large Time Steps, IEEE Transactions on Visualization and Computer Graphics, 21(10):1103–1115, 2015.
- C. A. Kennedy and M. H. Carpenter, Diagonally Implicit Runge-Kutta Methods for Ordinary Differential Equations: A Review, NASA/TM-2016-219173, 2016.