I have a function which should be solved using ode solver. The problems is that it has many constants (say 100) and at the same time I don't want to put them in an array because it would be hard to understand the formulas (which are chemical stuff). Some part of my code in this function looks like:
# Component: Calcium Fluxes
J_rel = v1*(P_O1+P_O2)*(Ca_JSR - Ca_ss)*P_RyR # (micromolar_per_millisecond)
J_tr = (Ca_NSR - Ca_JSR)/tau_tr # (micromolar_per_millisecond)
J_leak = v2*(Ca_NSR - Ca_i) # (micromolar_per_millisecond)
J_up = ( v3*(Ca_i ^ 2.00000))/((K_m_up ^ 2.00000)+(Ca_i ^ 2.00000)) # (micromolar_per_millisecond)
J_xfer = (Ca_ss - Ca_i)/tau_xfer # (micromolar_per_millisecond)
P_RyR_prime = - 0.0400000*P_RyR - (( 0.100000*I_Ca_channels)/i_CaL_max)*(exp(( - ((V_m - 5.00000) ^ 2.00000)/648.000))) # (micromolar_per_millisecond)
If I wanted to put them in an array it would become something like this:
J_rel = algebraic[2]*(constants[21]+constants[3])*(constants[4] - Ca_ss)*P_RyR # (micromolar_per_millisecond)
J_tr = (Ca_NSR - Ca_JSR)/tau_tr # (micromolar_per_millisecond)
J_leak = constants[31]*(Ca_NSR - Ca_i) # (micromolar_per_millisecond)
J_up = ( constants[69]*(Ca_i ^ 2.00000))/((constants[17] ^ 2.00000)+(Ca_i ^ 2.00000)) # (micromolar_per_millisecond)
J_xfer = (Ca_ss - Ca_i)/tau_xfer # (micromolar_per_millisecond)
P_RyR_prime = - 0.constants[5]*P_RyR - (( 0.100000*constants[65])/constants[43])*(exp(( - ((V_m - constants[4]) ^ 2.00000)/constants[34]))) # (micromolar_per_millisecond)
Which is extremely hard to 'see' the actual formulas. Do I have to define the constants as global variables? this functions is used by ode solver and gets iterated about 50000 times. So I need something efficient.
P.S. I'm using python(scipy library), but I think one might have the same problem in other languages too.
Thank you very much