Skip to content

Networks of leaky integrate-and-fire neurons with delays

A random network of leaky integrate-and-fire neurons with delayed spikes.

  • Class: DelayedLIFNetworkSystem
  • Import: from skcomplex.systems.biology.neuroscience import DelayedLIFNetworkSystem
  • Field: biology/neuroscience
  • Topics: neuron, spiking, network, delay, events
  • References:
    • Brunel and Hakim 1999
    • arXiv:2112.12147

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 DelayedLIFNetworkSystem

trajectory = DelayedLIFNetworkSystem().prepare().simulate()

Parameters

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

Parameter Default
n_neurons 10
probability 0.3
J 0.5
D 1.5
mu 25.0
random_state 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 unknown
Domains real
Structure fixed

Class

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

class DelayedLIFNetworkSystem(BaseSystem):
    """A random network of leaky integrate-and-fire neurons with delayed spikes.

    The spikes reach their targets after a delay.

    Every neuron is driven above threshold and fires on its own with period `tau ln((mu - reset) / (mu - threshold))`.
    Each directed link exists with a probability and moves the target's potential by `J` per spike, after the delay `D`.
    Excitation speeds the firing up and inhibition slows it down. The system has the potentials `neuron_<i>.v`, the
    traces `neuron_<i>.s`, and the spikes of neuron `i` as `spike_<i>` events.

    Args:
        n_neurons:
            The number of neurons.

        probability:
            The probability of each directed link.

        J:
            The efficacy of every link in mV.

        D:
            The transmission delay in ms.

        mu:
            The constant drive in mV.

        random_state:
            The seed or generator of the links and the initial potentials.

        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 DelayedLIFNetworkSystem
        >>> len(DelayedLIFNetworkSystem(5).prepare().system_.elements)
        5
    """

    field = 'biology/neuroscience'
    topics = ('neuron', 'spiking', 'network', 'delay', 'events')
    references = ('Brunel and Hakim 1999', 'arXiv:2112.12147')
    until = 100.0
    dt = 0.5

    def __init__(
        self,
        n_neurons: int = 10,
        *,
        probability: float = 0.3,
        J: float = 0.5,
        D: float = 1.5,
        mu: float = 25.0,
        random_state: int | np.random.Generator | None = 0,
        label: str = 'system',
        solver: BaseSolver | str = 'auto',
        backend: BaseBackend | str = 'auto',
    ) -> None:
        super().__init__(label, solver=solver, backend=backend)
        self.n_neurons = n_neurons
        self.probability = probability
        self.J = J
        self.D = D
        self.mu = mu
        self.random_state = random_state

    @staticmethod
    def _get_random_connections(n_neurons: int, probability: float, rng: np.random.Generator) -> list[tuple[int, int]]:
        """Return the directed links of a random network without self-links."""
        return list(nx.gnp_random_graph(n_neurons, probability, seed=rng, directed=True).edges)

    def _prepare(self, context: Sequence[Observable] | None = None) -> None:
        """Set the system of a random network of leaky integrate-and-fire neurons.

        Args:
            context:
                The observables to compile with the problem, or `None` for none.
        """
        super()._prepare(context)
        rng = np.random.default_rng(self.random_state)
        potentials = rng.uniform(10.0, 20.0, self.n_neurons)
        neurons = [
            SpikingNeuronElement(f'neuron_{index}', v=float(potentials[index]), mu=self.mu, tau_s=TRACE_TIME)
            for index in range(self.n_neurons)
        ]
        leaks = [
            LeakyIntegrationInteraction(
                f'leak_{index}',
                target=neuron.label,
                state='v',
                goal=lambda s: s.target.mu,
                time=lambda s: s.target.tau,
            )
            for index, neuron in enumerate(neurons)
        ]
        traces = [
            Interaction(
                f'trace_decay_{index}',
                roles={'target': neuron.label},
                laws=lambda s: [RateLaw(s.target.s, -s.target.s / s.target.tau_s)],
            )
            for index, neuron in enumerate(neurons)
        ]
        spikes = [
            SpikeResetInteraction(
                f'spike_{index}',
                target=neuron.label,
                threshold=THRESHOLD,
                after=RESET,
                kicked='s',
                kick=1 / TRACE_TIME,
            )
            for index, neuron in enumerate(neurons)
        ]
        synapses = [
            DelayedSynapseInteraction(
                f'synapse_{source}_{target}',
                source=f'neuron_{source}',
                target=f'neuron_{target}',
                J=self.J,
                D=self.D,
            )
            for source, target in self._get_random_connections(self.n_neurons, self.probability, rng)
        ]
        self.system_ = System(self.label, elements=neurons, interactions=[*leaks, *traces, *spikes, *synapses])

