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 14 entries in each of the rate and state variable arrays.
   There are a total of 43 entries in the constant variable array.
 */
/*
 * VOI is time in component environment (millisecond).
 * STATES[0] is Vm_n in component Vm_n (millivolt).
 * ALGEBRAIC[0] is i_app in component Vm_n (nanoA_per_cm2).
 * CONSTANTS[0] is Cm in component Vm_n (microF_per_cm2).
 * CONSTANTS[1] is t0 in component Vm_n (millisecond).
 * CONSTANTS[2] is t1 in component Vm_n (millisecond).
 * ALGEBRAIC[35] is i_NaT in component i_NaT (nanoA_per_cm2).
 * ALGEBRAIC[37] is i_NaP in component i_NaP (nanoA_per_cm2).
 * ALGEBRAIC[44] is i_leakNa in component i_leakNa (nanoA_per_cm2).
 * ALGEBRAIC[39] is i_KDR in component i_KDR (nanoA_per_cm2).
 * ALGEBRAIC[41] is i_KA in component i_KA (nanoA_per_cm2).
 * ALGEBRAIC[46] is i_leakK in component i_leakK (nanoA_per_cm2).
 * ALGEBRAIC[15] is i_leakf in component i_leakf (nanoA_per_cm2).
 * ALGEBRAIC[43] is i_NaKATPase_n in component i_NaKATPase_n (nanoA_per_cm2).
 * ALGEBRAIC[36] is J_NaT in component i_NaT (picomole_per_cm2_millisecond).
 * CONSTANTS[3] is gNaT in component i_NaT (microS_per_cm2).
 * CONSTANTS[4] is F in component model_parameters (coulomb_per_mole).
 * ALGEBRAIC[28] is ENa_n in component electric_potentials (millivolt).
 * STATES[1] is m in component i_NaT_m_gate (dimensionless).
 * STATES[2] is h in component i_NaT_h_gate (dimensionless).
 * ALGEBRAIC[1] is alpha_m in component i_NaT_m_gate (per_millisecond).
 * ALGEBRAIC[2] is beta_m in component i_NaT_m_gate (per_millisecond).
 * ALGEBRAIC[3] is alpha_h in component i_NaT_h_gate (per_millisecond).
 * ALGEBRAIC[4] is beta_h in component i_NaT_h_gate (per_millisecond).
 * ALGEBRAIC[38] is J_NaP in component i_NaP (picomole_per_cm2_millisecond).
 * CONSTANTS[5] is gNaP in component i_NaP (microS_per_cm2).
 * STATES[3] is m in component i_NaP_m_gate (dimensionless).
 * STATES[4] is h in component i_NaP_h_gate (dimensionless).
 * ALGEBRAIC[5] is alpha_m in component i_NaP_m_gate (per_millisecond).
 * ALGEBRAIC[6] is beta_m in component i_NaP_m_gate (per_millisecond).
 * CONSTANTS[6] is tau_activation in component i_NaP_m_gate (millisecond).
 * ALGEBRAIC[7] is alpha_h in component i_NaP_h_gate (per_millisecond).
 * ALGEBRAIC[8] is beta_h in component i_NaP_h_gate (per_millisecond).
 * ALGEBRAIC[40] is J_KDR in component i_KDR (picomole_per_cm2_millisecond).
 * CONSTANTS[7] is gKDR in component i_KDR (microS_per_cm2).
 * ALGEBRAIC[29] is EK_n in component electric_potentials (millivolt).
 * STATES[5] is n in component i_KDR_n_gate (dimensionless).
 * ALGEBRAIC[9] is alpha_n in component i_KDR_n_gate (per_millisecond).
 * ALGEBRAIC[10] is beta_n in component i_KDR_n_gate (per_millisecond).
 * ALGEBRAIC[42] is J_KA in component i_KA (picomole_per_cm2_millisecond).
 * CONSTANTS[8] is gKA in component i_KA (microS_per_cm2).
 * STATES[6] is m in component i_KA_m_gate (dimensionless).
 * STATES[7] is h in component i_KA_h_gate (dimensionless).
 * ALGEBRAIC[11] is alpha_m in component i_KA_m_gate (per_millisecond).
 * ALGEBRAIC[12] is beta_m in component i_KA_m_gate (per_millisecond).
 * ALGEBRAIC[13] is alpha_h in component i_KA_h_gate (per_millisecond).
 * ALGEBRAIC[14] is beta_h in component i_KA_h_gate (per_millisecond).
 * ALGEBRAIC[26] is J_NaKATPase_n in component i_NaKATPase_n (picomole_per_cm2_millisecond).
 * CONSTANTS[9] is I_NaKATPase_n_max in component i_NaKATPase_n (picomole_per_cm2_millisecond).
 * CONSTANTS[10] is KmNa in component model_parameters (millimolar).
 * CONSTANTS[11] is KmK in component model_parameters (millimolar).
 * ALGEBRAIC[22] is Nan in component ion_concentrations (millimolar).
 * ALGEBRAIC[18] is Ko in component ion_concentrations (millimolar).
 * ALGEBRAIC[45] is J_leakNa in component i_leakNa (picomole_per_cm2_millisecond).
 * CONSTANTS[12] is gleakNa in component i_leakNa (microS_per_cm2).
 * ALGEBRAIC[47] is J_leakK in component i_leakK (picomole_per_cm2_millisecond).
 * CONSTANTS[13] is gleakK in component i_leakK (microS_per_cm2).
 * CONSTANTS[14] is gleakf in component i_leakf (microS_per_cm2).
 * CONSTANTS[15] is Ef_n in component electric_potentials (millivolt).
 * ALGEBRAIC[50] is Vm_g in component Vm_g (millivolt).
 * ALGEBRAIC[30] is ENa_g in component electric_potentials (millivolt).
 * ALGEBRAIC[31] is EK_g in component electric_potentials (millivolt).
 * ALGEBRAIC[49] is ECl_g in component electric_potentials (millivolt).
 * ALGEBRAIC[32] is ENBC_g in component electric_potentials (millivolt).
 * CONSTANTS[16] is gNa in component J_Na (microS_per_cm2).
 * CONSTANTS[17] is gK in component J_K (microS_per_cm2).
 * CONSTANTS[18] is gCl in component model_parameters (microS_per_cm2).
 * CONSTANTS[19] is gNBC in component J_NBC (microS_per_cm2).
 * ALGEBRAIC[27] is J_NaKATPase_g in component J_NaKATPase_g (picomole_per_cm2_millisecond).
 * ALGEBRAIC[51] is J_Na in component J_Na (picomole_per_cm2_millisecond).
 * ALGEBRAIC[52] is J_K in component J_K (picomole_per_cm2_millisecond).
 * CONSTANTS[20] is I_NaKATPase_g_max in component J_NaKATPase_g (picomole_per_cm2_millisecond).
 * ALGEBRAIC[20] is Nag in component ion_concentrations (millimolar).
 * ALGEBRAIC[53] is J_NBC in component J_NBC (picomole_per_cm2_millisecond).
 * ALGEBRAIC[48] is J_NKCC1 in component J_NKCC1 (picomole_per_cm2_millisecond).
 * CONSTANTS[21] is gNKCC1 in component J_NKCC1 (microS_per_cm2).
 * CONSTANTS[40] is Psi in component model_parameters (millivolt).
 * ALGEBRAIC[21] is Nao in component ion_concentrations (millimolar).
 * CONSTANTS[22] is P_Ko in component ion_concentrations (millimolar).
 * ALGEBRAIC[17] is Kg in component ion_concentrations (millimolar).
 * ALGEBRAIC[34] is Clo in component ion_concentrations (millimolar).
 * ALGEBRAIC[33] is Clg in component ion_concentrations (millimolar).
 * STATES[8] is N_Nag in component N_Nag (nanomole_per_cm2).
 * ALGEBRAIC[54] is dN_Nag_dt in component N_Nag (nanomole_per_cm2_millisecond).
 * STATES[9] is N_Kg in component N_Kg (nanomole_per_cm2).
 * ALGEBRAIC[55] is dN_Kg_dt in component N_Kg (nanomole_per_cm2_millisecond).
 * STATES[10] is wg in component wg (micrometre).
 * CONSTANTS[23] is Lp in component model_parameters (cm_per_second_millimolar).
 * CONSTANTS[24] is Xg in component model_parameters (millimolar_micrometre).
 * ALGEBRAIC[24] is HCO3o in component ion_concentrations (millimolar).
 * ALGEBRAIC[25] is HCO3g in component ion_concentrations (millimolar).
 * ALGEBRAIC[16] is wo in component wo (micrometre).
 * CONSTANTS[25] is P_wo in component model_parameters (micrometre).
 * CONSTANTS[26] is P_wg in component model_parameters (micrometre).
 * STATES[11] is N_Nao in component N_Nao (nanomole_per_cm2).
 * STATES[12] is N_Ko in component N_Ko (nanomole_per_cm2).
 * STATES[13] is N_HCO3o in component N_HCO3o (nanomole_per_cm2).
 * ALGEBRAIC[19] is Kn in component ion_concentrations (millimolar).
 * ALGEBRAIC[23] is Cln in component ion_concentrations (millimolar).
 * CONSTANTS[27] is P_Vm_g in component ion_concentrations (millivolt).
 * CONSTANTS[39] is P_Clo in component ion_concentrations (millimolar).
 * CONSTANTS[28] is P_Cln in component ion_concentrations (millimolar).
 * CONSTANTS[41] is P_Clg in component ion_concentrations (millimolar).
 * CONSTANTS[29] is P_Nan in component ion_concentrations (millimolar).
 * CONSTANTS[30] is P_Nao in component ion_concentrations (millimolar).
 * CONSTANTS[31] is P_Nag in component ion_concentrations (millimolar).
 * CONSTANTS[32] is P_Kn in component ion_concentrations (millimolar).
 * CONSTANTS[33] is P_Kg in component ion_concentrations (millimolar).
 * CONSTANTS[42] is P_HCO3g in component ion_concentrations (millimolar).
 * CONSTANTS[34] is P_HCO3o in component ion_concentrations (millimolar).
 * CONSTANTS[35] is P_wn in component ion_concentrations (micrometre).
 * CONSTANTS[36] is rho in component model_parameters (dimensionless).
 * CONSTANTS[37] is R in component model_parameters (joule_per_mole_kelvin).
 * CONSTANTS[38] is T in component model_parameters (kelvin).
 * RATES[0] is d/dt Vm_n in component Vm_n (millivolt).
 * RATES[1] is d/dt m in component i_NaT_m_gate (dimensionless).
 * RATES[2] is d/dt h in component i_NaT_h_gate (dimensionless).
 * RATES[3] is d/dt m in component i_NaP_m_gate (dimensionless).
 * RATES[4] is d/dt h in component i_NaP_h_gate (dimensionless).
 * RATES[5] is d/dt n in component i_KDR_n_gate (dimensionless).
 * RATES[6] is d/dt m in component i_KA_m_gate (dimensionless).
 * RATES[7] is d/dt h in component i_KA_h_gate (dimensionless).
 * RATES[8] is d/dt N_Nag in component N_Nag (nanomole_per_cm2).
 * RATES[9] is d/dt N_Kg in component N_Kg (nanomole_per_cm2).
 * RATES[10] is d/dt wg in component wg (micrometre).
 * RATES[11] is d/dt N_Nao in component N_Nao (nanomole_per_cm2).
 * RATES[12] is d/dt N_Ko in component N_Ko (nanomole_per_cm2).
 * RATES[13] is d/dt N_HCO3o in component N_HCO3o (nanomole_per_cm2).
 * There are a total of 3 condition variables.
 */
