% LRGbinding module - for saucerman B1AR as GPCR

% Return kinetic parameters, constraints, and vector of volumes in each
% compartment (pL) (1 if gating variable, or in element corresponding to
% kappa)

function [k_kinetic, N_cT, K_C, W] = kinetic_parameters(M, include_type2_reactions, dims, V)
    % 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
    
    num_cols = dims.num_cols;
    num_rows = dims.num_rows;

    % concentration of BARK = 0.6uM (crude approx from litsearch, for GRK)
    bigNum = 1e6;
    fastKineticConstant = bigNum;
    
    Kl = 0.285; % uM
    Kr = 0.062; % uM
    Kc = 33; % uM
    ksig1p = fastKineticConstant;
    ksig1m = ksig1p*Kc;
    ksig2p = fastKineticConstant;
    ksig2m = ksig2p*Kl;
    ksig3p = fastKineticConstant;
    ksig3m = ksig3p*Kr;
    ksig4p = fastKineticConstant;
    % find ksig4m using detailed balance
    ksig4m = ksig1m*ksig2m*ksig3p*ksig4p/(ksig1p*ksig2p*ksig3m);
        
    k_kinetic = [
        ksig1p, ksig2p, ksig3p, ksig4p,...
        ksig1m, ksig2m, ksig3m, ksig4m
        ]';

    % CONSTRAINTS
    N_cT = [];
    if false
        N_cT = zeros(1,size(M,2)); 
        % substrate B1ARp is in eqlm with product B1ARtot
        N_cT(1,num_cols + 1) = 1;
        N_cT(1,num_cols + 2) = -1;
    end
    K_C = ones(1,size(N_cT,1));

    % volume vector
    W = [ones(num_cols,1); V.V_myo*ones(num_rows,1)];

return 