IndependentIntegration#
- class braincell.quad.IndependentIntegration(solver, **kwargs)[source]#
Mixin that opts a submodule out of its parent’s integration loop.
States owned by an
IndependentIntegrationsubmodule are filtered out bybraincell.quad._util.split_diffeq_states(), so they are not touched by whichever solver is driving the parentDiffEqModule. The submodule then advances its own states by callingmake_integration(), which dispatches through whatever solver was named at construction time.This is the right tool when a sub-system needs a different time step or a fundamentally different solver from the rest of the cell — for example, fast voltage gating that should run with exponential Euler while the surrounding model uses RK4, or a calcium pool that prefers backward Euler.
- Parameters:
solver (
str|Callable) – Name of a registered integrator (canonical or alias) or a step function. Resolved throughbraincell.quad.get_integrator(), so unknown strings raiseValueError.**kwargs – Forwarded to other
Mixinbases in the MRO.
See also
DiffEqModuleParent integration interface.
braincell.quad.get_integratorSolver lookup.
Examples
>>> from braincell import DiffEqModule, IndependentIntegration >>> class FastGate(IndependentIntegration, DiffEqModule): ... def __init__(self): ... super().__init__(solver='exp_euler') ... def compute_derivative(self, *args): ... ...