Skip to main content
QUICK REVIEW

[Paper Review] SymX: Energy-based Simulation from Symbolic Expressions

José Antonio Fernández-Fernández, Fabian Löschner|arXiv (Cornell University)|Feb 22, 2023
Modeling and Simulation Systems4 citations
TL;DR

SymX is a symbolic differentiation framework that automatically computes first- and second-order derivatives of energy functions in physics-based simulations, compiles optimized vectorized code on-the-fly, and assembles global derivatives in parallel. It enables high-performance, production-ready simulations with minimal user effort, achieving up to two orders of magnitude speedup over state-of-the-art frameworks in higher-order FEM simulations.

ABSTRACT

Optimization time integrators are effective at solving complex multi-physics problems including deformable solids with non-linear material models, contact with friction, strain limiting, etc. For challenging problems, Newton-type optimizers are often used, which necessitates first- and second-order derivatives of the global non-linear objective function. Manually differentiating, implementing, testing, optimizing, and maintaining the resulting code is extremely time-consuming, error-prone, and precludes quick changes to the model, even when using tools that assist with parts of such pipeline. We present SymX, an open source framework that computes the required derivatives of the different energy contributions by symbolic differentiation, generates optimized code, compiles it on-the-fly, and performs the global assembly. The user only has to provide the symbolic expression of each energy for a single representative element in its corresponding discretization and our system will determine the assembled derivatives for the whole simulation. We demonstrate the versatility of SymX in complex simulations featuring different non-linear materials, high-order finite elements, rigid body systems, adaptive discretizations, frictional contact, and coupling of multiple interacting physical systems. SymX's derivatives offer performance on par with SymPy, an established off-the-shelf symbolic engine, and produces simulations at least one order of magnitude faster than TinyAD, an alternative state-of-the-art integral solution.

Motivation & Objective

  • To automate the derivation and efficient implementation of first- and second-order derivatives required by optimization-based time integrators in complex physics simulations.
  • To eliminate the need for manual, error-prone symbolic and code-level differentiation of non-linear energy functions in multi-physics systems.
  • To enable rapid prototyping and iteration in simulation development by providing fast compilation and high-performance evaluation of derivatives.
  • To support flexible integration into existing simulation pipelines with customizable data types and solvers.
  • To handle dynamic systems with changing sparsity patterns, such as those arising from contact, fracture, or adaptive refinement.

Proposed method

  • The framework uses symbolic expressions to represent local energy functions for individual elements, such as finite elements or constraints.
  • It performs symbolic differentiation to automatically derive analytical first and second derivatives of the energy with respect to degrees of freedom.
  • Generated derivative code is vectorized and compiled on-the-fly using a just-in-time (JIT) compilation pipeline for high performance.
  • The system automatically assembles element-level contributions into global residual and Hessian matrices in parallel.
  • It supports arbitrary data types and integrates seamlessly with existing optimization solvers and simulation back-ends.
  • The framework handles dynamic changes in system topology and sparsity, such as those introduced by contact or adaptive refinement.

Experimental results

Research questions

  • RQ1Can symbolic differentiation and on-the-fly code generation produce derivatives that match the performance of hand-optimized code in complex physics simulations?
  • RQ2To what extent can automatic derivative computation reduce development time and error rates in multi-physics simulation systems?
  • RQ3How does the framework scale across different material models, element types, and system complexities?
  • RQ4Can the system efficiently handle dynamic systems with changing sparsity patterns due to contact or topology changes?
  • RQ5What performance gains are achievable compared to existing automatic differentiation tools in high-order finite element methods?

Key findings

  • SymX achieves performance comparable to hand-optimized code, with up to two orders of magnitude speedup over a state-of-the-art framework in higher-order finite element simulations.
  • The framework enables rapid simulation development, with minimal code required to express complex energy functions that closely mirror their mathematical formulations.
  • For a 5th-order beam element, SymX generated 23,824 derivative terms and 51,565 operations, compiling to 1002 kB of optimized code with high efficiency.
  • In a complex car drift simulation with nine distinct energy types, SymX successfully managed the global assembly of derivatives across rigid bodies, deformable solids, and contact constraints.
  • The system demonstrated robustness in adaptive cloth and trebuchet simulations, handling dynamic changes and complex couplings with consistent performance.
  • Despite limitations in handling non-differentiable intermediate expressions (e.g., norms or square roots), SymX provides warnings and supports stable approximations to mitigate numerical instability.

Better researchstarts right now

From reading papers to final review, dramatically reduce your research time.

No credit card · Free plan available

This review was created by AI and reviewed by human editors.