function dZM = neur1(t,ZMI)
%% funkcja do calkowania ukladu rownian
global Iinj
C=1;
gNa=120;
VNa=50;
gK=36;
VK=-77;
gL=0.3;
VL=-54;

V=ZMI(1);
n=ZMI(2);
m=ZMI(3);
h=ZMI(4);

alfan = 0.01*(V+55)/(1-exp(-(V+55)/10));
betan = 0.125*exp(-(V+65)/80);
alfam = 0.01*(V+40)/(1-exp(-(V+40)/10));
betam = 4*exp(-(V+65)/18);
alfah = 0.07*exp(-(V+65)/20);
betah = 1/(1+exp(-(V+35)/10));

dV = (Iinj-gNa*m*m*m*h*(V-VNa)-gK*n*n*n*n*(V-VK)-gL*(V-VL))/C;
dn = alfan*(1-n)-betan*n;
dm = alfam*(1-m)-betam*m;
dh = alfah*(1-h)-betah*h;

dZM=[dV;dn;dm;dh];