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 13 entries in the algebraic variable array.
   There are a total of 9 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 (minute).
 * STATES[0] is S1 in component S1 (millimolar).
 * CONSTANTS[0] is Jo in component glucose_influx_rate (flux).
 * ALGEBRAIC[3] is v1 in component v1 (flux).
 * STATES[1] is S2 in component S2 (millimolar).
 * ALGEBRAIC[4] is v2 in component v2 (flux).
 * STATES[2] is S3 in component S3 (millimolar).
 * ALGEBRAIC[5] is v3 in component v3 (flux).
 * ALGEBRAIC[10] is v8 in component v8 (flux).
 * STATES[3] is S4 in component S4 (millimolar).
 * ALGEBRAIC[6] is v4 in component v4 (flux).
 * STATES[4] is S5 in component S5 (millimolar).
 * ALGEBRAIC[7] is v5 in component v5 (flux).
 * STATES[5] is S6 in component S6 (millimolar).
 * ALGEBRAIC[8] is v6 in component v6 (flux).
 * ALGEBRAIC[12] is J in component S6_flux_rate_across_the_plasma_membrane (flux).
 * STATES[6] is S6_ex in component S6_ex (millimolar).
 * CONSTANTS[1] is phi in component S6_ex (dimensionless).
 * ALGEBRAIC[11] is v9 in component v9 (flux).
 * STATES[7] is A3 in component A3 (millimolar).
 * ALGEBRAIC[9] is v7 in component v7 (flux).
 * CONSTANTS[2] is A in component A (millimolar).
 * ALGEBRAIC[0] is A2 in component A (millimolar).
 * STATES[8] is N2 in component N2 (millimolar).
 * CONSTANTS[3] is N in component N (millimolar).
 * ALGEBRAIC[1] is N1 in component N (millimolar).
 * CONSTANTS[4] is K_i in component v1 (millimolar).
 * CONSTANTS[5] is k_1 in component v1 (second_order_rate_constant).
 * CONSTANTS[6] is n in component v1 (dimensionless).
 * ALGEBRAIC[2] is f_A3 in component v1 (dimensionless).
 * CONSTANTS[7] is k_2 in component v2 (first_order_rate_constant).
 * CONSTANTS[8] is k_GAPDH_plus in component v3 (second_order_rate_constant).
 * CONSTANTS[9] is k_GAPDH_minus in component v3 (second_order_rate_constant).
 * CONSTANTS[10] is k_PGK_plus in component v3 (second_order_rate_constant).
 * CONSTANTS[11] is k_PGK_minus in component v3 (second_order_rate_constant).
 * CONSTANTS[12] is k_4 in component v4 (second_order_rate_constant).
 * CONSTANTS[13] is k_5 in component v5 (first_order_rate_constant).
 * CONSTANTS[14] is k_6 in component v6 (second_order_rate_constant).
 * CONSTANTS[15] is k_7 in component v7 (first_order_rate_constant).
 * CONSTANTS[16] is k_8 in component v8 (second_order_rate_constant).
 * CONSTANTS[17] is k_9 in component v9 (first_order_rate_constant).
 * CONSTANTS[18] is k in component S6_flux_rate_across_the_plasma_membrane (first_order_rate_constant).
 * RATES[0] is d/dt S1 in component S1 (millimolar).
 * RATES[1] is d/dt S2 in component S2 (millimolar).
 * RATES[2] is d/dt S3 in component S3 (millimolar).
 * RATES[3] is d/dt S4 in component S4 (millimolar).
 * RATES[4] is d/dt S5 in component S5 (millimolar).
 * RATES[5] is d/dt S6 in component S6 (millimolar).
 * RATES[6] is d/dt S6_ex in component S6_ex (millimolar).
 * RATES[7] is d/dt A3 in component A3 (millimolar).
 * RATES[8] is d/dt N2 in component N2 (millimolar).
 * There are a total of 0 condition variables.
 */
