# an obscure XPP file that will 
# compute CV vs inhibition
par ne=4000,ni=1000
par rate=.005,rati=.012
!re=ne*rate*det
!ri=ni*rati*det
se'=-se/taue+poisson(re)/det
si'=-si/taui+poisson(ri)/det
# det is the timestep dt
par det=.05,taue=4,taui=8
@ meth=euler,total=30000,trans=100000,nout=10
v'=(-v+ie*se-ii*si)/taum
# this code is to compute the ISI and keep track of it
told'=0
isi'=0
count'=0
# keep track of isi^2 to get variance
# mean isi is just total time / count
isi2'=0
global 1 v-vth {v=vreset;isi=t-told;told=t;count=count+1;isi2=isi2+isi^2;out_put=(t>tend)}
par taum=10,vth=10,vreset=-1
# these are the voltages per spike
par ie=1,ii=.75
# keep for plotting purposes
aux i_i=ii
# running average
ibar=t/max(count,1)
i2bar=isi2/max(count,1)
# get SD
sd=sqrt(max(i2bar-ibar^2,0))
# plot running averages
aux mean=ibar
aux std=sd
par tend=29950
aux cv=sd/max(ibar,1)
@ maxstor=100000,bound=100000000
@ rangereset=0,rangeover=ii,rangelow=0,rangehigh=1,rangestep=50
@ range=1
@ xlo=0,xhi=1,ylo=0,yhi=1.25,xp=i_i,yp=cv
done