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 56 entries in the algebraic variable array.
   There are a total of 6 entries in each of the rate and state variable arrays.
   There are a total of 46 entries in the constant variable array.
 */
/*
 * VOI is time in component environment (ms).
 * CONSTANTS[0] is V_myo in component cell_geometry (um3).
 * CONSTANTS[1] is V_SR in component cell_geometry (um3).
 * CONSTANTS[2] is A_cap in component cell_geometry (um2).
 * ALGEBRAIC[0] is V in component membrane (mV).
 * CONSTANTS[3] is R in component membrane (mJ_per_mole_K).
 * CONSTANTS[4] is T in component membrane (kelvin).
 * CONSTANTS[5] is F in component membrane (C_per_mole).
 * ALGEBRAIC[30] is FVRT in component membrane (dimensionless).
 * ALGEBRAIC[31] is FVRT_Ca in component membrane (dimensionless).
 * CONSTANTS[6] is g_D in component CaRU (um3_per_ms).
 * CONSTANTS[7] is J_R in component CaRU (um3_per_ms).
 * CONSTANTS[8] is J_L in component CaRU (um3_per_ms).
 * CONSTANTS[9] is N in component CaRU (dimensionless).
 * STATES[0] is Ca_i in component intracellular_ion_concentrations (mM).
 * CONSTANTS[10] is Ca_o in component extracellular_ion_concentrations (mM).
 * STATES[1] is Ca_SR in component intracellular_ion_concentrations (mM).
 * ALGEBRAIC[53] is I_RyR in component RyR_current (mM_per_ms).
 * ALGEBRAIC[55] is I_LCC in component LCC_current (mM_per_ms).
 * ALGEBRAIC[33] is C_oc in component DS_Calcium_Concentrations (mM).
 * ALGEBRAIC[9] is C_co in component DS_Calcium_Concentrations (mM).
 * CONSTANTS[11] is V_L in component CaRU_Transitions (mV).
 * CONSTANTS[12] is del_VL in component CaRU_Transitions (mV).
 * CONSTANTS[13] is phi_L in component CaRU_Transitions (dimensionless).
 * CONSTANTS[14] is t_L in component CaRU_Transitions (ms).
 * CONSTANTS[15] is tau_L in component CaRU_Transitions (ms).
 * CONSTANTS[43] is t_R in component CaRU_Transitions (ms).
 * CONSTANTS[16] is tau_R in component CaRU_Transitions (ms).
 * CONSTANTS[17] is phi_R in component CaRU_Transitions (dimensionless).
 * CONSTANTS[18] is theta_R in component CaRU_Transitions (dimensionless).
 * CONSTANTS[19] is K_RyR in component CaRU_Transitions (mM).
 * CONSTANTS[20] is K_L in component CaRU_Transitions (mM).
 * CONSTANTS[21] is a in component CaRU_Transitions (dimensionless).
 * CONSTANTS[22] is b in component CaRU_Transitions (dimensionless).
 * CONSTANTS[23] is c in component CaRU_Transitions (dimensionless).
 * CONSTANTS[24] is d in component CaRU_Transitions (dimensionless).
 * ALGEBRAIC[1] is expVL in component CaRU_Transitions (dimensionless).
 * ALGEBRAIC[2] is alpha_p in component CaRU_Transitions (per_ms).
 * CONSTANTS[44] is alpha_m in component CaRU_Transitions (per_ms).
 * ALGEBRAIC[40] is beta_poc in component CaRU_Transitions (per_ms).
 * ALGEBRAIC[3] is beta_pcc in component CaRU_Transitions (per_ms).
 * CONSTANTS[45] is beta_m in component CaRU_Transitions (per_ms).
 * ALGEBRAIC[32] is epsilon_pco in component CaRU_Transitions (per_ms).
 * ALGEBRAIC[4] is epsilon_pcc in component CaRU_Transitions (per_ms).
 * ALGEBRAIC[5] is epsilon_m in component CaRU_Transitions (per_ms).
 * ALGEBRAIC[41] is mu_poc in component CaRU_Transitions (per_ms).
 * ALGEBRAIC[6] is mu_pcc in component CaRU_Transitions (per_ms).
 * ALGEBRAIC[42] is mu_moc in component CaRU_Transitions (per_ms).
 * ALGEBRAIC[7] is mu_mcc in component CaRU_Transitions (per_ms).
 * ALGEBRAIC[8] is C_cc in component DS_Calcium_Concentrations (mM).
 * ALGEBRAIC[34] is C_oo in component DS_Calcium_Concentrations (mM).
 * ALGEBRAIC[37] is J_Loo in component LCC_and_RyR_fluxes (um3_mM_per_ms).
 * ALGEBRAIC[36] is J_Loc in component LCC_and_RyR_fluxes (um3_mM_per_ms).
 * ALGEBRAIC[10] is J_Rco in component LCC_and_RyR_fluxes (um3_mM_per_ms).
 * ALGEBRAIC[35] is J_Roo in component LCC_and_RyR_fluxes (um3_mM_per_ms).
 * ALGEBRAIC[43] is denom in component CaRU_states (per_ms3).
 * ALGEBRAIC[44] is y_oc in component CaRU_states (dimensionless).
 * ALGEBRAIC[45] is y_co in component CaRU_states (dimensionless).
 * ALGEBRAIC[46] is y_oo in component CaRU_states (dimensionless).
 * ALGEBRAIC[47] is y_cc in component CaRU_states (dimensionless).
 * ALGEBRAIC[11] is y_ci in component CaRU_states (dimensionless).
 * ALGEBRAIC[12] is y_oi in component CaRU_states (dimensionless).
 * ALGEBRAIC[13] is y_ic in component CaRU_states (dimensionless).
 * ALGEBRAIC[14] is y_io in component CaRU_states (dimensionless).
 * ALGEBRAIC[48] is y_ii in component CaRU_states (dimensionless).
 * ALGEBRAIC[49] is r_1 in component CaRU_reduced_states (per_ms).
 * ALGEBRAIC[50] is r_2 in component CaRU_reduced_states (per_ms).
 * ALGEBRAIC[15] is r_3 in component CaRU_reduced_states (per_ms).
 * ALGEBRAIC[16] is r_4 in component CaRU_reduced_states (per_ms).
 * ALGEBRAIC[51] is r_5 in component CaRU_reduced_states (per_ms).
 * ALGEBRAIC[17] is r_6 in component CaRU_reduced_states (per_ms).
 * ALGEBRAIC[18] is r_7 in component CaRU_reduced_states (per_ms).
 * ALGEBRAIC[19] is r_8 in component CaRU_reduced_states (per_ms).
 * STATES[2] is z_1 in component CaRU_reduced_states (dimensionless).
 * STATES[3] is z_2 in component CaRU_reduced_states (dimensionless).
 * STATES[4] is z_3 in component CaRU_reduced_states (dimensionless).
 * ALGEBRAIC[20] is z_4 in component CaRU_reduced_states (dimensionless).
 * ALGEBRAIC[52] is J_R1 in component RyR_current (um3_mM_per_ms).
 * ALGEBRAIC[21] is J_R3 in component RyR_current (um3_mM_per_ms).
 * ALGEBRAIC[54] is J_L1 in component LCC_current (um3_mM_per_ms).
 * ALGEBRAIC[38] is J_L2 in component LCC_current (um3_mM_per_ms).
 * CONSTANTS[25] is K_mNa in component Na_Ca_Exchanger (mM).
 * CONSTANTS[26] is K_mCa in component Na_Ca_Exchanger (mM).
 * CONSTANTS[27] is eta in component Na_Ca_Exchanger (dimensionless).
 * CONSTANTS[28] is k_sat in component Na_Ca_Exchanger (dimensionless).
 * CONSTANTS[29] is g_NCX in component Na_Ca_Exchanger (mM_per_ms).
 * CONSTANTS[30] is Na_i in component intracellular_ion_concentrations (mM).
 * CONSTANTS[31] is Na_o in component extracellular_ion_concentrations (mM).
 * ALGEBRAIC[39] is I_NaCa in component Na_Ca_Exchanger (mM_per_ms).
 * CONSTANTS[32] is g_SERCA in component SERCA (mM_per_ms).
 * CONSTANTS[33] is K_SERCA in component SERCA (mM).
 * ALGEBRAIC[22] is I_SERCA in component SERCA (mM_per_ms).
 * CONSTANTS[34] is g_pCa in component Sarcolemmal_Ca_pump (mM_per_ms).
 * CONSTANTS[35] is K_mpCa in component Sarcolemmal_Ca_pump (mM).
 * ALGEBRAIC[23] is I_pCa in component Sarcolemmal_Ca_pump (mM_per_ms).
 * ALGEBRAIC[24] is E_Ca in component Background_Ca_current (mV).
 * CONSTANTS[36] is g_CaB in component Background_Ca_current (mM_per_mV_ms).
 * ALGEBRAIC[25] is I_CaB in component Background_Ca_current (mM_per_ms).
 * CONSTANTS[37] is g_SRl in component SR_Ca_leak_current (per_ms).
 * ALGEBRAIC[26] is I_SR in component SR_Ca_leak_current (mM_per_ms).
 * CONSTANTS[38] is k_m_TRPN in component troponin_Ca_buffer (per_ms).
 * CONSTANTS[39] is k_p_TRPN in component troponin_Ca_buffer (per_mM_ms).
 * CONSTANTS[40] is B_TRPN in component troponin_Ca_buffer (mM).
 * STATES[5] is TRPN in component intracellular_ion_concentrations (mM).
 * ALGEBRAIC[27] is I_TRPN in component troponin_Ca_buffer (mM_per_ms).
 * CONSTANTS[41] is k_CMDN in component calmodulin_Ca_buffer (mM).
 * CONSTANTS[42] is B_CMDN in component calmodulin_Ca_buffer (mM).
 * ALGEBRAIC[28] is beta_CMDN in component calmodulin_Ca_buffer (dimensionless).
 * ALGEBRAIC[29] is CaSR_plot in component intracellular_ion_concentrations (mM).
 * RATES[2] is d/dt z_1 in component CaRU_reduced_states (dimensionless).
 * RATES[3] is d/dt z_2 in component CaRU_reduced_states (dimensionless).
 * RATES[4] is d/dt z_3 in component CaRU_reduced_states (dimensionless).
 * RATES[5] is d/dt TRPN in component intracellular_ion_concentrations (mM).
 * RATES[0] is d/dt Ca_i in component intracellular_ion_concentrations (mM).
 * RATES[1] is d/dt Ca_SR in component intracellular_ion_concentrations (mM).
 * There are a total of 7 condition variables.
 */
