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 21 entries in the algebraic variable array.
   There are a total of 11 entries in each of the rate and state variable arrays.
   There are a total of 33 entries in the constant variable array.
 */
/*
 * VOI is time in component environment (minute).
 * CONSTANTS[0] is k1 in component rate_constants (first_order_rate_constant).
 * CONSTANTS[1] is k1_ in component rate_constants (first_order_rate_constant).
 * CONSTANTS[2] is k1__ in component rate_constants (first_order_rate_constant).
 * CONSTANTS[3] is kn1 in component rate_constants (first_order_rate_constant).
 * CONSTANTS[4] is k2 in component rate_constants (first_order_rate_constant).
 * CONSTANTS[5] is kn2 in component rate_constants (first_order_rate_constant).
 * CONSTANTS[6] is k3 in component rate_constants (first_order_rate_constant).
 * CONSTANTS[7] is k3_ in component rate_constants (first_order_rate_constant).
 * CONSTANTS[8] is kn4 in component rate_constants (first_order_rate_constant).
 * CONSTANTS[9] is k5 in component rate_constants (first_order_rate_constant).
 * CONSTANTS[10] is kn6 in component rate_constants (first_order_rate_constant).
 * CONSTANTS[11] is k8 in component rate_constants (first_order_rate_constant).
 * CONSTANTS[12] is k9 in component rate_constants (first_order_rate_constant).
 * CONSTANTS[13] is k10 in component rate_constants (first_order_rate_constant).
 * CONSTANTS[14] is k17 in component rate_constants (first_order_rate_constant).
 * CONSTANTS[15] is k18 in component rate_constants (first_order_rate_constant).
 * CONSTANTS[16] is k19 in component rate_constants (first_order_rate_constant).
 * CONSTANTS[17] is k20 in component rate_constants (first_order_rate_constant).
 * CONSTANTS[18] is k21 in component rate_constants (first_order_rate_constant).
 * CONSTANTS[19] is k22 in component rate_constants (first_order_rate_constant).
 * CONSTANTS[20] is k24 in component rate_constants (first_order_rate_constant).
 * CONSTANTS[21] is k25 in component rate_constants (first_order_rate_constant).
 * CONSTANTS[22] is k25_ in component rate_constants (first_order_rate_constant).
 * CONSTANTS[23] is k26 in component rate_constants (first_order_rate_constant).
 * CONSTANTS[24] is k26_ in component rate_constants (first_order_rate_constant).
 * CONSTANTS[25] is k28 in component rate_constants (first_order_rate_constant).
 * CONSTANTS[26] is k29 in component rate_constants (first_order_rate_constant).
 * STATES[0] is a_CyclinE_Cdk2 in component a_CyclinE_Cdk2 (dimensionless).
 * ALGEBRAIC[1] is V_2 in component V_2 (first_order_rate_constant).
 * ALGEBRAIC[9] is V_10 in component V_10 (first_order_rate_constant).
 * ALGEBRAIC[2] is V_n2 in component V_n2 (first_order_rate_constant).
 * ALGEBRAIC[8] is V_9 in component V_9 (first_order_rate_constant).
 * ALGEBRAIC[14] is V_21 in component V_21 (first_order_rate_constant).
 * STATES[1] is i_CyclinE_Cdk2 in component i_CyclinE_Cdk2 (dimensionless).
 * ALGEBRAIC[3] is V_3 in component V_3 (first_order_rate_constant).
 * ALGEBRAIC[5] is V_5 in component V_5 (first_order_rate_constant).
 * STATES[2] is pRB_E2F in component pRB_E2F (dimensionless).
 * CONSTANTS[32] is V_n1 in component V_n1 (first_order_rate_constant).
 * ALGEBRAIC[0] is V_1 in component V_1 (first_order_rate_constant).
 * STATES[3] is E2F in component E2F (dimensionless).
 * CONSTANTS[27] is V_4 in component E2F (first_order_rate_constant).
 * ALGEBRAIC[11] is V_18 in component V_18 (first_order_rate_constant).
 * ALGEBRAIC[4] is V_n4 in component V_n4 (first_order_rate_constant).
 * STATES[4] is pRB in component pRB (dimensionless).
 * CONSTANTS[28] is V_27 in component pRB (first_order_rate_constant).
 * ALGEBRAIC[18] is V_26 in component V_26 (first_order_rate_constant).
 * ALGEBRAIC[20] is V_29 in component V_29 (first_order_rate_constant).
 * ALGEBRAIC[19] is V_28 in component V_28 (first_order_rate_constant).
 * STATES[5] is CycD_Cdk4 in component CycD_Cdk4 (dimensionless).
 * CONSTANTS[29] is V_6 in component CycD_Cdk4 (first_order_rate_constant).
 * ALGEBRAIC[13] is V_20 in component V_20 (first_order_rate_constant).
 * ALGEBRAIC[6] is V_n6 in component V_n6 (first_order_rate_constant).
 * ALGEBRAIC[12] is V_19 in component V_19 (first_order_rate_constant).
 * ALGEBRAIC[10] is V_17 in component V_17 (first_order_rate_constant).
 * STATES[6] is p27 in component p27 (dimensionless).
 * CONSTANTS[30] is V_7 in component p27 (first_order_rate_constant).
 * ALGEBRAIC[7] is V_8 in component V_8 (first_order_rate_constant).
 * ALGEBRAIC[15] is V_22 in component V_22 (first_order_rate_constant).
 * STATES[7] is CycE_Cdk2_p27 in component CycE_Cdk2_p27 (dimensionless).
 * STATES[8] is CycD_Cdk4_p27 in component CycD_Cdk4_p27 (dimensionless).
 * STATES[9] is p16 in component p16 (dimensionless).
 * CONSTANTS[31] is V_23 in component p16 (first_order_rate_constant).
 * ALGEBRAIC[17] is V_25 in component V_25 (first_order_rate_constant).
 * ALGEBRAIC[16] is V_24 in component V_24 (first_order_rate_constant).
 * STATES[10] is pRB_P in component pRB_P (dimensionless).
 * RATES[0] is d/dt a_CyclinE_Cdk2 in component a_CyclinE_Cdk2 (dimensionless).
 * RATES[1] is d/dt i_CyclinE_Cdk2 in component i_CyclinE_Cdk2 (dimensionless).
 * RATES[2] is d/dt pRB_E2F in component pRB_E2F (dimensionless).
 * RATES[3] is d/dt E2F in component E2F (dimensionless).
 * RATES[4] is d/dt pRB in component pRB (dimensionless).
 * RATES[5] is d/dt CycD_Cdk4 in component CycD_Cdk4 (dimensionless).
 * RATES[6] is d/dt p27 in component p27 (dimensionless).
 * RATES[7] is d/dt CycE_Cdk2_p27 in component CycE_Cdk2_p27 (dimensionless).
 * RATES[8] is d/dt CycD_Cdk4_p27 in component CycD_Cdk4_p27 (dimensionless).
 * RATES[9] is d/dt p16 in component p16 (dimensionless).
 * RATES[10] is d/dt pRB_P in component pRB_P (dimensionless).
 * There are a total of 0 condition variables.
 */
