# Differentiable Physics-Equilibrium Projection

- ID: 2741
- Canonical URL: https://synthcore.org/idea/2741/differentiable-physics-equilibrium-projection
- API JSON: https://synthcore.org/api/idea/2741.json
- API Markdown: https://synthcore.org/api/idea/2741.md
- Verification status: beats_baseline
- Source: [arXiv:2608.25784](https://arxiv.org/abs/2608.25784)
- Category: dynamics
- Solves: stability, accuracy, generalization
- ML areas: graph-nn, optimizer, training-dynamics, world-model
- Math tags: control-theory, dynamical-systems, optimization, linear-algebra, numerical-analysis, graph-theory
- Ratings: usefulness 9/10; difficulty 7/10; novelty 5/10

## Idea description

Use a neural network to predict an operating point or latent state, then pass it through a sparse differentiable implicit layer that solves governing nonlinear equilibrium equations. This replaces soft physics penalties with an exact or tightly solved equality projection and can be combined with primal-dual inequality handling and deterministic restoration.

## Mathematical statement

Let $u$ denote exogenous inputs such as loads, topology, and limits, and let $z$ denote predicted decision variables. Define the equality residual $F(z;u)=0$. For AC power flow, at bus $i$, $P_i=V_i\sum_jV_j(G_{ij}\cos(\theta_i-\theta_j)+B_{ij}\sin(\theta_i-\theta_j))$ and $Q_i=V_i\sum_jV_j(G_{ij}\sin(\theta_i-\theta_j)-B_{ij}\cos(\theta_i-\theta_j))$. The implicit layer returns $z^\star(u)$ satisfying $F(z^\star;u)=0$. If $J_F=\partial F/\partial z$ is nonsingular, implicit differentiation gives $\partial z^\star/\partial u=-J_F^{-1}\partial F/\partial u$. For inequalities $g(z;u)\leq0$, use $\mathcal{L}=f(z)+\lambda^\top g(z;u)+(\beta/2)\|[g(z;u)]_+\|_2^2$ and projected multiplier updates. The smallest singular value of $J_F$ controls conditioning and gradient amplification.

## Key formulas

- $$F(z^\star;u)=0,\qquad \frac{\partial z^\star}{\partial u}=-\left(\frac{\partial F}{\partial z}\right)^{-1}\frac{\partial F}{\partial u}$$
- $$P_i=V_i\sum_jV_j\left(G_{ij}\cos(\theta_i-\theta_j)+B_{ij}\sin(\theta_i-\theta_j)\right)$$
- $$Q_i=V_i\sum_jV_j\left(G_{ij}\sin(\theta_i-\theta_j)-B_{ij}\cos(\theta_i-\theta_j)\right)$$
- $$\mathcal{L}=f(z)+\lambda^\top g(z;u)+\frac{\beta}{2}\|[g(z;u)]_+\|_2^2,\qquad \lambda\leftarrow[\lambda+\eta_\lambda g(z;u)]_+$$

## Implementation notes

1. Integration point: attach the layer to a graph encoder that predicts voltage magnitudes, angles, generator outputs, or the state of another differentiable physical system. Construct $F$ from the supplied topology and parameters. During training, solve the equality system with damped Newton or sparse nonlinear least squares; during inference, use a fixed small number of sparse Newton iterations followed by deterministic inequality restoration. 2. Pseudocode: encode $(u,A)$ to produce $\hat z$; initialize $z_0=\hat z$; repeat $z\leftarrow z-\tau(J_F^\top J_F+\epsilon I)^{-1}J_F^\top F(z;u)$; return converged $z$; for backward propagation solve $J_F^\top v=\partial\mathcal{L}/\partial z$ and apply the implicit derivative; update multipliers with $\lambda\leftarrow[\lambda+\eta_\lambda g(z)]_+$. 3. Computed quantities are $F$, its sparse Jacobian, Newton residual, and the implicit backward linear solve. Estimate damping $\tau$, regularization $\epsilon$, Newton tolerance, and multiplier step $\eta_\lambda$ empirically. Monitor $\sigma_{\min}(J_F)$ because ill-conditioning predicts gradient amplification and solver failure. 4. First cheap experiment: compare a plain MLP or GNN, penalty-only physics training, and the implicit model on 14-bus AC power-flow data with random loads and line outages. Measure $\|F\|$, inequality violations, objective gap, solver iterations, and runtime. The prediction is that equality residual reaches the Newton tolerance largely independently of neural predictor error, while penalty-only residual remains dependent on penalty weight. As operating points approach an ill-conditioned regime, gradient norms should scale approximately as $1/\sigma_{\min}(J_F)$; failures should cluster when $\sigma_{\min}(J_F)$ approaches the regularization scale $\sqrt{\epsilon}$.

## Verification

- Status: beats_baseline
- Mechanism evidence: yes
- Mechanism confirmed: no
- Practical verdict: helps
- Verdict: Built a differentiable cubic-equilibrium projection with fixed-step Newton forward solving and an analytic implicit backward pass. The mechanism manifested: the least-squares iteration matched the predicted contraction factor |1-tau*a^2| and switched from contraction to divergence at the predicted boundary tau*a^2=2; implicit sensitivities matched finite differences, including 1/sigma_min(J) growth from 10 to about 999 as sigma_min(J) decreased from 0.1 to 0.001. Projection reduced the test residual to 3.93e-12 versus 0.109 for penalty training and 0.286 for direct prediction, while projected state MSE was 8.46e-16.

### Mechanism check

- Verdict: Built a differentiable cubic-equilibrium projection with fixed-step Newton forward solving and an analytic implicit backward pass. The mechanism manifested: the least-squares iteration matched the predicted contraction factor |1-tau*a^2| and switched from contraction to divergence at the predicted boundary tau*a^2=2; implicit sensitivities matched finite differences, including 1/sigma_min(J) growth from 10 to about 999 as sigma_min(J) decreased from 0.1 to 0.001. Projection reduced the test residual to 3.93e-12 versus 0.109 for penalty training and 0.286 for direct prediction, while projected state MSE was 8.46e-16.
- Confidence: 9/10
- Limitations: This is a scalar cubic toy system, not a sparse AC 14-bus network, GNN, inequality restoration, or a wall-clock/FLOP comparison. The experiment does not test large-scale sparse linear solves, multiple equilibria, solver failures under realistic topology outages, or robustness to noisy/extrapolating inputs.

### Practical benchmark

- Paired seeds: 8
- Baseline mean: 0
- Idea mean: 0
- p-value: 0.0081
- Paired wins: 8/8
- Benchmark verdict: idea better (significant)

## Artifacts

- [bench_report.json](https://synthcore.org/code/1051/bench_report.json)
- [bench_stage2.py](https://synthcore.org/code/1051/bench_stage2.py)
- [experiment.py](https://synthcore.org/code/1051/experiment.py)
- [implicit_layer.py](https://synthcore.org/code/1051/implicit_layer.py)
- [report.md](https://synthcore.org/code/1051/report.md)
- [report_bench_2026-09-01T225642.md](https://synthcore.org/code/1051/report_bench_2026-09-01T225642.md)
- [results.json](https://synthcore.org/code/1051/results.json)
- [Download all files as ZIP](https://synthcore.org/download/1051)

## Disclaimer

AI-generated research hypothesis, automatically tested. Not peer-reviewed.
