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 6 entries in the algebraic variable array.
   There are a total of 13 entries in each of the rate and state variable arrays.
   There are a total of 23 entries in the constant variable array.
 */
/*
 * VOI is time in component environment (minute).
 * STATES[0] is Cdk2_CycE in component Cdk2_CycE (dimensionless).
 * CONSTANTS[0] is kwee in component kinetic_parameters (first_order_rate_constant).
 * CONSTANTS[1] is kon in component kinetic_parameters (first_order_rate_constant).
 * CONSTANTS[2] is k25A in component kinetic_parameters (first_order_rate_constant).
 * CONSTANTS[3] is koff in component kinetic_parameters (first_order_rate_constant).
 * CONSTANTS[4] is kassoc in component kinetic_parameters (first_order_rate_constant).
 * CONSTANTS[5] is kdissoc in component kinetic_parameters (first_order_rate_constant).
 * ALGEBRAIC[4] is phi in component kinetic_parameters (dimensionless).
 * STATES[1] is Wee1_a in component Wee1_a (dimensionless).
 * STATES[2] is PCdk2_CycE in component PCdk2_CycE (dimensionless).
 * STATES[3] is Xic in component Xic (dimensionless).
 * STATES[4] is Cdk2_CycErem in component Cdk2_CycErem (dimensionless).
 * STATES[5] is Xic_Cdk2_CycE in component Xic_Cdk2_CycE (dimensionless).
 * STATES[6] is PCdk2_CycErem in component PCdk2_CycErem (dimensionless).
 * STATES[7] is Xic_PCdk2_CycE in component Xic_PCdk2_CycE (dimensionless).
 * CONSTANTS[6] is Jwact in component Wee1_a (dimensionless).
 * CONSTANTS[7] is Jwinact in component Wee1_a (dimensionless).
 * CONSTANTS[8] is Wee1_total in component Wee1_a (dimensionless).
 * CONSTANTS[9] is kwact in component Wee1_a (first_order_rate_constant).
 * CONSTANTS[10] is kwinact in component Wee1_a (first_order_rate_constant).
 * STATES[8] is Kin_a in component Kin_a (dimensionless).
 * CONSTANTS[11] is Jiact in component Kin_a (dimensionless).
 * CONSTANTS[12] is Jiinact in component Kin_a (dimensionless).
 * CONSTANTS[13] is kiact in component Kin_a (first_order_rate_constant).
 * CONSTANTS[14] is kiinact in component Kin_a (first_order_rate_constant).
 * CONSTANTS[15] is kedeg in component kinetic_parameters (first_order_rate_constant).
 * CONSTANTS[16] is kxdeg in component kinetic_parameters (first_order_rate_constant).
 * STATES[9] is Deg_a in component Deg_a (dimensionless).
 * STATES[10] is Xic_Cdk2_CycErem in component Xic_Cdk2_CycErem (dimensionless).
 * STATES[11] is Xic_PCdk2_CycErem in component Xic_PCdk2_CycErem (dimensionless).
 * ALGEBRAIC[5] is Heav in component Deg_a (dimensionless).
 * CONSTANTS[17] is kdact in component Deg_a (first_order_rate_constant).
 * CONSTANTS[18] is theta in component Deg_a (dimensionless).
 * ALGEBRAIC[1] is x in component Deg_a (dimensionless).
 * CONSTANTS[19] is Deg in component kinetic_parameters (dimensionless).
 * STATES[12] is Xicrem in component Xicrem (dimensionless).
 * ALGEBRAIC[2] is Cyc_total in component Cyc_total (dimensionless).
 * ALGEBRAIC[3] is Xic_total in component Xic_total (dimensionless).
 * CONSTANTS[20] is epsilon in component kinetic_parameters (dimensionless).
 * ALGEBRAIC[0] is pool in component kinetic_parameters (dimensionless).
 * CONSTANTS[21] is n in component kinetic_parameters (dimensionless).
 * CONSTANTS[22] is L in component kinetic_parameters (dimensionless).
 * RATES[0] is d/dt Cdk2_CycE in component Cdk2_CycE (dimensionless).
 * RATES[2] is d/dt PCdk2_CycE in component PCdk2_CycE (dimensionless).
 * RATES[1] is d/dt Wee1_a in component Wee1_a (dimensionless).
 * RATES[8] is d/dt Kin_a in component Kin_a (dimensionless).
 * RATES[4] is d/dt Cdk2_CycErem in component Cdk2_CycErem (dimensionless).
 * RATES[6] is d/dt PCdk2_CycErem in component PCdk2_CycErem (dimensionless).
 * RATES[9] is d/dt Deg_a in component Deg_a (dimensionless).
 * RATES[3] is d/dt Xic in component Xic (dimensionless).
 * RATES[5] is d/dt Xic_Cdk2_CycE in component Xic_Cdk2_CycE (dimensionless).
 * RATES[7] is d/dt Xic_PCdk2_CycE in component Xic_PCdk2_CycE (dimensionless).
 * RATES[10] is d/dt Xic_Cdk2_CycErem in component Xic_Cdk2_CycErem (dimensionless).
 * RATES[11] is d/dt Xic_PCdk2_CycErem in component Xic_PCdk2_CycErem (dimensionless).
 * RATES[12] is d/dt Xicrem in component Xicrem (dimensionless).
 */
