/* There are a total of 9 entries in the algebraic variable array. There are a total of 3 entries in each of the rate and state variable arrays. There are a total of 28 entries in the constant variable array. */ /* * VOI is time in component environment (millisecond). * STATES[0] is V in component membrane (millivolt). * CONSTANTS[0] is Cm in component membrane (femtoF). * ALGEBRAIC[7] is i_Ca in component calcium_current (picoA). * ALGEBRAIC[0] is i_K in component rapidly_activating_K_current (picoA). * ALGEBRAIC[5] is i_K_Ca in component calcium_activated_K_current (picoA). * ALGEBRAIC[8] is i_Na_Ca in component Na_Ca_exchanger_current (picoA). * CONSTANTS[1] is V_K in component rapidly_activating_K_current (millivolt). * CONSTANTS[2] is g_K in component rapidly_activating_K_current (picoS). * STATES[1] is n in component rapidly_activating_K_current_n_gate (dimensionless). * ALGEBRAIC[1] is n_infinity in component rapidly_activating_K_current_n_gate (dimensionless). * CONSTANTS[3] is lamda in component rapidly_activating_K_current_n_gate (dimensionless). * ALGEBRAIC[2] is tau_n in component rapidly_activating_K_current_n_gate (millisecond). * CONSTANTS[4] is V_n in component rapidly_activating_K_current_n_gate (millivolt). * CONSTANTS[5] is S_n in component rapidly_activating_K_current_n_gate (millivolt). * CONSTANTS[6] is a in component rapidly_activating_K_current_n_gate (millivolt). * CONSTANTS[7] is b in component rapidly_activating_K_current_n_gate (millivolt). * CONSTANTS[8] is c in component rapidly_activating_K_current_n_gate (millisecond). * CONSTANTS[9] is V_ in component rapidly_activating_K_current_n_gate (millivolt). * CONSTANTS[10] is V_Ca in component calcium_current (millivolt). * CONSTANTS[11] is g_Ca in component calcium_current (picoS). * ALGEBRAIC[3] is m_infinity in component calcium_current_m_gate (dimensionless). * ALGEBRAIC[4] is h in component calcium_current_h_gate (dimensionless). * CONSTANTS[12] is V_m in component calcium_current_m_gate (millivolt). * CONSTANTS[13] is S_m in component calcium_current_m_gate (millivolt). * CONSTANTS[14] is V_h in component calcium_current_h_gate (millivolt). * CONSTANTS[15] is S_h in component calcium_current_h_gate (millivolt). * CONSTANTS[16] is g_K_Ca in component calcium_activated_K_current (picoS). * CONSTANTS[17] is K_d in component calcium_activated_K_current (micromolar). * STATES[2] is Ca_i in component ionic_concentrations (micromolar). * CONSTANTS[18] is g_Na_Ca in component Na_Ca_exchanger_current (picoS). * CONSTANTS[19] is K_1_2 in component Na_Ca_exchanger_current (micromolar). * ALGEBRAIC[6] is V_Na_Ca in component Na_Ca_exchanger_current (millivolt). * CONSTANTS[20] is RT_F in component Na_Ca_exchanger_current (millivolt). * CONSTANTS[21] is nH in component Na_Ca_exchanger_current (dimensionless). * CONSTANTS[22] is Ca_o in component ionic_concentrations (micromolar). * CONSTANTS[23] is Na_i in component ionic_concentrations (millimolar). * CONSTANTS[24] is Na_o in component ionic_concentrations (millimolar). * CONSTANTS[25] is f in component ionic_concentrations (dimensionless). * CONSTANTS[26] is k_Ca in component ionic_concentrations (per_millisecond). * CONSTANTS[27] is alpha in component ionic_concentrations (mole_per_microlitre_coulomb). * RATES[0] is d/dt V in component membrane (millivolt). * RATES[1] is d/dt n in component rapidly_activating_K_current_n_gate (dimensionless). * RATES[2] is d/dt Ca_i in component ionic_concentrations (micromolar). * There are a total of 0 condition variables. */ void initConsts(double* CONSTANTS, double* RATES, double *STATES) { STATES[0] = -76.0; CONSTANTS[0] = 5310.0; CONSTANTS[1] = -75.0; CONSTANTS[2] = 2500.0; STATES[1] = 0.1; CONSTANTS[3] = 1.6; CONSTANTS[4] = -15.0; CONSTANTS[5] = 5.6; CONSTANTS[6] = 65.0; CONSTANTS[7] = 20.0; CONSTANTS[8] = 6.0; CONSTANTS[9] = -75.0; CONSTANTS[10] = 110.0; CONSTANTS[11] = 1400.0; CONSTANTS[12] = 4.0; CONSTANTS[13] = 14.0; CONSTANTS[14] = -10.0; CONSTANTS[15] = -10.0; CONSTANTS[16] = 30000.0; CONSTANTS[17] = 100.0; STATES[2] = 0.52; CONSTANTS[18] = 234.0; CONSTANTS[19] = 1.5; CONSTANTS[20] = 26.54; CONSTANTS[21] = 5.0; CONSTANTS[22] = 2600.0; CONSTANTS[23] = 10.0; CONSTANTS[24] = 140.0; CONSTANTS[25] = 0.001; CONSTANTS[26] = 0.03; CONSTANTS[27] = 0.0000045055; RATES[0] = 0.1001; RATES[1] = 0.1001; RATES[2] = 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[0]+ALGEBRAIC[7]+ALGEBRAIC[5]+ALGEBRAIC[8])/CONSTANTS[0]; resid[1] = RATES[1] - CONSTANTS[3]*((ALGEBRAIC[1] - STATES[1])/ALGEBRAIC[2]); resid[2] = RATES[2] - CONSTANTS[25]*( - CONSTANTS[27]*(ALGEBRAIC[7] - 2.00000*ALGEBRAIC[8]) - CONSTANTS[26]*STATES[2]); } 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[0] = CONSTANTS[2]*STATES[1]*(STATES[0] - CONSTANTS[1]); ALGEBRAIC[1] = 1.00000/(1.00000+exp((CONSTANTS[4] - STATES[0])/CONSTANTS[5])); ALGEBRAIC[2] = CONSTANTS[8]/(exp((STATES[0] - CONSTANTS[9])/CONSTANTS[6])+exp((CONSTANTS[9] - STATES[0])/CONSTANTS[7])); ALGEBRAIC[5] = CONSTANTS[16]*(STATES[2]/(CONSTANTS[17]+STATES[2]))*(STATES[0] - CONSTANTS[1]); ALGEBRAIC[3] = 1.00000/(1.00000+exp((CONSTANTS[12] - STATES[0])/CONSTANTS[13])); ALGEBRAIC[4] = 1.00000/(1.00000+exp((CONSTANTS[14] - STATES[0])/CONSTANTS[15])); ALGEBRAIC[7] = CONSTANTS[11]*ALGEBRAIC[3]*ALGEBRAIC[4]*(STATES[0] - CONSTANTS[10]); ALGEBRAIC[6] = CONSTANTS[20]*( 3.00000*log(CONSTANTS[24]/CONSTANTS[23] - log(CONSTANTS[22]/STATES[2]))); ALGEBRAIC[8] = CONSTANTS[18]*(pow(STATES[2], CONSTANTS[21])/(pow(CONSTANTS[19], CONSTANTS[21])+pow(STATES[2], CONSTANTS[21])))*(STATES[0] - ALGEBRAIC[6]); } void getStateInformation(double* SI) { SI[0] = 1.0; SI[1] = 1.0; SI[2] = 1.0; } void computeRoots(double VOI, double* CONSTANTS, double* RATES, double* OLDRATES, double* STATES, double* OLDSTATES, double* ALGEBRAIC, double* CONDVARS) { }