# integrate and fire # here is the ODE v'=(-v+vrest + rm*ie(t))/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(t)=a0+a1*sin(w1*t)+a2*sin(w2*t) # 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 a0=1.5,a1=.75,w1=.05,a2=.75,w2=.12345 # plot the stimulus aux stim=rm*ie(t)+vrest # set up simulation parameters @ total=500,dt=.1,nplot=2,xlo=0,xhi=500,ylo=-75,yhi=-35 @ yp2=stim,maxstor=20000 done