File: examples-misc_poissongroup.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 (43 lines) | stat: -rw-r--r-- 1,007 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
.. currentmodule:: brian

.. index::
   pair: example usage; subplot
   pair: example usage; plot
   pair: example usage; run
   pair: example usage; show
   pair: example usage; Connection
   pair: example usage; PoissonGroup
   pair: example usage; SpikeMonitor
   pair: example usage; NeuronGroup
   pair: example usage; StateMonitor

.. _example-misc_poissongroup:

Example: poissongroup (misc)
============================

Poisson input to an IF model

::

    from brian import *
    
    PG = PoissonGroup(1, lambda t:200 * Hz * (1 + cos(2 * pi * t * 50 * Hz)))
    IF = NeuronGroup(1, model='dv/dt=-v/(10*ms) : volt', reset=0 * volt, threshold=10 * mV)
    
    C = Connection(PG, IF, 'v', weight=3 * mV)
    
    MS = SpikeMonitor(PG, True)
    Mv = StateMonitor(IF, 'v', record=True)
    rates = StateMonitor(PG, 'rate', record=True)
    
    run(100 * ms)
    
    subplot(211)
    plot(rates.times / ms, rates[0] / Hz)
    subplot(212)
    plot(Mv.times / ms, Mv[0] / mV)
    
    show()