Skip to content

Izhikevich

The Izhikevich neuron.

  • Class: IzhikevichSystem
  • Import: from skcomplex.systems.biology.neuroscience import IzhikevichSystem
  • Field: biology/neuroscience
  • Topics: neuron, spiking, events, bursting
  • References:
    • Izhikevich 2003

Use this system

The block imports the class and simulates the system with its default parameters and its tuned run settings.

from skcomplex.systems.biology.neuroscience import IzhikevichSystem

trajectory = IzhikevichSystem().prepare().simulate()

Parameters

The model parameters take these defaults, and set_params changes them.

Parameter Default
v -65.0
u None
a 0.02
b 0.2
c -65.0
d 8.0
I 10.0
solver 'auto'
backend 'auto'

Tags

The system with its default parameters has these capability tags, which solvers and analyses check.

Tag Values
Time continuous
Space none
Laws rate, update
Randomness deterministic
Domains real
Structure fixed

Class

The source of the class shows how it builds its components from its model parameters.

class IzhikevichSystem(BaseSystem):
    """The Izhikevich neuron.

    Its four parameters give regular spiking, bursting, chattering, and more.

    The potential follows `v' = 0.04 v² + 5 v + 140 - u + I` and the recovery `u' = a (b v - u)`. When `v` reaches 30 mV
    the neuron spikes, `v` resets to `c`, and `u` grows by `d`. The defaults give regular spiking. The system has the
    potential `neuron.v`, the recovery `neuron.u`, and its spikes as `spike` events.

    Args:
        v:
            The initial membrane potential in mV.

        u:
            The initial recovery variable, or `None` for `b v`.

        a:
            The time scale of the recovery.

        b:
            The sensitivity of the recovery to the potential.

        c:
            The potential after a spike.

        d:
            The increase of the recovery after a spike.

        I:
            The input current.

        label:
            The label of the system, which names it when it is nested in another one.

        solver:
            The solver of the problem, or `'auto'` for the one the system chooses.

        backend:
            The backend that evaluates the compiled functions, or `'auto'` for the one the system chooses.

    Examples:
        >>> from skcomplex.systems.biology.neuroscience import IzhikevichSystem
        >>> IzhikevichSystem(d=2.0).prepare().system_.interactions[1].kick
        2.0
    """

    field = 'biology/neuroscience'
    topics = ('neuron', 'spiking', 'events', 'bursting')
    references = ('Izhikevich 2003',)
    until = 200.0
    dt = 0.1

    def __init__(
        self,
        v: float = -65.0,
        u: float | None = None,
        *,
        a: float = 0.02,
        b: float = 0.2,
        c: float = -65.0,
        d: float = 8.0,
        I: float = 10.0,
        label: str = 'system',
        solver: BaseSolver | str = 'auto',
        backend: BaseBackend | str = 'auto',
    ) -> None:
        super().__init__(label, solver=solver, backend=backend)
        self.v = v
        self.u = u
        self.a = a
        self.b = b
        self.c = c
        self.d = d
        self.I = I

    def _prepare(self, context: Sequence[Observable] | None = None) -> None:
        """Set the system of the Izhikevich neuron.

        Args:
            context:
                The observables to compile with the problem, or `None` for none.
        """
        super()._prepare(context)
        neuron = IzhikevichElement('neuron', v=self.v, u=self.b * self.v if self.u is None else self.u)
        membrane = IzhikevichInteraction('membrane', target='neuron', a=self.a, b=self.b, I=self.I)
        spike = SpikeResetInteraction('spike', target='neuron', threshold=PEAK, after=self.c, kicked='u', kick=self.d)
        self.system_ = System(self.label, elements=[neuron], interactions=[membrane, spike])

Components

The system uses these element and interaction classes, each with its nearest class of the core.

Elements:

Interactions:

  • IzhikevichInteraction, from Interaction
  • SpikeResetInteraction, from Interaction
class IzhikevichElement(Element):
    """Izhikevich neuron, a quadratic potential `v` and a linear recovery `u`.

    Args:
        label:
            The label of the neuron.

        v:
            The initial potential.

        u:
            The initial recovery.

    Examples:
        >>> from skcomplex.systems.biology.neuroscience import IzhikevichElement
        >>> IzhikevichElement('neuron').u
        -13.0
    """

    def __init__(self, label: str, *, v: float = -65.0, u: float = -13.0) -> None:
        super().__init__(label)
        self.v = v
        self.u = u

