-
Notifications
You must be signed in to change notification settings - Fork 2
/
leak.oc
62 lines (38 loc) · 1.02 KB
/
leak.oc
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
//-----------------------------------------------------------------------
//
// Defines additional functions to add leak or dc current
//
//-----------------------------------------------------------------------
//
// add_leak(ga,va) -> add leak current in all compartments
// NON ADDITIVE: restarts from the values of E_pas,G_pas
//
proc add_leak() {
forall{
g_pas = $1 + G_pas
e_pas = (G_pas * E_pas + $1 * $2) / (G_pas + $1)
}
}
//
// add_dc(i) -> add dc current (in nA) in current compartment
// redefines e_pas from current values of e_pas,g_pas
// ADDITIVE: starts from the current values of e_pas,g_pas
// the dc variable accumulates successive dc's
//
proc add_dc() { // local idc
dc = dc + $1
idc = 100 * $1 / area(0.5) // conversion to mA/cm2
e_pas = e_pas + idc/g_pas
}
//
// reset() -> resets the leak current to the values E_pas,G_pas
// resets dc to zero
//
proc reset() {
forall {
g_pas = G_pas
e_pas = E_pas
}
dc = 0
}
dc = 0 // dc variable initialized to zero