ACCURATELY SOLVING ROD DYNAMICS WITH GRAPH LEARNING

Abstract

Iterative solvers are widely used to accurately simulate physical systems. These solvers require initial guesses to generate a sequence of improving approximate solutions. In this contribution, we introduce a novel method to accelerate iterative solvers for rod dynamics with graph networks (GNs) by predicting the initial guesses to reduce the number of iterations. Unlike existing methods that aim to learn physical systems in an end-to-end manner, our approach guarantees longterm stability and therefore leads to more accurate solutions. Furthermore, our method improves the run time performance of traditional iterative solvers for rod dynamics. To explore our method we make use of position-based dynamics (PBD) as a common solver for physical systems and evaluate it by simulating the dynamics of elastic rods. Our approach is able to generalize across different initial conditions, discretizations, and realistic material properties. We demonstrate that it also performs well when taking discontinuous effects into account such as collisions between individual rods. Finally, to illustrate the scalability of our approach, we simulate complex 3D tree models composed of over a thousand individual branch segments swaying in wind fields.

1. INTRODUCTION

The numeric simulation of a dynamic system commonly comprises the derivation of the mathematical model given by the underlying differential equations and their integration forward in time. In the context of physics-based systems, the mathematical model is usually based on first principles and depending on the properties of the simulated system, the numerical integration of a complex system can be very resource demanding (Nealen et al., 2006) , e.g., hindering interactive applications. Enabled by the success of deep neural networks to serve as effective function approximators, researchers recently started investigating the applicability of neural networks for simulating dynamic systems. While many physical phenomena can well be described within fixed spatial domains (e.g., in fluid dynamics) that can be learned with convolutional neural network (CNN) architectures (Chu & Thuerey, 2017; Guo et al., 2016; Tompson et al., 2016; Xiao et al., 2020) , a large range of physical systems can more naturally be represented as graphs. Examples include systems based on connected particles (Müller et al., 2007 ), coupled oscillators (Michels & Desbrun, 2015; Michels et al., 2014) , or finite elements (Nealen et al., 2006) . Existing methods enable learning these systems often in an end-to-end manner and with a focus on replacing the entire or a part of the integration procedure. A number of methods show initial success in approximating physical systems; however, they often fail to reliably simulate the state of a system over longer time horizons if significant disadvantages are not accepted, such as the use of large datasets containing long-term simulations and the employment of specific memory structures (Sanchez-Gonzalez et al., 2020) . In this paper, we aim to improve the performance of iterative solvers for physical systems with graph networks (GN). An iterative solver requires an initial guess, and based on it generates a sequence of improving approximate solutions. The initial guess can be computed by simply using values obtained in the previous iteration or by solving a few steps of a similar but simpler physical system. The performance of an iterative solver is significantly influenced by the calculation of the initial guess, which we aim to replace with the prediction of a GN. To demonstrate our approach, we use a position-based dynamics (PBD) solver that approximates physical phenomena by using sets of connected vertices (Bender et al., 2017; 2014b; Macklin et al., 2016; Müller et al., 2007) . To simulate a physical system, PBD first computes updated locations of vertices using symplectic Euler integration to then correct the initial position estimates so as to satisfy a set of predefined constraints. The correction step is known as constraint projection and is commonly solved iteratively. The explicit forward integration for predicting the system's updated state has negligible cost, whereas the projection step is computationally expensive. Our goal is to employ a GN to predict the outcome of the constraint projection step as an initial guess. This way, our approach inherits the long-term stability of a classic PBD solver, while providing better run-time performance. To showcase the capabilities of our combined PBD solver, we aim to simulate the physically plausible mechanics of elastic rods. Rods play an important role for a variety of application domains, ranging from surgical simulation of sutures (Feess et al., 2016), catheters, and tendons (Pai, 2002) , to human hair (Michels et al., 2015) and vegetation (Pirk et al., 2017) in animated movies. Furthermore, approaches exist to realistically simulate rods as sets of connected vertices accurately capturing their mechanical properties (Bergou et al., 2008; Kugelstadt & Schoemer, 2016; Michels et al., 2015; Pai, 2002) . Our approach is able to generalize across different initial conditions, rod discretizations, and realistic material parameters such as Young's modulus and torsional modulus (Deul et al., 2018) . Moreover, we demonstrate that our approach can handle discontinuous collisions between individual rods. Figure 1 shows examples of elastic rod deformations of a helix falling down (left) and two colliding rods (right). Finally, we show that the data-driven prediction of the initial guesses of the constraint projection leads to a decreased number of required iterations, which -in turn -results in a significant increase of performance compared to canonical initial guesses. In summary, our contributions are: (1) we show how to accelerate iterative solvers with GNs; (2) we show that our network-enabled solver ensures long-term stability required for simulating physical systems; (3) we showcase the effectiveness of our method by realistically simulating elastic rods; (4) we demonstrate accuracy and generalizability of our approach by simulating different scenarios and various mechanical properties of rods including collisions and complex topologies (dynamic tree simulations).

