Generated Code

The following is c_ida code generated by the CellML API from this CellML file. (Back to language selection)

The raw code is available.

/*
   There are a total of 44 entries in the algebraic variable array.
   There are a total of 15 entries in each of the rate and state variable arrays.
   There are a total of 48 entries in the constant variable array.
 */
/*
 * VOI is time in component environment (second).
 * STATES[0] is V in component membrane (millivolt).
 * CONSTANTS[0] is R in component membrane (joule_per_kilomole_kelvin).
 * CONSTANTS[1] is T in component membrane (kelvin).
 * CONSTANTS[2] is F in component membrane (coulomb_per_mole).
 * CONSTANTS[3] is C in component membrane (microF).
 * CONSTANTS[43] is RTONF in component membrane (millivolt).
 * ALGEBRAIC[4] is i_f in component hyperpolarising_activated_current (nanoA).
 * ALGEBRAIC[9] is i_K in component time_dependent_potassium_current (nanoA).
 * ALGEBRAIC[13] is i_K1 in component time_independent_potassium_current (nanoA).
 * ALGEBRAIC[14] is i_Na_b in component sodium_background_current (nanoA).
 * ALGEBRAIC[16] is i_Ca_b in component calcium_background_current (nanoA).
 * ALGEBRAIC[17] is i_p in component sodium_potassium_pump (nanoA).
 * ALGEBRAIC[18] is i_NaCa in component Na_Ca_exchanger (nanoA).
 * ALGEBRAIC[20] is i_Na in component fast_sodium_current (nanoA).
 * ALGEBRAIC[29] is i_si in component second_inward_current (nanoA).
 * ALGEBRAIC[2] is i_fNa in component hyperpolarising_activated_current (nanoA).
 * ALGEBRAIC[0] is E_Na in component hyperpolarising_activated_current (millivolt).
 * ALGEBRAIC[1] is E_K in component hyperpolarising_activated_current (millivolt).
 * ALGEBRAIC[3] is i_fK in component hyperpolarising_activated_current (nanoA).
 * CONSTANTS[4] is g_f_Na in component hyperpolarising_activated_current (microS).
 * CONSTANTS[5] is g_f_K in component hyperpolarising_activated_current (microS).
 * CONSTANTS[6] is Km_f in component hyperpolarising_activated_current (millimolar).
 * STATES[1] is Kc in component extracellular_potassium_concentration (millimolar).
 * STATES[2] is Ki in component intracellular_potassium_concentration (millimolar).
 * STATES[3] is Nai in component intracellular_sodium_concentration (millimolar).
 * CONSTANTS[7] is Nao in component extracellular_sodium_concentration (millimolar).
 * STATES[4] is y in component hyperpolarising_activated_current_y_gate (dimensionless).
 * ALGEBRAIC[6] is alpha_y in component hyperpolarising_activated_current_y_gate (per_second).
 * ALGEBRAIC[7] is beta_y in component hyperpolarising_activated_current_y_gate (per_second).
 * CONSTANTS[8] is delta_y in component hyperpolarising_activated_current_y_gate (millivolt).
 * ALGEBRAIC[5] is E0_y in component hyperpolarising_activated_current_y_gate (millivolt).
 * CONSTANTS[9] is speed_y in component hyperpolarising_activated_current_y_gate (dimensionless).
 * ALGEBRAIC[8] is I_K in component time_dependent_potassium_current (nanoA).
 * CONSTANTS[10] is i_K_max in component time_dependent_potassium_current (nanoA).
 * STATES[5] is x in component time_dependent_potassium_current_x_gate (dimensionless).
 * ALGEBRAIC[11] is alpha_x in component time_dependent_potassium_current_x_gate (per_second).
 * ALGEBRAIC[12] is beta_x in component time_dependent_potassium_current_x_gate (per_second).
 * CONSTANTS[11] is delta_x in component time_dependent_potassium_current_x_gate (millivolt).
 * ALGEBRAIC[10] is E0_x in component time_dependent_potassium_current_x_gate (millivolt).
 * CONSTANTS[12] is g_K1 in component time_independent_potassium_current (microS).
 * CONSTANTS[13] is Km_K1 in component time_independent_potassium_current (millimolar).
 * CONSTANTS[14] is g_Nab in component sodium_background_current (microS).
 * ALGEBRAIC[15] is E_Ca in component calcium_background_current (millivolt).
 * CONSTANTS[15] is g_Cab in component calcium_background_current (microS).
 * STATES[6] is Cai in component intracellular_calcium_concentration (millimolar).
 * CONSTANTS[16] is Cao in component extracellular_calcium_concentration (millimolar).
 * CONSTANTS[17] is I_p in component sodium_potassium_pump (nanoA).
 * CONSTANTS[18] is K_mK in component sodium_potassium_pump (millimolar).
 * CONSTANTS[19] is K_mNa in component sodium_potassium_pump (millimolar).
 * CONSTANTS[20] is n_NaCa in component Na_Ca_exchanger (dimensionless).
 * CONSTANTS[21] is K_NaCa in component Na_Ca_exchanger (nanoA).
 * CONSTANTS[22] is d_NaCa in component Na_Ca_exchanger (dimensionless).
 * CONSTANTS[23] is gamma in component Na_Ca_exchanger (dimensionless).
 * CONSTANTS[24] is g_Na in component fast_sodium_current (microS).
 * ALGEBRAIC[19] is E_mh in component fast_sodium_current (millivolt).
 * STATES[7] is m in component fast_sodium_current_m_gate (dimensionless).
 * STATES[8] is h in component fast_sodium_current_h_gate (dimensionless).
 * ALGEBRAIC[22] is alpha_m in component fast_sodium_current_m_gate (per_second).
 * ALGEBRAIC[23] is beta_m in component fast_sodium_current_m_gate (per_second).
 * CONSTANTS[25] is delta_m in component fast_sodium_current_m_gate (millivolt).
 * ALGEBRAIC[21] is E0_m in component fast_sodium_current_m_gate (millivolt).
 * ALGEBRAIC[24] is alpha_h in component fast_sodium_current_h_gate (per_second).
 * ALGEBRAIC[25] is beta_h in component fast_sodium_current_h_gate (per_second).
 * ALGEBRAIC[26] is i_siCa in component second_inward_current (nanoA).
 * ALGEBRAIC[27] is i_siK in component second_inward_current (nanoA).
 * ALGEBRAIC[28] is i_siNa in component second_inward_current (nanoA).
 * CONSTANTS[26] is P_si in component second_inward_current (nanoA_per_millimolar).
 * STATES[9] is d in component second_inward_current_d_gate (dimensionless).
 * STATES[10] is f in component second_inward_current_f_gate (dimensionless).
 * STATES[11] is f2 in component second_inward_current_f2_gate (dimensionless).
 * ALGEBRAIC[31] is alpha_d in component second_inward_current_d_gate (per_second).
 * ALGEBRAIC[32] is beta_d in component second_inward_current_d_gate (per_second).
 * CONSTANTS[27] is delta_d in component second_inward_current_d_gate (millivolt).
 * ALGEBRAIC[30] is E0_d in component second_inward_current_d_gate (millivolt).
 * ALGEBRAIC[34] is alpha_f in component second_inward_current_f_gate (per_second).
 * ALGEBRAIC[35] is beta_f in component second_inward_current_f_gate (per_second).
 * CONSTANTS[28] is delta_f in component second_inward_current_f_gate (millivolt).
 * ALGEBRAIC[33] is E0_f in component second_inward_current_f_gate (millivolt).
 * CONSTANTS[29] is alpha_f2 in component second_inward_current_f2_gate (per_second).
 * ALGEBRAIC[36] is beta_f2 in component second_inward_current_f2_gate (per_second).
 * CONSTANTS[30] is K_mf2 in component second_inward_current_f2_gate (millimolar).
 * CONSTANTS[31] is radius in component intracellular_sodium_concentration (micrometre).
 * CONSTANTS[32] is length in component intracellular_sodium_concentration (micrometre).
 * CONSTANTS[33] is V_e_ratio in component intracellular_sodium_concentration (dimensionless).
 * CONSTANTS[44] is V_Cell in component intracellular_sodium_concentration (micrometre3).
 * CONSTANTS[45] is Vi in component intracellular_sodium_concentration (micrometre3).
 * CONSTANTS[46] is V_up in component intracellular_calcium_concentration (micrometre3).
 * CONSTANTS[47] is V_rel in component intracellular_calcium_concentration (micrometre3).
 * ALGEBRAIC[37] is i_up in component intracellular_calcium_concentration (nanoA).
 * ALGEBRAIC[38] is i_tr in component intracellular_calcium_concentration (nanoA).
 * ALGEBRAIC[42] is i_rel in component intracellular_calcium_concentration (nanoA).
 * STATES[12] is Ca_up in component intracellular_calcium_concentration (millimolar).
 * STATES[13] is Ca_rel in component intracellular_calcium_concentration (millimolar).
 * CONSTANTS[34] is Ca_up_max in component intracellular_calcium_concentration (millimolar).
 * CONSTANTS[35] is K_mCa in component intracellular_calcium_concentration (millimolar).
 * STATES[14] is p in component intracellular_calcium_concentration (dimensionless).
 * ALGEBRAIC[40] is alpha_p in component intracellular_calcium_concentration (per_second).
 * ALGEBRAIC[41] is beta_p in component intracellular_calcium_concentration (per_second).
 * ALGEBRAIC[39] is E0_p in component intracellular_calcium_concentration (millivolt).
 * CONSTANTS[36] is tau_up in component intracellular_calcium_concentration (second).
 * CONSTANTS[37] is tau_rep in component intracellular_calcium_concentration (second).
 * CONSTANTS[38] is tau_rel in component intracellular_calcium_concentration (second).
 * CONSTANTS[39] is rCa in component intracellular_calcium_concentration (dimensionless).
 * CONSTANTS[40] is V_e in component extracellular_potassium_concentration (micrometre3).
 * CONSTANTS[41] is Kb in component extracellular_potassium_concentration (millimolar).
 * ALGEBRAIC[43] is i_mK in component extracellular_potassium_concentration (nanoA).
 * CONSTANTS[42] is pf in component extracellular_potassium_concentration (per_second).
 * RATES[0] is d/dt V in component membrane (millivolt).
 * RATES[4] is d/dt y in component hyperpolarising_activated_current_y_gate (dimensionless).
 * RATES[5] is d/dt x in component time_dependent_potassium_current_x_gate (dimensionless).
 * RATES[7] is d/dt m in component fast_sodium_current_m_gate (dimensionless).
 * RATES[8] is d/dt h in component fast_sodium_current_h_gate (dimensionless).
 * RATES[9] is d/dt d in component second_inward_current_d_gate (dimensionless).
 * RATES[10] is d/dt f in component second_inward_current_f_gate (dimensionless).
 * RATES[11] is d/dt f2 in component second_inward_current_f2_gate (dimensionless).
 * RATES[3] is d/dt Nai in component intracellular_sodium_concentration (millimolar).
 * RATES[14] is d/dt p in component intracellular_calcium_concentration (dimensionless).
 * RATES[12] is d/dt Ca_up in component intracellular_calcium_concentration (millimolar).
 * RATES[13] is d/dt Ca_rel in component intracellular_calcium_concentration (millimolar).
 * RATES[6] is d/dt Cai in component intracellular_calcium_concentration (millimolar).
 * RATES[1] is d/dt Kc in component extracellular_potassium_concentration (millimolar).
 * RATES[2] is d/dt Ki in component intracellular_potassium_concentration (millimolar).
 * There are a total of 7 condition variables.
 */
