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 17 entries in the algebraic variable array.
   There are a total of 10 entries in each of the rate and state variable arrays.
   There are a total of 19 entries in the constant variable array.
 */
/*
 * VOI is time in component environment (second).
 * STATES[0] is C_6PG in component C_6PG (millimolar).
 * CONSTANTS[0] is mu in component model_constants (per_hour).
 * ALGEBRAIC[3] is rG6PDH in component rG6PDH (flux).
 * ALGEBRAIC[9] is r6PGDH in component r6PGDH (flux).
 * STATES[1] is C_Ru5P in component C_Ru5P (millimolar).
 * ALGEBRAIC[11] is rRu5PE in component rRu5PE (flux).
 * ALGEBRAIC[10] is rR5PI in component rR5PI (flux).
 * STATES[2] is C_R5P in component C_R5P (millimolar).
 * ALGEBRAIC[12] is rTKL1 in component rTKL1 (flux).
 * ALGEBRAIC[13] is rRPPK in component rRPPK (flux).
 * STATES[3] is C_X5P in component C_X5P (millimolar).
 * ALGEBRAIC[15] is rTKL2 in component rTKL2 (flux).
 * STATES[4] is C_S7P in component C_S7P (millimolar).
 * ALGEBRAIC[14] is rTAL in component rTAL (flux).
 * STATES[5] is C_E4P in component C_E4P (millimolar).
 * ALGEBRAIC[16] is rPKDA in component rPKDA (flux).
 * STATES[6] is C_G6P in component C_G6P (millimolar).
 * ALGEBRAIC[0] is dC_G6P_dt in component C_G6P (flux).
 * STATES[7] is C_NADP in component C_NADP (millimolar).
 * STATES[8] is C_NADPH in component C_NADPH (millimolar).
 * STATES[9] is C_MgATP in component C_MgATP (millimolar).
 * CONSTANTS[1] is K_NADP_1 in component rG6PDH (millimolar).
 * CONSTANTS[2] is Ki_NADPH_1 in component rG6PDH (millimolar).
 * CONSTANTS[3] is Ki_MgATP_1 in component rG6PDH (millimolar).
 * ALGEBRAIC[1] is I_NADPH_1 in component rG6PDH (dimensionless).
 * ALGEBRAIC[2] is I_MgATP_1 in component rG6PDH (dimensionless).
 * CONSTANTS[4] is rmax_G6PDH in component rG6PDH (flux).
 * CONSTANTS[5] is K_NADP_2 in component r6PGDH (millimolar).
 * CONSTANTS[6] is Ki_NADPH_2 in component r6PGDH (millimolar).
 * CONSTANTS[7] is Ki_MgATP_2 in component r6PGDH (millimolar).
 * ALGEBRAIC[4] is I_NADPH_2 in component r6PGDH (dimensionless).
 * ALGEBRAIC[6] is I_MgATP_2 in component r6PGDH (dimensionless).
 * CONSTANTS[8] is rmax_6PGDH in component r6PGDH (flux).
 * CONSTANTS[9] is rmax_R5PI in component rR5PI (millimole_per_second).
 * CONSTANTS[10] is rmax_Ru5PE in component rRu5PE (millimole_per_second).
 * CONSTANTS[11] is rmax_TKL1 in component rTKL1 (millimole_per_second).
 * CONSTANTS[12] is C_GAP in component model_constants (millimolar).
 * CONSTANTS[13] is rmax_TAL in component rTAL (millimole_per_second).
 * CONSTANTS[14] is rmax_TKL2 in component rTKL2 (millimole_per_second).
 * CONSTANTS[15] is K_PKDA in component rPKDA (millimolar).
 * CONSTANTS[16] is rmax_PKDA in component rPKDA (millimole_per_second).
 * CONSTANTS[17] is K_RPPK in component rRPPK (millimolar).
 * CONSTANTS[18] is rmax_RPPK in component rRPPK (millimole_per_second).
 * ALGEBRAIC[7] is rHK in component rHK (flux).
 * ALGEBRAIC[5] is qs in component model_constants (flux).
 * ALGEBRAIC[8] is rPGI in component rPGI (flux).
 * RATES[0] is d/dt C_6PG in component C_6PG (millimolar).
 * RATES[1] is d/dt C_Ru5P in component C_Ru5P (millimolar).
 * RATES[2] is d/dt C_R5P in component C_R5P (millimolar).
 * RATES[3] is d/dt C_X5P in component C_X5P (millimolar).
 * RATES[4] is d/dt C_S7P in component C_S7P (millimolar).
 * RATES[5] is d/dt C_E4P in component C_E4P (millimolar).
 * RATES[6] is d/dt C_G6P in component C_G6P (millimolar).
 * RATES[7] is d/dt C_NADP in component C_NADP (millimolar).
 * RATES[8] is d/dt C_NADPH in component C_NADPH (millimolar).
 * RATES[9] is d/dt C_MgATP in component C_MgATP (millimolar).
 */
