Solving Differential Equations with Constrained Learning

Viggo Moro, Luiz F. O. Chamon

Introduction

Partial differential equations (PDEs) are fundamental tools for describing natural phenomena, making their solution crucial across science and engineering. While traditional numerical methods like Finite Element Methods (FEM) are reliable, they are computationally expensive, heavily reliant on fine meshes, and struggle to incorporate real-world measurements or adapt dynamically to changing parameters.

Neural network-based solvers, such as Physics-Informed Neural Networks (PINNs) and Neural Operators (NOs), offer a promising mesh-free alternative. They can directly fit models to PDE solutions, integrate prior knowledge, and tackle entire families of PDEs. However, these approaches possess a notorious Achilles' heel: hyperparameter sensitivity.

In a standard PINN, the model minimizes a weighted sum of losses (e.g., the PDE residual plus boundary conditions). If these weights are slightly off, or if the "collocation points" (where the physics are evaluated) are poorly distributed, the model often converges to a trivial or physically impossible solution. This paper addresses these challenges by introducing Science-Constrained Learning (SCL), a framework that reformulates PDE solving to eliminate the need for tedious hyperparameter tuning and naturally handle complex, "hard-to-fit" physical scenarios.

Methodology: A Shift in Perspective

The authors argue that the core issue with current neural solvers isn't how we solve these equations, but which problem we are actually solving. They mathematically demonstrate that finding a "weak solution" to a PDE is equivalent to solving a constrained learning problem with worst-case losses.

The SCL framework is built on four key components:

  1. Constrained Formulation: Instead of a fragile weighted sum of losses, SCL treats the PDE as a hard constraint. For example, the objective becomes minimizing boundary error subject to the PDE residual remaining below a strict threshold $\epsilon$.
  2. Worst-Case Losses: Rather than minimizing the average error over the domain, SCL seeks to minimize the maximum error. This "min-max" approach ensures the underlying physics are respected even in the most difficult regions of the space.
  3. Primal-Dual Algorithm: The framework employs a practical algorithm that alternates between updating the neural network parameters (the "primal" step) and adjusting Lagrange multipliers (the "dual" step).
  4. Metropolis-Hastings Sampling: To efficiently locate the "worst-case" regions where the model struggles, the algorithm uses Markov Chain Monte Carlo (MCMC) sampling. This automatically focuses training on the most challenging areas of the domain without manual intervention.

Experimental Setup

The SCL framework was evaluated across six diverse and challenging PDE benchmarks, utilizing both standard Multi-Layer Perceptrons (MLPs) and advanced Fourier Neural Operators (FNOs):

  • Convection & Reaction-Diffusion: Standard tests for transport and chemical phenomena.
  • Eikonal Equation: Used in wave propagation and computer vision (tested on a complex "gears" geometry).
  • Burgers’ Equation: A classic model for shock waves.
  • Diffusion-Sorption: A highly non-linear equation used in environmental science.
  • Navier-Stokes: The gold standard for fluid dynamics (evaluated in vorticity form).

Key Results and Insights

Robustness in Hard-to-Fit Scenarios

Standard PINNs often fail completely in high-convection scenarios or complex geometries. As shown in the performance comparison below, when the convection parameter $\beta$ is increased to 50, standard PINNs suffer a massive 56.5% error. In stark contrast, SCL maintains a highly accurate 3.74% error. Similarly, for the Eikonal equation, SCL reduces the error from over 85% (in baseline methods) to under 10%.

Performance comparison of SCL against baseline PINN methods across challenging PDEs.

Efficiency and Supervised Learning

When solving entire families of PDEs (parametric studies), SCL proved significantly more efficient. For the convection problem, it achieved better accuracy than PINNs while requiring only 16% of the computational complexity. Furthermore, when training Neural Operators, SCL’s min-max approach led to more homogeneous and accurate fits across different initial conditions compared to standard average-error minimization.

Emergent Properties

  • "Causal" Emergence: SCL naturally discovers "causal training." In time-dependent problems, the algorithm automatically focuses on earlier time steps before moving to later ones. This behavior emerges organically because early steps are where the worst-case errors initially manifest.
  • Dual Variables as Reliability Metrics: The Lagrange multipliers ($\lambda$) act as a diagnostic "heat map." High $\lambda$ values pinpoint exactly which physical parameters or domain regions are hardest for the model to learn.
  • Beyond Mechanistic Knowledge: SCL easily integrates structural constraints (like periodic symmetries) and observational data (like sparse sensor measurements) into the same unified framework.

Limitations and Future Work

While highly effective, the Metropolis-Hastings sampling in SCL adds some computational overhead per iteration, though this is frequently offset by faster overall convergence in parametric problems. Additionally, the theoretical guarantees of the framework rely on certain smoothness assumptions for the solutions.

Future directions include extending SCL to handle functional parameters (such as spatially varying forcing functions) and leveraging the dual variables to drive active learning, where the model can explicitly instruct researchers on where more physical data needs to be collected.

Summary updated

BibTeX
@inproceedings{moro2025solving,
  author = {Viggo Moro and Luiz F. O. Chamon},
  title = {{Solving Differential Equations with Constrained Learning}},
  booktitle = {International Conference on Learning Representations},
  year = {2025},
  url = {https://openreview.net/forum?id=5KqveQdXiZ},
}
Figure