#!pip install ANNarchy
Gap Junctions
A simple network with gap junctions.
This is a reimplementation of the Brian example:
http://brian2.readthedocs.org/en/2.0b3/examples/synapses.gapjunctions.html
import numpy as np
import matplotlib.pyplot as plt
import ANNarchy as ann
= ann.Neuron(
neuron = dict(v0 = 1.05, tau = 10.0),
parameters = "tau * dv/dt = v0 - v + g_gap",
equations = "v > 1.",
spike = "v = 0."
reset
)
= ann.Synapse(
gap_junction = "w * (pre.v - post.v)"
psp
)
= ann.Network(dt=0.1)
net = net.create(10, neuron)
pop = np.linspace(0., 1., 10)
pop.v
= net.connect(pop, pop, 'gap', gap_junction)
proj 0.02)
proj.all_to_all(
= net.monitor(pop[0] + pop[5], 'v')
trace
compile()
net.
500.)
net.simulate(
= trace.get('v')
data
=(10, 8))
plt.figure(figsize0])
plt.plot(data[:, 1])
plt.plot(data[:, 'Time (ms)')
plt.xlabel('v')
plt.ylabel( plt.show()
ANNarchy 5.0 (5.0.0) on darwin (posix).
Compiling network 1... OK