Components

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

Elements:

  • SpikingNeuronElement, from Element

Interactions:

  • LeakyIntegrationInteraction, from Interaction
  • Interaction
  • SpikeResetInteraction, from Interaction
  • DelayedSynapseInteraction, from Interaction
class SpikingNeuronElement(Element):
    """Leaky integrate-and-fire neuron with a synaptic trace of its own spikes.

    The trace is exponential.

    The potential follows `tau v' = -v + mu` plus synaptic input, and the trace decays as `s' = -s / tau_s`. A spike
    reset sets the potential back and raises the trace by `1 / tau_s`, so every spike carries a unit area of trace.
    Units are mV and ms. The element holds the states and parameters and has no laws of its own: the leak and trace
    interactions of `DelayedLIFNetworkSystem` read its parameters.

    Args:
        label:
            The label of the neuron.

        v:
            The initial potential.

        s:
            The initial synaptic trace.

        tau:
            The membrane time constant.

        mu:
            The constant external drive, the potential the membrane relaxes to.

        tau_s:
            The decay time of the synaptic trace.

    Examples:
        >>> from skcomplex.systems.biology.neuroscience import SpikingNeuronElement
        >>> SpikingNeuronElement('neuron').tau_s
        2.0
    """

    def __init__(
        self,
        label: str,
        *,
        v: float = 0.0,
        s: Annotated[float, RealSet.closed_open(0, oo)] = 0.0,
        tau: Annotated[float, RealSet.open(0, oo)] = 20.0,
        mu: float = 25.0,
        tau_s: Annotated[float, RealSet.open(0, oo)] = 2.0,
    ) -> None:
        super().__init__(label)
        self.v = v
        self.s = s
        self.tau = tau
        self.mu = mu
        self.tau_s = tau_s

