function xdot=Ghhfun(t,x); % Carol Lucas % Called function for Morris_Lecar.m % Note that all parameters are set in the calling program global VNa VK VL gNa gK gL C Iapp V=x(1); m=x(2); h=x(3); n=x(4); taum=1/(0.1*(V+40)/(1-exp(-(V+40)/10))+4*exp(-(V+65)/18)); minf=(0.1*(V+40)/(1-exp(-(V+40)/10)))*taum; tauh=1/(0.07*exp(-(V+65)/20)+(1/(1+exp(-(V+35)/10)))); hinf=0.07*exp(-(V+65)/20)*tauh; taun=1/(0.01*(V+55)/(1-exp(-(V+55)/10))+0.125*exp(-(V+65)/80)); ninf=(0.01*(V+55)/(1-exp(-(V+55)/10)))*taun; xdot(1,1)=(-gNa*m^3*h*(V-VNa)-gK*(V-VK)*n^4-gL*(V-VL)+Iapp)/C; xdot(2,1)=-(m-minf)/taum; xdot(3,1)=-(h-hinf)/tauh; xdot(4,1)=-(n-ninf)/taun;