# The Morris-Lecar equations # with applied current pulse # Declare the parameters p basei=0,pulsei=0,ton=0,toff=0 p gl=2,gca=4.4,gk=8 p vk=-84,vl=-60,vca=120 p v1=-1.2,v2=18,v3=2,v4=30 p C=20,phi=.04 # Define some functions minf(v)=.5*(1+tanh((v-v1)/v2)) winf(v)= .5*(1+tanh((v-v3)/v4)) lamw(v)= cosh((v-v3)/(2*v4)) i(t)=basei+heav(t-ton)*heav(toff-t)*pulsei # define the differential equations v'= (-gl*(v-vl)-gk*w*(v-vk)-icaf+i(t))/C w'= phi*(winf(v)-w)*lamw(v) # where another function is icaf=gca*minf(v)*(v-vca) # let applied current be plotted as auxiliary variable aux i=i(t) # some initial conditions -- not necessary but for completeness v(0)=-61 w(0)=0.015 # set the graphics window and numerics parameters @ maxstor=100000,total=1000,bound=1000 @ method=rk4,dt=0.05,noutput=10 @ xlo=0,xhi=1000,ylo=-70,yhi=70 # Done!! d