File: examples-synapses_gapjunctions.txt

package info (click to toggle)
brian 1.4.3-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, stretch
  • size: 23,436 kB
  • sloc: python: 68,707; cpp: 29,040; ansic: 5,182; sh: 111; makefile: 61
file content (49 lines) | stat: -rw-r--r-- 1,036 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
.. currentmodule:: brian

.. index::
   pair: example usage; plot
   pair: example usage; run
   pair: example usage; trace
   pair: example usage; show
   pair: example usage; Synapses
   pair: example usage; linspace
   pair: example usage; NeuronGroup
   pair: example usage; StateMonitor

.. _example-synapses_gapjunctions:

Example: gapjunctions (synapses)
================================

Neurons with gap junctions

::

    from brian import *
    
    N = 10
    v0=1.05
    tau=10*ms
    
    eqs = '''
    dv/dt=(v0-v+Igap)/tau : 1
    Igap : 1 # gap junction current
    '''
    
    neurons = NeuronGroup(N, model=eqs, threshold=1, reset=0)
    neurons.v=linspace(0,1,N)
    trace = StateMonitor(neurons, 'v', record=[0, 5])
    
    S=Synapses(neurons,model='''w:1 # gap junction conductance
                                Igap=w*(v_pre-v_post): 1''')
    S[:,:]=True
    neurons.Igap=S.Igap
    S.w=.02
    
    run(500*ms)
    
    plot(trace.times / ms, trace[0])
    plot(trace.times / ms, trace[5])
    show()