class LeakyIntegrationInteraction(Interaction):
    """Leaky integration of a potential or an activity towards its input over a time constant.

    Neuroscience names it the leak of a membrane or of a population, as in the Wilson-Cowan and leaky integrate-and-fire
    models. The rate is `(goal(ns) - x) / time(ns)` of a state `x` of a target, with optional noise. With a constant
    goal and time and an additive noise of amplitude `sigma`, the state follows the Ornstein-Uhlenbeck process `dx =
    (goal - x) / time dt + sigma dW`, whose stationary variance is `sigma**2 time / 2`. A goal or a time function takes
    the namespace of the interaction, which reads the target as `ns.target` and the time as `ns.t`, and a number stands
    for a constant. A goal that is a number applies to every component of a vector state.

    Args:
        label:
            The label of the interaction, unique among the components of its system.

        target:
            The path of the element or group whose state relaxes.

        state:
            The name of the state of the target that relaxes.

        goal:
            A function of the namespace that returns the goal, or a number.

        time:
            A function of the namespace that returns the relaxation time, or a positive number.

        noise:
            A function of the namespace that returns the amplitude of the noise, a number, or `None` for no noise.

    Raises:
        ValidationError:
            The state is not a name, or a function is neither callable nor a number.

    Examples:
        >>> from skcomplex.core.components.elements import Element
        >>> from skcomplex.core.systems import System
        >>> from skcomplex.systems.biology.neuroscience import LeakyIntegrationInteraction
        >>> relaxation = LeakyIntegrationInteraction('relaxation', target='stock', goal=10.0, time=0.5)
        >>> system = System(elements=[Element('stock', values={'x': 0.0})], interactions=[relaxation]).prepare()
        >>> round(float(system.simulate(5.0, dt=0.01).get_values('stock.x')[-1]), 3)
        10.0
    """

    law_classes = (RateLaw, NoiseLaw)

    def __init__(
        self,
        label: str,
        *,
        target: Role,
        state: str = 'x',
        goal: Callable[[SimpleNamespace], object] | float = 0.0,
        time: Callable[[SimpleNamespace], object] | float = 1.0,
        noise: Callable[[SimpleNamespace], object] | float | None = None,
    ) -> None:
        super().__init__(label)
        self.target = target
        self.state = state
        self.goal = goal
        self.time = time
        self.noise = noise

    def _get_tags(self) -> Tags:
        """Return the tags of the rate, and of the noise when there is one."""
        return self._get_variant_tags((RateLaw,) if self.noise is None else (RateLaw, NoiseLaw))

    def _check_arguments(self) -> None:
        """Raise an error for an argument the interaction cannot take.

        Raises:
            ValidationError:
                The state is not a name, or a function is neither callable nor a number.
        """
        super()._check_arguments()
        if not isinstance(self.state, str) or not self.state.isidentifier():
            error_msg = f'The state of {self.label!r} is {self.state!r}. Give the name of a state.'
            raise ValidationError(error_msg)
        for name in ('goal', 'time', 'noise'):
            value = getattr(self, name)
            if not (callable(value) or isinstance(value, int | float) or (name == 'noise' and value is None)):
                error_msg = f'The {name} of {self.label!r} is {value!r}. Give a function of the namespace or a number.'
                raise ValidationError(error_msg)

    def _prepare(self, context: SimpleNamespace) -> None:
        """Set the relaxation `(goal - x) / time` of the state, and its noise.

        Args:
            context:
                The namespace of the target.
        """
        super()._prepare(context)
        state = getattr(context.target, self.state)
        goal = self._broadcast(self._evaluate('goal', context), state)
        laws: list[BaseLaw] = [RateLaw(state, (goal - state) / self._evaluate('time', context))]
        if self.noise is not None:
            laws.append(NoiseLaw(state, self._evaluate('noise', context)))
        self.laws_ = laws

    def _evaluate(self, name: str, context: SimpleNamespace) -> object:
        """Return the value of a function of the namespace, or the symbol of a number."""
        value = getattr(self, name)
        return value(context) if callable(value) else getattr(context, name)

    @staticmethod
    def _broadcast(value: object, state: object) -> object:
        """Return a value with one component per component of a vector state, repeating a number."""
        if isinstance(state, FreeModuleElement) and not isinstance(value, FreeModuleElement | list | tuple):
            return vector(SR, [value] * len(state))
        return value

