r/ScientificComputing • • 4d ago

SiNDAE: training neural nets inside DAEs with collocation and an interior-point solver

Post image

Our group just released SiNDAE (pronounced "sin-day"), a Python package for hybrid modeling. You keep the physics you trust, replace the term you don't know with a neural net, and fit the whole thing to data.

Most neural ODE / UDE tooling trains sequentially: integrate forward, backprop, repeat until the coffee runs out. That works great for ODEs. Add algebraic constraints and it gets awkward fast, especially for higher-index DAEs. The usual fixes are penalty terms or projection, so your mass balance turns into more of a suggestion.

SiNDAE uses the simultaneous approach from dynamic optimization instead. Instead of integrating forward and backpropagating through the solver, we discretize the DAE with Lagrange–Radau collocation on finite elements (Pyomo.DAE). The network weights, states and algebraic variables then all become decision variables in one sparse NLP, which we solve with an interior-point method using exact second derivatives. There's no integrator in the loop. Higher-index DAEs are fine because their algebraic equations are just NLP constraints, satisfied at every collocation point.

If your problem is too big for one NLP (lots of trajectories, bigger nets), there's a decomposition mode. An outer Adam loop updates the weights, the per-trajectory NLPs get solved in parallel (MPI optional), and the gradients come from implicit differentiation through the KKT conditions. Switching between the two modes takes one keyword.

Highlights:

- ODEs and high-index DAEs

- Hard constraint satisfaction

- A decomposition mode for bigger problems (Adam outer loop, parallel per-trajectory NLPs, KKT sensitivities), one keyword away

- Works with partially observed data

- Custom architectures through a grey-box interface

- sklearn-style fit / predict

- No HSL license. The default solvers ship as pip wheels, so pip install sindae is the whole install

- Export to ONNX, Equinox, JSON or OMLT

- A sindae-skills folder for people who build models with coding agents like Claude Code (most people)

Available:

- GitHub: https://github.com/Alves-research-group/SiNDAE

- PyPI: pip install sindae

- Docs: https://alves-research-group.github.io/SiNDAE/

- Paper: https://arxiv.org/abs/2504.04665

- JOSS Paper (submission): https://github.com/Alves-research-group/SiNDAE/blob/main/paper/paper.pdf

Feedback (and a GitHub star ⭐) welcome.

7 Upvotes

0 comments sorted by