void
initConsts(double* CONSTANTS, double* RATES, double *STATES)
{
CONSTANTS[0] = 0.1;
CONSTANTS[1] = 0.5;
CONSTANTS[2] = 0.5;
CONSTANTS[3] = 0.001;
CONSTANTS[4] = 0.1;
CONSTANTS[5] = 1;
CONSTANTS[6] = 1.42;
CONSTANTS[7] = 0;
CONSTANTS[8] = 0.016;
CONSTANTS[9] = 0.02;
CONSTANTS[10] = 5;
CONSTANTS[11] = 2;
CONSTANTS[12] = 2;
CONSTANTS[13] = 0.035;
CONSTANTS[14] = 3.5;
CONSTANTS[15] = 0.0001;
CONSTANTS[16] = 0.05;
CONSTANTS[17] = 0.01;
CONSTANTS[18] = 0.1;
CONSTANTS[19] = 0.001;
CONSTANTS[20] = 0.1;
CONSTANTS[21] = 0.01;
CONSTANTS[22] = 0.02;
CONSTANTS[23] = 0.01;
CONSTANTS[24] = 0.1;
CONSTANTS[25] = 0.01;
CONSTANTS[26] = 0.001;
STATES[0] = 0;
STATES[1] = 0.01;
STATES[2] = 1.95;
STATES[3] = 0;
CONSTANTS[27] = 0.000001;
STATES[4] = 0.05;
CONSTANTS[28] = 0.01;
STATES[5] = 0;
CONSTANTS[29] = 0.018;
STATES[6] = 5;
CONSTANTS[30] = 0.0001;
STATES[7] = 1;
STATES[8] = 0;
STATES[9] = 5;
CONSTANTS[31] = 0.2;
STATES[10] = 0.01;
CONSTANTS[32] = CONSTANTS[3];
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;
}
void
computeResiduals(double VOI, double* CONSTANTS, double* RATES, double* OLDRATES, double* STATES,
                 double* OLDSTATES, double* ALGEBRAIC, double* CONDVARS)
{
resid[0] = RATES[0] - (ALGEBRAIC[1]+ALGEBRAIC[9]) - (ALGEBRAIC[2]+ALGEBRAIC[8]+ALGEBRAIC[14]);
resid[1] = RATES[1] - (ALGEBRAIC[3]+ALGEBRAIC[2]) - (ALGEBRAIC[1]+ALGEBRAIC[5]);
resid[2] = RATES[2] - CONSTANTS[32] - ALGEBRAIC[0];
resid[3] = RATES[3] - (ALGEBRAIC[0]+CONSTANTS[27]+ALGEBRAIC[11]) - (CONSTANTS[32]+ALGEBRAIC[4]);
resid[4] = RATES[4] - (CONSTANTS[28]+ALGEBRAIC[18]+ALGEBRAIC[20]) - (CONSTANTS[32]+ALGEBRAIC[19]);
resid[5] = RATES[5] - (CONSTANTS[29]+ALGEBRAIC[13]) - (ALGEBRAIC[6]+ALGEBRAIC[12]+ALGEBRAIC[10]);
resid[6] = RATES[6] - (CONSTANTS[30]+ALGEBRAIC[9]+ALGEBRAIC[13]) - (ALGEBRAIC[7]+ALGEBRAIC[8]+ALGEBRAIC[12]+ALGEBRAIC[15]);
resid[7] = RATES[7] - ALGEBRAIC[8] - ALGEBRAIC[9];
resid[8] = RATES[8] - ALGEBRAIC[12] - ALGEBRAIC[13];
resid[9] = RATES[9] - (CONSTANTS[31]+ALGEBRAIC[17]) - (ALGEBRAIC[10]+ALGEBRAIC[16]);
resid[10] = RATES[10] - ALGEBRAIC[0] - ALGEBRAIC[20];
}
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[0] =  CONSTANTS[1]*STATES[5]*STATES[2]+ CONSTANTS[2]*STATES[8]*STATES[2]+ CONSTANTS[0]*STATES[0]*STATES[2];
ALGEBRAIC[1] =  CONSTANTS[4]*STATES[0]*STATES[1];
ALGEBRAIC[2] =  CONSTANTS[5]*STATES[0];
ALGEBRAIC[3] =  CONSTANTS[6]*STATES[3]+CONSTANTS[7];
ALGEBRAIC[4] =  CONSTANTS[8]*STATES[3];
ALGEBRAIC[5] =  CONSTANTS[9]*STATES[1];
ALGEBRAIC[6] =  CONSTANTS[10]*STATES[5];
ALGEBRAIC[7] =  CONSTANTS[11]*STATES[6]*STATES[0];
ALGEBRAIC[8] =  CONSTANTS[12]*STATES[6]*STATES[0];
ALGEBRAIC[9] =  CONSTANTS[13]*STATES[7];
ALGEBRAIC[10] =  CONSTANTS[14]*STATES[9]*STATES[5];
ALGEBRAIC[11] =  CONSTANTS[15]*STATES[3];
ALGEBRAIC[12] =  CONSTANTS[16]*STATES[6]*STATES[5];
ALGEBRAIC[13] =  CONSTANTS[17]*STATES[8];
ALGEBRAIC[14] =  CONSTANTS[18]*pow(STATES[0], 2.00000);
ALGEBRAIC[15] =  CONSTANTS[19]*STATES[6];
ALGEBRAIC[16] =  CONSTANTS[20]*STATES[9];
ALGEBRAIC[17] = CONSTANTS[21]/( (1.00000+ CONSTANTS[22]*STATES[4])*1.00000);
ALGEBRAIC[18] = CONSTANTS[23]/( (1.00000+ CONSTANTS[24]*STATES[9])*1.00000);
ALGEBRAIC[19] =  CONSTANTS[25]*STATES[4];
ALGEBRAIC[20] =  CONSTANTS[26]*STATES[10];
}
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;
}
void
computeRoots(double VOI, double* CONSTANTS, double* RATES, double* OLDRATES, double* STATES,
             double* OLDSTATES, double* ALGEBRAIC, double* CONDVARS)
{
}