class Interaction(BaseInteraction):
    """An interaction whose laws run once for the elements its roles bind.

    It states the laws that change the values of the elements its roles bind, such as gravity on a ball in
    `Interaction('gravity', roles={'target': 'ball'}, laws=lambda s: [RateLaw(s.target.x.diff(s.t, 2), -9.81)])`. When a
    role binds a group, the laws run once for every member, as arrays. With `among` and `along`, they run once for every
    edge of a network and read `s.source` and `s.target`, the members at its two ends, or once for every hyperedge or
    random small group and read `s.member`, `s.others`, and `s.members`. With `within`, they run once for every pair of
    members closer than a radius and read `s.first` and `s.second`. A subclass takes its roles, typed `Role`, and its
    parameters as arguments of its `__init__` and sets `laws_` in its `_prepare`. It states predation between two
    populations, a reaction between two chemicals, and an infection along the contacts of a network.

    Read more in the user guide, under Interactions.

    Args:
        label:
            The name of the interaction, unique among the components of its system, such as `'predation'`.

        roles:
            The element each role binds, by the name of the role, such as `{'target': 'ball'}`, for a rule written
            without a class, or `None`.

        laws:
            The function of the namespace that returns the laws of a rule written without a class, such as
            `lambda s: [RateLaw(s.target.n.diff(s.t), s.target.n)]`, the laws themselves when they read no element, or
            `None`.

        among:
            The group whose members sit at the ends of the edges, such as `'people'`, or `None` to bind elements by
            their roles only. A subclass annotates it as a role, and a rule written without a class binds it as one.

        along:
            `True` for the edges of the network the group lives on, the name of a layer of a network with several, such
            as `'contacts'`, `'hyperedges'` for its hyperedges, `('hyperedges', k)` for its hyperedges of `k` members,
            `RandomPartition(k)` for random groups of `k` members drawn at every step, `'neighborhoods'` for every
            member with the members around it, or `None` for no edges. On the edges, the laws read the member of an
            element that sits on them as `s.edge`, and on the hyperedges as `s.hyperedge`.

        within:
            A `RadiusNeighborhood(r)` for laws that run once for every pair of members of the roles `first` and `second`
            closer than `r`, which read `s.first` and `s.second` and give the laws of both, such as the repulsion of
            walkers of two crowds, or `None` for no pairs. With `among`, both members come from that group. The laws may
            give the energy of the pair as `ObjectiveLaw(V)` in place of its forces, and each member then feels the
            force `-dV/dx` on its position `x`.

    See Also:
        BaseInteraction: The base of every interaction.
        RandomPartition: Groups the members of a group at random at every step.
        TrainingInteraction: Trains the parameters of a nested system.

    Examples:
        >>> from skcomplex.core.components.interactions import Interaction
        >>> from skcomplex.core.components.laws import RateLaw
        >>> birth = Interaction('birth', roles={'target': 'fish'}, laws=lambda s: [RateLaw(s.target.n.diff(s.t), 1)])
        >>> birth.roles
        {'target': 'fish'}
    """

    def __init__(
        self,
        label: str,
        *,
        roles: Mapping[str, object] | None = None,
        laws: Callable[[SimpleNamespace], Sequence[BaseLaw]] | Sequence[BaseLaw] | None = None,
        among: str | None = None,
        along: bool | str | tuple[str, int] | RandomPartition | None = None,
        within: RadiusNeighborhood | None = None,
    ) -> None:
        super().__init__(label)
        self.roles = roles
        self.laws = laws
        self.among = among
        self.along = along
        self.within = within

    def _get_declared(self) -> Mapping[str, _DeclaredVariableSpec]:
        """Return the numeric arguments as parameters, and `roles` and `among` as roles.

        With `within`, `among` binds both members of a pair, `first` and `second`.
        """
        declared = dict(super()._get_declared())
        for name, binding in (self.roles or {}).items():
            declared[name] = _DeclaredVariableSpec(binding, RoleSpec())
        if self.among is not None and self.within is not None:
            for name in PAIR_ROLES:
                declared.setdefault(name, _DeclaredVariableSpec(self.among, RoleSpec()))
        elif self.among is not None and 'among' not in declared and 'among' not in self._get_specs():
            declared['among'] = _DeclaredVariableSpec(self.among, RoleSpec())
        return declared

    @classmethod
    def _get_state_arguments(cls, role: RoleSpec) -> tuple[str, ...]:
        """Return the arguments that name the states a role reads.

        The mapping `roles` of bindings names none.
        """
        return tuple(name for name in super()._get_state_arguments(role) if name != 'roles')

    def _get_binding(self, role: str) -> object:
        """Return what a role binds, from `roles` or from the argument of its name.

        Args:
            role:
                The name of the role.

        Returns:
            binding:
                The label, labels, or entries the role binds, or `None` when it binds nothing.
        """
        if self.roles is not None and role in self.roles:
            return self.roles[role]
        if self.among is not None and self.within is not None and role in PAIR_ROLES:
            return self.among
        return super()._get_binding(role)

    def _check_arguments(self) -> None:
        """Raise an error for roles, laws, or groups the interaction cannot take.

        Raises:
            ValidationError:
                A role of `roles` takes the name of an argument, `laws` is neither a function nor a list of laws, or
                `along` names hyperedges of fewer than two members.
        """
        clashes = sorted(set(self.roles or {}) & {'label', 'roles', 'laws', 'among', 'along'})
        if clashes:
            error_msg = f'The role {clashes[0]!r} of {self.label!r} takes the name of an argument. Rename the role.'
            raise ValidationError(error_msg)
        if self.laws is not None and not callable(self.laws) and not isinstance(self.laws, list | tuple):
            error_msg = (
                f'The laws of {self.label!r} are {self.laws!r}. Give a function that takes the bound elements as '
                '`s` and returns the laws, such as `laws=lambda s: [RateLaw(s.target.n.diff(s.t), s.target.n)]`.'
            )
            raise ValidationError(error_msg)
        if isinstance(self.along, tuple) and not self._is_sized(self.along):
            error_msg = (
                f'{self.label!r} runs along {self.along!r}. Give the hyperedges of one size as a whole number of 2 or '
                "more, such as `along=('hyperedges', 3)`."
            )
            raise ValidationError(error_msg)
        if isinstance(self.along, RandomPartition):
            self.along._check()
        grouped = isinstance(self.along, RandomPartition) or self.along == NEIGHBORHOODS
        if grouped and self.among is None:
            error_msg = f'{self.label!r} runs along groups of members. Name their group with `among`.'
            raise ValidationError(error_msg)
        super()._check_arguments()

    def _prepare(self, context: SimpleNamespace) -> None:
        """Set the laws of `laws` for a binding.

        Args:
            context:
                The namespace of the elements a binding of the roles names.
        """
        super()._prepare(context)
        if self.laws is not None:
            self.laws_ = list(self.laws(context) if callable(self.laws) else self.laws)

    @staticmethod
    def _is_sized(along: tuple[object, ...]) -> bool:
        """Return whether `along` names hyperedges of a whole size of at least two."""
        if len(along) != MIN_SIZE or along[0] != HYPEREDGES:
            return False
        size = along[1]
        return isinstance(size, int) and not isinstance(size, bool) and size >= MIN_SIZE

    def _get_draws(self) -> bool:
        """Return whether the interaction draws, as it does along random groups."""
        return super()._get_draws() or isinstance(self.along, RandomPartition)

    def _runs_on_edges(self) -> bool:
        """Return whether the interaction runs along edges."""
        grouped = self._runs_on_hyperedges() or self._get_grouping() is not None
        return self.along is not None and self.along is not False and not grouped

    def _runs_on_hyperedges(self) -> bool:
        """Return whether the interaction runs along the hyperedges of a network."""
        return self.along == HYPEREDGES or (isinstance(self.along, tuple) and self.along[0] == HYPEREDGES)

    def _get_hyperedge_size(self) -> int | None:
        """Return the size `along` gives the hyperedges, or `None` for every size."""
        return int(self.along[-1]) if isinstance(self.along, tuple) and self._runs_on_hyperedges() else None

    def _get_within(self) -> RadiusNeighborhood | None:
        """Return the neighbourhood of the pairs the laws run for, or `None` for no pairs."""
        return self.within

    def _get_layer(self) -> str | None:
        """Return the layer `along` names, or `None` for no layer."""
        if not isinstance(self.along, str) or self.along == NEIGHBORHOODS or self._runs_on_hyperedges():
            return None
        return self.along

    def _get_grouping(self) -> tuple[str, int, str] | None:
        """Return the kind, size, and reduction of the groups `along` names, or `None`."""
        if isinstance(self.along, RandomPartition):
            return ('partition', self.along.size, 'sum')
        if self.along == NEIGHBORHOODS:
            return ('neighborhood', 0, 'sum')
        return None

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)]

