#!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 ANNarchy as ann
ann.clear()=0.1)
ann.setup(dt
= ann.Neuron(
neuron = "v0 = 1.05: population; tau = 10.0: population",
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.Population(10, neuron)
pop = np.linspace(0., 1., 10)
pop.v
= ann.Projection(pop, pop, 'gap', gap_junction)
proj 0.02)
proj.connect_all_to_all(
= ann.Monitor(pop[0] + pop[5], 'v')
trace
compile()
ann.
500.)
ann.simulate(
= trace.get('v')
data
import matplotlib.pyplot as plt
=(15, 10))
plt.figure(figsize0])
plt.plot(data[:, 1])
plt.plot(data[:, 'Time (ms)')
plt.xlabel('v')
plt.ylabel( plt.show()
ANNarchy 4.8 (4.8.2) on darwin (posix).
Compiling ... OK