File: examples-frompapers_Brette_Gerstner_2005.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 (68 lines) | stat: -rw-r--r-- 1,802 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
65
66
67
68
.. currentmodule:: brian

.. index::
   pair: example usage; NeuronGroup
   pair: example usage; run
   pair: example usage; trace
   pair: example usage; plot
   pair: example usage; show
   pair: example usage; SpikeMonitor
   pair: example usage; StateMonitor

.. _example-frompapers_Brette_Gerstner_2005:

Example: Brette_Gerstner_2005 (frompapers)
==========================================

Adaptive exponential integrate-and-fire model.
http://www.scholarpedia.org/article/Adaptive_exponential_integrate-and-fire_model

Introduced in Brette R. and Gerstner W. (2005), Adaptive Exponential
Integrate-and-Fire Model as an Effective Description of Neuronal Activity,
J. Neurophysiol. 94: 3637 - 3642. 

::

    from brian import *
    
    # Parameters
    C = 281 * pF
    gL = 30 * nS
    taum = C / gL
    EL = -70.6 * mV
    VT = -50.4 * mV
    DeltaT = 2 * mV
    Vcut = VT + 5 * DeltaT
    
    # Pick an electrophysiological behaviour
    tauw, a, b, Vr = 144 * ms, 4 * nS, 0.0805 * nA, -70.6 * mV # Regular spiking (as in the paper)
    #tauw,a,b,Vr=20*ms,4*nS,0.5*nA,VT+5*mV # Bursting
    #tauw,a,b,Vr=144*ms,2*C/(144*ms),0*nA,-70.6*mV # Fast spiking
    
    eqs = """
    dvm/dt=(gL*(EL-vm)+gL*DeltaT*exp((vm-VT)/DeltaT)+I-w)/C : volt
    dw/dt=(a*(vm-EL)-w)/tauw : amp
    I : amp
    """
    
    neuron = NeuronGroup(1, model=eqs, threshold=Vcut, reset="vm=Vr;w+=b", freeze=True)
    neuron.vm = EL
    trace = StateMonitor(neuron, 'vm', record=0)
    spikes = SpikeMonitor(neuron)
    
    run(20 * ms)
    neuron.I = 1 * nA
    run(100 * ms)
    neuron.I = 0 * nA
    run(20 * ms)
    
    # We draw nicer spikes
    vm = trace[0]
    for _, t in spikes.spikes:
        i = int(t / defaultclock.dt)
        vm[i] = 20 * mV
    
    plot(trace.times / ms, vm / mV)
    show()