class IzhikevichInteraction(Interaction):
    """Izhikevich's quadratic potential and linear recovery of a neuron.

    The potential follows `v' = 0.04 v² + 5 v + 140 - u + I` and the recovery `u' = a (b v - u)`. A spike reset fires
    the neuron.

    Args:
        label:
            The label of the interaction.

        target:
            The path of the neuron, with the potential `v` and the recovery `u`.

        a:
            The time scale of the recovery.

        b:
            The sensitivity of the recovery to the potential.

        I:
            The input current.

    Examples:
        >>> from skcomplex.systems.biology.neuroscience import IzhikevichInteraction
        >>> IzhikevichInteraction('membrane', target='neuron').b
        0.2
    """

    law_classes = (RateLaw,)

    def __init__(self, label: str, *, target: Role, a: float = 0.02, b: float = 0.2, I: float = 10.0) -> None:
        super().__init__(label)
        self.target = target
        self.a = a
        self.b = b
        self.I = I

    def _prepare(self, context: SimpleNamespace) -> None:
        """Set the quadratic potential and the linear recovery.

        Args:
            context:
                The namespace of the neuron, the time `t`, and the parameters.
        """
        super()._prepare(context)
        s = context
        v, u = s.target.v, s.target.u
        self.laws_ = [RateLaw(v, 0.04 * v**2 + 5 * v + 140 - u + s.I), RateLaw(u, s.a * (s.b * v - u))]

class SpikeResetInteraction(Interaction):
    """Spike of a neuron that resets its potential when it crosses a threshold upwards.

    When the potential `v` rises through `threshold`, it is set to `after`, and the state `kicked`, such as a recovery
    variable or a synaptic trace, grows by `kick`. Every spike is an event labelled by the interaction.

    Args:
        label:
            The label of the interaction and of its events.

        target:
            The path of the neuron.

        state:
            The name of the potential.

        threshold:
            The potential of a spike.

        after:
            The potential after a spike.

        kicked:
            The name of the state a spike increments, or `None` for none.

        kick:
            The increment of the kicked state at a spike.

    Raises:
        ValidationError:
            The direction is not -1, 0, or 1, or the guard or a new value is not a function.

    Examples:
        >>> from skcomplex.core.components.elements import Element
        >>> from skcomplex.core.systems import System
        >>> from skcomplex.systems.biology.common.pharmacokinetics import DosingInteraction
        >>> from skcomplex.systems.biology.neuroscience import SpikeResetInteraction
        >>> drive = DosingInteraction('drive', target='neuron', state='x', dose=1.0)
        >>> spike = SpikeResetInteraction('spike', target='neuron', state='x', threshold=1.0, after=0.0)
        >>> system = System(elements=[Element('neuron', values={'x': 0.0})], interactions=[drive, spike])
        >>> trajectory = system.prepare().simulate(until=2.1, dt=0.25)
        >>> [round(event.time, 6) for event in trajectory.events]
        [1.0, 2.0]
    """

    law_classes = (EventLaw,)

    def __init__(
        self,
        label: str,
        *,
        target: Role,
        state: str = 'v',
        threshold: float = 1.0,
        after: float = 0.0,
        kicked: str | None = None,
        kick: float = 0.0,
    ) -> None:
        super().__init__(label)
        self.target = target
        self.state = state
        self.threshold = threshold
        self.after = after
        self.kicked = kicked
        self.kick = kick

    def _prepare(self, context: SimpleNamespace) -> None:
        """Set the spike, an event when the potential rises through the threshold.

        Args:
            context:
                The namespace of the neuron, the threshold, the potential after a spike, and the kick.
        """
        super()._prepare(context)
        neuron = context.target
        potential = getattr(neuron, self.state)
        reset = {potential: context.after}
        if self.kicked is not None:
            kicked = getattr(neuron, self.kicked)
            reset[kicked] = kicked + context.kick
        self.laws_: list[BaseLaw] = [EventLaw(potential - context.threshold, reset, 1, label=self.label)]

Equations

The equations are those that symbolic returns for the system with its default parameters.

neuron.v: diff(v_neuron(t), t) == 0.04*v_neuron(t)^2 + I_membrane - u_neuron(t) + 5*v_neuron(t) + 140
neuron.u: diff(u_neuron(t), t) == (b_membrane*v_neuron(t) - u_neuron(t))*a_membrane