A Self-Limiting TVD Explicit Runge-Kutta Family for Real-Time Physics, Robotics, and Scientific Computing
Author: Pratyaksh Raj
Contact: pratyakshnarayanlal1@gmail.com
Manuscript: The Pratyaksh Framework: A Self-Limiting TVD Explicit Runge-Kutta Family for Real-Time Physics, Robotics, and Scientific Computing (arXiv: math.NA / cs.CE)
In continuous-depth ML (Neural ODEs), weight matrices often learn highly compressed, "stiff" latent spaces. Standard explicit solvers like RK4 or DOPRI5 suffer from catastrophic NaN explosions during these stiff transients, forcing the network to take infinitely small time-steps. The industry workaround is to use Implicit solvers (like BDF), which require computing massive
The Pratyaksh Framework solves this by acting as an autonomous mathematical shock-absorber. It remains 100% explicit and matrix-free, yet gracefully navigates stiff latent manifolds without exploding.
Running the stiff Neural ODE benchmark (python3 live_terminal_showdown.py) demonstrates RK4 mathematically detonating, while the Pratyaksh framework automatically damps the shock:
Click to expand full 120-step terminal output #
Simulating highly stiff latent space... (dt = 0.028)
Step | Time | Pratyaksh 'u' | Classical RK4 'u' | Status #
001 | 0.03s | 2.087566 | 10.775120 | Running... 002 | 0.06s | 2.179691 | 65.514174 | Running... 003 | 0.08s | 2.276612 | 406.95 | π¨ RK4 Diverging! 004 | 0.11s | 2.378579 | 2536.62 | π¨ RK4 Diverging! 005 | 0.14s | 2.485855 | 15820.26 | π¨ RK4 Diverging! 006 | 0.17s | 2.598716 | 98675.61 | π¨ RK4 Diverging! 007 | 0.20s | 2.717453 | 615477.59 | π¨ RK4 Diverging! 008 | 0.22s | 2.842373 | 3838978.29 | π¨ RK4 Diverging! 009 | 0.25s | 2.973796 | 23945241.52 | π¨ RK4 Diverging! 010 | 0.28s | 3.112062 | 149356047.82 | π¨ RK4 Diverging! 011 | 0.31s | 3.257527 | 931593411.06 | π¨ RK4 Diverging! 012 | 0.34s | 3.410566 | 5810720740.52 | π¨ RK4 Diverging! 013 | 0.36s | 3.571574 | NaN | π’ Pratyaksh Stable 014 | 0.39s | 3.740965 | NaN | π’ Pratyaksh Stable 015 | 0.42s | 3.919177 | NaN | π’ Pratyaksh Stable 016 | 0.45s | 4.106668 | NaN | π’ Pratyaksh Stable 017 | 0.48s | 4.303922 | NaN | π’ Pratyaksh Stable 018 | 0.50s | 4.511447 | NaN | π’ Pratyaksh Stable 019 | 0.53s | 4.729779 | NaN | π’ Pratyaksh Stable 020 | 0.56s | 4.959479 | NaN | π’ Pratyaksh Stable 021 | 0.59s | 5.201141 | NaN | π’ Pratyaksh Stable 022 | 0.62s | 5.455387 | NaN | π’ Pratyaksh Stable 023 | 0.64s | 5.722872 | NaN | π’ Pratyaksh Stable 024 | 0.67s | 6.004286 | NaN | π’ Pratyaksh Stable 025 | 0.70s | 6.300355 | NaN | π’ Pratyaksh Stable 026 | 0.73s | 6.611841 | NaN | π’ Pratyaksh Stable 027 | 0.76s | 6.939547 | NaN | π’ Pratyaksh Stable 028 | 0.78s | 7.284319 | NaN | π’ Pratyaksh Stable 029 | 0.81s | 7.647045 | NaN | π’ Pratyaksh Stable 030 | 0.84s | 8.028660 | NaN | π’ Pratyaksh Stable 031 | 0.87s | 8.430147 | NaN | π’ Pratyaksh Stable 032 | 0.90s | 8.852542 | NaN | π’ Pratyaksh Stable 033 | 0.92s | 9.296933 | NaN | π’ Pratyaksh Stable 034 | 0.95s | 9.764465 | NaN | π’ Pratyaksh Stable 035 | 0.98s | 10.256345 | NaN | π’ Pratyaksh Stable 036 | 1.01s | 10.773839 | NaN | π’ Pratyaksh Stable 037 | 1.04s | 11.318282 | NaN | π’ Pratyaksh Stable 038 | 1.06s | 11.891078 | NaN | π’ Pratyaksh Stable 039 | 1.09s | 12.493701 | NaN | π’ Pratyaksh Stable 040 | 1.12s | 13.127707 | NaN | π’ Pratyaksh Stable 041 | 1.15s | 13.794729 | NaN | π’ Pratyaksh Stable 042 | 1.18s | 14.496486 | NaN | π’ Pratyaksh Stable 043 | 1.20s | 15.234788 | NaN | π’ Pratyaksh Stable 044 | 1.23s | 16.011537 | NaN | π’ Pratyaksh Stable 045 | 1.26s | 16.828736 | NaN | π’ Pratyaksh Stable 046 | 1.29s | 17.688490 | NaN | π’ Pratyaksh Stable 047 | 1.32s | 18.593017 | NaN | π’ Pratyaksh Stable 048 | 1.34s | 19.544648 | NaN | π’ Pratyaksh Stable 049 | 1.37s | 20.545835 | NaN | π’ Pratyaksh Stable 050 | 1.40s | 21.599159 | NaN | π’ Pratyaksh Stable 051 | 1.43s | 22.707336 | NaN | π’ Pratyaksh Stable 052 | 1.46s | 23.873221 | NaN | π’ Pratyaksh Stable 053 | 1.48s | 25.099820 | NaN | π’ Pratyaksh Stable 054 | 1.51s | 26.390295 | NaN | π’ Pratyaksh Stable 055 | 1.54s | 27.747972 | NaN | π’ Pratyaksh Stable 056 | 1.57s | 29.176351 | NaN | π’ Pratyaksh Stable 057 | 1.60s | 30.679113 | NaN | π’ Pratyaksh Stable 058 | 1.62s | 32.260132 | NaN | π’ Pratyaksh Stable 059 | 1.65s | 33.923482 | NaN | π’ Pratyaksh Stable 060 | 1.68s | 35.673453 | NaN | π’ Pratyaksh Stable 061 | 1.71s | 37.514553 | NaN | π’ Pratyaksh Stable 062 | 1.74s | 39.451530 | NaN | π’ Pratyaksh Stable 063 | 1.76s | 41.489375 | NaN | π’ Pratyaksh Stable 064 | 1.79s | 43.633341 | NaN | π’ Pratyaksh Stable 065 | 1.82s | 45.888955 | NaN | π’ Pratyaksh Stable 066 | 1.85s | 48.262031 | NaN | π’ Pratyaksh Stable 067 | 1.88s | 50.758685 | NaN | π’ Pratyaksh Stable 068 | 1.90s | 53.385352 | NaN | π’ Pratyaksh Stable 069 | 1.93s | 56.148805 | NaN | π’ Pratyaksh Stable 070 | 1.96s | 59.056164 | NaN | π’ Pratyaksh Stable 071 | 1.99s | 62.114925 | NaN | π’ Pratyaksh Stable 072 | 2.02s | 65.332971 | NaN | π’ Pratyaksh Stable 073 | 2.04s | 68.718598 | NaN | π’ Pratyaksh Stable 074 | 2.07s | 72.280531 | NaN | π’ Pratyaksh Stable 075 | 2.10s | 76.027953 | NaN | π’ Pratyaksh Stable 076 | 2.13s | 79.970522 | NaN | π’ Pratyaksh Stable 077 | 2.16s | 84.118402 | NaN | π’ Pratyaksh Stable 078 | 2.18s | 88.482282 | NaN | π’ Pratyaksh Stable 079 | 2.21s | 93.073412 | NaN | π’ Pratyaksh Stable 080 | 2.24s | 97.903626 | NaN | π’ Pratyaksh Stable 081 | 2.27s | 102.985374 | NaN | π’ Pratyaksh Stable 082 | 2.30s | 108.331754 | NaN | π’ Pratyaksh Stable 083 | 2.32s | 113.956547 | NaN | π’ Pratyaksh Stable 084 | 2.35s | 119.874252 | NaN | π’ Pratyaksh Stable 085 | 2.38s | 126.100122 | NaN | π’ Pratyaksh Stable 086 | 2.41s | 132.650204 | NaN | π’ Pratyaksh Stable 087 | 2.44s | 139.541382 | NaN | π’ Pratyaksh Stable 088 | 2.46s | 146.791419 | NaN | π’ Pratyaksh Stable 089 | 2.49s | 154.419002 | NaN | π’ Pratyaksh Stable 090 | 2.52s | 162.443792 | NaN | π’ Pratyaksh Stable 091 | 2.55s | 170.886473 | NaN | π’ Pratyaksh Stable 092 | 2.58s | 179.768807 | NaN | π’ Pratyaksh Stable 093 | 2.60s | 189.113689 | NaN | π’ Pratyaksh Stable 094 | 2.63s | 198.945206 | NaN | π’ Pratyaksh Stable 095 | 2.66s | 209.288699 | NaN | π’ Pratyaksh Stable 096 | 2.69s | 220.170830 | NaN | π’ Pratyaksh Stable 097 | 2.72s | 231.619648 | NaN | π’ Pratyaksh Stable 098 | 2.74s | 243.664664 | NaN | π’ Pratyaksh Stable 099 | 2.77s | 256.336924 | NaN | π’ Pratyaksh Stable 100 | 2.80s | 269.669092 | NaN | π’ Pratyaksh Stable 101 | 2.83s | 283.695533 | NaN | π’ Pratyaksh Stable 102 | 2.86s | 298.452401 | NaN | π’ Pratyaksh Stable 103 | 2.88s | 313.977732 | NaN | π’ Pratyaksh Stable 104 | 2.91s | 330.311546 | NaN | π’ Pratyaksh Stable 105 | 2.94s | 347.495943 | NaN | π’ Pratyaksh Stable 106 | 2.97s | 365.575217 | NaN | π’ Pratyaksh Stable 107 | 3.00s | 384.595969 | NaN | π’ Pratyaksh Stable 108 | 3.02s | 404.607226 | NaN | π’ Pratyaksh Stable 109 | 3.05s | 425.660570 | NaN | π’ Pratyaksh Stable 110 | 3.08s | 447.810266 | NaN | π’ Pratyaksh Stable 111 | 3.11s | 471.113407 | NaN | π’ Pratyaksh Stable 112 | 3.14s | 495.630059 | NaN | π’ Pratyaksh Stable 113 | 3.16s | 521.423415 | NaN | π’ Pratyaksh Stable 114 | 3.19s | 548.559960 | NaN | π’ Pratyaksh Stable 115 | 3.22s | 577.109640 | NaN | π’ Pratyaksh Stable 116 | 3.25s | 607.146043 | NaN | π’ Pratyaksh Stable 117 | 3.28s | 638.746592 | NaN | π’ Pratyaksh Stable 118 | 3.30s | 671.992738 | NaN | π’ Pratyaksh Stable 119 | 3.33s | 706.970176 | NaN | π’ Pratyaksh Stable FATAL ERROR: Classical RK4 suffered NaN overflow. SUCCESS: The Pratyaksh Framework autonomously damped the shock.
The Pratyaksh Integrator uses only basic operations (addition, multiplication, and a single differentiable vector-norm division). This means you can use **Direct Autograd** (backprop-through-time) without custom implicit differentiation rules.
If memory is a bottleneck, you can plug the Pratyaksh Integrator directly into the **$O(1)$ Adjoint Method** to integrate backward explicitly, bypassing the
The entire solver is contained in a single self-contained C++20 header file: [`pratyaksh.hpp`](https://github.com/Pratyaksh3142/The-Pratyaksh-Framework/blob/main/pratyaksh.hpp).
#include "pratyaksh.hpp" #include <iostream> #include <vector>
void harmonic_oscillator(double t, const std::vector<double>& y, std::vector<double>& dy) { dy[0] = y[1]; dy[1] = -y[0]; }
int main() { std::vector<double> y = {1.0, 0.0}; // position = 1, velocity = 0 std::vector<double> k1(2), k2(2), k3(2), k4(2), temp(2); double dt = 0.01; double t = 0.0;
// Advance one step with Formula B (Order 4)
auto result = pratyaksh::step_formula_b(t, dt, y, k1, k2, k3, k4, temp, harmonic_oscillator);
std::cout << "y(0.01) = " << y[0] << ", Denominator = " << result.denominator << "\n";
return 0;
}
The benchmark suite in `benchmarks/` reproduces the exact numerical results published in Section 5 of the paper:
clang++ -std=c++20 -O3 benchmarks/test_convergence.cpp -o test_convergence ./test_convergence
clang++ -std=c++20 -O3 benchmarks/test_ks.cpp -o test_ks ./test_ks
clang++ -std=c++20 -O3 benchmarks/test_burgers.cpp -o test_burgers ./test_burgers
clang++ -std=c++20 -O3 benchmarks/test_brusselator.cpp -o test_brusselator ./test_brusselator
python3 verify_derivation.py The-Pratyaksh-Framework/ βββ pratyaksh.hpp # Production single-header C++20 framework βββ verify_derivation.py # SymPy CAS verification of Taylor series βββ benchmarks/ β βββ test_convergence.cpp # Section 5.1 step-halving order test β βββ test_ks.cpp # Section 5.2 Kuramoto-Sivashinsky CFL test β βββ test_burgers.cpp # Section 5.3 Burgers TVD shock preservation test β βββ test_brusselator.cpp # Section 5.4 2,000-D Brusselator wave test βββ paper.tex # Complete LaTeX manuscript βββ LICENSE # Academic & Non-Commercial Research License βββ README.md # Documentation & Quickstart
If you utilize the Pratyaksh Framework in scientific research, please cite:
@article{raj2026pratyaksh, title={The Pratyaksh Framework: A Self-Limiting TVD Explicit Runge-Kutta Family for Real-Time Physics, Robotics, and Scientific Computing}, author={Raj, Pratyaksh}, journal={Zenodo Preprints}, year={2026}, doi={10.5281/zenodo.23012055}, url={https://doi.org/10.5281/zenodo.23012055} }
Copyright (c) 2026 Pratyaksh Raj. All rights reserved.
The Pratyaksh Framework is provided free for academic research and personal non-commercial evaluation under the terms of the [`LICENSE`](https://github.com/Pratyaksh3142/The-Pratyaksh-Framework/blob/main/LICENSE). Commercial deployment in game physics engines, commercial simulators, or closed-source enterprise software requires a commercial license. For commercial licensing inquiries, contact `pratyakshnarayanlal1@gmail.com`.