void
initConsts(double* CONSTANTS, double* RATES, double *STATES)
{
STATES[0] = 1.57981839;
CONSTANTS[0] = 50;
STATES[1] = 4.8279999;
STATES[2] = 0.468657507;
STATES[3] = 0.589391932;
STATES[4] = 8.210114438;
STATES[5] = 0.078042624;
STATES[6] = 0.025277594;
CONSTANTS[1] = 0.1;
STATES[7] = 1.972814237;
CONSTANTS[2] = 4;
STATES[8] = 0.384873894;
CONSTANTS[3] = 1;
CONSTANTS[4] = 1;
CONSTANTS[5] = 550;
CONSTANTS[6] = 4;
CONSTANTS[7] = 9.8;
CONSTANTS[8] = 323.8;
CONSTANTS[9] = 57823.1;
CONSTANTS[10] = 76411.1;
CONSTANTS[11] = 23.7;
CONSTANTS[12] = 80;
CONSTANTS[13] = 9.7;
CONSTANTS[14] = 2000;
CONSTANTS[15] = 28;
CONSTANTS[16] = 85.7;
CONSTANTS[17] = 80;
CONSTANTS[18] = 375;
RATES[0] = 0.1;
RATES[1] = 0.1;
RATES[2] = 0.1;
RATES[3] = 0.1;
RATES[4] = 0.1;
RATES[5] = 0.1;
RATES[6] = 0.1;
RATES[7] = 0.1;
RATES[8] = 0.1;
}
void
computeResiduals(double VOI, double* CONSTANTS, double* RATES, double* OLDRATES, double* STATES,
                 double* OLDSTATES, double* ALGEBRAIC, double* CONDVARS)
{
resid[0] = RATES[0] - CONSTANTS[0] - ALGEBRAIC[3];
resid[1] = RATES[1] - ALGEBRAIC[3] - ALGEBRAIC[4];
resid[2] = RATES[2] -  2.00000*ALGEBRAIC[4] - (ALGEBRAIC[5]+ALGEBRAIC[10]);
resid[3] = RATES[3] - ALGEBRAIC[5] - ALGEBRAIC[6];
resid[4] = RATES[4] - ALGEBRAIC[6] - ALGEBRAIC[7];
resid[5] = RATES[5] - ALGEBRAIC[7] - (ALGEBRAIC[8]+ALGEBRAIC[12]);
resid[6] = RATES[6] -  CONSTANTS[1]*ALGEBRAIC[12] - ALGEBRAIC[11];
resid[7] = RATES[7] - (ALGEBRAIC[5]+ALGEBRAIC[6]) - ( 2.00000*ALGEBRAIC[3]+ALGEBRAIC[9]);
resid[8] = RATES[8] - ALGEBRAIC[5] - (ALGEBRAIC[8]+ALGEBRAIC[10]);
}
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[2] = pow(1.00000+pow(STATES[7]/CONSTANTS[4], CONSTANTS[6]), - 1.00000);
ALGEBRAIC[3] =  CONSTANTS[5]*STATES[0]*STATES[7]*ALGEBRAIC[2];
ALGEBRAIC[4] =  CONSTANTS[7]*STATES[1];
ALGEBRAIC[0] = CONSTANTS[2] - STATES[7];
ALGEBRAIC[1] = CONSTANTS[3] - STATES[8];
ALGEBRAIC[5] = ( CONSTANTS[8]*CONSTANTS[10]*STATES[2]*ALGEBRAIC[1]*ALGEBRAIC[0] -  CONSTANTS[9]*CONSTANTS[11]*STATES[3]*STATES[7]*STATES[8])/( CONSTANTS[9]*STATES[8]+ CONSTANTS[10]*ALGEBRAIC[0]);
ALGEBRAIC[6] =  CONSTANTS[12]*STATES[3]*ALGEBRAIC[0];
ALGEBRAIC[7] =  CONSTANTS[13]*STATES[4];
ALGEBRAIC[8] =  CONSTANTS[14]*STATES[5]*STATES[8];
ALGEBRAIC[9] =  CONSTANTS[15]*STATES[7];
ALGEBRAIC[10] =  CONSTANTS[16]*STATES[2]*STATES[8];
ALGEBRAIC[11] =  CONSTANTS[17]*STATES[6];
ALGEBRAIC[12] =  CONSTANTS[18]*(STATES[5] - STATES[6]);
}
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;
}
void
computeRoots(double VOI, double* CONSTANTS, double* RATES, double* OLDRATES, double* STATES,
             double* OLDSTATES, double* ALGEBRAIC, double* CONDVARS)
{
}