File: examples-misc_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-- 952 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; show
   pair: example usage; raster_plot
   pair: example usage; Connection
   pair: example usage; SpikeMonitor

.. _example-misc_delays:

Example: delays (misc)
======================

Random network with external noise and transmission delays

::

    from brian import *
    tau = 10 * ms
    sigma = 5 * mV
    eqs = 'dv/dt = -v/tau+sigma*xi/tau**.5 : volt'
    P = NeuronGroup(4000, model=eqs, threshold=10 * mV, reset=0 * mV, \
                  refractory=5 * ms)
    P.v = -60 * mV
    Pe = P.subgroup(3200)
    Pi = P.subgroup(800)
    C = Connection(P, P, 'v', delay=2 * ms)
    C.connect_random(Pe, P, 0.05, weight=.7 * mV)
    C.connect_random(Pi, P, 0.05, weight= -2.8 * mV)
    M = SpikeMonitor(P, True)
    run(1 * second)
    print 'Mean rate =', M.nspikes / 4000. / second
    raster_plot(M)
    show()