%Rhs for HH equations

AM=.1*(25.-V)./(exp(.1*(25.-V))-1.);
BM=4.*exp(-V/18);
AH=.07*exp(-V/20.);
BH=1./(exp(.1*(30.-V))+1.);
AN=.01*(10.-V)./(exp(.1*(10.-V))-1.);
BN=.125*exp(-V/80.);
m = W(1,:);
n = W(3,:);
h = W(2,:);
Fw(1)=AM*(1.-m)-BM*m;
Fw(2)=AH*(1.-h)-BH*h;
Fw(3)=AN*(1.-n)-BN*n;
gna=gnabar*m.^3.*h;
gk=gkbar*n.^4;
Icl=.3*(V-10.5988);
Minf = AM./(AM+BM);
Fv = -gna*(V-Vna)-gk*(V-Vk)-Icl;
