SymX: Energy-based Simulation from Symbolic Expressions

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.
@Article{FLW25,
author = {Fern\'{a}ndez-Fern\'{a}ndez, Jos\'{e} and L\"{o}schner, Fabian and Westhofen, Lukas and Longva, Andreas and Bender, Jan},
journal = {ACM Trans. Graph.},
title = {{SymX: Energy-based Simulation from Symbolic Expressions}},
year = {2025},
month = sep,
doi = {10.1145/3764928},
url = {https://doi.org/10.1145/3764928},
publisher = {Association for Computing Machinery},
}