The simulation engine
Turn a cyclic feedback graph into a solved ODE system with 11 solvers, events, and σ-propagation.
From graph to ODE
Captyse analyzes a cyclic feedback compound, cuts the feedback edges, and builds an OdeSystem that borrows the graph executor to evaluate the right-hand side. The simulation reuses the exact same node math as the rest of the app — there is no separate equation language.
A MATLAB-class solver menu
Eleven solvers cover the range:
- Variable-step: ode45 (Dormand–Prince 5(4), FSAL, dense output, PI step control), ode23, tsit5, dop853.
- Stiff: ode15s (BDF), ode23tb, esdirk34.
- Fixed-step: ode1 through ode5.
A clean adaptive-stepper seam and tableau-driven generic RK make new solvers easy to add.
The residual
For a state vector , the engine integrates
Zero-crossing events
Event detection is bisection-localized with state reset. A bouncing ball is a modular hit_crossing block driving an integrator's reset port, validated against analytic physics facts. The engine is event-honest: a model with events run on an event-blind solver is refused loudly, never silently wrong.
Uncertainty through the solve
Units and ±σ propagate through the integration via forward sensitivity analysis — the augmented state evolves as
Speed: the AOT compiler
The scalar residual is ahead-of-time compiled once into a flat f64 slot program with constant folding — 46.6 ms, ~730× faster than the naive re-parse — and validated bit-for-bit against the generic path. If they ever disagree, it bails out. Unit conversions are baked into the compiled program, so the hot loop is unit-blind.
Authoring from text
Type or paste ODEs in textbook form and Captyse auto-builds a runnable compound:
dx/dt = sigma*(y - x)
dy/dt = x*(rho - z) - y
dz/dt = x*y - beta*z
sigma = 10; rho = 28; beta = 8/3
x(0) = 1; y(0) = 1; z(0) = 1That's the Lorenz system — one integrator and one formula per state, wired automatically. Vector notation d[x,y,z]/dt = […] is accepted too.