Generated Code

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

The raw code is available.

/*
   There are a total of 34 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 88 entries in the constant variable array.
 */
/*
 * VOI is t in component environment (second).
 * ALGEBRAIC[18] is Pi in component TempCDa (UnitP).
 * STATES[0] is Pi in component TempRLC (UnitP).
 * ALGEBRAIC[30] is Qo in component TempRC (UnitQ).
 * ALGEBRAIC[10] is Qo in component TempCDv (UnitQ).
 * ALGEBRAIC[19] is Pi in component TempCDa (UnitP).
 * STATES[1] is Pi in component TempRLC (UnitP).
 * ALGEBRAIC[31] is Qo in component TempRC (UnitQ).
 * ALGEBRAIC[11] is Qo in component TempCDv (UnitQ).
 * ALGEBRAIC[6] is Pi in component TempCDv (UnitP).
 * ALGEBRAIC[22] is Qo in component TempCDa (UnitQ).
 * CONSTANTS[0] is CVao in component ParaHeart (UnitCV).
 * ALGEBRAIC[4] is E in component EVentricle (UnitE).
 * STATES[2] is V in component TempCDv (UnitV).
 * CONSTANTS[1] is PlvIni in component ParaHeart (UnitP).
 * CONSTANTS[2] is VlvIni in component ParaHeart (UnitV).
 * ALGEBRAIC[8] is Tao in component TempCDv (dimensionless).
 * CONSTANTS[3] is Vlv0 in component ParaHeart (UnitV).
 * CONSTANTS[4] is CVmi in component ParaHeart (UnitCV).
 * ALGEBRAIC[16] is E in component EAtrium (UnitE).
 * STATES[3] is V in component TempCDa (UnitV).
 * CONSTANTS[5] is PlaIni in component ParaHeart (UnitP).
 * CONSTANTS[6] is VlaIni in component ParaHeart (UnitV).
 * ALGEBRAIC[20] is Tao in component TempCDa (dimensionless).
 * CONSTANTS[7] is Vla0 in component ParaHeart (UnitV).
 * CONSTANTS[8] is ElvMax in component ParaHeart (UnitE).
 * CONSTANTS[9] is ElvMin in component ParaHeart (UnitE).
 * CONSTANTS[10] is T in component ParaHeart (second).
 * CONSTANTS[11] is Ts1 in component ParaHeart (dimensionless).
 * CONSTANTS[12] is Ts2 in component ParaHeart (dimensionless).
 * ALGEBRAIC[0] is mt in component EVentricle (second).
 * ALGEBRAIC[2] is et in component EVentricle (dimensionless).
 * CONSTANTS[13] is ElaMax in component ParaHeart (UnitE).
 * CONSTANTS[14] is ElaMin in component ParaHeart (UnitE).
 * CONSTANTS[15] is Tpwb in component ParaHeart (dimensionless).
 * CONSTANTS[16] is Tpww in component ParaHeart (dimensionless).
 * ALGEBRAIC[12] is mt in component EAtrium (second).
 * ALGEBRAIC[14] is et in component EAtrium (dimensionless).
 * CONSTANTS[17] is EraMax in component ParaHeart (UnitE).
 * CONSTANTS[18] is EraMin in component ParaHeart (UnitE).
 * CONSTANTS[19] is PraIni in component ParaHeart (UnitP).
 * CONSTANTS[20] is VraIni in component ParaHeart (UnitV).
 * CONSTANTS[21] is ErvMax in component ParaHeart (UnitE).
 * CONSTANTS[22] is ErvMin in component ParaHeart (UnitE).
 * CONSTANTS[23] is PrvIni in component ParaHeart (UnitP).
 * CONSTANTS[24] is VrvIni in component ParaHeart (UnitV).
 * CONSTANTS[25] is CVpa in component ParaHeart (UnitCV).
 * CONSTANTS[26] is CVti in component ParaHeart (UnitCV).
 * CONSTANTS[27] is Vra0 in component ParaHeart (UnitV).
 * CONSTANTS[28] is Vrv0 in component ParaHeart (UnitV).
 * ALGEBRAIC[7] is Pi in component TempCDv (UnitP).
 * ALGEBRAIC[23] is Qo in component TempCDa (UnitQ).
 * CONSTANTS[29] is CVpa in component ParaHeart (UnitCV).
 * ALGEBRAIC[5] is E in component EVentricle (UnitE).
 * STATES[4] is V in component TempCDv (UnitV).
 * CONSTANTS[30] is PrvIni in component ParaHeart (UnitP).
 * CONSTANTS[31] is VrvIni in component ParaHeart (UnitV).
 * ALGEBRAIC[9] is Tao in component TempCDv (dimensionless).
 * CONSTANTS[32] is Vrv0 in component ParaHeart (UnitV).
 * CONSTANTS[33] is CVti in component ParaHeart (UnitCV).
 * ALGEBRAIC[17] is E in component EAtrium (UnitE).
 * STATES[5] is V in component TempCDa (UnitV).
 * CONSTANTS[34] is PraIni in component ParaHeart (UnitP).
 * CONSTANTS[35] is VraIni in component ParaHeart (UnitV).
 * ALGEBRAIC[21] is Tao in component TempCDa (dimensionless).
 * CONSTANTS[36] is Vra0 in component ParaHeart (UnitV).
 * CONSTANTS[37] is ErvMax in component ParaHeart (UnitE).
 * CONSTANTS[38] is ErvMin in component ParaHeart (UnitE).
 * CONSTANTS[39] is T in component ParaHeart (second).
 * CONSTANTS[40] is Ts1 in component ParaHeart (dimensionless).
 * CONSTANTS[41] is Ts2 in component ParaHeart (dimensionless).
 * ALGEBRAIC[1] is mt in component EVentricle (second).
 * ALGEBRAIC[3] is et in component EVentricle (dimensionless).
 * CONSTANTS[42] is EraMax in component ParaHeart (UnitE).
 * CONSTANTS[43] is EraMin in component ParaHeart (UnitE).
 * CONSTANTS[44] is Tpwb in component ParaHeart (dimensionless).
 * CONSTANTS[45] is Tpww in component ParaHeart (dimensionless).
 * ALGEBRAIC[13] is mt in component EAtrium (second).
 * ALGEBRAIC[15] is et in component EAtrium (dimensionless).
 * CONSTANTS[46] is ElaMax in component ParaHeart (UnitE).
 * CONSTANTS[47] is ElaMin in component ParaHeart (UnitE).
 * CONSTANTS[48] is PlaIni in component ParaHeart (UnitP).
 * CONSTANTS[49] is VlaIni in component ParaHeart (UnitV).
 * CONSTANTS[50] is ElvMax in component ParaHeart (UnitE).
 * CONSTANTS[51] is ElvMin in component ParaHeart (UnitE).
 * CONSTANTS[52] is PlvIni in component ParaHeart (UnitP).
 * CONSTANTS[53] is VlvIni in component ParaHeart (UnitV).
 * CONSTANTS[54] is CVao in component ParaHeart (UnitCV).
 * CONSTANTS[55] is CVmi in component ParaHeart (UnitCV).
 * CONSTANTS[56] is Vlv0 in component ParaHeart (UnitV).
 * CONSTANTS[57] is Vla0 in component ParaHeart (UnitV).
 * STATES[6] is Pi in component TempRLC (UnitP).
 * STATES[7] is Qo in component TempRLC (UnitQ).
 * CONSTANTS[58] is Rsas in component ParaSys (UnitR).
 * CONSTANTS[59] is Csas in component ParaSys (UnitC).
 * CONSTANTS[60] is Lsas in component ParaSys (UnitL).
 * CONSTANTS[61] is P0sas in component ParaSys (UnitP).
 * CONSTANTS[62] is Q0sas in component ParaSys (UnitQ).
 * ALGEBRAIC[32] is Pi in component TempR (UnitP).
 * STATES[8] is Qo in component TempRLC (UnitQ).
 * CONSTANTS[63] is Rsat in component ParaSys (UnitR).
 * CONSTANTS[64] is Csat in component ParaSys (UnitC).
 * CONSTANTS[65] is Lsat in component ParaSys (UnitL).
 * CONSTANTS[66] is P0sat in component ParaSys (UnitP).
 * CONSTANTS[67] is Q0sat in component ParaSys (UnitQ).
 * ALGEBRAIC[28] is Pi in component TempR (UnitP).
 * ALGEBRAIC[25] is Qo in component TempR (UnitQ).
 * CONSTANTS[68] is Rsar in component ParaSys (UnitR).
 * STATES[9] is Pi in component TempRC (UnitP).
 * ALGEBRAIC[27] is Qo in component TempR (UnitQ).
 * CONSTANTS[69] is Rscp in component ParaSys (UnitR).
 * CONSTANTS[70] is Rsvn in component ParaSys (UnitR).
 * CONSTANTS[71] is Csvn in component ParaSys (UnitC).
 * CONSTANTS[72] is P0svn in component ParaSys (UnitP).
 * STATES[10] is Pi in component TempRLC (UnitP).
 * STATES[11] is Qo in component TempRLC (UnitQ).
 * CONSTANTS[73] is Rpas in component ParaPul (UnitR).
 * CONSTANTS[74] is Cpas in component ParaPul (UnitC).
 * CONSTANTS[75] is Lpas in component ParaPul (UnitL).
 * CONSTANTS[76] is P0pas in component ParaPul (UnitP).
 * CONSTANTS[77] is Q0pas in component ParaPul (UnitQ).
 * ALGEBRAIC[33] is Pi in component TempR (UnitP).
 * STATES[12] is Qo in component TempRLC (UnitQ).
 * CONSTANTS[78] is Rpat in component ParaPul (UnitR).
 * CONSTANTS[79] is Cpat in component ParaPul (UnitC).
 * CONSTANTS[80] is Lpat in component ParaPul (UnitL).
 * CONSTANTS[81] is P0pat in component ParaPul (UnitP).
 * CONSTANTS[82] is Q0pat in component ParaPul (UnitQ).
 * ALGEBRAIC[29] is Pi in component TempR (UnitP).
 * ALGEBRAIC[24] is Qo in component TempR (UnitQ).
 * CONSTANTS[83] is Rpar in component ParaPul (UnitR).
 * STATES[13] is Pi in component TempRC (UnitP).
 * ALGEBRAIC[26] is Qo in component TempR (UnitQ).
 * CONSTANTS[84] is Rpcp in component ParaPul (UnitR).
 * CONSTANTS[85] is Rpvn in component ParaPul (UnitR).
 * CONSTANTS[86] is Cpvn in component ParaPul (UnitC).
 * CONSTANTS[87] is P0pvn in component ParaPul (UnitP).
 * RATES[2] is d/dt V in component TempCDv (UnitV).
 * RATES[3] is d/dt V in component TempCDa (UnitV).
 * RATES[4] is d/dt V in component TempCDv (UnitV).
 * RATES[5] is d/dt V in component TempCDa (UnitV).
 * RATES[0] is d/dt Pi in component TempRLC (UnitP).
 * RATES[7] is d/dt Qo in component TempRLC (UnitQ).
 * RATES[6] is d/dt Pi in component TempRLC (UnitP).
 * RATES[8] is d/dt Qo in component TempRLC (UnitQ).
 * RATES[9] is d/dt Pi in component TempRC (UnitP).
 * RATES[1] is d/dt Pi in component TempRLC (UnitP).
 * RATES[11] is d/dt Qo in component TempRLC (UnitQ).
 * RATES[10] is d/dt Pi in component TempRLC (UnitP).
 * RATES[12] is d/dt Qo in component TempRLC (UnitQ).
 * RATES[13] is d/dt Pi in component TempRC (UnitP).
 */
