Cellier-Elmqvist Algebraic Loop Tearing
Implementation: TornBlock in packages/runtime/src/wasm/structural/tearing.ts
Academic Citations
- Cellier, F. E. (1979). Combined Continuous/Discrete System Simulation by Use of Digital Computers: Techniques and Tools.
PhD thesis, ETH Zurich.
DOI: 10.3929/ethz-a-000179979 - Elmqvist, H., & Otter, M. (1994). "Methods for Tearing Systems of Equations in Object-Oriented Modeling."
Proceedings of the European Simulation Multiconference (ESM'94), pp. 326–332. - Mahana, P. N., & Eagan, J. P. (1975). "A tearing algorithm for large systems of equations."
IEEE Transactions on Circuits and Systems.
ModelScript Architectural Rationale
Even after BLT partitioning, physical systems containing closed kinematic loops, electrical bridge circuits, or multi-phase fluid balances yield coupled Strongly Connected Components of size
Solving an
The Cellier-Elmqvist Minimum Degree Tearing algorithm identifies a minimal set of
The non-linear iterative solver is restricted to the tiny
ModelScript Modifications & WASM Architecture
- Unmanaged WebAssembly Kernel: Implemented as
@unmanagedclasses directly in linear memory with zero garbage collection pauses. - Dynamic Minimum Degree Heuristic: Evaluates vertex degrees in the block incidence graph in memory, prioritizing linear tearing variables over non-linear variables to avoid non-linear solving where possible.
- Partitioned In-Memory Structures: Splits the block into:
tearing variables ( tearVarIndices)explicit causal equations ( innerEqIndices)residual constraint equations ( residualEqIndices)
- Direct Matrix Integration: Emits residual Jacobians directly to the in-WASM LU factorizer (
luFactor,luSolve).
Algorithm Steps
Upstream & Downstream Pipeline Connections
- Upstream Inputs:
- Receives coupled SCC blocks of size
from BltEngine.
- Receives coupled SCC blocks of size
- Downstream Consumers:
- Feeds explicit forward chains and
residual systems to the in-WASM Newton-Raphson solver and Sparse LU Solver. - Evaluated inside simulation step loops (
SUNDIALS,TR-BDF2,Tsit5).
- Feeds explicit forward chains and

