function dydt = ML_derivs(t, y, I, coefs)
% function [dydt] = derivsI(t, y, I)
% The derivs function
persistent V;
persistent n;
persistent Ser;
persistent Sef;
V = y(1,:);
n = y(2,:);
Ser = y(3,:);
Sef = y(4,:);
%dXidt = minf(V)*(1minf(V)); %MaxRand*sqrt(tTLast)*randn;
%totalSynapticDrive = gEPSP*((Sef  Ser).*(E_EPSPV)) + gIPSP*((Sif  Sir).*(E_IPSPV));
dydt = [1.0./coefs.C*(Icoefs.gL.*(Vcoefs.EL)  ...
coefs.gNa.*(1.0./(1.0 + exp((coefs.Vhalfm  V)/coefs.km ))).*(Vcoefs.ENa)  ...
coefs.gK.*n.*(Vcoefs.EK) + ...
coefs.gEPSP.*(SefSer).*(coefs.E_EPSPV));...%(coefs.E_EPSPV))
(1.0./(1.0+exp((coefs.Vhalfn  V)/coefs.kn ))n)./exp(0.07*V3);...
Ser/coefs.tauEPSPr;
Sef/coefs.tauEPSPf];
