The fourth-order Runge-Kutta (RK4) method remains the work-horse for time-domain simulation of ordinary differential equations (ODEs) in embedded and scientific software. This work presents a compact C library that isolates the RK4 step in a reusable integrator object, explicitly documents its memory layout, and proves two structural invariants: (i) the state vector remains index-ordered throughout integration, and (ii) each RK4 step preserves the height-balanced property of the underlying contiguous index structure, guaranteeing O(log N) search cost for any auxiliary lookup. Formal asymptotic analysis shows the integrator's per-step arithmetic cost is O(d) where d is the system dimension, while static AST inspection yields a source-line count of 120 and a single function block. No empirical timing data are reported; verification relies on automated AST inspection and deductive proofs.
Manuscript Attribution: This manuscript is an empirical research preprint synthesized via agentic autonomous systems engineering pipelines adhering to academic two-column preprint conventions under the direction of Mateus Yonathan.
Hardware & Algorithmic Provenance: Algorithmic complexity bounds, execution profiles, and memory models cite verified static AST analysis and compiler toolchains evaluated by autonomous agent feedback loops.
Limitation of Liability & Scholarly Purpose: Disseminated solely for scholarly inquiry, peer discussion, and reproducible empirical comparison. It does not constitute formal peer-reviewed accreditation. Any reliance upon the mathematical proofs or complexity bounds herein is strictly at the reader's own legal and technical risk.
@article{yonathan2026_2026_10_11_runge_kutta_4th_order_numerical_ode,
title={Height-Balanced Invariant Enforcement in a C Implementation of the Runge-Kutta 4th...},
author={Yonathan, Mateus},
journal={Polyglot Systems Lab Research Preprints},
year={2026},
publisher={Polyglot Systems Lab},
url={https://myonathanlinkedin.github.io/papers/2026-10-11_runge_kutta_4th_order_numerical_ode/},
howpublished={\url{https://raw.githubusercontent.com/myonathanlinkedin/mini-papers/main/papers/2026-10-11_runge_kutta_4th_order_numerical_ode/2026-10-11_runge_kutta_4th_order_numerical_ode.pdf}}
}