The Pendulum Challenge

Matthias Müller, Nvidia

This simulation shows that extended position based dynamics (XPBD) is a strong competitor to state of the art simulation methods in terms of accuracy, stability, speed and simplicity. To understand why and how to use the demo see the text below.

.


Your browser does not support the HTML5 canvas tag.

0.000 ms per frame, dt = 1/60 s, g = -10 m/s2

Number of links: 3

Number of sub-steps: 50

mass (kg)length (m)compliance (m/N)uni
1.0 0.3 0.000
1.0 0.3 0.000
1.0 0.3 0.000
1.0 0.3 0.000

Edge damping coefficient (Ns/m) 0.0

Global damping coefficient (Ns/m) 0.0

Enforce energy conservation

Collision handling

Show trail Force labels

This pendulum simulation shows single step XPBD in action. Two small modifications in our original position based dynamics method PBD turns the latter from a toy used in games into a serious competitor of physical simulation methods even surpassing their accuracy while staying as simple as PBD. We describe the method here. The pendulum simulation showcases the following features: It handles stiff systems with large mass ratios. (Zero compliance means infinite stiffness). It shows high frequency details and a high level of energy conservation both of which are difficult to achieve with implicit global solvers. All quantities have physical units and internal forces can easily be evaluated. It removes the conceptual differences of PBD to the backward Euler method. It also generalizes beyond the distance constraints we show here.

The challenge is to beat our method in terms of simplicity, speed, stability or accuracy. The html document you see here is self-contained. It includes the GUI, the rendering and the complete simulation code. You can have a look at it here. The solver itself only takes 100 lines of code (lines 460-560) which you can simply replace it with your own solution.

More challenges