Scientific Computing, Linear Algebra, Surrogates & Digital Twins
Implementation:
- Sparse Linear Algebra & Symbolic Solvers:
packages/runtime/src/wasm/solvers/ - Reduced-Order & Dimensional Surrogates:
packages/simulate/src/surrogates/ - Operational Digital Twin Estimation & Prognostics:
packages/simulate/src/twin/,packages/simulate/src/calibration/bayesian_calibrator.ts, andpackages/simulate/src/optimizer/core/calibrator.ts
1. Davis SuiteSparse Left-Looking Cholesky ( )
Academic Citations
- Davis, T. A. (2006). Direct Methods for Sparse Linear Systems.
SIAM. DOI: 10.1137/1.9780898718881 - Chen, Y., Davis, T. A., Hager, W. W., & Rajamanickam, S. (2008). "Algorithm 887: CHOLMOD, supernodal sparse Cholesky factorization and update/downdate."
ACM Transactions on Mathematical Software, 35(3), pp. 22:1–22:14. DOI: 10.1145/1462166.1462176
ModelScript Rationale & Modifications
Solves symmetric positive-definite sparse systems
- Modifications: Left-looking column-by-column factorization computing non-zero patterns dynamically via elimination trees; operates inside unmanaged WebAssembly linear memory with zero heap fragmentation.
2. Gilbert-Peierls Left-Looking Sparse LU ( )
Academic Citations
- Gilbert, J. R., & Peierls, T. (1988). "An approach to sparse LU factorization based on graph coloring and topological sort."
International Conference on Supercomputing. - Davis, T. A. (2006). Direct Methods for Sparse Linear Systems. SIAM. Chapter 5.
ModelScript Rationale & Modifications
Factorizes unsymmetric, highly irregular sparse Jacobians generated by torn physical DAE systems.
- Modifications: Depth-first search (DFS) topological ordering to find the exact non-zero structure of each column in
and in time proportional to arithmetic operations; threshold partial pivoting with diagonal preference to preserve physical sparsity.
3. Householder QR with Column Pivoting
Academic Citations
- Golub, G. H., & Van Loan, C. F. (2013). Matrix Computations (4th ed.).
Johns Hopkins University Press. - Businger, P., & Golub, G. H. (1965). "Linear least squares solutions by Householder transformations."
Numerische Mathematik, 7(3), pp. 269–276. DOI: 10.1007/BF01436084
ModelScript Rationale & Modifications
Computes numerically stable orthogonal factorizations
4. Buchberger's Gröbner Basis Engine with Gebauer-Möller Criteria
Academic Citations
- Buchberger, B. (1965). An Algorithm for Finding the Basis Elements of the Residue Class Ring of a Zero Dimensional Polynomial Ideal.
PhD thesis, University of Innsbruck. - Gebauer, R., & Möller, H. M. (1988). "On an installation of Buchberger's algorithm."
Journal of Symbolic Computation, 6(2-3), pp. 275–286. DOI: 10.1016/S0747-7171(88)80048-8 - Cox, D., Little, J., & O'Shea, D. (2015). Ideals, Varieties, and Algorithms (4th ed.).
Springer. DOI: 10.1007/978-3-319-16721-3
ModelScript Rationale & Modifications
Solves small non-linear algebraic loops analytically to avoid numerical Newton iterations entirely. Computes the Gröbner basis under lexicographic monomial ordering (
- Modifications: Implements the Gebauer-Möller criteria (
and sets) to eliminate over 90% of redundant -polynomial reduction checks; operates over exact rational coefficients .
5. Proper Orthogonal Decomposition (POD) / Snapshot SVD
Academic Citations
- Sirovich, L. (1987). "Turbulence and coherence in Catherine's wheel: Method of snapshots."
Quarterly of Applied Mathematics, 45(3), pp. 561–571. DOI: 10.1090/qam/910462 - Berkooz, G., Holmes, P., & Lumley, J. L. (1993). "The proper orthogonal decomposition in the analysis of turbulent flows."
Annual Review of Fluid Mechanics, 25, pp. 539–575. DOI: 10.1146/annurev.fl.25.010193.002543
ModelScript Rationale & Modifications
Extracts reduced-order models (ROM) from massive 3D CFD or FEA simulation field snapshots (
- Modifications: Employs Sirovich's snapshot method to compute eigenvalues of the small
temporal correlation matrix ( snapshots), retaining cumulative kinetic energy in spatial modes.
6. Buckingham Dimensional Analysis & Similarity Engine
Academic Citations
- Buckingham, E. (1914). "On physically similar systems; illustrations of the use of dimensional equations."
Physical Review, 4(4), pp. 345–376. DOI: 10.1103/PhysRev.4.345 - Vaschy, A. (1892). "Sur les lois de similitude en physique."
Annales Télégraphiques, 19, pp. 25–28. - Barenblatt, G. I. (1996). Scaling, Self-Similarity, and Intermediate Asymptotics.
Cambridge Texts in Applied Mathematics 14. DOI: 10.1017/CBO9781107050242
ModelScript Rationale & Modifications
Reduces parameter dimensionality in surrogate modeling by converting raw physical quantities (
- Modifications: Computes the null-space of the 7-dimensional SI unit exponent matrix using exact rational Gaussian elimination with coprime integer exponents; canonical fingerprint matching recognizes standard dimensionless numbers (Reynolds
, Nusselt , Mach , Froude ).
7. Operational Digital Twin Estimation & Prognostics (packages/simulate/src/twin/)
Academic Citations
- Rao, C. V., Rawlings, J. B., & Mayne, D. Q. (2003). "Constrained state estimation for nonlinear discrete-time systems: stability and moving horizon approximations."
IEEE Transactions on Automatic Control, 48(2), pp. 246–258. DOI: 10.1109/TAC.2002.808470 - Julier, S. J., & Uhlmann, J. K. (2004). "Unscented filtering and nonlinear estimation."
Proceedings of the IEEE, 92(3), pp. 401–422. DOI: 10.1109/JPROC.2003.823141 - Page, E. S. (1954). "Continuous inspection schemes."
Biometrika, 41(1/2), pp. 100–115. DOI: 10.2307/2333009 - Miner, M. A. (1945). "Cumulative damage in fatigue."
Journal of Applied Mechanics, 12(3), pp. A159–A164.
ModelScript Architectural Overview
1. Moving Horizon Estimation (MHE) over the Linear-Memory DAE Arena (arena-mhe.ts)
MovingHorizonEstimator reconciles streaming physical sensor windows (TelemetryWindow over DAEBuilder arena by solving a box-constrained trajectory-tracking problem:
- Joint Physical & Neural Hybrid Calibration: Simultaneously estimates physical DAE parameters
and embedded ArenaNeuralBlocksurrogate weightsinside the same optimization vector. - Adjoint-Driven L-BFGS-B: Evaluates exact objective gradients via
DaeAdjointSolver(solveDaeAdjoint) and converges inquasi-Newton lbfgsbSolveiterations, automatically warm-starting initial states from window boundaries.
2. Unscented Kalman Filter (UKF) & Multi-Strategy Parameter Calibration (calibrator.ts, bayesian_calibrator.ts)
ModelScript provides two complementary calibration engines for offline test-stand identification and online probabilistic tracking:
- Joint-State Unscented Kalman Filter (
BayesianParameterCalibrator): Augments the continuous state vectorwith unknown physical parameters into . Propagates deterministic sigma points ( ) through the nonlinear DAE transition and measurement model ( UnscentedKalmanFilter), extracting full posterior covariance, confidence intervals ( ), and automated Digital Thread hypergraph write-back suggestions. - Deterministic & Global Metaheuristic Calibration (
ModelicaCalibratorincalibrator.ts): Supports Levenberg-Marquardt (lm) with damped normal equations, Sequential Quadratic Programming ( sqp) with BFGS Hessian updates, scalable adjointlbfgsb, Bayesian MCMC / global evolutionary search (cmaes,de,pso), and two-stagehybrid-cmaes-lmglobal-to-local polishing.
3. Page-Hinkley / CUSUM Statistical Residual Drift Detection (drift-detector.ts)
CusumDriftDetector continuously monitors multi-channel innovation residuals
- Two-Sided Sequential Cumulative Sum: Normalizes each channel residual
with minimum detectable shift slack (default ) and updates positive and negative CUSUM statistics: - Adaptive Burn-In & Severity Classification: Supports empirical baseline calibration (
calibrateFromData) and triggers structuredDriftEventalerts when, classifying severity ( low,medium,high,critical) by threshold ratioalongside online shift magnitude estimation.
4. Virtual Sensor Synthesis & Remaining Useful Life (RUL) Prognostics (prognostics.ts)
- Virtual Sensor Synthesis (
VirtualSensorSynthesizer): Evaluates unobservable internal physical states (e.g., rotor hotspot temperatures, internal valve spool stresses) at arbitrary timestampsdirectly from the continuous DenseHermiteCheckpointTape. - Physics-of-Failure Damage Accumulation (
RulPredictor): Computes instantaneous degradation ratesunder three selectable damage laws: - Arrhenius Thermal Aging:
- Miner's Power-Law / Basquin Fatigue:
- Archard Linear Mechanical Wear:
- Arrhenius Thermal Aging:
- Probabilistic RUL Quantiles: Given current damage
and operational duty-cycle load variability , projects log-normal survival quantiles:
Upstream & Downstream Pipeline Connections
- Upstream Inputs:
- Downstream Consumers:
- Embedded into real-time Modelica plant loops via
msx surrogateand operational digital twins. - Feeds calibrated posterior parameters and RUL health metrics back into the
DigitalThreadHypergraph. - Accelerates linear solves across all numerical integrators and optimal control routines.
- Embedded into real-time Modelica plant loops via

