% Format: y = [P g]'
function dydt = p2c_fsa(t,y,params) %#ok<INUSL>

g0   = params.g0;
l    = params.l;
T_R  = params.T_R;
tauL = params.tauL;
E_L  = params.E_L;

P = y(1);
g = y(2);

dPdt = 1/T_R*...
        (2*(g-l-q_fsa(P,params))*P+1e-8*g);
dgdt = -(g-g0)/tauL-g*P/E_L;

dydt = [dPdt; dgdt];