File: examples-synapses_transient_sync.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 (54 lines) | stat: -rw-r--r-- 1,438 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
.. currentmodule:: brian

.. index::
   pair: example usage; subplot
   pair: example usage; plot
   pair: example usage; Synapses
   pair: example usage; run
   pair: example usage; PopulationRateMonitor
   pair: example usage; show
   pair: example usage; raster_plot
   pair: example usage; reshape
   pair: example usage; imshow
   pair: example usage; SpikeMonitor
   pair: example usage; title
   pair: example usage; NeuronGroup

.. _example-synapses_transient_sync:

Example: transient_sync (synapses)
==================================

Transient synchronisation in a population of noisy IF neurons
with distance-dependent synaptic weights (organised as a ring)

::

    from brian import *
    import time
    
    tau = 10 * ms
    N = 100
    v0 = 5 * mV
    sigma = 4 * mV
    group = NeuronGroup(N, model='dv/dt=(v0-v)/tau + sigma*xi/tau**.5 : volt', \
                      threshold=10 * mV, reset=0 * mV)
    C = Synapses(group,model='w:1',pre='v+=w')
    C[:,:]=True
    C.w='.4 * mV * cos(2. * pi * (i - j) * 1. / N)'
    S = SpikeMonitor(group)
    R = PopulationRateMonitor(group)
    group.v = rand(N) * 10 * mV
    
    run(5000 * ms,report='text')
    subplot(211)
    raster_plot(S)
    subplot(223)
    imshow(C.w[:].reshape((N,N)), interpolation='nearest')
    title('Synaptic connections')
    subplot(224)
    plot(R.times / ms, R.smooth_rate(2 * ms, filter='flat'))
    title('Firing rate')
    show()