File: examples-misc_HodgkinHuxley.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 (45 lines) | stat: -rw-r--r-- 1,045 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
.. currentmodule:: brian

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

.. _example-misc_HodgkinHuxley:

Example: HodgkinHuxley (misc)
=============================

Hodgkin-Huxley model
Assuming area 1*cm**2

::

    
    from brian import *
    from brian.library.ionic_currents import *
    
    #defaultclock.dt=.01*ms # more precise
    El = 10.6 * mV
    EK = -12 * mV
    ENa = 120 * mV
    eqs = MembraneEquation(1 * uF) + leak_current(.3 * msiemens, El)
    eqs += K_current_HH(36 * msiemens, EK) + Na_current_HH(120 * msiemens, ENa)
    eqs += Current('I:amp')
    
    neuron = NeuronGroup(1, eqs, implicit=True, freeze=True)
    
    trace = StateMonitor(neuron, 'vm', record=True)
    
    run(100 * ms)
    neuron.I = 10 * uA
    run(100 * ms)
    plot(trace.times / ms, trace[0] / mV)
    show()