Asgard
Write equations. Get differentiable simulations. Reason algebraically.
A dynamical system can be represented in more than one way, and the usual choices are lossy. Implicit models — Neural ODEs, PINNs — approximate the dynamics as a black box. They are powerful function approximators, but you can't inspect why a system behaves as it does, compose two learned subsystems through typed interfaces, or bring the standard tools — Lyapunov analysis, reachability, formal verification — to bear on a black box.
The classical-explicit alternative keeps the equations, but only as a description. You write the model down and hand it to a numerical solver, which compiles it away into trajectory-stepping code — so the structure isn't what runs, and it isn't something you can compute on. You can't ask the solver to simplify the model, compose it with another, or prove two formulations equivalent.
Asgard takes a third path. It is a programming language for dynamical systems in which the mathematical structure is the primary object of computation. You write equations in a LEAN-style notation, and Asgard turns them into typed circuits that stay explicit all the way from equation to execution — circuits you can compose through typed interfaces, rewrite algebraically while provably preserving their meaning, and run under a choice of calculus (real, stochastic, or discrete) without changing the model. It is the execution and reasoning layer of Gimle, and because everything compiles to JAX, it stays fast and differentiable throughout. Implicit models give you predictions; explicit structure gives you predictions and the ability to reason about why.
How It Works
Write
Define your system as a mathematical equation in LEAN-style notation — a standard, readable syntax used in formal mathematics. Differential equations, integrals, compositions — what you write is what you mean.
Compile
Asgard translates your equation into a typed circuit — a signal-flow network whose atomics carry fixed input/output degrees. Composition is checked statically: composition(f, g) requires the output degree of f to match the input degree of g, so wiring errors surface at compile time as degree mismatches, before any numerics run.
Execute
Run the compiled system under any supported calculus. The same equation produces Taylor-series solutions, Monte Carlo SDE paths, or discrete sequences — depending only on the runtime interpretation.
Reason
Transform, simplify, and prove properties of your system using algebraic rewrite rules. Because the rewrites are justified by the categorical axioms, they provably preserve meaning — with one exception: approximate rewrites trade exactness for simplicity and are validated numerically.
What This Enables
Composable Systems
Build complex dynamics from simple parts. Systems compose sequentially, in parallel, and with feedback — and the composition is algebraically verified, not just bolted together.
Differentiable Everything
Every system compiles to JAX with GPU acceleration. Gradients flow through the entire simulation, enabling parameter optimization, sensitivity analysis, and hybrid physics-ML models out of the box.
One Framework, Many Calculi
Define once, execute under deterministic, stochastic, or discrete semantics. The separation between structure and interpretation means switching calculi is a runtime choice, not a rewrite.
Algebraic Reasoning
A built-in proof system lets you transform and simplify systems mechanically. Finding a closed-form solution becomes finding a rewrite that eliminates a circuit's feedback (trace) — a question about the rewrite theory itself, undecidable in general. Verify equivalences and search for models that fit observed data within the same framework.
Hybrid Physics-ML
Compose known physics with learned components — explicit where possible, learned where necessary. Black-box operators wrap neural networks as first-class building blocks, trainable end-to-end via backpropagation through the full simulation.
Declarative Simulations
Define and run complete simulations from YAML — equation, inputs, evaluation, and visualization — without writing Python. Interactive dashboards render results in real time.
Fields of Application
Climate & Weather
Model coupled atmospheric and ocean dynamics as composable systems. Combine known physics with learned components, and switch between deterministic forecasts and stochastic ensemble simulations.
Finance
Option pricing, risk analysis, and portfolio dynamics as differentiable stochastic systems. Calibrate model parameters via gradient descent and reason about hedging strategies algebraically.
Physics & Engineering
Express governing equations directly and compile to efficient simulations. Compose multi-physics systems, optimize design parameters, and check structural equivalences through algebraic transformation.
Control Systems
Feedback loops are first-class citizens. Model controllers, plants, and observers as composable systems whose stability and performance you can analyze algebraically.
Biology & Epidemiology
Compartmental models, population dynamics, and gene regulatory networks as composable differential systems. Fit parameters to observed data and explore stochastic mutation pathways.
Scientific Discovery
Search the space of composable dynamical systems for models that explain observed behavior. Algebraic reasoning narrows the search; differentiability enables gradient-guided exploration.
See concrete examples from each of these domains — with the math and the YAML — on the Examples page.