CurrentClamp

Contents

CurrentClamp#

class braincell.CurrentClamp(delay=<factory>, durations=<factory>, amplitudes=<factory>, target_index=None)[source]#

Piecewise-constant current clamp.

Parameters:
  • delay (Any) – Absolute simulation time at which the first segment begins. May be a scalar or broadcastable to the placed target shape.

  • durations (Any) – Single-segment duration or multi-segment durations.

  • amplitudes (Any) – Single-segment amplitude or multi-segment amplitudes.

  • target_index (Any) – Reserved sparse target indices over the flattened placement target axis. None keeps dense/broadcast semantics.

Raises:
  • TypeError – If delay, durations or amplitudes are not quantities.

  • ValueError – If any duration is non-positive, or if target_index is not a one-dimensional non-negative integer array.

Examples

>>> import brainunit as u
>>> from braincell.mech import CurrentClamp
>>> cc = CurrentClamp(
...     delay=10 * u.ms,
...     durations=50 * u.ms,
...     amplitudes=0.2 * u.nA,
... )