braincell.quad.splitting_step

Contents

braincell.quad.splitting_step#

braincell.quad.splitting_step(target, t, dt, *args)[source]#

Advance a multi-compartment cell with operator-splitting.

Two complementary updates are applied within a single dt:

  1. Channels and concentrations. With axial currents temporarily disabled (compute_axial_current=False), every DiffEqState in target is advanced by the manually parallelised Newton iteration in _newton_method_manual_parallel(). This handles ion channel gating variables, calcium pools, and any other non-voltage state.

  2. Cable voltage. A dense LU factorisation of the implicit-Euler cable matrix \(I - \Delta t A\) is constructed once via construct_lu() and reused with jax.scipy.linalg.lu_solve() to solve for the new midpoint voltages. The factorisation lives inside ensure_compile_time_eval so it is hoisted out of the JIT cache.

For non-Cell targets the splitting collapses to a single Newton solve over the whole state vector.

Splitting recovers full-cable stability while keeping the channel update embarrassingly parallel across compartments. It is the historical NEURON-style integrator and is provided here mainly for comparison against staggered_step(), which uses a sparser DHS cable solve.

Parameters:
  • target (DiffEqModule) – The module to advance. When target is a braincell.Cell, the splitting branch is used; otherwise the routine falls back to a plain Newton step.

  • t (Quantity[s]) – Current simulation time.

  • dt (Quantity[s]) – Time step. Must carry units of time.

  • *args – Extra positional arguments forwarded to target’s compute_derivative and pre/post_integral hooks.

Returns:

target’s state — voltage and channel/ion variables — is updated in place.

Return type:

None

See also

staggered_step

Sparser DHS-based splitting suitable for large trees.

cn_rk4_step, implicit_rk4_step, implicit_exp_euler_step