File: examples-synapses_nonlinear_synapses.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 (55 lines) | stat: -rw-r--r-- 1,246 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
50
51
52
53
54
55
.. currentmodule:: brian

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

.. _example-synapses_nonlinear_synapses:

Example: nonlinear_synapses (synapses)
======================================

NMDA synapses

::

    from brian import *
    import time
    
    a=1/(10*ms)
    b=1/(10*ms)
    c=1/(10*ms)
    
    input=NeuronGroup(2,model='dv/dt=1/(10*ms):1', threshold=1, reset=0)
    neurons = NeuronGroup(1, model="""dv/dt=(gtot-v)/(10*ms) : 1
                                      gtot : 1""")
    S=Synapses(input,neurons,
               model='''dg/dt=-a*g+b*x*(1-g) : 1
                        dx/dt=-c*x : 1
                        w : 1 # synaptic weight
                     ''',
               pre='x+=w') # NMDA synapses
    neurons.gtot=S.g
    S[:,:]=True
    S.w=[1.,10.]
    input.v=[0.,0.5]
    
    M=StateMonitor(S,'g',record=True)
    Mn=StateMonitor(neurons,'v',record=0)
    
    run(100*ms)
    
    subplot(211)
    plot(M.times/ms,M[0])
    plot(M.times/ms,M[1])
    subplot(212)
    plot(Mn.times/ms,Mn[0])
    
    show()