% The matrix of flow equations for the standard Giamarchi and Schulz case
% the components are [Kc vc y Db Df]
function yprime = statRedFlowMatrix(l,y)

    Kc = y(1); vc = y(2); yp = y(3); Db = y(4); Df = y(5);

    vf =1;
    zKc = 1-0.5*((vf/vc)^(2-Kc))*(1+1/(Kc^2))*(2-Kc-(3/2)*yp);
    zvc = 1+0.5*((vf/vc)^(2-Kc))*(1-1/(Kc^2))*(2-Kc-(3/2)*yp);
    zy  = 1-((vf/vc)^(-Kc))*(2-Kc+0.5*yp);
    
    dKc = -0.5*(vc/vf)*(Kc^2)*Db*zKc;
    dvc = -0.5*(Kc/vf)*(vc^2)*Db*zvc;
    dy  = -yp^2 - Db*zy;
    dDb = (2-Kc-((3/2)*yp))*Db;
    dDf = Df;

yprime = [dKc; dvc; dy; dDb; dDf];

  