void
initConsts(double* CONSTANTS, double* RATES, double *STATES)
{
CONSTANTS[0] = 25.84e3;
CONSTANTS[1] = 2.098e3;
CONSTANTS[2] = 1.534e4;
CONSTANTS[3] = 8314.5;
CONSTANTS[4] = 295;
CONSTANTS[5] = 96487;
CONSTANTS[6] = 0.065;
CONSTANTS[7] = 0.02;
CONSTANTS[8] = 9.13e-4;
CONSTANTS[9] = 50000;
STATES[0] = 0.0001;
CONSTANTS[10] = 1;
STATES[1] = 700e-3;
CONSTANTS[11] = -2;
CONSTANTS[12] = 7;
CONSTANTS[13] = 2.35;
CONSTANTS[14] = 1;
CONSTANTS[15] = 650;
CONSTANTS[16] = 2.43;
CONSTANTS[17] = 0.05;
CONSTANTS[18] = 0.012;
CONSTANTS[19] = 41e-3;
CONSTANTS[20] = 0.22e-3;
CONSTANTS[21] = 0.0625;
CONSTANTS[22] = 14;
CONSTANTS[23] = 0.01;
CONSTANTS[24] = 100;
STATES[2] = 0.98859;
STATES[3] = 0.0087302;
STATES[4] = 0.0026566;
CONSTANTS[25] = 87.5;
CONSTANTS[26] = 1.38;
CONSTANTS[27] = 0.35;
CONSTANTS[28] = 0.1;
CONSTANTS[29] = 38.5e-3;
CONSTANTS[30] = 10;
CONSTANTS[31] = 140;
CONSTANTS[32] = 0.45e-3;
CONSTANTS[33] = 0.5e-3;
CONSTANTS[34] = 0.0035e-3;
CONSTANTS[35] = 0.5e-3;
CONSTANTS[36] = 2.6875e-8;
CONSTANTS[37] = 1.8951e-5;
CONSTANTS[38] = 0.04;
CONSTANTS[39] = 0.04e3;
CONSTANTS[40] = 70e-3;
STATES[5] = 0.0636364;
CONSTANTS[41] = 2.382e-3;
CONSTANTS[42] = 50e-3;
CONSTANTS[43] =  1.17000*CONSTANTS[14];
CONSTANTS[44] = CONSTANTS[13]/CONSTANTS[14];
CONSTANTS[45] = CONSTANTS[17]/CONSTANTS[43];
RATES[2] = 0.1001;
RATES[3] = 0.1001;
RATES[4] = 0.1001;
RATES[5] = 0.1001;
RATES[0] = 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[2] -  - (ALGEBRAIC[49]+ALGEBRAIC[51])*STATES[2]+ ALGEBRAIC[50]*STATES[3]+ ALGEBRAIC[17]*STATES[4];
resid[1] = RATES[3] - ( ALGEBRAIC[49]*STATES[2] -  (ALGEBRAIC[50]+ALGEBRAIC[18])*STATES[3])+ ALGEBRAIC[19]*ALGEBRAIC[20];
resid[2] = RATES[4] - ( ALGEBRAIC[51]*STATES[2] -  (ALGEBRAIC[17]+ALGEBRAIC[15])*STATES[4])+ ALGEBRAIC[16]*ALGEBRAIC[20];
resid[3] = RATES[5] - ALGEBRAIC[27];
resid[4] = RATES[0] -  ALGEBRAIC[28]*(((((ALGEBRAIC[55]+ALGEBRAIC[53]) - ALGEBRAIC[22])+ALGEBRAIC[26]+ALGEBRAIC[39]) - ALGEBRAIC[23])+ALGEBRAIC[25]+ALGEBRAIC[27]);
resid[5] = RATES[1] -  (CONSTANTS[0]/CONSTANTS[1])*((- ALGEBRAIC[53]+ALGEBRAIC[22]) - ALGEBRAIC[26]);
}
void
computeVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
ALGEBRAIC[8] = STATES[0];
ALGEBRAIC[11] = CONSTANTS[44]/(ALGEBRAIC[2]+CONSTANTS[44]);
ALGEBRAIC[12] = ALGEBRAIC[2]/(ALGEBRAIC[2]+CONSTANTS[44]);
ALGEBRAIC[13] = CONSTANTS[45]/(ALGEBRAIC[3]+CONSTANTS[45]);
ALGEBRAIC[14] = ALGEBRAIC[3]/(ALGEBRAIC[3]+CONSTANTS[45]);
ALGEBRAIC[29] = ( STATES[1]*CONSTANTS[1])/CONSTANTS[0];
ALGEBRAIC[34] = (CONDVAR[3]>0.00000 ? (STATES[0]+ (CONSTANTS[7]/CONSTANTS[6])*STATES[1]+( (CONSTANTS[8]/CONSTANTS[6])*CONSTANTS[10]*ALGEBRAIC[31]*exp(- ALGEBRAIC[31]))/(1.00000 - exp(- ALGEBRAIC[31])))/(1.00000+CONSTANTS[7]/CONSTANTS[6]+( (CONSTANTS[8]/CONSTANTS[6])*ALGEBRAIC[31])/(1.00000 - exp(- ALGEBRAIC[31]))) : (STATES[0]+ (CONSTANTS[7]/CONSTANTS[6])*STATES[1]+ (CONSTANTS[8]/CONSTANTS[6])*CONSTANTS[10])/(1.00000+CONSTANTS[7]/CONSTANTS[6]+CONSTANTS[8]/CONSTANTS[6]));
ALGEBRAIC[48] = (((((((1.00000 - ALGEBRAIC[44]) - ALGEBRAIC[45]) - ALGEBRAIC[46]) - ALGEBRAIC[47]) - ALGEBRAIC[11]) - ALGEBRAIC[13]) - ALGEBRAIC[12]) - ALGEBRAIC[14];
}
void
computeEssentialVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
ALGEBRAIC[3] = pow(STATES[0], 2.00000)/( CONSTANTS[43]*(pow(STATES[0], 2.00000)+pow(CONSTANTS[19], 2.00000)));
ALGEBRAIC[6] = (pow(STATES[0], 2.00000)+ CONSTANTS[23]*pow(CONSTANTS[19], 2.00000))/( CONSTANTS[16]*(pow(STATES[0], 2.00000)+pow(CONSTANTS[19], 2.00000)));
ALGEBRAIC[15] = ( CONSTANTS[45]*ALGEBRAIC[6])/(CONSTANTS[45]+ALGEBRAIC[3]);
ALGEBRAIC[7] = ( CONSTANTS[18]*CONSTANTS[24]*(pow(STATES[0], 2.00000)+ CONSTANTS[23]*pow(CONSTANTS[19], 2.00000)))/( CONSTANTS[16]*( CONSTANTS[24]*pow(STATES[0], 2.00000)+ CONSTANTS[23]*pow(CONSTANTS[19], 2.00000)));
ALGEBRAIC[16] = ALGEBRAIC[7];
ALGEBRAIC[0] = (CONDVAR[0]>=0.00000&&CONDVAR[1]<=0.00000 ? 0.00000 : - 80.0000);
ALGEBRAIC[1] = exp((ALGEBRAIC[0] - CONSTANTS[11])/CONSTANTS[12]);
ALGEBRAIC[5] = ( CONSTANTS[22]*(ALGEBRAIC[1]+CONSTANTS[21]))/( CONSTANTS[15]*( CONSTANTS[22]*ALGEBRAIC[1]+CONSTANTS[21]));
ALGEBRAIC[17] = ALGEBRAIC[5];
ALGEBRAIC[2] = ALGEBRAIC[1]/( CONSTANTS[14]*(ALGEBRAIC[1]+1.00000));
ALGEBRAIC[4] = ( STATES[0]*(ALGEBRAIC[1]+CONSTANTS[21]))/( CONSTANTS[15]*CONSTANTS[20]*(ALGEBRAIC[1]+1.00000));
ALGEBRAIC[18] = ( CONSTANTS[44]*ALGEBRAIC[4])/(ALGEBRAIC[2]+CONSTANTS[44]);
ALGEBRAIC[19] = ALGEBRAIC[5];
ALGEBRAIC[20] = ((1.00000 - STATES[2]) - STATES[3]) - STATES[4];
ALGEBRAIC[22] = ( CONSTANTS[32]*pow(STATES[0], 2.00000))/(pow(CONSTANTS[33], 2.00000)+pow(STATES[0], 2.00000));
ALGEBRAIC[23] = ( CONSTANTS[34]*STATES[0])/(CONSTANTS[35]+STATES[0]);
ALGEBRAIC[24] =  (( CONSTANTS[3]*CONSTANTS[4])/( 2.00000*CONSTANTS[5]))*log(CONSTANTS[10]/STATES[0]);
ALGEBRAIC[25] =  CONSTANTS[36]*(ALGEBRAIC[24] - ALGEBRAIC[0]);
ALGEBRAIC[26] =  CONSTANTS[37]*(STATES[1] - STATES[0]);
ALGEBRAIC[27] =  CONSTANTS[38]*(CONSTANTS[40] - STATES[5]) -  CONSTANTS[39]*STATES[5]*STATES[0];
ALGEBRAIC[28] = pow(1.00000+( CONSTANTS[41]*CONSTANTS[42])/pow(CONSTANTS[41]+STATES[0], 2.00000), - 1.00000);
ALGEBRAIC[30] = ( CONSTANTS[5]*ALGEBRAIC[0])/( CONSTANTS[3]*CONSTANTS[4]);
ALGEBRAIC[39] = ( CONSTANTS[29]*( exp( CONSTANTS[27]*ALGEBRAIC[30])*pow(CONSTANTS[30], 3.00000)*CONSTANTS[10] -  exp( (CONSTANTS[27] - 1.00000)*ALGEBRAIC[30])*pow(CONSTANTS[31], 3.00000)*STATES[0]))/( (pow(CONSTANTS[31], 3.00000)+pow(CONSTANTS[25], 3.00000))*(CONSTANTS[10]+CONSTANTS[26])*(1.00000+ CONSTANTS[28]*exp( (CONSTANTS[27] - 1.00000)*ALGEBRAIC[30])));
ALGEBRAIC[31] =  2.00000*ALGEBRAIC[30];
ALGEBRAIC[33] = (CONDVAR[2]>0.00000 ? (STATES[0]+( (CONSTANTS[8]/CONSTANTS[6])*CONSTANTS[10]*ALGEBRAIC[31]*exp(- ALGEBRAIC[31]))/(1.00000 - exp(- ALGEBRAIC[31])))/(1.00000+( (CONSTANTS[8]/CONSTANTS[6])*ALGEBRAIC[31])/(1.00000 - exp(- ALGEBRAIC[31]))) : (STATES[0]+ (CONSTANTS[8]/CONSTANTS[6])*CONSTANTS[10])/(1.00000+CONSTANTS[8]/CONSTANTS[6]));
ALGEBRAIC[41] = (pow(ALGEBRAIC[33], 2.00000)+ CONSTANTS[23]*pow(CONSTANTS[19], 2.00000))/( CONSTANTS[16]*(pow(ALGEBRAIC[33], 2.00000)+pow(CONSTANTS[19], 2.00000)));
ALGEBRAIC[40] = pow(ALGEBRAIC[33], 2.00000)/( CONSTANTS[43]*(pow(ALGEBRAIC[33], 2.00000)+pow(CONSTANTS[19], 2.00000)));
ALGEBRAIC[43] =  (ALGEBRAIC[2]+CONSTANTS[44])*( (CONSTANTS[44]+CONSTANTS[45]+ALGEBRAIC[40])*(CONSTANTS[45]+ALGEBRAIC[3])+ ALGEBRAIC[2]*(CONSTANTS[45]+ALGEBRAIC[40]));
ALGEBRAIC[44] = ( ALGEBRAIC[2]*CONSTANTS[45]*(ALGEBRAIC[2]+CONSTANTS[44]+CONSTANTS[45]+ALGEBRAIC[3]))/ALGEBRAIC[43];
ALGEBRAIC[47] = ( CONSTANTS[44]*CONSTANTS[45]*(CONSTANTS[44]+ALGEBRAIC[2]+CONSTANTS[45]+ALGEBRAIC[40]))/ALGEBRAIC[43];
ALGEBRAIC[49] =  ALGEBRAIC[44]*ALGEBRAIC[41]+ ALGEBRAIC[47]*ALGEBRAIC[6];
ALGEBRAIC[42] = ( CONSTANTS[18]*CONSTANTS[24]*(pow(ALGEBRAIC[33], 2.00000)+ CONSTANTS[23]*pow(CONSTANTS[19], 2.00000)))/( CONSTANTS[16]*( CONSTANTS[24]*pow(ALGEBRAIC[33], 2.00000)+ CONSTANTS[23]*pow(CONSTANTS[19], 2.00000)));
ALGEBRAIC[50] = ( ALGEBRAIC[2]*ALGEBRAIC[42]+ CONSTANTS[44]*ALGEBRAIC[7])/(ALGEBRAIC[2]+CONSTANTS[44]);
ALGEBRAIC[9] = (STATES[0]+ (CONSTANTS[7]/CONSTANTS[6])*STATES[1])/(1.00000+CONSTANTS[7]/CONSTANTS[6]);
ALGEBRAIC[32] = ( ALGEBRAIC[9]*(ALGEBRAIC[1]+CONSTANTS[21]))/( CONSTANTS[15]*CONSTANTS[20]*(ALGEBRAIC[1]+1.00000));
ALGEBRAIC[45] = ( CONSTANTS[44]*( ALGEBRAIC[3]*(CONSTANTS[44]+CONSTANTS[45]+ALGEBRAIC[40])+ ALGEBRAIC[40]*ALGEBRAIC[2]))/ALGEBRAIC[43];
ALGEBRAIC[51] =  ALGEBRAIC[45]*ALGEBRAIC[32]+ ALGEBRAIC[47]*ALGEBRAIC[4];
ALGEBRAIC[10] = ( CONSTANTS[7]*(STATES[1] - STATES[0]))/(1.00000+CONSTANTS[7]/CONSTANTS[6]);
ALGEBRAIC[35] = (CONDVAR[4]>0.00000 ? ( CONSTANTS[7]*((STATES[1] - STATES[0])+ (( (CONSTANTS[8]/CONSTANTS[6])*ALGEBRAIC[31])/(1.00000 - exp(- ALGEBRAIC[31])))*(STATES[1] -  CONSTANTS[10]*exp(- ALGEBRAIC[31]))))/(1.00000+CONSTANTS[7]/CONSTANTS[6]+( (CONSTANTS[8]/CONSTANTS[6])*ALGEBRAIC[31])/(1.00000 - exp(- ALGEBRAIC[31]))) : ( CONSTANTS[7]*((STATES[1] - STATES[0])+ (( (CONSTANTS[8]/CONSTANTS[6])*1.00000e-05)/(1.00000 - exp(- 1.00000e-05)))*(STATES[1] -  CONSTANTS[10]*exp(- 1.00000e-05))))/(1.00000+CONSTANTS[7]/CONSTANTS[6]+( (CONSTANTS[8]/CONSTANTS[6])*1.00000e-05)/(1.00000 - exp(- 1.00000e-05))));
ALGEBRAIC[46] = ( ALGEBRAIC[2]*( ALGEBRAIC[40]*(ALGEBRAIC[2]+CONSTANTS[45]+ALGEBRAIC[3])+ ALGEBRAIC[3]*CONSTANTS[44]))/ALGEBRAIC[43];
ALGEBRAIC[52] =  ALGEBRAIC[46]*ALGEBRAIC[35]+ ALGEBRAIC[10]*ALGEBRAIC[45];
ALGEBRAIC[21] = ( ALGEBRAIC[10]*ALGEBRAIC[3])/(CONSTANTS[45]+ALGEBRAIC[3]);
ALGEBRAIC[53] = ( ( STATES[2]*ALGEBRAIC[52]+ STATES[4]*ALGEBRAIC[21])*CONSTANTS[9])/CONSTANTS[0];
ALGEBRAIC[37] = (CONDVAR[6]>0.00000 ? ( (( CONSTANTS[8]*ALGEBRAIC[31])/(1.00000 - exp(- ALGEBRAIC[31])))*(( CONSTANTS[10]*exp(- ALGEBRAIC[31]) - STATES[0])+ (CONSTANTS[7]/CONSTANTS[6])*( CONSTANTS[10]*exp(- ALGEBRAIC[31]) - STATES[1])))/(1.00000+CONSTANTS[7]/CONSTANTS[6]+( (CONSTANTS[8]/CONSTANTS[6])*ALGEBRAIC[31])/(1.00000 - exp(ALGEBRAIC[31]))) : ( (( CONSTANTS[8]*1.00000e-05)/(1.00000 - exp(- 1.00000e-05)))*(( CONSTANTS[10]*exp(- 1.00000e-05) - STATES[0])+ (CONSTANTS[7]/CONSTANTS[6])*( CONSTANTS[10]*exp(- 1.00000e-05) - STATES[1])))/(1.00000+CONSTANTS[7]/CONSTANTS[6]+( (CONSTANTS[8]/CONSTANTS[6])*1.00000e-05)/(1.00000 - exp(- 1.00000e-05))));
ALGEBRAIC[36] = (CONDVAR[5]>0.00000 ? ( (( CONSTANTS[8]*ALGEBRAIC[31])/(1.00000 - exp(- ALGEBRAIC[31])))*( CONSTANTS[10]*exp(- ALGEBRAIC[31]) - STATES[0]))/(1.00000+( (CONSTANTS[8]/CONSTANTS[6])*ALGEBRAIC[31])/(1.00000 - exp(- ALGEBRAIC[31]))) : ( (( CONSTANTS[8]*1.00000e-05)/(1.00000 - exp(- 1.00000e-05)))*( CONSTANTS[10]*exp(- 1.00000e-05) - STATES[0]))/(1.00000+( (CONSTANTS[8]/CONSTANTS[6])*1.00000e-05)/(1.00000 - exp(- 1.00000e-05))));
ALGEBRAIC[54] =  ALGEBRAIC[37]*ALGEBRAIC[46]+ ALGEBRAIC[36]*ALGEBRAIC[44];
ALGEBRAIC[38] = ( ALGEBRAIC[36]*ALGEBRAIC[2])/(ALGEBRAIC[2]+CONSTANTS[44]);
ALGEBRAIC[55] = ( ( STATES[2]*ALGEBRAIC[54]+ STATES[3]*ALGEBRAIC[38])*CONSTANTS[9])/CONSTANTS[0];
}
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;
}
void
computeRoots(double VOI, double* CONSTANTS, double* RATES, double* OLDRATES, double* STATES,
             double* OLDSTATES, double* ALGEBRAIC, double* CONDVARS)
{
CONDVAR[0] = VOI - 0.00000;
CONDVAR[1] = VOI - 200.000;
CONDVAR[2] = fabs(ALGEBRAIC[31]) - 1.00000e-09;
CONDVAR[3] = fabs(ALGEBRAIC[31]) - 1.00000e-09;
CONDVAR[4] = fabs(ALGEBRAIC[31]) - 1.00000e-05;
CONDVAR[5] = fabs(ALGEBRAIC[31]) - 1.00000e-05;
CONDVAR[6] = fabs(ALGEBRAIC[31]) - 1.00000e-05;
}