Surrogate models are frequently employed to improve tractability in chemical process optimization (1). Typically, these surrogates are data-driven and do not adhere to physical laws, leading to predictions that are physically inconsistent. As a result, physics-informed machine learning models are becoming increasingly popular. Physics-informed machine learning models can broadly be classified as soft-constrained and hard-constrained models. Soft-constrained models leverage automatic differentiation capabilities in state-of-the-art machine learning libraries to penalize violations in physical laws as additional terms in the loss function during training (2). As a result, this approach cannot guarantee the exact satisfaction of physical laws.
Conversely, hard-constrained model approaches guarantee exact constraint satisfaction. Various methodologies have been proposed to enforce the exact satisfaction of physical constraints. Prediction and completion approaches enforce equality and inequality (non)-linear constraints by predicting a subset of variables. The predicted subset of variables has the same codimension as the number of equality constraints. This is followed by solving a system of (non)-linear equations to predict the remaining variables (3). Another approach proposed recently is to train constrained neural networks using nonlinear programming solvers to guarantee the satisfaction of physical laws (4). However, both approaches become computationally expensive due to their reliance on external nonlinear optimization solvers, and they scale poorly with deep networks or large training datasets.
Chen and co-workers proposed appending a projection layer to the neural network to enforce linear equality constraints and mitigate the costs associated with external nonlinear optimization solvers (5). The parameters of the projection layer can be obtained via the analytical solution of KKT conditions, which is computationally cheap. An extension of this approach was proposed, which adapted Picard’s successive approximation method for solving nonlinear partial differential equations to enforce nonlinear enthalpy balances (6).
There has been a growing interest in embedding physics-informed neural networks (PINNs) in mathematical optimization problems in engineering, and several comparative studies have been conducted. Casas and co-workers compared different strategies to embed soft-constrained physics-informed neural networks via its algebraic formulation or as a gray-box within the optimization model for model predictive control problems (7). Other studies considered the comparison of soft-constrained PINNs with vanilla neural networks for optimal power flow problems and reported that predictions from PINNs offer better worst-case guarantees, particularly in data-limited settings (8). Expectedly, violations in physical laws are observed for soft-constrained PINNs, albeit the constraint violations are lower relative to vanilla neural networks (8). However, none of these studies consider hard-constrained neural networks in their comparison.
In this work, we compare hard-constrained PINNs to soft-constrained PINNs and vanilla neural networks as surrogate models within larger chemical process optimization problems. We individually consider the enforcement of both linear and nonlinear equality constraints in our comparison. We conduct the comparison for the case of replacing fixed-bed catalytic reactor models with neural network surrogates in chemical processes. We consider the data requirements, the physical validity of optimal solutions with surrogates, and the tractability of each model for our case studies. We observe that embedding hard-constrained brings significant prediction benefits with exact satisfaction of physical laws, particularly in data-scarce settings. However, this benefit comes at a slightly higher computational cost for optimization compared to soft-constrained PINNS and vanilla neural networks.
References:
- Misener R, Biegler L. Formulating data-driven surrogate models for process optimization. Comput Chem Eng. 2023 Nov 1;179:108411.
- Raissi M, Perdikaris P, Karniadakis GE. Physics-informed neural networks: A deep learning framework for solving forward and inverse problems involving nonlinear partial differential equations. J Comput Phys. 2019 Feb 1;378:686–707.
- Donti PL, Rolnick D, Kolter JZ. DC3: A learning method for optimization with hard constraints. ICLR 2021 - 9th International Conference on Learning Representations [Internet]. 2021 Apr 25 [cited 2025 Apr 7]; Available from: https://arxiv.org/abs/2104.12225v1
- Mukherjee A, Bhattacharyya D. On the development of steady-state and dynamic mass-constrained neural networks using noisy transient data. Comput Chem Eng. 2024 Aug 1;187:108722.
- Chen H, Flores GEC, Li C. Physics-informed neural networks with hard linear equality constraints. Comput Chem Eng. 2024 Oct 1;189:108764.
- Lastrucci G, Karia T, Gromotka Z, Schweidtmann AM. Picard-KKT-hPINN: Enforcing Nonlinear Enthalpy Balances for Physically Consistent Neural Networks. 2025 Jan 29 [cited 2025 Apr 4]; Available from: https://arxiv.org/abs/2501.17782v1
- Elorza Casas CA, Ricardez-Sandoval LA, Pulsipher JL. A comparison of strategies to embed physics-informed neural networks in nonlinear model predictive control formulations solved via direct transcription. Comput Chem Eng. 2025 Jul 1;198:109105.
- Jalving J, Eydenberg M, Blakely L, Castillo A, Kilwein Z, Skolfield JK, et al. Physics-informed machine learning with optimization-based guarantees: Applications to AC power flow. International Journal of Electrical Power & Energy Systems. 2024 Jun 1;157:109741.