File: examples-plasticity_short_term_plasticity.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 (64 lines) | stat: -rw-r--r-- 1,527 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
55
56
57
58
59
60
61
62
63
64
.. currentmodule:: brian

.. index::
   pair: example usage; subplot
   pair: example usage; plot
   pair: example usage; run
   pair: example usage; trace
   pair: example usage; title
   pair: example usage; show
   pair: example usage; Connection
   pair: example usage; rate
   pair: example usage; STP
   pair: example usage; linspace
   pair: example usage; NeuronGroup
   pair: example usage; StateMonitor

.. _example-plasticity_short_term_plasticity:

Example: short_term_plasticity (plasticity)
===========================================

Example with short term plasticity model
Neurons with regular inputs and depressing synapses

::

    from brian import *
    
    tau_e = 3 * ms
    taum = 10 * ms
    A_SE = 250 * pA
    Rm = 100 * Mohm
    N = 10
    
    eqs = '''
    dx/dt=rate : 1
    rate : Hz
    '''
    
    input = NeuronGroup(N, model=eqs, threshold=1., reset=0)
    input.rate = linspace(5 * Hz, 30 * Hz, N)
    
    eqs_neuron = '''
    dv/dt=(Rm*i-v)/taum:volt
    di/dt=-i/tau_e:amp
    '''
    neuron = NeuronGroup(N, model=eqs_neuron)
    
    C = Connection(input, neuron, 'i')
    C.connect_one_to_one(weight=A_SE)
    stp = STP(C, taud=1 * ms, tauf=100 * ms, U=.1) # facilitation
    #stp=STP(C,taud=100*ms,tauf=10*ms,U=.6) # depression
    trace = StateMonitor(neuron, 'v', record=[0, N - 1])
    
    run(1000 * ms)
    subplot(211)
    plot(trace.times / ms, trace[0] / mV)
    title('Vm')
    subplot(212)
    plot(trace.times / ms, trace[N - 1] / mV)
    title('Vm')
    show()