DiffEqModule#
- class braincell.quad.DiffEqModule#
Mixin marking a module as integrable by
braincell.quad.Any class that mixes in
DiffEqModuleexposes the small interface that every numerical integrator inbraincell.quadrelies on:pre_integral()— invoked once at the start of each step, before any derivative is computed. Use it to refresh voltage-dependent rate constants, recompute synaptic input, or perform other one-time-per-step bookkeeping.compute_derivative()— required override that writesstate.derivative(and optionallystate.diffusion) for everyDiffEqStateowned by the module.post_integral()— invoked once at the end of each step, after the integrated values have been written back. Use it to clamp states, project onto manifolds, or fire post-step events.
Concrete subclasses include
braincell.SingleCompartmentandbraincell.Cell. Solvers receive aDiffEqModuleas theirtargetargument and readt/dtfrom the activebrainstate.environcontext.See also
DiffEqStatePer-variable state container the solvers update.
IndependentIntegrationExcludes a submodule from the main solver.
- compute_derivative(*args, **kwargs)[source]#
Compute the derivative of the differential equation.
This method must be implemented by subclasses to define the specific differential equation for the system.
- Parameters:
- Returns:
This method should be overridden in subclasses.
- Return type:
NotImplemented
- Raises:
NotImplementedError – If this method is not overridden in a subclass.