class DelayedSynapseInteraction(Interaction):
    """Synapse that adds the delayed presynaptic trace to the postsynaptic potential.

    The trace is the one from a transmission delay ago.

    The target gains `J s_source(t - D)`, so every presynaptic spike moves the postsynaptic potential by `J` in
    total, spread over the decay time of the trace and arriving after the delay `D`.

    Args:
        label:
            The label of the interaction.

        source:
            The path of the presynaptic neuron.

        target:
            The path of the postsynaptic neuron.

        J:
            The efficacy in mV, positive for excitation and negative for inhibition.

        D:
            The transmission delay in ms.

    Examples:
        >>> from skcomplex.systems.biology.neuroscience import DelayedSynapseInteraction
        >>> DelayedSynapseInteraction('synapse', source='a', target='b', J=-1.0).D
        1.5
    """

    law_classes = (RateLaw,)

    def __init__(
        self,
        label: str,
        *,
        source: Role,
        target: Role,
        J: float = 0.5,
        D: Annotated[float, RealSet.open(0, oo)] = 1.5,
    ) -> None:
        super().__init__(label)
        self.source = source
        self.target = target
        self.J = J
        self.D = D

    def _prepare(self, context: SimpleNamespace) -> None:
        """Set the delayed synaptic input `J s_source(t - D)` of the postsynaptic potential.

        Args:
            context:
                The namespace of the source and the target.
        """
        super()._prepare(context)
        delayed = context.source.s(t=context.t - context.D)
        self.laws_: list[BaseLaw] = [RateLaw(context.target.v, context.J * delayed)]

Equations

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

