% B1AR module

function [k_kinetic, N_cT] = kinetic_parameters(M, include_type2_reactions, num_cols)
    % Set the kinetic rate constants.
    % original model had reactions that omitted enzymes as substrates e.g. BARK
    % convert unit from 1/s to 1/uM.s by dividing by conc of enzyme
    % all reactions were irreversible, made reversible by letting kr ~= 0

    
    % CONVERT TO fM 
    % oncentration of BARK = 0.6uM (crude approx from litsearch, for GRK)
    bigNum = 1e6;
    fastKineticConstant = bigNum;
    smallReverse = fastKineticConstant/(bigNum^2);
    u_to_f = 1e9;
    cBARK = 0.6*u_to_f;            %uM
    kB11p = 1.1e-3;          % 1/s
    
    kB11p = kB11p / cBARK;      % 1/fM.s
    kB11m = 2.2e-3;             % 1/s
    kB12p = fastKineticConstant;%1/s
    kB12m = smallReverse;       % 1/fM.s
    kB21p = kB11p;              % 1/fM.s
    kB21m = kB11m;              % 1/s
    kB22p = fastKineticConstant;%1/s
    kB22m = smallReverse;       % 1/fM.s
    kP1p = 2.2e-3;          % 1/s
    kP1m = 3.6e-3/u_to_f;             % 1/fM.s
    kP2p = fastKineticConstant; % 1/s
    kP2m = smallReverse;    % 1/fM.s
    kAct1p = 16;            % 1/s
    kAct1m = smallReverse;          % 1/fM.s            
    kAct2m = 16;            % 1/s
    kAct2p = smallReverse;          % 1/fM.s      
    kHydp = 0.8;            % 1/s      
    kHydm = smallReverse;           % 1/s
    kReassocp = 1.21e3/u_to_f;     % 1/fM.s
    kReassocm = kReassocp/bigNum;          % 1/s
    k_kinetic = [
        kB11p, kB12p, kB21p, kB22p, kP1p, kP2p, kAct1p, kAct2p, kHydp, kReassocp, ...
        kB11m, kB12m, kB21m, kB22m, kP1m, kP2m, kAct1m, kAct2m, kHydm, kReassocm
        ]';

    % CONSTRAINTS
    N_cT = zeros(3,size(M,2)); 
    % substrate LR/LRG is in eqlm with product B1ARd
    N_cT(1,num_cols + 1) = 1;
    N_cT(1,num_cols + 2) = -1;
    N_cT(2,num_cols + 5) = 1;
    N_cT(2,num_cols + 2) = -1;
    % substrate B1ARp is in eqlm with product B1ARtot
    N_cT(3,num_cols + 7) = 1;
    N_cT(3,num_cols + 8) = -1;


return 