# integrate and fire with noise # here is the ODE v'=(-v+vrest + rm*ie)/tau init v=-65 # # here is the reset condition - when v-vthreh=0 in the increasing # direction, reset the voltage global 1 v-vthresh {v=vreset} # here is the stimulus ie'=(-ie+a1*normal(0,1))*w1 # here are parameters # voltage - mV time - msec current - nanoamp R - MOhm par vrest=-65,vthresh=-50,vreset=-70,tau=15 par rm=10 # stimulus parameters par a1=30,w1=.05 # plot the stimulus aux stim=rm*ie+vrest # set up simulation parameters @ total=500,dt=.1,meth=euler @ nplot=2,xlo=0,xhi=500,ylo=-75,yhi=-35 @ yp2=stim,maxstor=20000,bound=1000 done