Mapping uncertainty using differentiable programming
Victor Alves, Carl D. Laird, Fernando V. Lima and John R. Kitchin, “Mapping uncertainty using differentiable programming”, AIChE Journal 71(10), e18940 (2025). https://doi.org/10.1002/aic.18940
This summary was written by a language model from the paper and has not been checked line by line. Rely on the published paper for details.
Question
Propagating uncertainty through a process model is usually done with local linearization (Taylor series or perturbation methods), which handles nonlinearity poorly, with Monte Carlo (MC) sampling, which is robust but needs many model evaluations, or with polynomial chaos expansions, which suffer from the growth of terms with input dimension and require choosing a polynomial family. The paper asks whether the boundary of a confidence region can be mapped through a nonlinear, implicit, multivariate model directly, in either the forward or the inverse direction, without sampling or optimization (Alves et al. 2025). The authors state that the method is not a replacement for techniques that characterize the full distribution; it maps only the terminal boundary of a confidence region, which they argue is enough for many applications.
Approach
The work extends the group’s earlier inverse mapping method based on automatic differentiation and the implicit function theorem (IFT). The model is written implicitly as F(X, Y) = 0 in JAX, and the terms Domain and Image replace inputs and outputs so the same code can map either way. The IFT gives the matrix of derivatives of the Image variables with respect to the Domain variables from the model Jacobian, and these derivatives are integrated along a closed path in the Domain with a fixed-step fourth-order Runge-Kutta scheme. The new element is that the closed path is a confidence boundary. For correlated Gaussian variables it is an ellipse built from a covariance matrix (semi-axes and rotation angle from its eigendecomposition) and scaled by the square root of a chi-square quantile, about 2.4477 for 95% confidence in two dimensions. For multimodal uncertainty a Gaussian mixture model is fitted (or assumed), a density threshold enclosing the chosen probability mass is found, and the boundary is traced by solving for the radius along unit directions leaving each mode. Ellipsoids in three or more dimensions are parameterized with hyperspherical angles. The method assumes the map is at least continuously differentiable with a nonsingular Jacobian over the region and is one-to-one, so that boundaries map to boundaries.
Key findings
For a 1 L CSTR with first-order A to B and second-order A to C reactions, an ellipse of correlated rate constants k1 and k2 was mapped forward to concentrations of A and B. The mapped boundary overlapped the analytical solution and agreed with 10,000 MC samples; a bimodal Gaussian mixture region of rate constants was also mapped and checked against 10,000 MC samples.
For the direct methane aromatization membrane reactor (eight steady-state ODEs), a 95% ellipse of correlated tube and shell pressures (roughly 0.25 to 1.75 and 0.6 to 1.4 atm) produced a nonconvex output region spanning more than 10% in methane conversion and about 20 mg/h in benzene production. In the inverse direction, a 95% ellipse in benzene production and methane conversion was mapped back to tube and shell flow rates. Of 10,000 MC points solved by an NLP-based inverse mapping in the Opyrability package, 95% fell inside the mapped input region, showing that the confidence level is preserved. The proposed method took 6 min 57 s for 100 boundary points against 10 h 27 min for NLP plus MC, a wall-clock reduction of about 99% (the two runs used different computers, an Apple M1 Pro and a Windows PC with an AMD Ryzen 7).
For a fed-batch bioreactor with Monod kinetics, an ellipsoid of uncertain measured product, biomass and substrate concentrations was mapped inversely to the kinetic parameters (maximum growth rate and two yield coefficients), and a forward pass of the result reproduced the original ellipsoid.
An appendix example suggested by a reviewer, y1 = x1 + x2 and y2 = x1 x2, has a singular Jacobian where x1 = x2 and is not one-to-one; there the mapped boundary does not bound the MC samples, and the authors suggest mapping several nested confidence contours instead.
Significance
The paper turns derivative-based inverse mapping into an uncertainty quantification tool in which one differentiable model serves both forward propagation and inverse inference from noisy measurements, at a small fraction of the cost of sampling with optimization. It connects uncertainty to process operability sets (expected disturbance, available input and achievable output sets). Limitations are the C1 diffeomorphism and injectivity assumptions, possible bifurcations requiring continuation methods, and the fact that only a boundary, not a full distribution, is obtained. Extending the method to dynamic systems where uncertainty evolves in time is named as future work. Code is available on GitHub (KitchinHUB/Mapping-Uncertainty-Using-Differentiable-Programming).