-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcurrent-clamp-5.py
More file actions
36 lines (23 loc) · 851 Bytes
/
Copy pathcurrent-clamp-5.py
File metadata and controls
36 lines (23 loc) · 851 Bytes
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
"""
This tutorial shows how the sodium (in green) and potassium (in purple)
conductances changes during an action potential.
"""
from compartment import Compartment
from experiment import Experiment
from gating import NaT, KDR, gL
from ploting import plot_Vm
channels = { NaT: [0.6, 50], KDR: [0.18,-90], gL: [0.03,-60] }
soma = Compartment(40, None, channels)
dend = Compartment(1.5, 100, channels, parent=soma) # soma can not be a child.
for chnn in soma.channel_list:
print(chnn.Tag)
nav = soma.get_channel("NaT")
nav.set_recording(True)
kdr = soma.get_channel("KDR")
kdr.set_recording(True)
clamper = soma.add_iclamper("alpha", delay=2, tau=0.5, amplitude=0.9)
xp = Experiment(soma, dend)
xp.run(15)
#xp.plot_Vm() # xp stores the membrane potentials of all compartments
#nav.plot_conductance(xp.T)
plot_Vm([soma], g_grid=True)