void
initConsts(double* CONSTANTS, double* RATES, double *STATES)
{
STATES[0] = 0.06;
CONSTANTS[0] = 1.5;
CONSTANTS[1] = 0.02;
CONSTANTS[2] = 0.1;
CONSTANTS[3] = 0.0001;
CONSTANTS[4] = 0.1;
CONSTANTS[5] = 0.001;
STATES[1] = 1.02;
STATES[2] = 0.94;
STATES[3] = 3;
STATES[4] = 0;
STATES[5] = 0;
STATES[6] = 0;
STATES[7] = 0;
CONSTANTS[6] = 0.01;
CONSTANTS[7] = 0.01;
CONSTANTS[8] = 8;
CONSTANTS[9] = 0.75;
CONSTANTS[10] = 1.5;
STATES[8] = 0.6;
CONSTANTS[11] = 0.01;
CONSTANTS[12] = 0.01;
CONSTANTS[13] = 0.15;
CONSTANTS[14] = 0.6;
CONSTANTS[15] = 0.017;
CONSTANTS[16] = 0.01;
STATES[9] = 0;
STATES[10] = 0;
STATES[11] = 0;
CONSTANTS[17] = 0.023;
CONSTANTS[18] = 0.3;
CONSTANTS[19] = 0;
STATES[12] = 0;
CONSTANTS[20] = 0.001;
CONSTANTS[21] = 4;
CONSTANTS[22] = 0.4;
}
void
computeRates(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
RATES[1] = ( CONSTANTS[9]*(CONSTANTS[8] - STATES[1]))/((CONSTANTS[6]+CONSTANTS[8]) - STATES[1]) - ( CONSTANTS[10]*STATES[8]*STATES[1])/(CONSTANTS[7]+STATES[1]);
RATES[8] = ( CONSTANTS[13]*(1.00000 - STATES[8]))/((CONSTANTS[11]+1.00000) - STATES[8]) - ( CONSTANTS[14]*STATES[0]*STATES[8])/(CONSTANTS[12]+STATES[8]);
RATES[3] =  CONSTANTS[5]*(STATES[5]+STATES[7]+STATES[10]+STATES[11]) -  CONSTANTS[4]*STATES[3]*(STATES[0]+STATES[2]+STATES[4]+STATES[6]);
RATES[12] = ( CONSTANTS[15]*STATES[9]*STATES[10]+ CONSTANTS[15]*STATES[9]*STATES[11]) -  CONSTANTS[16]*STATES[12];
ALGEBRAIC[0] = STATES[4]+STATES[6]+STATES[10]+STATES[11];
ALGEBRAIC[4] = (CONSTANTS[20]+pow(ALGEBRAIC[0], CONSTANTS[21]))/(pow(CONSTANTS[22], CONSTANTS[21])+pow(ALGEBRAIC[0], CONSTANTS[21]));
RATES[0] = ( CONSTANTS[2]*STATES[2]+ CONSTANTS[3]*STATES[4]+ CONSTANTS[5]*STATES[5]) - ( CONSTANTS[0]*STATES[1]*STATES[0]+ CONSTANTS[1]*ALGEBRAIC[4]*STATES[0]+ CONSTANTS[4]*STATES[3]*STATES[0]);
RATES[2] = ( CONSTANTS[0]*STATES[1]*STATES[0]+ CONSTANTS[3]*STATES[6]+ CONSTANTS[5]*STATES[7]) - ( CONSTANTS[2]*STATES[2]+ CONSTANTS[1]*ALGEBRAIC[4]*STATES[2]+ CONSTANTS[4]*STATES[3]*STATES[2]);
RATES[4] = ( CONSTANTS[1]*ALGEBRAIC[4]*STATES[0]+ CONSTANTS[16]*STATES[10]+ CONSTANTS[5]*STATES[10]) - ( CONSTANTS[3]*STATES[4]+ CONSTANTS[15]*STATES[9]*STATES[4]+ CONSTANTS[4]*STATES[3]*STATES[4]);
RATES[6] = ( CONSTANTS[1]*ALGEBRAIC[4]*STATES[2]+ CONSTANTS[16]*STATES[11]+ CONSTANTS[5]*STATES[11]) - ( CONSTANTS[3]*STATES[6]+ CONSTANTS[15]*STATES[9]*STATES[6]+ CONSTANTS[4]*STATES[3]*STATES[6]);
ALGEBRAIC[1] = STATES[4] - CONSTANTS[18];
ALGEBRAIC[5] = (ALGEBRAIC[1]<0.00000 ? 0.00000 : 1.00000);
RATES[9] =  CONSTANTS[17]*ALGEBRAIC[5];
RATES[5] = ( CONSTANTS[4]*STATES[3]*STATES[0]+ CONSTANTS[3]*STATES[10]+ CONSTANTS[2]*STATES[7]) - ( CONSTANTS[5]*STATES[5]+ CONSTANTS[1]*ALGEBRAIC[4]*STATES[5]+ CONSTANTS[0]*STATES[1]*STATES[5]);
RATES[7] = ( CONSTANTS[4]*STATES[3]*STATES[2]+ CONSTANTS[3]*STATES[11]+ CONSTANTS[0]*STATES[1]*STATES[5]) - ( CONSTANTS[5]*STATES[7]+ CONSTANTS[1]*ALGEBRAIC[4]*STATES[7]+ CONSTANTS[2]*STATES[7]);
RATES[10] = ( CONSTANTS[4]*STATES[3]*STATES[4]+ CONSTANTS[1]*ALGEBRAIC[4]*STATES[5]) - ( CONSTANTS[5]*STATES[10]+ CONSTANTS[3]*STATES[10]+ CONSTANTS[15]*STATES[9]*STATES[10]+ CONSTANTS[16]*STATES[10]);
RATES[11] = ( CONSTANTS[4]*STATES[3]*STATES[6]+ CONSTANTS[1]*ALGEBRAIC[4]*STATES[7]) - ( CONSTANTS[5]*STATES[11]+ CONSTANTS[3]*STATES[11]+ CONSTANTS[15]*CONSTANTS[19]*STATES[11]+ CONSTANTS[16]*STATES[11]);
}
void
computeVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
ALGEBRAIC[0] = STATES[4]+STATES[6]+STATES[10]+STATES[11];
ALGEBRAIC[4] = (CONSTANTS[20]+pow(ALGEBRAIC[0], CONSTANTS[21]))/(pow(CONSTANTS[22], CONSTANTS[21])+pow(ALGEBRAIC[0], CONSTANTS[21]));
ALGEBRAIC[1] = STATES[4] - CONSTANTS[18];
ALGEBRAIC[5] = (ALGEBRAIC[1]<0.00000 ? 0.00000 : 1.00000);
ALGEBRAIC[2] = STATES[7]+STATES[5]+STATES[11]+STATES[10]+STATES[6]+STATES[4]+STATES[0]+STATES[2];
ALGEBRAIC[3] = (STATES[3]+STATES[7]+STATES[5]+STATES[11]+STATES[10]+STATES[12])/3.00000;
}