I need to generate random spikes on these two neurons. How should I do?

Code: Select all

```
load_file("nrngui.hoc")
begintemplate SThcell
public soma, nclist
public x, y, z
public sinapse
public conta
create soma
objectvar nclist
objectvar sinapse
objectvar conta
proc init() {
x=$1
y=$2
z=$3
create soma
nclist=new List()
soma {
pt3dclear()
pt3dadd(x,y,z,50)
pt3dadd(x+50,y,z,50)
nseg = 1
diam = 18.8
L = 18.8
Ra = 123.0
insert hh
sinapse=new ExpSynSTDP_triplet(0)
sinapse.e=0
sinapse.tau=10
sinapse.factor=1//potentiation depotentiation factor
sinapse.gw=1e-5 //uS max conductance
}
}
endtemplate SThcell
//Usa-se os templates
objref neuron[2]
neuron[0]=new SThcell(0,0,0)
neuron[1]=new SThcell(100,0,0)
CONNECTION_PROB=1
CONNECTION_THRESHOLD=0
CONNECTION_DELAY=0
CONNECTION_WEIGHT=1e-5 // max conductance uS
access neuron[0].soma
neuron[0].soma neuron[1].nclist.append(new NetCon(&neuron[0].soma.v(0.5),neuron[1].sinapse,CONNECTION_THRESHOLD,CONNECTION_DELAY,CONNECTION_WEIGHT))
objectvar stim[8]
neuron[0].soma {
stim[0] = new IClamp(0.5)
stim[0].del = 100
stim[0].dur = 1
stim[0].amp = 0.1
stim[1] = new IClamp(0.5)
stim[1].del = 300
stim[1].dur = 1
stim[1].amp = 0.0
stim[2] = new IClamp(0.5)
stim[2].del = 500
stim[2].dur = 1
stim[2].amp = 0.0
stim[3] = new IClamp(0.5)
stim[3].del = 4000 //700
stim[3].dur = 1
stim[3].amp = 0.0
}
neuron[1].soma {
stim[4] = new IClamp(0.5)
stim[4].del = 110
stim[4].dur = 1
stim[4].amp = 0.1
stim[5] = new IClamp(0.5)
stim[5].del = 300
stim[5].dur = 1
stim[5].amp = 0.0
stim[6] = new IClamp(0.5)
stim[6].del = 500
stim[6].dur = 1
stim[6].amp = 0.0
stim[7] = new IClamp(0.5)
stim[7].del = 700
stim[7].dur = 1
stim[7].amp = 0.0
}
tstop = 1000
objref grafico[7]
grafico[0]=new Graph()
grafico[0].size(0,tstop ,-100,50)
grafico[0].beginline()
grafico[0].addvar("Pre",&neuron[0].soma.v(0.5),1,1)
grafico[0].addvar("Pos",&neuron[1].soma.v(0.5),2,1)
grafico[0].flush()
grafico[2]=new Graph()
grafico[2].size(0,tstop ,0,10)
grafico[2].beginline()
grafico[2].addvar("Gsyn",&neuron[1].sinapse.g,3,1)
grafico[2].flush()
grafico[4]=new Graph()
grafico[4].size(0,tstop ,-30,20)
grafico[4].beginline()
grafico[4].addvar("peso",&neuron[1].sinapse.peso,3,1)
grafico[4].flush()
grafico[5]=new Graph()
grafico[5].size(0,tstop ,-30,20)
grafico[5].beginline()
grafico[5].addvar("O1",&neuron[1].sinapse.O1,1,1)
grafico[5].addvar("O2",&neuron[1].sinapse.O2,2,1)
grafico[5].addvar("R1",&neuron[1].sinapse.R1,3,1)
grafico[5].addvar("R2",&neuron[1].sinapse.R2,4,1)
grafico[5].flush()
graphList[0].append(grafico[0])
graphList[0].append(grafico[1])
graphList[0].append(grafico[2])
graphList[0].append(grafico[3])
graphList[0].append(grafico[4])
graphList[0].append(grafico[5])
graphList[0].append(grafico[6])
run()
```

Maybe this netstim, but it is not working.

P.S .: Ted, I did what you suggested in another post, but I did not get what I need.

Code: Select all

```
ns = new NetStim(0.5)
ns.start = 1
ns.interval = 25
ns.noise = 0
ns.number = 2
```