void
initConsts(double* CONSTANTS, double* RATES, double *STATES)
{
STATES[0] = -60;
CONSTANTS[0] = 8314.472;
CONSTANTS[1] = 310;
CONSTANTS[2] = 96485.3415;
CONSTANTS[3] = 0.006;
CONSTANTS[4] = 6;
CONSTANTS[5] = 6;
CONSTANTS[6] = 45;
STATES[1] = 3;
STATES[2] = 140;
STATES[3] = 7.5;
CONSTANTS[7] = 140;
STATES[4] = 0.007;
CONSTANTS[8] = 1e-5;
CONSTANTS[9] = 2;
CONSTANTS[10] = 20;
STATES[5] = 0.54;
CONSTANTS[11] = 0.0001;
CONSTANTS[12] = 0.75;
CONSTANTS[13] = 10;
CONSTANTS[14] = 0.07;
CONSTANTS[15] = 0.01;
STATES[6] = 5.8e-5;
CONSTANTS[16] = 2;
CONSTANTS[17] = 50;
CONSTANTS[18] = 1;
CONSTANTS[19] = 40;
CONSTANTS[20] = 3;
CONSTANTS[21] = 0.002;
CONSTANTS[22] = 0.0001;
CONSTANTS[23] = 0.5;
CONSTANTS[24] = 1.25;
STATES[7] = 0.076;
STATES[8] = 0.015;
CONSTANTS[25] = 1e-5;
CONSTANTS[26] = 7.5;
STATES[9] = 0.0011;
STATES[10] = 0.785;
STATES[11] = 0.785;
CONSTANTS[27] = 0.0001;
CONSTANTS[28] = 0.0001;
CONSTANTS[29] = 10;
CONSTANTS[30] = 0.0005;
CONSTANTS[31] = 0.08;
CONSTANTS[32] = 0.08;
CONSTANTS[33] = 0.1;
STATES[12] = 1.98;
STATES[13] = 0.55;
CONSTANTS[34] = 5;
CONSTANTS[35] = 0.002;
STATES[14] = 0.785;
CONSTANTS[36] = 0.005;
CONSTANTS[37] = 0.2;
CONSTANTS[38] = 0.01;
CONSTANTS[39] = 2;
CONSTANTS[40] = 0.00016077;
CONSTANTS[41] = 3;
CONSTANTS[42] = 1;
CONSTANTS[43] = ( CONSTANTS[0]*CONSTANTS[1])/CONSTANTS[2];
CONSTANTS[44] =  3.14159*pow(CONSTANTS[31], 2.00000)*CONSTANTS[32];
CONSTANTS[45] =  CONSTANTS[44]*(1.00000 - CONSTANTS[33]);
CONSTANTS[46] =  CONSTANTS[45]*0.0500000;
CONSTANTS[47] =  CONSTANTS[45]*0.0200000;
RATES[0] = 0.1001;
RATES[4] = 0.1001;
RATES[5] = 0.1001;
RATES[7] = 0.1001;
RATES[8] = 0.1001;
RATES[9] = 0.1001;
RATES[10] = 0.1001;
RATES[11] = 0.1001;
RATES[3] = 0.1001;
RATES[14] = 0.1001;
RATES[12] = 0.1001;
RATES[13] = 0.1001;
RATES[6] = 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[4]+ALGEBRAIC[9]+ALGEBRAIC[13]+ALGEBRAIC[14]+ALGEBRAIC[16]+ALGEBRAIC[17]+ALGEBRAIC[18]+ALGEBRAIC[20]+ALGEBRAIC[29])/CONSTANTS[3];
resid[1] = RATES[4] -  CONSTANTS[9]*( ALGEBRAIC[6]*(1.00000 - STATES[4]) -  ALGEBRAIC[7]*STATES[4]);
resid[2] = RATES[5] -  ALGEBRAIC[11]*(1.00000 - STATES[5]) -  ALGEBRAIC[12]*STATES[5];
resid[3] = RATES[7] -  ALGEBRAIC[22]*(1.00000 - STATES[7]) -  ALGEBRAIC[23]*STATES[7];
resid[4] = RATES[8] -  ALGEBRAIC[24]*(1.00000 - STATES[8]) -  ALGEBRAIC[25]*STATES[8];
resid[5] = RATES[9] -  ALGEBRAIC[31]*(1.00000 - STATES[9]) -  ALGEBRAIC[32]*STATES[9];
resid[6] = RATES[10] -  ALGEBRAIC[34]*(1.00000 - STATES[10]) -  ALGEBRAIC[35]*STATES[10];
resid[7] = RATES[11] - CONSTANTS[29] -  STATES[11]*(CONSTANTS[29]+ALGEBRAIC[36]);
resid[8] = RATES[3] - ( - 1.00000*(ALGEBRAIC[20]+ALGEBRAIC[14]+ALGEBRAIC[2]+ALGEBRAIC[28]+ ALGEBRAIC[17]*3.00000+( ALGEBRAIC[18]*CONSTANTS[20])/(CONSTANTS[20] - 2.00000)))/( 1.00000*CONSTANTS[45]*CONSTANTS[2]);
resid[9] = RATES[14] -  ALGEBRAIC[40]*(1.00000 - STATES[14]) -  ALGEBRAIC[41]*STATES[14];
resid[10] = RATES[12] - ( 1.00000*(ALGEBRAIC[37] - ALGEBRAIC[38]))/( 2.00000*1.00000*CONSTANTS[46]*CONSTANTS[2]);
resid[11] = RATES[13] - ( 1.00000*(ALGEBRAIC[38] - ALGEBRAIC[42]))/( 2.00000*1.00000*CONSTANTS[47]*CONSTANTS[2]);
resid[12] = RATES[6] - ( - 1.00000*((((ALGEBRAIC[26]+ALGEBRAIC[16]) - ( 2.00000*ALGEBRAIC[18])/(CONSTANTS[20] - 2.00000)) - ALGEBRAIC[42])+ALGEBRAIC[37]))/( 2.00000*1.00000*CONSTANTS[45]*CONSTANTS[2]);
resid[13] = RATES[1] -  - CONSTANTS[42]*(STATES[1] - CONSTANTS[41])+( 1.00000*ALGEBRAIC[43])/( 1.00000*CONSTANTS[40]*CONSTANTS[2]);
resid[14] = RATES[2] - ( - 1.00000*ALGEBRAIC[43])/( 1.00000*CONSTANTS[45]*CONSTANTS[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[43]*log(CONSTANTS[7]/STATES[3]);
ALGEBRAIC[2] =  (( STATES[4]*STATES[1])/(STATES[1]+CONSTANTS[6]))*CONSTANTS[4]*(STATES[0] - ALGEBRAIC[0]);
ALGEBRAIC[1] =  CONSTANTS[43]*log(STATES[1]/STATES[2]);
ALGEBRAIC[3] =  (( STATES[4]*STATES[1])/(STATES[1]+CONSTANTS[6]))*CONSTANTS[5]*(STATES[0] - ALGEBRAIC[1]);
ALGEBRAIC[4] = ALGEBRAIC[2]+ALGEBRAIC[3];
ALGEBRAIC[5] = STATES[0]+52.0000;
ALGEBRAIC[6] =  0.0500000*exp( - 0.0670000*ALGEBRAIC[5]);
ALGEBRAIC[7] = (CONDVAR[0]<0.00000 ? 2.50000 : ALGEBRAIC[5]/(1.00000 -  1.00000*exp( - 0.200000*ALGEBRAIC[5])));
ALGEBRAIC[8] = ( CONSTANTS[10]*(STATES[2] -  STATES[1]*exp(- STATES[0]/CONSTANTS[43])))/140.000;
ALGEBRAIC[9] =  STATES[5]*ALGEBRAIC[8];
ALGEBRAIC[10] = STATES[0]+22.0000;
ALGEBRAIC[11] = (CONDVAR[1]<0.00000 ? 2.50000 : ( 0.500000*ALGEBRAIC[10])/(1.00000 - exp(- ALGEBRAIC[10]/5.00000)));
ALGEBRAIC[12] = (CONDVAR[2]<0.00000 ? 2.50000 : ( 0.178000*ALGEBRAIC[10])/(exp(ALGEBRAIC[10]/15.0000) - 1.00000));
ALGEBRAIC[13] = ( (( CONSTANTS[12]*STATES[1])/(STATES[1]+CONSTANTS[13]))*(STATES[0] - ALGEBRAIC[1]))/(1.00000+exp(( ((STATES[0]+10.0000) - ALGEBRAIC[1])*2.00000)/CONSTANTS[43]));
ALGEBRAIC[14] =  CONSTANTS[14]*(STATES[0] - ALGEBRAIC[0]);
ALGEBRAIC[15] =  0.500000*CONSTANTS[43]*log(CONSTANTS[16]/STATES[6]);
ALGEBRAIC[16] =  CONSTANTS[15]*(STATES[0] - ALGEBRAIC[15]);
ALGEBRAIC[17] = ( (( CONSTANTS[17]*STATES[1])/(CONSTANTS[18]+STATES[1]))*STATES[3])/(CONSTANTS[19]+STATES[3]);
ALGEBRAIC[18] = ( CONSTANTS[21]*( exp(( CONSTANTS[23]*(CONSTANTS[20] - 2.00000)*STATES[0])/CONSTANTS[43])*pow(STATES[3], CONSTANTS[20])*CONSTANTS[16] -  exp(( (CONSTANTS[23] - 1.00000)*(CONSTANTS[20] - 2.00000)*STATES[0])/CONSTANTS[43])*pow(CONSTANTS[7], CONSTANTS[20])*STATES[6]))/( (1.00000+ CONSTANTS[22]*( STATES[6]*pow(CONSTANTS[7], CONSTANTS[20])+ CONSTANTS[16]*pow(STATES[3], CONSTANTS[20])))*(1.00000+STATES[6]/0.00690000));
ALGEBRAIC[19] =  CONSTANTS[43]*log((CONSTANTS[7]+ 0.120000*STATES[1])/(STATES[3]+ 0.120000*STATES[2]));
ALGEBRAIC[20] =  CONSTANTS[24]*pow(STATES[7], 3.00000)*STATES[8]*(STATES[0] - ALGEBRAIC[19]);
ALGEBRAIC[21] = STATES[0]+41.0000;
ALGEBRAIC[22] = (CONDVAR[3]<0.00000 ? 2000.00 : ( 200.000*ALGEBRAIC[21])/(1.00000 - exp( - 0.100000*ALGEBRAIC[21])));
ALGEBRAIC[23] =  8000.00*exp( - 0.0560000*(STATES[0]+66.0000));
ALGEBRAIC[24] =  20.0000*exp( - 0.125000*(STATES[0]+75.0000));
ALGEBRAIC[25] = 2000.00/( 320.000*exp( - 0.100000*(STATES[0]+75.0000))+1.00000);
ALGEBRAIC[26] =  (( 4.00000*CONSTANTS[26]*(STATES[0] - 50.0000))/( CONSTANTS[43]*(1.00000 - exp(( - 1.00000*(STATES[0] - 50.0000)*2.00000)/CONSTANTS[43]))))*( STATES[6]*exp(100.000/CONSTANTS[43]) -  CONSTANTS[16]*exp(( - 2.00000*(STATES[0] - 50.0000))/CONSTANTS[43]))*STATES[9]*STATES[10]*STATES[11];
ALGEBRAIC[28] =  (( 0.0100000*CONSTANTS[26]*(STATES[0] - 50.0000))/( CONSTANTS[43]*(1.00000 - exp(( - 1.00000*(STATES[0] - 50.0000))/CONSTANTS[43]))))*( STATES[3]*exp(50.0000/CONSTANTS[43]) -  CONSTANTS[7]*exp(( - 1.00000*(STATES[0] - 50.0000))/CONSTANTS[43]))*STATES[9]*STATES[10]*STATES[11];
ALGEBRAIC[27] =  (( 0.0100000*CONSTANTS[26]*(STATES[0] - 50.0000))/( CONSTANTS[43]*(1.00000 - exp(( - 1.00000*(STATES[0] - 50.0000))/CONSTANTS[43]))))*( STATES[2]*exp(50.0000/CONSTANTS[43]) -  STATES[1]*exp(( - 1.00000*(STATES[0] - 50.0000))/CONSTANTS[43]))*STATES[9]*STATES[10]*STATES[11];
ALGEBRAIC[29] = ALGEBRAIC[26]+ALGEBRAIC[27]+ALGEBRAIC[28];
ALGEBRAIC[30] = (STATES[0]+24.0000) - 5.00000;
ALGEBRAIC[31] = (CONDVAR[4]<0.00000 ? 120.000 : ( 30.0000*ALGEBRAIC[30])/(1.00000 - exp(( - 1.00000*ALGEBRAIC[30])/4.00000)));
ALGEBRAIC[32] = (CONDVAR[5]<0.00000 ? 120.000 : ( 12.0000*ALGEBRAIC[30])/(exp(ALGEBRAIC[30]/10.0000) - 1.00000));
ALGEBRAIC[33] = STATES[0]+34.0000;
ALGEBRAIC[34] = (CONDVAR[6]<0.00000 ? 25.0000 : ( 6.25000*ALGEBRAIC[33])/(exp(ALGEBRAIC[33]/4.00000) - 1.00000));
ALGEBRAIC[35] = 50.0000/(1.00000+exp(( - 1.00000*(STATES[0]+34.0000))/4.00000));
ALGEBRAIC[36] = ( STATES[6]*CONSTANTS[29])/CONSTANTS[30];
ALGEBRAIC[37] =  (( 2.00000*1.00000*CONSTANTS[45]*CONSTANTS[2])/( 1.00000*CONSTANTS[36]*CONSTANTS[34]))*STATES[6]*(CONSTANTS[34] - STATES[12]);
ALGEBRAIC[38] =  (( 2.00000*1.00000*CONSTANTS[47]*CONSTANTS[2])/( 1.00000*CONSTANTS[37]))*STATES[14]*(STATES[12] - STATES[13]);
ALGEBRAIC[39] = (STATES[0]+34.0000) - - 30.0000;
ALGEBRAIC[40] = ( 0.625000*ALGEBRAIC[39])/(exp(ALGEBRAIC[39]/4.00000) - 1.00000);
ALGEBRAIC[41] = 5.00000/(1.00000+exp(( - 1.00000*ALGEBRAIC[39])/4.00000));
ALGEBRAIC[42] = ( (( 2.00000*1.00000*CONSTANTS[47]*CONSTANTS[2])/( 1.00000*CONSTANTS[38]))*STATES[13]*pow(STATES[6], CONSTANTS[39]))/(pow(STATES[6], CONSTANTS[39])+pow(CONSTANTS[35], CONSTANTS[39]));
ALGEBRAIC[43] = (ALGEBRAIC[13]+ALGEBRAIC[9]+ALGEBRAIC[3]+ALGEBRAIC[27]) -  2.00000*ALGEBRAIC[17];
}
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;
SI[7] = 1.0;
SI[8] = 1.0;
SI[9] = 1.0;
SI[10] = 1.0;
SI[11] = 1.0;
SI[12] = 1.0;
SI[13] = 1.0;
SI[14] = 1.0;
}
void
computeRoots(double VOI, double* CONSTANTS, double* RATES, double* OLDRATES, double* STATES,
             double* OLDSTATES, double* ALGEBRAIC, double* CONDVARS)
{
CONDVAR[0] = fabs(ALGEBRAIC[5]) - CONSTANTS[8];
CONDVAR[1] = fabs(ALGEBRAIC[10]) - CONSTANTS[11];
CONDVAR[2] = fabs(ALGEBRAIC[10]) - CONSTANTS[11];
CONDVAR[3] = fabs(ALGEBRAIC[21]) - CONSTANTS[25];
CONDVAR[4] = fabs(ALGEBRAIC[30]) - CONSTANTS[27];
CONDVAR[5] = fabs(ALGEBRAIC[30]) - CONSTANTS[27];
CONDVAR[6] = fabs(ALGEBRAIC[33]) - CONSTANTS[28];
}