braincell.quad.cn_exp_euler_step

braincell.quad.cn_exp_euler_step#

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

Advance a cell with Crank-Nicolson voltage and exponential Euler channels.

Operator-splitting update inside one dt:

  1. Channels and concentrations. With axial currents disabled, all non-voltage DiffEqState leaves are advanced by the coupled exponential Euler update from _exponential_euler() (the same linearised matrix-exponential step used by exp_euler_step()).

  2. Cable voltage. The linear axial system is then advanced by a Crank-Nicolson half-implicit step, \((I - \tfrac{\Delta t}{2} A) V_{n+1} = (I + \tfrac{\Delta t}{2} A) V_n\).

The Crank-Nicolson voltage solve is second-order accurate and unconditionally stable. Pairing it with exponential Euler for the channels is the recommended choice when the channel kinetics are very stiff (e.g. fast sodium activation) — exponential Euler captures the local exponential decay exactly while Crank-Nicolson keeps the cable update centred in time.

Parameters:
  • target (DiffEqModule) – Multi-compartment cell to advance.

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

  • dt (Quantity[s]) – Time step.

  • *args – Extra positional arguments forwarded to the channel and voltage solvers.

Returns:

target’s state is updated in place.

Return type:

None

Raises:

AssertionError – If target is not a braincell.Cell.

See also

cn_rk4_step

Same Crank-Nicolson voltage solve paired with classical RK4 channel updates.

implicit_exp_euler_step

Implicit Euler voltage solve paired with exponential Euler channel updates.