Skip to content
Oakfield Operator Calculus Function Reference Site

Integrator Creation

sim_create_context_integrator(ctx, name, config) -> integrator
  • name is one of: euler, euler_deterministic, heun, rk4, rkf45, backward_euler, crank_nicolson, subordination.
  • config is optional; unspecified fields use defaults in lua_api.c.

Key config fields:

  • initial_dt (default 0.1), min_dt (1e-4), max_dt (1.0)
  • tolerance (1e-3), safety (0.9)
  • adaptive (false unless the method enables it), enable_stochastic (false)
  • stochastic_strength, random_seed
  • workspace_hint (optional state length hint)

Attach with sim_set_integrator(ctx, integrator). The handle is kept alive via a Lua registry ref until you call sim_detach_integrator or sim_shutdown.

  • euler: explicit Euler; fixed step only.
  • euler_deterministic: Euler with deterministic noise handling; fixed step.
  • heun: Heun’s method (improved Euler); fixed step.
  • rk4: Classical 4th-order Runge–Kutta; fixed step.
  • rkf45: Dormand–Prince RK45 with adaptive stepping (uses tolerance, safety, min_dt, max_dt).
  • backward_euler: Implicit Euler; stable on stiff problems; fixed step.
  • crank_nicolson: Implicit trapezoidal rule; A-stable; fixed step.
  • subordination: Two-stage integrator handling fractional/subordinated clocks; respects stochastic parameters.