neuron_0.v: diff(v_neuron_0(t), t) == J_synapse_4_0*s_neuron_4(-D_synapse_4_0 + t) + J_synapse_5_0*s_neuron_5(-D_synapse_5_0 + t) + J_synapse_6_0*s_neuron_6(-D_synapse_6_0 + t) + (mu_neuron_0 - v_neuron_0(t))/tau_neuron_0
neuron_0.s: diff(s_neuron_0(t), t) == -s_neuron_0(t)/tau_s_neuron_0
neuron_1.v: diff(v_neuron_1(t), t) == J_synapse_9_1*s_neuron_9(-D_synapse_9_1 + t) + (mu_neuron_1 - v_neuron_1(t))/tau_neuron_1
neuron_1.s: diff(s_neuron_1(t), t) == -s_neuron_1(t)/tau_s_neuron_1
neuron_2.v: diff(v_neuron_2(t), t) == J_synapse_0_2*s_neuron_0(-D_synapse_0_2 + t) + J_synapse_1_2*s_neuron_1(-D_synapse_1_2 + t) + J_synapse_4_2*s_neuron_4(-D_synapse_4_2 + t) + J_synapse_6_2*s_neuron_6(-D_synapse_6_2 + t) + (mu_neuron_2 - v_neuron_2(t))/tau_neuron_2
neuron_2.s: diff(s_neuron_2(t), t) == -s_neuron_2(t)/tau_s_neuron_2
neuron_3.v: diff(v_neuron_3(t), t) == J_synapse_1_3*s_neuron_1(-D_synapse_1_3 + t) + J_synapse_5_3*s_neuron_5(-D_synapse_5_3 + t) + (mu_neuron_3 - v_neuron_3(t))/tau_neuron_3
neuron_3.s: diff(s_neuron_3(t), t) == -s_neuron_3(t)/tau_s_neuron_3
neuron_4.v: diff(v_neuron_4(t), t) == J_synapse_0_4*s_neuron_0(-D_synapse_0_4 + t) + J_synapse_5_4*s_neuron_5(-D_synapse_5_4 + t) + (mu_neuron_4 - v_neuron_4(t))/tau_neuron_4
neuron_4.s: diff(s_neuron_4(t), t) == -s_neuron_4(t)/tau_s_neuron_4
neuron_5.v: diff(v_neuron_5(t), t) == J_synapse_2_5*s_neuron_2(-D_synapse_2_5 + t) + J_synapse_6_5*s_neuron_6(-D_synapse_6_5 + t) + J_synapse_9_5*s_neuron_9(-D_synapse_9_5 + t) + (mu_neuron_5 - v_neuron_5(t))/tau_neuron_5
neuron_5.s: diff(s_neuron_5(t), t) == -s_neuron_5(t)/tau_s_neuron_5
neuron_6.v: diff(v_neuron_6(t), t) == J_synapse_0_6*s_neuron_0(-D_synapse_0_6 + t) + J_synapse_4_6*s_neuron_4(-D_synapse_4_6 + t) + J_synapse_8_6*s_neuron_8(-D_synapse_8_6 + t) + (mu_neuron_6 - v_neuron_6(t))/tau_neuron_6
neuron_6.s: diff(s_neuron_6(t), t) == -s_neuron_6(t)/tau_s_neuron_6
neuron_7.v: diff(v_neuron_7(t), t) == J_synapse_5_7*s_neuron_5(-D_synapse_5_7 + t) + (mu_neuron_7 - v_neuron_7(t))/tau_neuron_7
neuron_7.s: diff(s_neuron_7(t), t) == -s_neuron_7(t)/tau_s_neuron_7
neuron_8.v: diff(v_neuron_8(t), t) == J_synapse_4_8*s_neuron_4(-D_synapse_4_8 + t) + J_synapse_5_8*s_neuron_5(-D_synapse_5_8 + t) + (mu_neuron_8 - v_neuron_8(t))/tau_neuron_8
neuron_8.s: diff(s_neuron_8(t), t) == -s_neuron_8(t)/tau_s_neuron_8
neuron_9.v: diff(v_neuron_9(t), t) == J_synapse_0_9*s_neuron_0(-D_synapse_0_9 + t) + (mu_neuron_9 - v_neuron_9(t))/tau_neuron_9
neuron_9.s: diff(s_neuron_9(t), t) == -s_neuron_9(t)/tau_s_neuron_9