Location: BG_NSCC @ d8a444c2040d / parameter_finder / kinetic_parameters_nscc.py

Author:
Shelley Fong <sfon036@UoA.auckland.ac.nz>
Date:
2025-08-01 14:51:16+12:00
Desc:
Adding BG diagram
Permanent Source URI:
https://staging.physiomeproject.org/workspace/d54/rawfile/d8a444c2040df2ca7c8e925311693cdd3c9e6a31/parameter_finder/kinetic_parameters_nscc.py

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

# Adapted from Pan 2018 cardiac AP

import numpy as np

def kinetic_parameters(M, include_type2_reactions, dims, V):
    # Set the kinetic rate constants

    num_cols = dims['num_cols']
    num_rows = dims['num_rows']

    # constants are stored in V
    F = V['F']
    R = V['R']
    T = V['T']
    N_A = V['N_A']
    # G_GHK must be positive
    G_GHK_Ca = 3.98E-12    # Unit mA/mM
    G_GHK_Na = 1.35E-13
    G_GHK_K = 1.34E-13
    P_Ca = G_GHK_Ca/F * 1e12 # Unit pL/s . G_GHK_Ca [=] Amp/(mol/s)
    P_Na = G_GHK_Na / F * 1e12
    P_K = G_GHK_K / F * 1e12

    x_ns = V['numChannels']/N_A*1e15 # unit fmol

    # Calculate bond graph constants from kinetic parameters
    # Note: units of kappa are fmol/s, units of K are fmol^-1
    kf_ns = [P_Ca/x_ns, P_Na/x_ns, P_K/x_ns]
    kr_ns = [P_Ca/x_ns, P_Na/x_ns, P_K/x_ns]

    k_kinetic = kf_ns + kr_ns

    # CONSTRAINTS
    N_cT = []
    K_C = []

    # volume vector
    # W = list(np.append([1] * num_cols, [V['V_myo']] * num_rows))
    W = [1] * num_cols + 3*[V['V_myo'], V['V_o']]

    return (k_kinetic, N_cT, K_C, W)