2. RELATED WORK

In the following we provide an overview of the related work, which spans from data-driven physics simulations and graph learning to position-based dynamics and elastic rods. Data-driven Physics Simulations. It has been recognized that neural networks can be used as effective function approximators for physical and dynamic systems. To this end, early approaches focus on emulating the dynamics of physics through learned controllers (Grzeszczuk et al., 1998) or by designing subspace integrators (Barbič & James, 2005) . Today, a range of approaches exist that enable learning ordinary and partial differential equations (Lagaris et al., 1998; Raissi et al., 2019; Raissi & Karniadakis, 2018) , for example, to transform them into optimization problems (Dissanayake & Phan-Thien, 1994), to accelerate their computation (Mishra, 2018; Sirignano & Spiliopoulos, 2018) , or to solve for advection and diffusion in complex geometries (Berg & Nyström, 2018) . Other methods focus on specific data-driven solutions for non-linear elasticity (Ibañez et al., 2017) , for approximating Maxwell's equation in photonic simulations (Trivedi et al., 2019) , or for animating cloth (Wang et al., 2011) , partially focusing on interactive applications (Holden et al., 2019) . More recently, research on data-driven approaches for modeling the intricacies of fluid dynamics has gained momentum (Ladický et al., 2015; Ummenhofer et al., 2020) . Due to fixed-size spatial representation of Eulerian fluid solvers, a number of approaches rely on CNN-type architectures (Chu & Thuerey, 2017; Guo et al., 2016; Tompson et al., 2016; Xiao et al., 2020) . Furthermore, it has been shown that data-driven approaches can even be used to approximate the temporal evolution of fluid flows (Wiewel et al., 2018) , to compute liquid splashing (Um et al., 2017) , artistic styletransfer (Kim et al., 2020) , or to derive fluid dynamics from reduced sets of parameters (Kim et al., 2019) . Graph-based Learning. Graphs have proven to be a powerful representation for learning a wide range of tasks (Battaglia et al., 2018; Scarselli et al., 2009) . In particular, it has been shown that graphs enable learning knowledge representations (Kipf et al., 2018) , message passing (Gilmer et al., 2017) , or to encode long-range dependencies, e.g., as found in video processing (Wang et al., 2017) . A variety of methods uses graph-based representations to learn properties of dynamic physical systems, e.g. for climate prediction (Seo & Liu, 2019) , with an emphasis on individual objects (Chang et al., 2016) and their relations (Sanchez-Gonzalez et al., 2018) , for partially observable systems (Li et al., 2018) , the prevalent interactions within physical systems (Kipf et al., 2018) , hierarchically-organized particle systems (Mrowca et al., 2018) , or -more generally -physical simulation (Sanchez-Gonzalez et al., 2019; 2020) . While many of the existing approaches learn the time integration of physical systems in an end-to-end manner, we use a graph network to predict the outcome of a PBD solver for rod dynamics to enable more efficient computations.



Figure 1: Renderings taken from real-time simulations of the elastic deformation of a helix falling down on the ground plane (left) and two rods colliding with each other (right).

