Skip to content

Instantly share code, notes, and snippets.

@dlion
Created May 18, 2014 11:39
Show Gist options
  • Save dlion/f2e407d2900de7996e54 to your computer and use it in GitHub Desktop.
Save dlion/f2e407d2900de7996e54 to your computer and use it in GitHub Desktop.
Plasticità sinaptica
create rete[3]
rete[0] {pt3dclear()
pt3dadd(-12.5, 0, 0, 5)
pt3dadd(-7.5, 0, 0, 5)
}
rete[1] {pt3dclear()
pt3dadd(-2.5, 0, 0, 5)
pt3dadd(2.5, 0, 0, 5)
}
rete[2] {pt3dclear()
pt3dadd(7.5, 0, 0, 5)
pt3dadd(12.5, 0, 0, 5)
}
load_file("nrngui.hoc")
load_file("rete.hoc")
celsius = 34
forall {
insert pas e_pas=-65 g_pas=1/30000 cm=1 Ra=150
insert kdr ek=-90
insert nax ena=50 gbar_nax=0.01
}
access rete[0]
objref stim, ns, syn[100], nc[100], apc
ns = new NetStim(.5)
ns.start = 10
ns.number = 100000000
ns.interval = 20
ns.noise = 1
for k=0, 2 rete[k] {
syn[k] = new Exp2Syn(.5)
syn[k].tau1 = 0.5
syn[k].tau2 = 5
syn[k].e = 0
}
apc = new APCount(.5)
apc.thresh = 0
tpre = 0
pre = 0
nc[0] = new NetCon(ns, syn[0], 0, 20, 0.01e-3)
proc advance() {
fadvance()
if(apc.n > pre) {
freq = 1000/(apc.time - tpre)
if(freq < 30 && freq > 5) {
nc.weight -= nc.weight * 0.01
}
if(freq > 30) {
nc.weight += nc.weight * 0.01
}
print t, nc.weight*1e5
tpre = apc.time
pre = apc.n
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment