braincell.quad module#
Numerical integrators for BrainCell.
Exposes get_integrator() plus every canonical solver name
registered in braincell.quad._registry.
Note
This __init__.py deliberately performs side-effect imports of
every _<backend>.py module. Each backend self-registers into the
integrator registry at import time via @register_integrator. Do
not lazily defer these imports — unresolved solver names would
surface as ValueError: unknown integrator from
get_integrator() at first call instead of at import time.
braincell.quad provides a mechanism to define coupled ordinary differential equations (ODEs)
and solve them using various numerical integration methods.
The integration methods are categorized into exponential integrators, Runge-Kutta methods,
and implicit methods.
Defining Coupled ODEs#
A |
|
Mixin marking a module as integrable by |
|
Mixin that opts a submodule out of its parent's integration loop. |
Integrator Registry#
A single registered integrator and its metadata. |
|
Mutable, observable registry of integrator step functions. |
|
Resolve a numerical integrator from a string name or a callable. |
|
Return the process-wide |
|
Decorator: register the wrapped function in the global registry. |
|
Backwards-compatible mapping view of the integrator registry. |
Exponential Integrators#
|
Advance one step with the (coupled) exponential Euler method. |
|
Advance a cell with exponential cable and exponential Euler channels. |
|
Advance each |
Runge-Kutta Integrators#
|
Advance one step with the explicit (forward) Euler method. |
|
Advance one step with the explicit midpoint (modified Euler) method. |
|
Advance one step with a generic second-order Runge-Kutta method. |
|
Advance one step with Heun's second-order Runge-Kutta method. |
|
Advance one step with Ralston's second-order Runge-Kutta method. |
|
Advance one step with the classical third-order Runge-Kutta method. |
|
Advance one step with Heun's third-order Runge-Kutta method. |
|
Advance one step with the Strong-Stability-Preserving RK3 method. |
|
Advance one step with Ralston's third-order Runge-Kutta method. |
|
Advance one step with the classical fourth-order Runge-Kutta method. |
|
Advance one step with Ralston's fourth-order Runge-Kutta method. |
Implicit Integrators#
|
Advance one step with the linearised backward (implicit) Euler method. |
|
Advance one step with the implicit (backward) Euler method. |
|
Advance a cell with implicit Euler voltage and exponential Euler channels. |
|
Advance a cell with implicit Euler voltage and explicit RK4 channels. |
Other Integrators#
|
Advance a cell with Crank-Nicolson voltage and exponential Euler channels. |
|
Advance a cell with Crank-Nicolson voltage and explicit RK4 channels. |
|
Advance a multi-compartment cell with operator-splitting. |
|
Advance a multi-compartment cell by one staggered time step. |