File: examples-electrophysiology_SEVC.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 (50 lines) | stat: -rw-r--r-- 1,325 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
.. currentmodule:: brian

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

.. _example-electrophysiology_SEVC:

Example: SEVC (electrophysiology)
=================================

Voltage-clamp experiment (SEVC)

::

    from brian import *
    from brian.library.electrophysiology import *
    
    defaultclock.dt = .01 * ms
    
    taum = 20 * ms        # membrane time constant
    gl = 1. / (50 * Mohm)   # leak conductance
    Cm = taum * gl        # membrane capacitance
    Re = 50 * Mohm        # electrode resistance
    Ce = 0.1 * ms / Re      # electrode capacitance
    
    eqs = Equations('''
    dvm/dt=(-gl*vm+i_inj)/Cm : volt
    I:amp
    ''')
    eqs += current_clamp(i_cmd='I', Re=Re, Ce=Ce)
    setup = NeuronGroup(1, model=eqs)
    ampli = SEVC(setup, 'v_rec', 'I', 1 * kHz, gain=250 * nS, gain2=50 * nS / ms)
    recording = StateMonitor(ampli, 'record', record=True)
    soma = StateMonitor(setup, 'vm', record=True)
    
    ampli.command = 20 * mV
    run(200 * ms)
    figure()
    plot(recording.times / ms, recording[0] / nA, 'k')
    figure()
    plot(soma.times / ms, soma[0] / mV, 'b')
    show()