void
initConsts(double* CONSTANTS, double* RATES, double *STATES)
{
STATES[0] = -70;
CONSTANTS[0] = 1;
CONSTANTS[1] = 100;
CONSTANTS[2] = 700;
CONSTANTS[3] = 5000;
CONSTANTS[4] = 9.649e4;
STATES[1] = 0.005;
STATES[2] = 0.9961;
CONSTANTS[5] = 150;
STATES[3] = 0.0129;
STATES[4] = 0.9718;
CONSTANTS[6] = 6;
CONSTANTS[7] = 5000;
STATES[5] = 0.0012;
CONSTANTS[8] = 1000;
STATES[6] = 0.1193;
STATES[7] = 0.1205;
CONSTANTS[9] = 0.0289;
CONSTANTS[10] = 10;
CONSTANTS[11] = 1.5;
CONSTANTS[12] = 20;
CONSTANTS[13] = 66.06;
CONSTANTS[14] = 10;
CONSTANTS[15] = -70;
CONSTANTS[16] = 100.0;
CONSTANTS[17] = 1696.0;
CONSTANTS[18] = 50;
CONSTANTS[19] = 80;
CONSTANTS[20] = 0.1151;
CONSTANTS[21] = 2;
CONSTANTS[22] = 3;
STATES[8] = 0.75;
STATES[9] = 5;
STATES[10] = 0.05;
CONSTANTS[23] = 2e-8;
CONSTANTS[24] = 8.45;
CONSTANTS[25] = 0.025;
CONSTANTS[26] = 0.05;
STATES[11] = 3.65;
STATES[12] = 0.075;
STATES[13] = 0.375;
CONSTANTS[27] = -85;
CONSTANTS[28] = 50;
CONSTANTS[29] = 10;
CONSTANTS[30] = 146;
CONSTANTS[31] = 15;
CONSTANTS[32] = 130;
CONSTANTS[33] = 100;
CONSTANTS[34] = 15;
CONSTANTS[35] = 0.05;
CONSTANTS[36] = 0.5975;
CONSTANTS[37] = 8.315;
CONSTANTS[38] = 300;
CONSTANTS[39] = (CONSTANTS[30]+CONSTANTS[22]) - CONSTANTS[34];
CONSTANTS[40] = ( 1000.00*CONSTANTS[37]*CONSTANTS[38])/CONSTANTS[4];
CONSTANTS[41] =  CONSTANTS[39]*exp(CONSTANTS[27]/CONSTANTS[40]);
CONSTANTS[42] =  CONSTANTS[34]* pow(( (CONSTANTS[30]/CONSTANTS[31])*exp(CONSTANTS[27]/CONSTANTS[40])), 1.0 / 2);
RATES[0] = 0.1001;
RATES[1] = 0.1001;
RATES[2] = 0.1001;
RATES[3] = 0.1001;
RATES[4] = 0.1001;
RATES[5] = 0.1001;
RATES[6] = 0.1001;
RATES[7] = 0.1001;
RATES[8] = 0.1001;
RATES[9] = 0.1001;
RATES[10] = 0.1001;
RATES[11] = 0.1001;
RATES[12] = 0.1001;
RATES[13] = 0.1001;
}
void
computeResiduals(double VOI, double* CONSTANTS, double* RATES, double* OLDRATES, double* STATES,
                 double* OLDSTATES, double* ALGEBRAIC, double* CONDVARS)
{
resid[0] = RATES[0] - ( 0.00100000*(- (ALGEBRAIC[35]+ALGEBRAIC[37]+ALGEBRAIC[44]+ALGEBRAIC[39]+ALGEBRAIC[41]+ALGEBRAIC[46]+ALGEBRAIC[15]+ALGEBRAIC[43])+ALGEBRAIC[0]))/CONSTANTS[0];
resid[1] = RATES[1] -  ALGEBRAIC[1]*(1.00000 - STATES[1]) -  ALGEBRAIC[2]*STATES[1];
resid[2] = RATES[2] -  ALGEBRAIC[3]*(1.00000 - STATES[2]) -  ALGEBRAIC[4]*STATES[2];
resid[3] = RATES[3] -  ALGEBRAIC[5]*(1.00000 - STATES[3]) -  ALGEBRAIC[6]*STATES[3];
resid[4] = RATES[4] -  ALGEBRAIC[7]*(1.00000 - STATES[4]) -  ALGEBRAIC[8]*STATES[4];
resid[5] = RATES[5] -  ALGEBRAIC[9]*(1.00000 - STATES[5]) -  ALGEBRAIC[10]*STATES[5];
resid[6] = RATES[6] -  ALGEBRAIC[11]*(1.00000 - STATES[6]) -  ALGEBRAIC[12]*STATES[6];
resid[7] = RATES[7] -  ALGEBRAIC[13]*(1.00000 - STATES[7]) -  ALGEBRAIC[14]*STATES[7];
resid[8] = RATES[8] - ALGEBRAIC[54];
resid[9] = RATES[9] - ALGEBRAIC[55];
resid[10] = RATES[10] -  10.0000*CONSTANTS[23]*((ALGEBRAIC[20]+ALGEBRAIC[17]+ALGEBRAIC[33]+ALGEBRAIC[25]+CONSTANTS[24]/STATES[10]) - (ALGEBRAIC[21]+ALGEBRAIC[18]+ALGEBRAIC[34]+ALGEBRAIC[24]));
resid[11] = RATES[11] -  0.0100000*(( 3.00000*ALGEBRAIC[26]+ALGEBRAIC[36]+ALGEBRAIC[38]+ALGEBRAIC[45]) -  100.000*ALGEBRAIC[54]);
resid[12] = RATES[12] -  -0.0100000*(ALGEBRAIC[36]+ALGEBRAIC[38]+ALGEBRAIC[45]+ 3.00000*ALGEBRAIC[26]) - ALGEBRAIC[55];
resid[13] = RATES[13] -  - 0.0100000*2.00000*ALGEBRAIC[53];
}
void
computeVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
ALGEBRAIC[40] = ( CONSTANTS[7]*pow(STATES[5], 2.00000)*(STATES[0] - ALGEBRAIC[29]))/CONSTANTS[4];
ALGEBRAIC[42] = ( CONSTANTS[8]*pow(STATES[6], 2.00000)*STATES[7]*(STATES[0] - ALGEBRAIC[29]))/CONSTANTS[4];
ALGEBRAIC[47] = ( CONSTANTS[13]*(STATES[0] - ALGEBRAIC[29]))/CONSTANTS[4];
}
void
computeEssentialVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
ALGEBRAIC[0] = (CONDVAR[0]>=0.00000&&CONDVAR[1]<=0.00000 ? 3500.00 : 0.00000);
ALGEBRAIC[1] = ( 0.320000*(- STATES[0] - 51.9000))/(exp(- ( 0.250000*STATES[0]+12.9750)) - 1.00000);
ALGEBRAIC[2] = ( 0.280000*(STATES[0]+24.8900))/(exp( 0.200000*STATES[0]+4.97800) - 1.00000);
ALGEBRAIC[3] =  0.128000*exp(- ( 0.0560000*STATES[0]+2.94000));
ALGEBRAIC[4] = 4.00000/(exp(- ( 0.200000*STATES[0]+6.00000))+1.00000);
ALGEBRAIC[5] = ( (1.00000/CONSTANTS[6])*1.00000)/(exp(- ( 0.143000*STATES[0]+5.67000))+1.00000);
ALGEBRAIC[6] = ( (1.00000/CONSTANTS[6])*exp(- ( 0.143000*STATES[0]+5.67000)))/(exp(- ( 0.143000*STATES[0]+5.67000))+1.00000);
ALGEBRAIC[7] =  5.12000e-08*exp(- ( 0.0560000*STATES[0]+2.94000));
ALGEBRAIC[8] = 1.60000e-06/(exp(- ( 0.200000*STATES[0]+8.00000))+1.00000);
ALGEBRAIC[9] = ( 0.0160000*(- STATES[0] - 34.9000))/(exp(- ( 0.200000*STATES[0]+6.98000)) - 1.00000);
ALGEBRAIC[10] =  0.250000*exp(- ( 0.0250000*STATES[0]+1.25000));
ALGEBRAIC[11] = ( 0.0200000*(- STATES[0] - 56.9000))/(exp(- ( 0.100000*STATES[0]+5.69000)) - 1.00000);
ALGEBRAIC[12] = ( 0.0175000*(STATES[0]+29.9000))/(exp( 0.100000*STATES[0]+2.99000) - 1.00000);
ALGEBRAIC[13] =  0.0160000*exp(- ( 0.0560000*STATES[0]+4.61000));
ALGEBRAIC[14] = 0.500000/(exp(- ( 0.200000*STATES[0]+11.9800))+1.00000);
ALGEBRAIC[15] =  CONSTANTS[14]*(STATES[0] - CONSTANTS[15]);
ALGEBRAIC[17] = STATES[9]/STATES[10];
ALGEBRAIC[16] = (CONSTANTS[26]+CONSTANTS[25]) - STATES[10];
ALGEBRAIC[18] = STATES[12]/ALGEBRAIC[16];
ALGEBRAIC[20] = STATES[8]/STATES[10];
ALGEBRAIC[21] = STATES[11]/ALGEBRAIC[16];
ALGEBRAIC[24] = STATES[13]/ALGEBRAIC[16];
ALGEBRAIC[25] = (( CONSTANTS[26]*CONSTANTS[42]+ CONSTANTS[25]*CONSTANTS[34]) - STATES[13])/STATES[10];
ALGEBRAIC[22] = (( CONSTANTS[35]*CONSTANTS[29]+ CONSTANTS[26]*CONSTANTS[31]+ CONSTANTS[25]*CONSTANTS[30]) - (STATES[11]+STATES[8]))/CONSTANTS[35];
ALGEBRAIC[26] = ( (( CONSTANTS[9]*pow(ALGEBRAIC[22], 1.50000))/(pow(ALGEBRAIC[22], 1.50000)+pow(CONSTANTS[10], 1.50000)))*ALGEBRAIC[18])/(ALGEBRAIC[18]+CONSTANTS[11]);
ALGEBRAIC[33] = (ALGEBRAIC[20]+ALGEBRAIC[17]) - (ALGEBRAIC[25]+( CONSTANTS[36]*CONSTANTS[24])/STATES[10]);
ALGEBRAIC[19] = (( CONSTANTS[35]*CONSTANTS[32]+ CONSTANTS[26]*CONSTANTS[33]+ CONSTANTS[25]*CONSTANTS[22]) - (STATES[12]+STATES[9]))/CONSTANTS[35];
ALGEBRAIC[23] = ((CONSTANTS[28]+ALGEBRAIC[22]) - CONSTANTS[29])+(ALGEBRAIC[19] - CONSTANTS[32]);
ALGEBRAIC[34] = (( CONSTANTS[26]*CONSTANTS[41]+ CONSTANTS[25]*CONSTANTS[39]+ CONSTANTS[35]*CONSTANTS[28]) - ( STATES[10]*ALGEBRAIC[33]+ CONSTANTS[35]*ALGEBRAIC[23]))/ALGEBRAIC[16];
ALGEBRAIC[28] =  CONSTANTS[40]*log(ALGEBRAIC[21]/ALGEBRAIC[22]);
ALGEBRAIC[35] =  CONSTANTS[3]*pow(STATES[1], 3.00000)*STATES[2]*(STATES[0] - ALGEBRAIC[28]);
ALGEBRAIC[36] = ( CONSTANTS[3]*pow(STATES[1], 3.00000)*STATES[2]*(STATES[0] - ALGEBRAIC[28]))/CONSTANTS[4];
ALGEBRAIC[37] =  CONSTANTS[5]*pow(STATES[3], 2.00000)*STATES[4]*(STATES[0] - ALGEBRAIC[28]);
ALGEBRAIC[38] = ( CONSTANTS[5]*pow(STATES[3], 2.00000)*STATES[4]*(STATES[0] - ALGEBRAIC[28]))/CONSTANTS[4];
ALGEBRAIC[29] =  CONSTANTS[40]*log(ALGEBRAIC[18]/ALGEBRAIC[19]);
ALGEBRAIC[39] =  CONSTANTS[7]*pow(STATES[5], 2.00000)*(STATES[0] - ALGEBRAIC[29]);
ALGEBRAIC[41] =  CONSTANTS[8]*pow(STATES[6], 2.00000)*STATES[7]*(STATES[0] - ALGEBRAIC[29]);
ALGEBRAIC[43] =  ALGEBRAIC[26]*CONSTANTS[4];
ALGEBRAIC[44] =  CONSTANTS[12]*(STATES[0] - ALGEBRAIC[28]);
ALGEBRAIC[45] = ( CONSTANTS[12]*(STATES[0] - ALGEBRAIC[28]))/CONSTANTS[4];
ALGEBRAIC[46] =  CONSTANTS[13]*(STATES[0] - ALGEBRAIC[29]);
ALGEBRAIC[30] =  CONSTANTS[40]*log(ALGEBRAIC[21]/ALGEBRAIC[20]);
ALGEBRAIC[31] =  CONSTANTS[40]*log(ALGEBRAIC[18]/ALGEBRAIC[17]);
ALGEBRAIC[49] =  - 1.00000*CONSTANTS[40]*log(ALGEBRAIC[34]/ALGEBRAIC[33]);
ALGEBRAIC[32] =  - CONSTANTS[40]*log( (ALGEBRAIC[21]/ALGEBRAIC[20])*pow(ALGEBRAIC[24]/ALGEBRAIC[25], 2.00000));
ALGEBRAIC[27] = ( (( CONSTANTS[20]*pow(ALGEBRAIC[20], 1.50000))/(pow(ALGEBRAIC[20], 1.50000)+pow(CONSTANTS[10], 1.50000)))*ALGEBRAIC[18])/(ALGEBRAIC[18]+CONSTANTS[11]);
ALGEBRAIC[50] = ( CONSTANTS[16]*ALGEBRAIC[30]+ CONSTANTS[17]*ALGEBRAIC[31]+ CONSTANTS[18]*ALGEBRAIC[49]+ CONSTANTS[19]*ALGEBRAIC[32])/(CONSTANTS[16]+CONSTANTS[17]+CONSTANTS[18]+CONSTANTS[19]) - ( CONSTANTS[4]*ALGEBRAIC[27])/(CONSTANTS[16]+CONSTANTS[17]+CONSTANTS[18]+CONSTANTS[19]);
ALGEBRAIC[53] = ( CONSTANTS[19]*(ALGEBRAIC[50] - ALGEBRAIC[32]))/CONSTANTS[4];
ALGEBRAIC[51] = ( CONSTANTS[16]*(ALGEBRAIC[50] - ALGEBRAIC[30]))/CONSTANTS[4];
ALGEBRAIC[48] = (CONDVAR[2]>0.00000 ? ( (pow(ALGEBRAIC[18] - CONSTANTS[22], 10.0000)/(pow(ALGEBRAIC[18] - CONSTANTS[22], 10.0000)+pow(0.0300000, 10.0000)))*CONSTANTS[40]*CONSTANTS[21]*log( (( (ALGEBRAIC[18]/ALGEBRAIC[17])*ALGEBRAIC[21])/ALGEBRAIC[20])*pow(ALGEBRAIC[34]/ALGEBRAIC[33], 2.00000)))/CONSTANTS[4] : 0.00000);
ALGEBRAIC[54] =  0.0100000*((- ALGEBRAIC[51] -  3.00000*ALGEBRAIC[27])+ALGEBRAIC[48]+ALGEBRAIC[53]);
ALGEBRAIC[52] = ( CONSTANTS[17]*(ALGEBRAIC[50] - ALGEBRAIC[31]))/CONSTANTS[4];
ALGEBRAIC[55] =  0.0100000*(- ALGEBRAIC[52]+ 2.00000*ALGEBRAIC[27]+ALGEBRAIC[48]);
}
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;
}
void
computeRoots(double VOI, double* CONSTANTS, double* RATES, double* OLDRATES, double* STATES,
             double* OLDSTATES, double* ALGEBRAIC, double* CONDVARS)
{
CONDVAR[0] = VOI - CONSTANTS[1];
CONDVAR[1] = VOI - CONSTANTS[2];
CONDVAR[2] = ALGEBRAIC[18] - CONSTANTS[22];
}