File: examples-misc_after_potential.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 (35 lines) | stat: -rw-r--r-- 795 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
.. currentmodule:: brian

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

.. _example-misc_after_potential:

Example: after_potential (misc)
===============================

A model with depolarizing after-potential.

::

    from brian import *
    
    v0=20.5*mV
    eqs = '''
    dv/dt = (v0-v)/(30*ms) : volt # the membrane equation
    dAP/dt = -AP/(3*ms) : volt # the after-potential
    vm = v+AP : volt # total membrane potential
    '''
    IF = NeuronGroup(1, model=eqs, threshold='vm>20*mV',
                     reset='v=0*mV; AP=10*mV')
    Mv = StateMonitor(IF, 'vm', record=True)
    
    run(500 * ms)
    plot(Mv.times / ms, Mv[0] / mV)
    show()