Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Simultaneous Solver

In the simultaneous approach, the network parameters θ\boldsymbol{\theta} are treated as additional decision variables in the collocation NLP. The solver (POUNCE or cyipopt) optimises the differential states x\mathbf{x}, the algebraic variables y\mathbf{y} and z\mathbf{z}, the static parameters p\mathbf{p}, and the weights θ\boldsymbol{\theta} jointly in a single solve.


Mathematical Formulation

After Radau collocation, the simultaneous NLP (eq. 6 of Lueg et al. (2025)) reads:

minθ,p,{x,y,z}sSφ(s)(x(s))+αrr(θ),\min_{\boldsymbol{\theta},\, \mathbf{p},\, \{\mathbf{x},\mathbf{y},\mathbf{z}\}} \quad \sum_{s \in \mathcal{S}} \varphi^{(s)}\bigl(\mathbf{x}^{(s)}\bigr) + \alpha_r\, r(\boldsymbol{\theta}),

subject to, at each collocation point (i,k)(i, k) of every scenario sSs \in \mathcal{S},

jxij(s)j(τk)=hif(xik(s),yik(s),zik(s),p),(collocation)0=h(xik(s),yik(s),zik(s),p),(algebraic)zik(s)=fNN(vik(s),θ).(network)\begin{aligned} \sum_j \mathbf{x}_{ij}^{(s)}\, \ell_j'(\tau_k) &= h_i\, \mathbf{f}\bigl(\mathbf{x}_{ik}^{(s)}, \mathbf{y}_{ik}^{(s)}, \mathbf{z}_{ik}^{(s)}, \mathbf{p}\bigr), && \text{(collocation)} \\ 0 &= \mathbf{h}\bigl(\mathbf{x}_{ik}^{(s)}, \mathbf{y}_{ik}^{(s)}, \mathbf{z}_{ik}^{(s)}, \mathbf{p}\bigr), && \text{(algebraic)} \\ \mathbf{z}_{ik}^{(s)} &= \mathbf{f}_{NN}\bigl(\mathbf{v}_{ik}^{(s)}, \boldsymbol{\theta}\bigr). && \text{(network)} \end{aligned}

Here φ(s)\varphi^{(s)} is the data-fit loss and fNN\mathbf{f}_{NN}, f\mathbf{f}, h\mathbf{h} follow the Hybrid DAE Overview. The term r(θ)=12θ22r(\boldsymbol{\theta}) = \tfrac{1}{2}\|\boldsymbol{\theta}\|_2^2 is an L2 regularizer with weight αr\alpha_r (the reg_coef argument). The network constraint is embedded symbolically, either by expression-writing (exact Hessian) or as a grey-box model (GBM, Jacobian-only, L-BFGS).


Two Sub-Variants

Expression-writing (default, use_gbm=False)

NN computations are written as explicit Pyomo expressions. This exposes the exact second-order structure to IPOPT, enabling the full Hessian and typically faster convergence.

Solver: POUNCE by default. Pass nlp_solver='ipopt' (or nlp_solver='cyipopt') to solve_simultaneous to use an alternative ASL backend (see Solvers).

Grey-box model (use_gbm=True)

The NN forward pass is wrapped in a NNSimulGreyBoxModel (a PyNumero ExternalGreyBoxModel). Only Jacobian-vector products are provided and the Hessian is approximated via L-BFGS. Slower per iteration but scales better to large networks.

Solver: POUNCE by default, through its grey-box (cyipopt-style) interface; pass nlp_solver='cyipopt' to use cyipopt instead. L-BFGS is selected automatically.


Usage

The high-level wrapper drives this method with HybridDAE(method="simultaneous", ...); the stage-level call is:

from sindae.algorithms.simultaneous.train import SimultaneousConfig, solve_simultaneous

cfg = SimultaneousConfig(
    use_gbm=False,    # expression-writing (exact Hessian)
    reg_coef=1e-3,    # L2 regularization on NN weights
)
trained_m, mlp = solve_simultaneous(
    problem=problem,
    mlp=mlp,
    cfg=cfg,
    data=smoother_data,           # provides normalization stats
    smoother_model=smoother_m,    # warm-start (optional but recommended)
    solver_options={
        'tol': 1e-6,
        'max_iter': 1000,
    },
)

mlp holds the trained network weights (extracted from the NLP solution). trained_m is the solved Pyomo model; pass it to extract_instance_data for trajectories.

The simultaneous approach solves a single NLP, so there is no training-curve history to return (unlike Decomposition Solver, whose outer Adam loop produces one). Solve progress is reported by the solver status and, with tee=True, the live IPOPT iteration log.


Warm-starting

Passing smoother_model reuses the already-discretised and solved smoother NLP as the starting point. This avoids re-building the model and gives IPOPT a feasible (or near-feasible) initial point, significantly reducing iteration count.


POUNCE Options

Common options for the expression-writing path:

OptionTypical valueEffect
tol1e-6Primal–dual feasibility tolerance
max_iter1000Maximum IPOPT iterations
hessian_approximationexact (default)Use limited-memory for large networks

The GBM path always uses L-BFGS; solve_simultaneous sets hessian_approximation: limited-memory for you (POUNCE also forces it internally).


When to Use

For large networks, many trajectories, or MPI-parallel training, consider the Decomposition Solver.


API Reference

See Simultaneous Solver for solve_simultaneous, build_simultaneous_model, build_simultaneous_model_gbm, and extract_mlp.

References
  1. Lueg, L. R., Alves, V., Schicksnus, D., Kitchin, J. R., Laird, C. D., & Biegler, L. T. (2025). A simultaneous approach for training neural differential-algebraic systems of equations. arXiv Preprint arXiv:2504.04665. https://arxiv.org/abs/2504.04665