File: examples-misc_rate_model.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 (37 lines) | stat: -rw-r--r-- 722 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
.. currentmodule:: brian

.. index::
   pair: example usage; NeuronGroup
   pair: example usage; run
   pair: example usage; PopulationRateMonitor
   pair: example usage; plot
   pair: example usage; PoissonThreshold
   pair: example usage; show
   pair: example usage; rate

.. _example-misc_rate_model:

Example: rate_model (misc)
==========================

A rate model

::

    from brian import *
    
    N = 50000
    tau = 20 * ms
    I = 10 * Hz
    eqs = '''
    dv/dt=(I-v)/tau : Hz # note the unit here: this is the output rate
    '''
    group = NeuronGroup(N, eqs, threshold=PoissonThreshold())
    S = PopulationRateMonitor(group, bin=1 * ms)
    
    run(100 * ms)
    
    plot(S.rate)
    show()