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

    Kc = A(1); vc = A(2); y = A(3); Db = A(4); Df = A(5); s = A(6); lambda = A(7);

    vf =1;
    zKc = 1-(1/6)*((vf/vc)^(2-Kc))*(1+1/(Kc^2))*(7-4*Kc-6*y);
    zvc = 1+(1/6)*((vf/vc)^(2-Kc))*(1-1/(Kc^2))*(7-4*Kc-6*y);
    zy  = 1-(1/3)((vf/vc)^(-Kc))*(7-4*Kc-2*y);
    
    dKc = -0.5*(vc/vf)*(Kc^2)*Db*zKc;
    dvc = -0.5*(Kc/vf)*(vc^2)*Db*zvc;
    dy  = -y^2 - Db*zy;
    dDb = ((7/4)-Kc-(3/2)*y)*Db;
    dDf = (3/4)*Df;
    ds  = -s-(1/(4*\sqrt(pi)))*sqrt(s)*s*Db*zs;
    dlambda = -(1/(4*\sqrt(pi)))*sqrt(s)*lambda*Db*zs;

dA = [dKc; dvc; dy; dDb; dDf; ds; dlambda];

  