void
initConsts(double* CONSTANTS, double* RATES, double *STATES)
{
STATES[0] = 0.25;
CONSTANTS[0] = 1.0;
STATES[1] = 0.033;
STATES[2] = 0.118;
STATES[3] = 0.041;
STATES[4] = 0.082;
STATES[5] = 0.029;
STATES[6] = 0.9;
STATES[7] = 0.168;
STATES[8] = 0.168;
STATES[9] = 2.3;
CONSTANTS[1] = 0.116;
CONSTANTS[2] = 1.702;
CONSTANTS[3] = 0.33;
CONSTANTS[4] = 44.19;
CONSTANTS[5] = 1.848;
CONSTANTS[6] = 0.055;
CONSTANTS[7] = 0.109;
CONSTANTS[8] = 0.654;
CONSTANTS[9] = 0.57;
CONSTANTS[10] = 0.85;
CONSTANTS[11] = 3.24;
CONSTANTS[12] = 0.064;
CONSTANTS[13] = 3.0;
CONSTANTS[14] = 10.5;
CONSTANTS[15] = 0.0032;
CONSTANTS[16] = 0.004;
CONSTANTS[17] = 0.0034;
CONSTANTS[18] = 0.003;
}
void
computeRates(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
RATES[7] = -1.48000/(9.17000+ 16.1000*VOI+ 0.480000*pow(VOI, 2.00000))+ (( 1.48000*VOI)/( (9.17000+ 16.1000*VOI+ 0.480000*pow(VOI, 2.00000))*(9.17000+ 16.1000*VOI+ 0.480000*pow(VOI, 2.00000))))*(16.1000+ 0.960000*VOI);
RATES[8] = 0.516000/(25.3900+ 0.370000*VOI+ 0.500000*pow(VOI, 2.00000)) -  (( 0.516000*VOI)/( (25.3900+ 0.370000*VOI+ 0.500000*pow(VOI, 2.00000))*(25.3900+ 0.370000*VOI+ 0.500000*pow(VOI, 2.00000))))*(0.370000+ 1.00000*VOI);
RATES[9] = 29.8300/(29.7700+ 13.4200*VOI+ 0.0500000*pow(VOI, 2.00000)) -  (( 29.8300*VOI)/( (29.7700+ 13.4200*VOI+ 0.0500000*pow(VOI, 2.00000))*(29.7700+ 13.4200*VOI+ 0.0500000*pow(VOI, 2.00000))))*(13.4200+ 0.100000*VOI);
ALGEBRAIC[0] = 44.1000/(48.0000+ 1.00000*VOI+ 0.450000*pow(VOI, 2.00000))+ (( 44.1000*VOI)/( (48.0000+ 1.00000*VOI+ 0.450000*pow(VOI, 2.00000))*(48.0000+ 1.00000*VOI+ 0.450000*pow(VOI, 2.00000))))*(1.00000+ 0.900000*VOI);
RATES[6] = ALGEBRAIC[0];
ALGEBRAIC[1] = 1.00000+STATES[8]/CONSTANTS[2];
ALGEBRAIC[2] = 1.00000+STATES[9]/CONSTANTS[3];
ALGEBRAIC[3] =  CONSTANTS[4]*(STATES[7]/( (STATES[7]+ CONSTANTS[1]*ALGEBRAIC[1])*ALGEBRAIC[2]));
ALGEBRAIC[4] = 1.00000+STATES[8]/CONSTANTS[6];
ALGEBRAIC[6] = 1.00000+STATES[9]/CONSTANTS[7];
ALGEBRAIC[9] =  CONSTANTS[8]*(STATES[7]/( (STATES[7]+ CONSTANTS[5]*ALGEBRAIC[4])*ALGEBRAIC[6]));
RATES[0] = ALGEBRAIC[3] - (ALGEBRAIC[9]+ CONSTANTS[0]*STATES[0]);
ALGEBRAIC[11] =  1.00000*CONSTANTS[10]*STATES[1];
ALGEBRAIC[10] =  1.00000*CONSTANTS[9]*STATES[1];
RATES[1] = ALGEBRAIC[9] - (ALGEBRAIC[10]+ALGEBRAIC[11]+ CONSTANTS[0]*STATES[1]);
ALGEBRAIC[12] =  1.00000*CONSTANTS[11]*STATES[3]*STATES[2];
ALGEBRAIC[13] =  1.00000*CONSTANTS[18]*(STATES[2]/(STATES[2]+CONSTANTS[17]));
RATES[2] = ALGEBRAIC[10] - (ALGEBRAIC[12]+ALGEBRAIC[13]+ CONSTANTS[0]*STATES[2]);
ALGEBRAIC[14] =  1.00000*CONSTANTS[13]*CONSTANTS[12]*STATES[4];
RATES[4] = ALGEBRAIC[12] - (ALGEBRAIC[14]+ CONSTANTS[0]*STATES[4]);
ALGEBRAIC[15] =  1.00000*CONSTANTS[14]*STATES[5]*STATES[3];
RATES[3] = ALGEBRAIC[11] - (ALGEBRAIC[12]+ALGEBRAIC[15]+ CONSTANTS[0]*STATES[3]);
ALGEBRAIC[16] =  1.00000*CONSTANTS[16]*(STATES[5]/(STATES[5]+CONSTANTS[15]));
RATES[5] = ALGEBRAIC[14] - (ALGEBRAIC[15]+ALGEBRAIC[16]+ CONSTANTS[0]*STATES[5]);
}
void
computeVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
ALGEBRAIC[0] = 44.1000/(48.0000+ 1.00000*VOI+ 0.450000*pow(VOI, 2.00000))+ (( 44.1000*VOI)/( (48.0000+ 1.00000*VOI+ 0.450000*pow(VOI, 2.00000))*(48.0000+ 1.00000*VOI+ 0.450000*pow(VOI, 2.00000))))*(1.00000+ 0.900000*VOI);
ALGEBRAIC[1] = 1.00000+STATES[8]/CONSTANTS[2];
ALGEBRAIC[2] = 1.00000+STATES[9]/CONSTANTS[3];
ALGEBRAIC[3] =  CONSTANTS[4]*(STATES[7]/( (STATES[7]+ CONSTANTS[1]*ALGEBRAIC[1])*ALGEBRAIC[2]));
ALGEBRAIC[4] = 1.00000+STATES[8]/CONSTANTS[6];
ALGEBRAIC[6] = 1.00000+STATES[9]/CONSTANTS[7];
ALGEBRAIC[9] =  CONSTANTS[8]*(STATES[7]/( (STATES[7]+ CONSTANTS[5]*ALGEBRAIC[4])*ALGEBRAIC[6]));
ALGEBRAIC[11] =  1.00000*CONSTANTS[10]*STATES[1];
ALGEBRAIC[10] =  1.00000*CONSTANTS[9]*STATES[1];
ALGEBRAIC[12] =  1.00000*CONSTANTS[11]*STATES[3]*STATES[2];
ALGEBRAIC[13] =  1.00000*CONSTANTS[18]*(STATES[2]/(STATES[2]+CONSTANTS[17]));
ALGEBRAIC[14] =  1.00000*CONSTANTS[13]*CONSTANTS[12]*STATES[4];
ALGEBRAIC[15] =  1.00000*CONSTANTS[14]*STATES[5]*STATES[3];
ALGEBRAIC[16] =  1.00000*CONSTANTS[16]*(STATES[5]/(STATES[5]+CONSTANTS[15]));
ALGEBRAIC[5] = (VOI<0.00000 ? 0.131000 : 0.546000);
ALGEBRAIC[7] = ALGEBRAIC[5];
ALGEBRAIC[8] = ALGEBRAIC[5] - (ALGEBRAIC[3]+ CONSTANTS[0]*STATES[6]+ALGEBRAIC[0]);
}