File: examples-electrophysiology_bridge.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 (62 lines) | stat: -rw-r--r-- 1,494 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
.. currentmodule:: brian

.. index::
   pair: example usage; plot
   pair: example usage; run
   pair: example usage; show
   pair: example usage; linspace
   pair: example usage; NeuronGroup
   pair: example usage; Equations
   pair: example usage; StateMonitor

.. _example-electrophysiology_bridge:

Example: bridge (electrophysiology)
===================================

Bridge experiment (current-clamp)

::

    from brian import *
    from brian.library.electrophysiology import *
    
    defaultclock.dt = .01 * ms
    
    #log_level_debug()
    
    taum = 20 * ms
    gl = 20 * nS
    Cm = taum * gl
    Re = 50 * Mohm
    Ce = 0.5 * ms / Re
    N = 10
    
    eqs = Equations('''
    dvm/dt=(-gl*vm+i_inj)/Cm : volt
    #Rbridge:ohm
    CC:farad
    I:amp
    ''')
    eqs += electrode(.6 * Re, Ce)
    #eqs+=current_clamp(vm='v_el',i_inj='i_cmd',i_cmd='I',Re=.4*Re,Ce=Ce,
    #                   bridge='Rbridge')
    eqs += current_clamp(vm='v_el', i_inj='i_cmd', i_cmd='I', Re=.4 * Re, Ce=Ce,
                       bridge=Re, capa_comp='CC')
    setup = NeuronGroup(N, model=eqs)
    setup.I = 0 * nA
    setup.v = 0 * mV
    #setup.Rbridge=linspace(0*Mohm,60*Mohm,N)
    setup.CC = linspace(0 * Ce, Ce, N)
    recording = StateMonitor(setup, 'v_rec', record=True)
    
    run(50 * ms)
    setup.I = .5 * nA
    run(200 * ms)
    setup.I = 0 * nA
    run(150 * ms)
    for i in range(N):
        plot(recording.times / ms + i * 400, recording[i] / mV, 'k')
    show()