## Landau: a Language for Dynamical Systems with Automatic Differentiation

Journal of Mathematical Sciences, 251(3), 354–362 (2020)

**DOI**: 10.1007/s10958-020-05096-2

**Keywords**:
dynamical systems, compilers, automatic differentiation

### Abstract

Most numerical solvers used to determine the free variables of dynamical systems rely on firstorder derivatives of the state of the system with respect to the free variables. The number of free variables can be fairly large. One of the approaches to obtaining these derivatives is the integration of the derivatives simultaneously with the dynamical equations, which is best done with automatic differentiation techniques. Even though there exist many automatic differentiation tools, none has been found to be scalable and usable for practical purposes of modeling dynamical systems. Landau is a Turing incomplete statically typed domain-specific language aimed to fill this gap. The Turing incompleteness allows for a sophisticated source code analysis and, as a result, a highly optimized compiled code. Among other things, the language syntax supports functions, compile-time ranged for loops, if/else branching constructions, real variables and arrays, and allows for manually discarding calculations where the automatic derivative values are expected to be negligibly small. In spite of reasonable restrictions, the language is rich enough to express and differentiate any cumbersome equation with practically no effort.