/* There are a total of 9 entries in the algebraic variable array. There are a total of 5 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[6] is i_Ca in component calcium_current (picoA). * ALGEBRAIC[0] is i_K in component rapidly_activating_K_current (picoA). * ALGEBRAIC[3] is i_slow in component slow_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). * CONSTANTS[4] is tau_n in component rapidly_activating_K_current_n_gate (millisecond). * CONSTANTS[5] is V_n in component rapidly_activating_K_current_n_gate (millivolt). * CONSTANTS[6] is S_n in component rapidly_activating_K_current_n_gate (millivolt). * CONSTANTS[7] is V_Ca in component calcium_current (millivolt). * CONSTANTS[8] is g_Ca in component calcium_current (picoS). * ALGEBRAIC[2] is m_infinity in component calcium_current_m_gate (dimensionless). * CONSTANTS[9] is V_m in component calcium_current_m_gate (millivolt). * CONSTANTS[10] is S_m in component calcium_current_m_gate (millivolt). * CONSTANTS[11] is g_s in component slow_K_current (picoS). * STATES[2] is s in component slow_K_current_s_gate (dimensionless). * ALGEBRAIC[4] is s_infinity in component slow_K_current_s_gate (dimensionless). * CONSTANTS[12] is tau_s in component slow_K_current_s_gate (millisecond). * CONSTANTS[13] is V_s in component slow_K_current_s_gate (millivolt). * CONSTANTS[14] is S_s in component slow_K_current_s_gate (millivolt). * CONSTANTS[15] is R_s in component slow_K_current_s_gate (dimensionless). * ALGEBRAIC[7] is S_V_R_s in component slow_K_current_s_gate (dimensionless). * CONSTANTS[16] is g_Na_Ca in component Na_Ca_exchanger_current (picoS). * CONSTANTS[17] is K_1_2 in component Na_Ca_exchanger_current (micromolar). * ALGEBRAIC[5] is V_Na_Ca in component Na_Ca_exchanger_current (millivolt). * CONSTANTS[18] is RT_F in component Na_Ca_exchanger_current (millivolt). * CONSTANTS[19] is nH in component Na_Ca_exchanger_current (dimensionless). * STATES[3] is Ca_i in component ionic_concentrations (micromolar). * CONSTANTS[20] is Ca_o in component ionic_concentrations (micromolar). * CONSTANTS[21] is Na_i in component ionic_concentrations (millimolar). * CONSTANTS[22] is Na_o in component ionic_concentrations (millimolar). * STATES[4] is Ca_ret in component ionic_concentrations (micromolar). * CONSTANTS[23] is f in component ionic_concentrations (dimensionless). * CONSTANTS[24] is k_Ca in component ionic_concentrations (per_millisecond). * CONSTANTS[25] is k_rel in component ionic_concentrations (per_millisecond). * CONSTANTS[26] is k_pump 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 s in component slow_K_current_s_gate (dimensionless). * RATES[3] is d/dt Ca_i in component ionic_concentrations (micromolar). * RATES[4] is d/dt Ca_ret 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] = 2700.0; STATES[1] = 0.1; CONSTANTS[3] = 1.0; CONSTANTS[4] = 20.0; CONSTANTS[5] = -16.0; CONSTANTS[6] = 5.6; CONSTANTS[7] = 25.0; CONSTANTS[8] = 1000.0; CONSTANTS[9] = -20.0; CONSTANTS[10] = 12.0; CONSTANTS[11] = 200.0; STATES[2] = 0.1; CONSTANTS[12] = 12000.0; CONSTANTS[13] = -52.0; CONSTANTS[14] = 10.0; CONSTANTS[15] = 0.58; CONSTANTS[16] = 350.0; CONSTANTS[17] = 1.5; CONSTANTS[18] = 26.54; CONSTANTS[19] = 5.0; STATES[3] = 0.52; CONSTANTS[20] = 2600.0; CONSTANTS[21] = 10.0; CONSTANTS[22] = 140.0; STATES[4] = 0.7; CONSTANTS[23] = 0.02; CONSTANTS[24] = 0.64; CONSTANTS[25] = 0.0006; CONSTANTS[26] = 0.2; CONSTANTS[27] = 0.00006; RATES[0] = 0.1001; RATES[1] = 0.1001; RATES[2] = 0.1001; RATES[3] = 0.1001; RATES[4] = 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[6]+ALGEBRAIC[3]+ALGEBRAIC[8])/CONSTANTS[0]; resid[1] = RATES[1] - CONSTANTS[3]*((ALGEBRAIC[1] - STATES[1])/CONSTANTS[4]); resid[2] = RATES[2] - (ALGEBRAIC[7] - STATES[2])/CONSTANTS[12]; resid[3] = RATES[3] - ( CONSTANTS[23]*( - CONSTANTS[27]*(ALGEBRAIC[6] - 2.00000*ALGEBRAIC[8]) - CONSTANTS[24]*STATES[3])+ CONSTANTS[25]*(STATES[4] - STATES[3])) - CONSTANTS[26]*STATES[3]; resid[4] = RATES[4] - - CONSTANTS[25]*(STATES[4] - STATES[3])+ CONSTANTS[26]*STATES[3]; } 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[5] - STATES[0])/CONSTANTS[6])); ALGEBRAIC[3] = CONSTANTS[11]*STATES[2]*(STATES[0] - CONSTANTS[1]); ALGEBRAIC[2] = 1.00000/(1.00000+exp((CONSTANTS[9] - STATES[0])/CONSTANTS[10])); ALGEBRAIC[6] = CONSTANTS[8]*ALGEBRAIC[2]*(STATES[0] - CONSTANTS[7]); ALGEBRAIC[4] = 1.00000/(1.00000+exp((CONSTANTS[13] - STATES[0])/CONSTANTS[14])); ALGEBRAIC[7] = ALGEBRAIC[4]+CONSTANTS[15]; ALGEBRAIC[5] = CONSTANTS[18]*( 3.00000*log(CONSTANTS[22]/CONSTANTS[21] - log(CONSTANTS[20]/STATES[3]))); ALGEBRAIC[8] = CONSTANTS[16]*(pow(STATES[3], CONSTANTS[19])/(pow(CONSTANTS[17], CONSTANTS[19])+pow(STATES[3], CONSTANTS[19])))*(STATES[0] - ALGEBRAIC[5]); } void getStateInformation(double* SI) { SI[0] = 1.0; SI[1] = 1.0; SI[2] = 1.0; SI[3] = 1.0; SI[4] = 1.0; } void computeRoots(double VOI, double* CONSTANTS, double* RATES, double* OLDRATES, double* STATES, double* OLDSTATES, double* ALGEBRAIC, double* CONDVARS) { }