File: examples-synapses_multiple_delays.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 (38 lines) | stat: -rw-r--r-- 744 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
.. currentmodule:: brian

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

.. _example-synapses_multiple_delays:

Example: multiple_delays (synapses)
===================================

Multiple delays

::

    from brian import *
    
    P=NeuronGroup(1,model='dv/dt=1/(20*ms):1',threshold=1,reset=0)
    Q=NeuronGroup(1,model='v:1')
    S=Synapses(P,Q,model='w:1',pre='v+=w')
    M=StateMonitor(Q,'v',record=True)
    
    S[0,0]=2
    S.w[0,0,0]=1.
    S.w[0,0,1]=.5
    S.delay[0,0,0]=.5*ms
    S.delay[0,0,1]=1*ms
    
    run(60*ms)
    
    plot(M.times/ms,M[0])
    show()