Accurately Solving Rod Dynamics with Graph Learning

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 ( Müller et al. , 2007 ) , coupled oscillators ( Michels & Desbrun , 2015 ; Michels et al. , 2014 ) , 35th Conference on Neural Information Processing Systems ( NeurIPS 2021 ) . 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 ; Mü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 ( Barbič & 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 & Nyström , 2018 ) . Other methods focus on specific data-driven solutions for non-linear elasticity ( Ibañ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 ( Ladický 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. , 2018b ) , 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 . Position-based Dynamics and Elastic Rods . PBD is a robust and efficient approach for simulating position changes of connected sets of vertices ( Bender et al. , 2017 , 2014b ; Macklin et al. , 2016 ; Müller et al. , 2007 ) . Compared to forced-based methods that compute the force directly , the interaction between different vertices in PBD is realized by a constraint projection step in an iterative manner . To avoid the dependency of the system ’ s stiffness on the number of iterations and the time step size , an extended position-based dynamics approach was introduced ( XPBD ) ( Macklin et al. , 2016 ) . A number of methods exist that model the dynamic properties of rods that can even simulate more complicated rod mechanics ( Pai , 2002 ) . Moreover , particle systems were employed to simulate the dynamics of rods ( Michels et al. , 2017 ) and , in particular , for the physically accurate simulation of thin fibers ( Michels et al. , 2015 ) such as present in human hair or textiles . On a different trajectory , it has been recognized that rods can be simulated based on PBD ( Umetani et al. , 2014 ) . The initial formulation was improved ( Kugelstadt & Schoemer , 2016 ) by including the orientation of rod segments in the system ’ s state to account for torsion effects . Later , the XPBD framework was utilized ( Deul et al. , 2018 ) to address the non-physical influence of iteration numbers and steps sizes , which enables the more accurate simulation of elastic rods . 3 Methodology . We propose a novel approach to simulate the temporal evolution of a dynamic system which consists of elastic rods . Each rod is discretized using several rod segments arranged along its centerline ( Figure 2 ) . For each rod segment , its state is described by its position , orientation , velocity and angular velocity . The state of the system is given as the set of the individual states of all rod segments . The simulation is carried out by employing PBD ( Müller et al. , 2007 ) directly manipulating the system ’ s state . Orientations are represented as quaternions allowing for a convenient implementation of bending and twisting effects ( Kugelstadt & Schoemer , 2016 ) . Extended PBD ( XPBD ) ( Macklin et al. , 2016 ) is implemented to avoid that the rods ’ stiffnesses depends on the time step size and the number of iterations ( Deul et al. , 2018 ) . The generalized coordinates of a rod segment i at time t is given by pi , t 2 R3 ⇥H , which includes its position xi , t 2 R3 given in Cartesian coordinates and its orientation described by a quaternion qi , t 2 H. Correspondingly , i , t 2 R6 refers to the generalized velocity of the rod segment , which includes velocity and angular velocity . The system is continuously updated during the simulation by applying corrections pi = ( xi , i ) T 2 R6 with position shifts xi 2 R3 and orientation shifts i 2 R3 representing the integration of the angular velocity.1 A single time integration step is presented in Algorithm 1 . In the beginning ( lines 1 to 4 ) , generalized velocity and generalized coordinates are updated by employing a symplectic Euler integration step . In this regard , aext denotes the generalized acceleration due to the external net force , e.g. , given by gravity . XPBD ( Macklin et al. , 2016 ) employs the Lagrange multiplier which is initialized as zero ( line 5 ) along with the integrated generalized coordinates p⇤ . Collision detection results are stored in Collr-r and Collr-p ( line 6 ) , where Collr-r includes all the pairs of two rod segments that potentially collide with each other and Collr-p includes information of all rod segments that potentially collide with another object such as a plane . Within several solver iterations , we alternate between rod constraint projection and the collision constraint projection ( lines 7 to 15 ) . The rod constraints include shear-stretch and bend-twist constraints representing the corresponding elastic energy . The Lagrange multiplier represents the interaction between rod segments . Figure 2 illustrates the discretization for a single rod into several interacting segments . The correction values p and in line 9 are computed by constraint projection ( Deul et al. , 2018 ; Kugelstadt & Schoemer , 2016 ) . The generalized coordinates and Lagrange multipliers are updated for each rod ( lines 8 to 12 ) , and rodrod and rod-plane collisions are addressed to update the generalized coordinates . For details about the collision projection procedure , we refer to Macklin et al . ( 2014 ) . For the non-collision case , the steps within line 6 and 13 are not needed . The most expensive part of Algorithm 1 involves the computation of the corrections of generalized coordinates and Lagrange multipliers ( line 9 ) . This projection step requires the solution of a linear system which is a linearization of a non-linear one so that the matrix depends on the system ’ s state 1Please note , that qi = G ( q ) i 2 R4 , in which the matrix G ( q ) 2 R4⇥3 describes the relationship between quaternion velocity and angular velocity ( Bender et al. , 2014a ) . Algorithm 1 Numerical integration procedure updating pi , t 7 ! pi , t+ t and i , t 7 ! i , t+ t. 1 : for all rod segments do 2 : ⇤i i , t + taext 3 : p⇤i pi , t + t H ( qi , t ) ⇤i with H ( qi , t ) : = [ 13⇥3,03⇥3 ; 04⇥3 , G ( qi , t ) ] 4 : end for 5 : 0 0 , p0 p⇤ 6 : ( Collr-r , Collr-p ) generateCollisionConstraints ( p , p⇤ ) 7 : for j 0 to number of required solver iterations do 8 : for all rods do 9 : ( p , ) rodConstraintProjection ( pj , j ) 10 : j+1 j + 11 : pj+1 pj + p 12 : end for 13 : pj+1 updateCollisionConstraintProjection ( pj+1 , Collr-r , Collr-p ) 14 : j j + 1 15 : end for 16 : for all rod segments do 17 : pi , t+ t pji 18 : i , t+ t HT ( qi , t ) ( pi , t+ t pi , t ) / t 19 : end for making it impossible to precompute its inverse . Instead , a new system at every point in time is solved iteratively using the conjugated gradient ( CG ) solver . Such iterative solvers are widely used in the context of physical simulations and regularly described as the de facto standard ( Barrett et al. , 1994 ; Saad , 2003 ) since they often show superior performance and usually scale well allowing for exploiting parallel hardware . However , we would like to point out that also highly efficient direct solvers can be found in the literature ( Deul et al. , 2018 ) . Instead of fully replacing the projection step in an end-to-end learning manner , we follow the strategy of accelerating it by first computing a guess ( p0 , 0 ) correctionGuess ( pj ) , ( 1 ) for the iterative procedure ( line 9 ) ( p , ) rodConstraintProjection ( pj , j , p0 , 0 ) . ( 2 ) A neural network is employed to compute the initial guess in Eq . ( 1 ) for the constraint projection . The motivation for this approach is to reduce the number of iterations required for the convergence of the CG solver which solves the linear system in Eq . ( 2 ) compared to the canonical initialization with zeros . We obtain our final framework by replacing line 9 in Algorithm 1 with Eq . ( 1 ) and Eq . ( 2 ) as illustrated in Figure 3 , which is inherently as accurate as the traditional PBD method . We name the data-driven part COPINGNet ( “ COnstraint Projection INitial Guess Network ” ) which learns to compute the correction guess .

Summary: This paper aims to accelerate the iterative physical simulators using graph neural networks, by combining the traditional iterative rod solver and the graph networks. Instead of an end-to-end way, this paper uses the trained GNN to provide the initial guess of the iterative solver to reduce the number of iterations. In the experiments section, this paper shows the improved run time performance compared with the traditional solver and a KKN method.