/* There are a total of 17 entries in the algebraic variable array. There are a total of 7 entries in each of the rate and state variable arrays. There are a total of 40 entries in the constant variable array. */ /* * VOI is time in component environment (millisecond). * CONSTANTS[0] is V_cell in component environment (picoL). * CONSTANTS[1] is Ca_e in component environment (millimolar). * CONSTANTS[2] is K_e in component environment (millimolar). * CONSTANTS[3] is K_i in component environment (millimolar). * CONSTANTS[4] is V_tau in component environment (millivolt). * CONSTANTS[5] is k_tau in component environment (millivolt). * STATES[0] is V in component membrane (millivolt). * CONSTANTS[6] is R in component membrane (joule_per_kilomole_kelvin). * CONSTANTS[7] is T in component membrane (kelvin). * CONSTANTS[8] is F in component membrane (coulomb_per_mole). * CONSTANTS[9] is Cm in component membrane (picoF). * ALGEBRAIC[14] is i_Ca_L in component L_type_calcium_current (picoA). * ALGEBRAIC[3] is i_Ca_T in component T_type_calcium_current (picoA). * ALGEBRAIC[15] is i_K_DR in component voltage_sensitive_K_current (picoA). * ALGEBRAIC[9] is i_K_Ca in component Ca_activated_K_current (picoA). * ALGEBRAIC[10] is i_leak in component leak_current (picoA). * ALGEBRAIC[0] is phi_Ca in component L_type_calcium_current (millivolt_millimolar). * CONSTANTS[10] is g_Ca_L in component L_type_calcium_current (nanoS_per_millimolar). * STATES[1] is Ca_i in component cytosolic_calcium (millimolar). * STATES[2] is m_L in component L_type_calcium_current_m_gate (dimensionless). * ALGEBRAIC[1] is m_L_infinity in component L_type_calcium_current_m_gate (dimensionless). * ALGEBRAIC[2] is tau_m_L in component L_type_calcium_current_m_gate (millisecond). * CONSTANTS[11] is tau_m_L_max in component L_type_calcium_current_m_gate (millisecond). * CONSTANTS[12] is V_m_L in component L_type_calcium_current_m_gate (millivolt). * CONSTANTS[13] is k_m_L in component L_type_calcium_current_m_gate (millivolt). * CONSTANTS[14] is g_Ca_T in component T_type_calcium_current (nanoS_per_millimolar). * STATES[3] is m_T in component T_type_calcium_current_m_gate (dimensionless). * STATES[4] is h_T in component T_type_calcium_current_h_gate (dimensionless). * ALGEBRAIC[4] is m_T_infinity in component T_type_calcium_current_m_gate (dimensionless). * ALGEBRAIC[5] is tau_m_T in component T_type_calcium_current_m_gate (millisecond). * CONSTANTS[15] is tau_m_T_max in component T_type_calcium_current_m_gate (millisecond). * CONSTANTS[16] is V_m_T in component T_type_calcium_current_m_gate (millivolt). * CONSTANTS[17] is k_m_T in component T_type_calcium_current_m_gate (millivolt). * ALGEBRAIC[6] is h_T_infinity in component T_type_calcium_current_h_gate (dimensionless). * CONSTANTS[18] is tau_h_T in component T_type_calcium_current_h_gate (millisecond). * CONSTANTS[19] is V_h_T in component T_type_calcium_current_h_gate (millivolt). * CONSTANTS[20] is k_h_T in component T_type_calcium_current_h_gate (millivolt). * ALGEBRAIC[7] is phi_K in component voltage_sensitive_K_current (millivolt_millimolar). * CONSTANTS[21] is g_K_DR in component voltage_sensitive_K_current (nanoS_per_millimolar). * STATES[5] is n in component voltage_sensitive_K_current_n_gate (dimensionless). * ALGEBRAIC[8] is n_infinity in component voltage_sensitive_K_current_n_gate (dimensionless). * CONSTANTS[22] is tau_n in component voltage_sensitive_K_current_n_gate (millisecond). * CONSTANTS[23] is V_n in component voltage_sensitive_K_current_n_gate (millivolt). * CONSTANTS[24] is k_n in component voltage_sensitive_K_current_n_gate (millivolt). * CONSTANTS[25] is g_K_Ca in component Ca_activated_K_current (nanoS_per_millimolar). * CONSTANTS[26] is Kc in component Ca_activated_K_current (millimolar). * CONSTANTS[27] is g_L in component leak_current (nanoS). * CONSTANTS[28] is V_L in component leak_current (millivolt). * STATES[6] is Ca_er in component ER_calcium (millimolar). * ALGEBRAIC[11] is J_rel in component ER_calcium (millimolar_picoL_per_millisecond). * ALGEBRAIC[12] is J_up in component ER_calcium (millimolar_picoL_per_millisecond). * CONSTANTS[38] is V_er in component ER_calcium (picoL). * CONSTANTS[29] is K_er in component ER_calcium (millimolar). * CONSTANTS[30] is f_er in component ER_calcium (dimensionless). * CONSTANTS[31] is P in component ER_calcium (picoL_per_millisecond). * CONSTANTS[32] is v_er in component ER_calcium (millimolar_picoL_per_millisecond). * CONSTANTS[39] is V_c in component cytosolic_calcium (picoL). * CONSTANTS[33] is K_p in component cytosolic_calcium (millimolar). * CONSTANTS[34] is f_cyt in component cytosolic_calcium (dimensionless). * CONSTANTS[35] is v_p in component cytosolic_calcium (millimolar_micrometre_per_millisecond). * ALGEBRAIC[16] is J_in in component cytosolic_calcium (millimolar_micrometre_per_millisecond). * ALGEBRAIC[13] is J_eff in component cytosolic_calcium (millimolar_micrometre_per_millisecond). * CONSTANTS[36] is alpha in component cytosolic_calcium (millimolar_micrometre_per_millisecond_per_picoA). * CONSTANTS[37] is beta in component cytosolic_calcium (per_micrometre). * RATES[0] is d/dt V in component membrane (millivolt). * RATES[2] is d/dt m_L in component L_type_calcium_current_m_gate (dimensionless). * RATES[3] is d/dt m_T in component T_type_calcium_current_m_gate (dimensionless). * RATES[4] is d/dt h_T in component T_type_calcium_current_h_gate (dimensionless). * RATES[5] is d/dt n in component voltage_sensitive_K_current_n_gate (dimensionless). * RATES[6] is d/dt Ca_er in component ER_calcium (millimolar). * RATES[1] is d/dt Ca_i in component cytosolic_calcium (millimolar). * There are a total of 0 condition variables. */ void initConsts(double* CONSTANTS, double* RATES, double *STATES) { CONSTANTS[0] = 1.77; CONSTANTS[1] = 20; CONSTANTS[2] = 5.6; CONSTANTS[3] = 140; CONSTANTS[4] = -60; CONSTANTS[5] = 22; STATES[0] = -70; CONSTANTS[6] = 8314; CONSTANTS[7] = 310; CONSTANTS[8] = 96845; CONSTANTS[9] = 7; CONSTANTS[10] = 9; STATES[1] = 0.00026; STATES[2] = 0; CONSTANTS[11] = 27; CONSTANTS[12] = -18; CONSTANTS[13] = 12; CONSTANTS[14] = 10; STATES[3] = 0; STATES[4] = 0; CONSTANTS[15] = 10; CONSTANTS[16] = -30; CONSTANTS[17] = 10.5; CONSTANTS[18] = 15; CONSTANTS[19] = -57; CONSTANTS[20] = 5; CONSTANTS[21] = 0.1; STATES[5] = 0; CONSTANTS[22] = 20; CONSTANTS[23] = -20; CONSTANTS[24] = 4.5; CONSTANTS[25] = 0.09; CONSTANTS[26] = 0.0004; CONSTANTS[27] = 0.3; CONSTANTS[28] = -67; STATES[6] = 0.0172; CONSTANTS[29] = 0.0002; CONSTANTS[30] = 0.0025; CONSTANTS[31] = 0.0012; CONSTANTS[32] = 0.00005; CONSTANTS[33] = 0.00008; CONSTANTS[34] = 0.01; CONSTANTS[35] = 0.000045; CONSTANTS[36] = 0.0000074; CONSTANTS[37] = 0.47; CONSTANTS[38] = CONSTANTS[0]*0.150000; CONSTANTS[39] = CONSTANTS[0]*0.850000; RATES[0] = 0.1001; RATES[2] = 0.1001; RATES[3] = 0.1001; RATES[4] = 0.1001; RATES[5] = 0.1001; RATES[6] = 0.1001; RATES[1] = 0.1001; } void computeResiduals(double VOI, double* CONSTANTS, double* RATES, double* OLDRATES, double* STATES, double* OLDSTATES, double* ALGEBRAIC, double* CONDVARS) { resid[0] = RATES[0] - - (ALGEBRAIC[14]+ALGEBRAIC[3]+ALGEBRAIC[15]+ALGEBRAIC[9]+ALGEBRAIC[10])/CONSTANTS[9]; resid[1] = RATES[2] - (ALGEBRAIC[1] - STATES[2])/ALGEBRAIC[2]; resid[2] = RATES[3] - (ALGEBRAIC[4] - STATES[3])/ALGEBRAIC[5]; resid[3] = RATES[4] - (ALGEBRAIC[6] - STATES[4])/CONSTANTS[18]; resid[4] = RATES[5] - (ALGEBRAIC[8] - STATES[5])/CONSTANTS[22]; resid[5] = RATES[6] - (- CONSTANTS[30]/CONSTANTS[38])*(ALGEBRAIC[11] - ALGEBRAIC[12]); resid[6] = RATES[1] - (CONSTANTS[34]/CONSTANTS[39])*(ALGEBRAIC[11] - ALGEBRAIC[12])+ CONSTANTS[34]*CONSTANTS[37]*(ALGEBRAIC[16] - ALGEBRAIC[13]); } void computeVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC) { } void computeEssentialVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC) { ALGEBRAIC[1] = 1.00000/(1.00000+exp((CONSTANTS[12] - STATES[0])/CONSTANTS[13])); ALGEBRAIC[2] = CONSTANTS[11]/(exp((STATES[0] - CONSTANTS[4])/CONSTANTS[5])+ 2.00000*exp(( 2.00000*(CONSTANTS[4] - STATES[0]))/CONSTANTS[5])); ALGEBRAIC[0] = ( STATES[0]*(STATES[1] - CONSTANTS[1])*exp(( - 2.00000*CONSTANTS[8]*STATES[0])/( CONSTANTS[6]*CONSTANTS[7])))/(1.00000 - exp(( - 2.00000*CONSTANTS[8]*STATES[0])/( CONSTANTS[6]*CONSTANTS[7]))); ALGEBRAIC[3] = CONSTANTS[14]*pow(STATES[3], 2.00000)*STATES[4]*ALGEBRAIC[0]; ALGEBRAIC[4] = 1.00000/(1.00000+exp((CONSTANTS[16] - STATES[0])/CONSTANTS[17])); ALGEBRAIC[5] = CONSTANTS[15]/(exp((STATES[0] - CONSTANTS[4])/CONSTANTS[5])+ 2.00000*exp(( 2.00000*(CONSTANTS[4] - STATES[0]))/CONSTANTS[5])); ALGEBRAIC[6] = 1.00000/(1.00000+exp((STATES[0] - CONSTANTS[19])/CONSTANTS[20])); ALGEBRAIC[8] = 1.00000/(1.00000+exp((CONSTANTS[23] - STATES[0])/CONSTANTS[24])); ALGEBRAIC[7] = ( STATES[0]*(CONSTANTS[3] - CONSTANTS[2])*exp(( - 1.00000*CONSTANTS[8]*STATES[0])/( CONSTANTS[6]*CONSTANTS[7])))/(1.00000 - exp(( - 1.00000*CONSTANTS[8]*STATES[0])/( CONSTANTS[6]*CONSTANTS[7]))); ALGEBRAIC[9] = (( CONSTANTS[25]*pow(STATES[1], 4.00000))/(pow(STATES[1], 4.00000)+pow(CONSTANTS[26], 4.00000)))*ALGEBRAIC[7]; ALGEBRAIC[10] = CONSTANTS[27]*(STATES[0] - CONSTANTS[28]); ALGEBRAIC[11] = CONSTANTS[31]*(STATES[6] - STATES[1]); ALGEBRAIC[12] = ( CONSTANTS[32]*pow(STATES[1], 2.00000))/(pow(STATES[1], 2.00000)+pow(CONSTANTS[29], 2.00000)); ALGEBRAIC[13] = ( CONSTANTS[35]*pow(STATES[1], 2.00000))/(pow(STATES[1], 2.00000)+pow(CONSTANTS[33], 2.00000)); ALGEBRAIC[14] = CONSTANTS[10]*pow(STATES[2], 2.00000)*ALGEBRAIC[0]; ALGEBRAIC[15] = CONSTANTS[21]*STATES[5]*ALGEBRAIC[7]; ALGEBRAIC[16] = - CONSTANTS[36]*(ALGEBRAIC[14]+ALGEBRAIC[3]); } void getStateInformation(double* SI) { SI[0] = 1.0; SI[1] = 1.0; SI[2] = 1.0; SI[3] = 1.0; SI[4] = 1.0; SI[5] = 1.0; SI[6] = 1.0; } void computeRoots(double VOI, double* CONSTANTS, double* RATES, double* OLDRATES, double* STATES, double* OLDSTATES, double* ALGEBRAIC, double* CONDVARS) { }