void
initConsts(double* CONSTANTS, double* RATES, double *STATES)
{
CONSTANTS[0] = 350.;
CONSTANTS[1] = 1.0;
CONSTANTS[2] = 5.0;
CONSTANTS[3] = 500;
CONSTANTS[4] = 400.;
CONSTANTS[5] = 1.0;
CONSTANTS[6] = 4.0;
CONSTANTS[7] = 20;
CONSTANTS[8] = 2.5;
CONSTANTS[9] = 0.1;
CONSTANTS[10] = 1.0;
CONSTANTS[11] = 0.3;
CONSTANTS[12] = 0.45;
CONSTANTS[13] = 0.25;
CONSTANTS[14] = 0.15;
CONSTANTS[15] = 0.92;
CONSTANTS[16] = 0.09;
CONSTANTS[17] = 0.25;
CONSTANTS[18] = 0.15;
CONSTANTS[19] = 1.0;
CONSTANTS[20] = 4.0;
CONSTANTS[21] = 1.15;
CONSTANTS[22] = 0.1;
CONSTANTS[23] = 1.0;
CONSTANTS[24] = 10.0;
CONSTANTS[25] = 350.;
CONSTANTS[26] = 400.;
CONSTANTS[27] = 20;
CONSTANTS[28] = 500;
CONSTANTS[29] = 350.;
CONSTANTS[30] = 1.0;
CONSTANTS[31] = 10.0;
CONSTANTS[32] = 500;
CONSTANTS[33] = 400.;
CONSTANTS[34] = 1.0;
CONSTANTS[35] = 4.0;
CONSTANTS[36] = 20;
CONSTANTS[37] = 1.15;
CONSTANTS[38] = 0.1;
CONSTANTS[39] = 1.0;
CONSTANTS[40] = 0.3;
CONSTANTS[41] = 0.45;
CONSTANTS[42] = 0.25;
CONSTANTS[43] = 0.15;
CONSTANTS[44] = 0.92;
CONSTANTS[45] = 0.09;
CONSTANTS[46] = 0.25;
CONSTANTS[47] = 0.15;
CONSTANTS[48] = 1.0;
CONSTANTS[49] = 4.0;
CONSTANTS[50] = 2.5;
CONSTANTS[51] = 0.1;
CONSTANTS[52] = 1.0;
CONSTANTS[53] = 5.0;
CONSTANTS[54] = 350.;
CONSTANTS[55] = 400.;
CONSTANTS[56] = 500;
CONSTANTS[57] = 20;
CONSTANTS[58] = 0.003;
CONSTANTS[59] = 0.08;
CONSTANTS[60] = 0.000062;
CONSTANTS[61] = 100.;
CONSTANTS[62] = 0.;
CONSTANTS[63] = 0.05;
CONSTANTS[64] = 1.6;
CONSTANTS[65] = 0.0017;
CONSTANTS[66] = 100.;
CONSTANTS[67] = 0.;
CONSTANTS[68] = 0.5;
CONSTANTS[69] = 0.52;
CONSTANTS[70] = 0.075;
CONSTANTS[71] = 20.5;
CONSTANTS[72] = 0.;
CONSTANTS[73] = 0.002;
CONSTANTS[74] = 0.18;
CONSTANTS[75] = 0.000052;
CONSTANTS[76] = 30.;
CONSTANTS[77] = 0.;
CONSTANTS[78] = 0.01;
CONSTANTS[79] = 3.8;
CONSTANTS[80] = 0.0017;
CONSTANTS[81] = 30.;
CONSTANTS[82] = 0.;
CONSTANTS[83] = 0.05;
CONSTANTS[84] = 0.25;
CONSTANTS[85] = 0.0006;
CONSTANTS[86] = 20.5;
CONSTANTS[87] = 0.;
STATES[0] = CONSTANTS[61];
STATES[1] = CONSTANTS[76];
STATES[2] = CONSTANTS[3];
STATES[3] = CONSTANTS[7];
STATES[4] = CONSTANTS[32];
STATES[5] = CONSTANTS[36];
STATES[6] = CONSTANTS[66];
STATES[7] = CONSTANTS[62];
STATES[8] = CONSTANTS[67];
STATES[9] = CONSTANTS[72];
STATES[10] = CONSTANTS[81];
STATES[11] = CONSTANTS[77];
STATES[12] = CONSTANTS[82];
STATES[13] = CONSTANTS[87];
}
void
computeRates(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
RATES[7] = ((STATES[0] - STATES[6]) -  CONSTANTS[58]*STATES[7])/CONSTANTS[60];
RATES[6] = (STATES[7] - STATES[8])/CONSTANTS[64];
RATES[11] = ((STATES[1] - STATES[10]) -  CONSTANTS[73]*STATES[11])/CONSTANTS[75];
RATES[10] = (STATES[11] - STATES[12])/CONSTANTS[79];
ALGEBRAIC[0] = VOI -  CONSTANTS[10]*floor(VOI/CONSTANTS[10]);
ALGEBRAIC[2] = (ALGEBRAIC[0]>=0.00000&&ALGEBRAIC[0]<= CONSTANTS[11]*CONSTANTS[10] ? 1.00000 - cos(( 3.14159*ALGEBRAIC[0])/( CONSTANTS[11]*CONSTANTS[10])) : ALGEBRAIC[0]> CONSTANTS[11]*CONSTANTS[10]&&ALGEBRAIC[0]<= CONSTANTS[12]*CONSTANTS[10] ? 1.00000+cos(( 3.14159*(ALGEBRAIC[0] -  CONSTANTS[11]*CONSTANTS[10]))/( (CONSTANTS[12] - CONSTANTS[11])*CONSTANTS[10])) : ALGEBRAIC[0]> CONSTANTS[12]*CONSTANTS[10]&&ALGEBRAIC[0]<CONSTANTS[10] ? 0.00000 : 0.0/0.0);
ALGEBRAIC[4] = CONSTANTS[9]+( ALGEBRAIC[2]*(CONSTANTS[8] - CONSTANTS[9]))/2.00000;
ALGEBRAIC[6] = CONSTANTS[1]+ ALGEBRAIC[4]*(STATES[2] - CONSTANTS[2]);
ALGEBRAIC[8] = (ALGEBRAIC[6]>=STATES[0] ? 1.00000 : ALGEBRAIC[6]<STATES[0] ? 0.00000 : 0.0/0.0);
ALGEBRAIC[10] = (ALGEBRAIC[6]>=STATES[0] ?  CONSTANTS[0]*ALGEBRAIC[8]*pow(fabs(ALGEBRAIC[6] - STATES[0]), 0.500000) : ALGEBRAIC[6]<STATES[0] ?  -1.00000*CONSTANTS[0]*ALGEBRAIC[8]*pow(fabs(STATES[0] - ALGEBRAIC[6]), 0.500000) : 0.0/0.0);
RATES[0] = (ALGEBRAIC[10] - STATES[7])/CONSTANTS[59];
ALGEBRAIC[1] = VOI -  CONSTANTS[39]*floor(VOI/CONSTANTS[39]);
ALGEBRAIC[3] = (ALGEBRAIC[1]>=0.00000&&ALGEBRAIC[1]<= CONSTANTS[40]*CONSTANTS[39] ? 1.00000 - cos(( 3.14159*ALGEBRAIC[1])/( CONSTANTS[40]*CONSTANTS[39])) : ALGEBRAIC[1]> CONSTANTS[40]*CONSTANTS[39]&&ALGEBRAIC[1]<= CONSTANTS[41]*CONSTANTS[39] ? 1.00000+cos(( 3.14159*(ALGEBRAIC[1] -  CONSTANTS[40]*CONSTANTS[39]))/( (CONSTANTS[41] - CONSTANTS[40])*CONSTANTS[39])) : ALGEBRAIC[1]> CONSTANTS[41]*CONSTANTS[39]&&ALGEBRAIC[1]<CONSTANTS[39] ? 0.00000 : 0.0/0.0);
ALGEBRAIC[5] = CONSTANTS[38]+( ALGEBRAIC[3]*(CONSTANTS[37] - CONSTANTS[38]))/2.00000;
ALGEBRAIC[7] = CONSTANTS[30]+ ALGEBRAIC[5]*(STATES[4] - CONSTANTS[31]);
ALGEBRAIC[9] = (ALGEBRAIC[7]>=STATES[1] ? 1.00000 : ALGEBRAIC[7]<STATES[1] ? 0.00000 : 0.0/0.0);
ALGEBRAIC[11] = (ALGEBRAIC[7]>=STATES[1] ?  CONSTANTS[29]*ALGEBRAIC[9]*pow(fabs(ALGEBRAIC[7] - STATES[1]), 0.500000) : ALGEBRAIC[7]<STATES[1] ?  -1.00000*CONSTANTS[29]*ALGEBRAIC[9]*pow(fabs(STATES[1] - ALGEBRAIC[7]), 0.500000) : 0.0/0.0);
RATES[1] = (ALGEBRAIC[11] - STATES[11])/CONSTANTS[74];
ALGEBRAIC[12] = VOI -  CONSTANTS[10]*floor(VOI/CONSTANTS[10]);
ALGEBRAIC[14] = (ALGEBRAIC[12]>=0.00000&&ALGEBRAIC[12]<= (CONSTANTS[15]+CONSTANTS[16])*CONSTANTS[10] - CONSTANTS[10] ? 1.00000 - cos(( 2.00000*3.14159*((ALGEBRAIC[12] -  CONSTANTS[15]*CONSTANTS[10])+CONSTANTS[10]))/( CONSTANTS[16]*CONSTANTS[10])) : ALGEBRAIC[12]> (CONSTANTS[15]+CONSTANTS[16])*CONSTANTS[10] - CONSTANTS[10]&&ALGEBRAIC[12]<= CONSTANTS[15]*CONSTANTS[10] ? 0.00000 : ALGEBRAIC[12]> CONSTANTS[15]*CONSTANTS[10]&&ALGEBRAIC[12]<=CONSTANTS[10] ? 1.00000 - cos(( 2.00000*3.14159*(ALGEBRAIC[12] -  CONSTANTS[15]*CONSTANTS[10]))/( CONSTANTS[16]*CONSTANTS[10])) : 0.0/0.0);
ALGEBRAIC[16] = CONSTANTS[14]+( ALGEBRAIC[14]*(CONSTANTS[13] - CONSTANTS[14]))/2.00000;
ALGEBRAIC[18] = CONSTANTS[5]+ ALGEBRAIC[16]*(STATES[3] - CONSTANTS[6]);
ALGEBRAIC[20] = (ALGEBRAIC[18]>=ALGEBRAIC[6] ? 1.00000 : ALGEBRAIC[18]<ALGEBRAIC[6] ? 0.00000 : 0.0/0.0);
ALGEBRAIC[22] = (ALGEBRAIC[18]>=ALGEBRAIC[6] ?  CONSTANTS[4]*ALGEBRAIC[20]*pow(fabs(ALGEBRAIC[18] - ALGEBRAIC[6]), 0.500000) : ALGEBRAIC[18]<ALGEBRAIC[6] ?  -1.00000*CONSTANTS[4]*ALGEBRAIC[20]*pow(fabs(ALGEBRAIC[6] - ALGEBRAIC[18]), 0.500000) : 0.0/0.0);
RATES[2] = ALGEBRAIC[22] - ALGEBRAIC[10];
ALGEBRAIC[13] = VOI -  CONSTANTS[39]*floor(VOI/CONSTANTS[39]);
ALGEBRAIC[15] = (ALGEBRAIC[13]>=0.00000&&ALGEBRAIC[13]<= (CONSTANTS[44]+CONSTANTS[45])*CONSTANTS[39] - CONSTANTS[39] ? 1.00000 - cos(( 2.00000*3.14159*((ALGEBRAIC[13] -  CONSTANTS[44]*CONSTANTS[39])+CONSTANTS[39]))/( CONSTANTS[45]*CONSTANTS[39])) : ALGEBRAIC[13]> (CONSTANTS[44]+CONSTANTS[45])*CONSTANTS[39] - CONSTANTS[39]&&ALGEBRAIC[13]<= CONSTANTS[44]*CONSTANTS[39] ? 0.00000 : ALGEBRAIC[13]> CONSTANTS[44]*CONSTANTS[39]&&ALGEBRAIC[13]<=CONSTANTS[39] ? 1.00000 - cos(( 2.00000*3.14159*(ALGEBRAIC[13] -  CONSTANTS[44]*CONSTANTS[39]))/( CONSTANTS[45]*CONSTANTS[39])) : 0.0/0.0);
ALGEBRAIC[17] = CONSTANTS[43]+( ALGEBRAIC[15]*(CONSTANTS[42] - CONSTANTS[43]))/2.00000;
ALGEBRAIC[19] = CONSTANTS[34]+ ALGEBRAIC[17]*(STATES[5] - CONSTANTS[35]);
ALGEBRAIC[21] = (ALGEBRAIC[19]>=ALGEBRAIC[7] ? 1.00000 : ALGEBRAIC[19]<ALGEBRAIC[7] ? 0.00000 : 0.0/0.0);
ALGEBRAIC[23] = (ALGEBRAIC[19]>=ALGEBRAIC[7] ?  CONSTANTS[33]*ALGEBRAIC[21]*pow(fabs(ALGEBRAIC[19] - ALGEBRAIC[7]), 0.500000) : ALGEBRAIC[19]<ALGEBRAIC[7] ?  -1.00000*CONSTANTS[33]*ALGEBRAIC[21]*pow(fabs(ALGEBRAIC[7] - ALGEBRAIC[19]), 0.500000) : 0.0/0.0);
RATES[4] = ALGEBRAIC[23] - ALGEBRAIC[11];
ALGEBRAIC[30] = (STATES[13] - ALGEBRAIC[18])/CONSTANTS[85];
RATES[3] = ALGEBRAIC[30] - ALGEBRAIC[22];
ALGEBRAIC[31] = (STATES[9] - ALGEBRAIC[19])/CONSTANTS[70];
RATES[5] = ALGEBRAIC[31] - ALGEBRAIC[23];
ALGEBRAIC[25] = STATES[8];
ALGEBRAIC[28] = STATES[9]+ CONSTANTS[69]*ALGEBRAIC[25];
ALGEBRAIC[32] = ALGEBRAIC[28]+ CONSTANTS[68]*STATES[8];
RATES[8] = ((STATES[6] - ALGEBRAIC[32]) -  CONSTANTS[63]*STATES[8])/CONSTANTS[65];
ALGEBRAIC[27] = ALGEBRAIC[25];
RATES[9] = (ALGEBRAIC[27] - ALGEBRAIC[31])/CONSTANTS[71];
ALGEBRAIC[24] = STATES[12];
ALGEBRAIC[29] = STATES[13]+ CONSTANTS[84]*ALGEBRAIC[24];
ALGEBRAIC[33] = ALGEBRAIC[29]+ CONSTANTS[83]*STATES[12];
RATES[12] = ((STATES[10] - ALGEBRAIC[33]) -  CONSTANTS[78]*STATES[12])/CONSTANTS[80];
ALGEBRAIC[26] = ALGEBRAIC[24];
RATES[13] = (ALGEBRAIC[26] - ALGEBRAIC[30])/CONSTANTS[86];
}
void
computeVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
ALGEBRAIC[0] = VOI -  CONSTANTS[10]*floor(VOI/CONSTANTS[10]);
ALGEBRAIC[2] = (ALGEBRAIC[0]>=0.00000&&ALGEBRAIC[0]<= CONSTANTS[11]*CONSTANTS[10] ? 1.00000 - cos(( 3.14159*ALGEBRAIC[0])/( CONSTANTS[11]*CONSTANTS[10])) : ALGEBRAIC[0]> CONSTANTS[11]*CONSTANTS[10]&&ALGEBRAIC[0]<= CONSTANTS[12]*CONSTANTS[10] ? 1.00000+cos(( 3.14159*(ALGEBRAIC[0] -  CONSTANTS[11]*CONSTANTS[10]))/( (CONSTANTS[12] - CONSTANTS[11])*CONSTANTS[10])) : ALGEBRAIC[0]> CONSTANTS[12]*CONSTANTS[10]&&ALGEBRAIC[0]<CONSTANTS[10] ? 0.00000 : 0.0/0.0);
ALGEBRAIC[4] = CONSTANTS[9]+( ALGEBRAIC[2]*(CONSTANTS[8] - CONSTANTS[9]))/2.00000;
ALGEBRAIC[6] = CONSTANTS[1]+ ALGEBRAIC[4]*(STATES[2] - CONSTANTS[2]);
ALGEBRAIC[8] = (ALGEBRAIC[6]>=STATES[0] ? 1.00000 : ALGEBRAIC[6]<STATES[0] ? 0.00000 : 0.0/0.0);
ALGEBRAIC[10] = (ALGEBRAIC[6]>=STATES[0] ?  CONSTANTS[0]*ALGEBRAIC[8]*pow(fabs(ALGEBRAIC[6] - STATES[0]), 0.500000) : ALGEBRAIC[6]<STATES[0] ?  -1.00000*CONSTANTS[0]*ALGEBRAIC[8]*pow(fabs(STATES[0] - ALGEBRAIC[6]), 0.500000) : 0.0/0.0);
ALGEBRAIC[1] = VOI -  CONSTANTS[39]*floor(VOI/CONSTANTS[39]);
ALGEBRAIC[3] = (ALGEBRAIC[1]>=0.00000&&ALGEBRAIC[1]<= CONSTANTS[40]*CONSTANTS[39] ? 1.00000 - cos(( 3.14159*ALGEBRAIC[1])/( CONSTANTS[40]*CONSTANTS[39])) : ALGEBRAIC[1]> CONSTANTS[40]*CONSTANTS[39]&&ALGEBRAIC[1]<= CONSTANTS[41]*CONSTANTS[39] ? 1.00000+cos(( 3.14159*(ALGEBRAIC[1] -  CONSTANTS[40]*CONSTANTS[39]))/( (CONSTANTS[41] - CONSTANTS[40])*CONSTANTS[39])) : ALGEBRAIC[1]> CONSTANTS[41]*CONSTANTS[39]&&ALGEBRAIC[1]<CONSTANTS[39] ? 0.00000 : 0.0/0.0);
ALGEBRAIC[5] = CONSTANTS[38]+( ALGEBRAIC[3]*(CONSTANTS[37] - CONSTANTS[38]))/2.00000;
ALGEBRAIC[7] = CONSTANTS[30]+ ALGEBRAIC[5]*(STATES[4] - CONSTANTS[31]);
ALGEBRAIC[9] = (ALGEBRAIC[7]>=STATES[1] ? 1.00000 : ALGEBRAIC[7]<STATES[1] ? 0.00000 : 0.0/0.0);
ALGEBRAIC[11] = (ALGEBRAIC[7]>=STATES[1] ?  CONSTANTS[29]*ALGEBRAIC[9]*pow(fabs(ALGEBRAIC[7] - STATES[1]), 0.500000) : ALGEBRAIC[7]<STATES[1] ?  -1.00000*CONSTANTS[29]*ALGEBRAIC[9]*pow(fabs(STATES[1] - ALGEBRAIC[7]), 0.500000) : 0.0/0.0);
ALGEBRAIC[12] = VOI -  CONSTANTS[10]*floor(VOI/CONSTANTS[10]);
ALGEBRAIC[14] = (ALGEBRAIC[12]>=0.00000&&ALGEBRAIC[12]<= (CONSTANTS[15]+CONSTANTS[16])*CONSTANTS[10] - CONSTANTS[10] ? 1.00000 - cos(( 2.00000*3.14159*((ALGEBRAIC[12] -  CONSTANTS[15]*CONSTANTS[10])+CONSTANTS[10]))/( CONSTANTS[16]*CONSTANTS[10])) : ALGEBRAIC[12]> (CONSTANTS[15]+CONSTANTS[16])*CONSTANTS[10] - CONSTANTS[10]&&ALGEBRAIC[12]<= CONSTANTS[15]*CONSTANTS[10] ? 0.00000 : ALGEBRAIC[12]> CONSTANTS[15]*CONSTANTS[10]&&ALGEBRAIC[12]<=CONSTANTS[10] ? 1.00000 - cos(( 2.00000*3.14159*(ALGEBRAIC[12] -  CONSTANTS[15]*CONSTANTS[10]))/( CONSTANTS[16]*CONSTANTS[10])) : 0.0/0.0);
ALGEBRAIC[16] = CONSTANTS[14]+( ALGEBRAIC[14]*(CONSTANTS[13] - CONSTANTS[14]))/2.00000;
ALGEBRAIC[18] = CONSTANTS[5]+ ALGEBRAIC[16]*(STATES[3] - CONSTANTS[6]);
ALGEBRAIC[20] = (ALGEBRAIC[18]>=ALGEBRAIC[6] ? 1.00000 : ALGEBRAIC[18]<ALGEBRAIC[6] ? 0.00000 : 0.0/0.0);
ALGEBRAIC[22] = (ALGEBRAIC[18]>=ALGEBRAIC[6] ?  CONSTANTS[4]*ALGEBRAIC[20]*pow(fabs(ALGEBRAIC[18] - ALGEBRAIC[6]), 0.500000) : ALGEBRAIC[18]<ALGEBRAIC[6] ?  -1.00000*CONSTANTS[4]*ALGEBRAIC[20]*pow(fabs(ALGEBRAIC[6] - ALGEBRAIC[18]), 0.500000) : 0.0/0.0);
ALGEBRAIC[13] = VOI -  CONSTANTS[39]*floor(VOI/CONSTANTS[39]);
ALGEBRAIC[15] = (ALGEBRAIC[13]>=0.00000&&ALGEBRAIC[13]<= (CONSTANTS[44]+CONSTANTS[45])*CONSTANTS[39] - CONSTANTS[39] ? 1.00000 - cos(( 2.00000*3.14159*((ALGEBRAIC[13] -  CONSTANTS[44]*CONSTANTS[39])+CONSTANTS[39]))/( CONSTANTS[45]*CONSTANTS[39])) : ALGEBRAIC[13]> (CONSTANTS[44]+CONSTANTS[45])*CONSTANTS[39] - CONSTANTS[39]&&ALGEBRAIC[13]<= CONSTANTS[44]*CONSTANTS[39] ? 0.00000 : ALGEBRAIC[13]> CONSTANTS[44]*CONSTANTS[39]&&ALGEBRAIC[13]<=CONSTANTS[39] ? 1.00000 - cos(( 2.00000*3.14159*(ALGEBRAIC[13] -  CONSTANTS[44]*CONSTANTS[39]))/( CONSTANTS[45]*CONSTANTS[39])) : 0.0/0.0);
ALGEBRAIC[17] = CONSTANTS[43]+( ALGEBRAIC[15]*(CONSTANTS[42] - CONSTANTS[43]))/2.00000;
ALGEBRAIC[19] = CONSTANTS[34]+ ALGEBRAIC[17]*(STATES[5] - CONSTANTS[35]);
ALGEBRAIC[21] = (ALGEBRAIC[19]>=ALGEBRAIC[7] ? 1.00000 : ALGEBRAIC[19]<ALGEBRAIC[7] ? 0.00000 : 0.0/0.0);
ALGEBRAIC[23] = (ALGEBRAIC[19]>=ALGEBRAIC[7] ?  CONSTANTS[33]*ALGEBRAIC[21]*pow(fabs(ALGEBRAIC[19] - ALGEBRAIC[7]), 0.500000) : ALGEBRAIC[19]<ALGEBRAIC[7] ?  -1.00000*CONSTANTS[33]*ALGEBRAIC[21]*pow(fabs(ALGEBRAIC[7] - ALGEBRAIC[19]), 0.500000) : 0.0/0.0);
ALGEBRAIC[30] = (STATES[13] - ALGEBRAIC[18])/CONSTANTS[85];
ALGEBRAIC[31] = (STATES[9] - ALGEBRAIC[19])/CONSTANTS[70];
ALGEBRAIC[25] = STATES[8];
ALGEBRAIC[28] = STATES[9]+ CONSTANTS[69]*ALGEBRAIC[25];
ALGEBRAIC[32] = ALGEBRAIC[28]+ CONSTANTS[68]*STATES[8];
ALGEBRAIC[27] = ALGEBRAIC[25];
ALGEBRAIC[24] = STATES[12];
ALGEBRAIC[29] = STATES[13]+ CONSTANTS[84]*ALGEBRAIC[24];
ALGEBRAIC[33] = ALGEBRAIC[29]+ CONSTANTS[83]*STATES[12];
ALGEBRAIC[26] = ALGEBRAIC[24];
}