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 9 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 43 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). * ALGEBRAIC[0] is k2 in component rate_constants (first_order_rate_constant). * CONSTANTS[1] is k2_ in component rate_constants (first_order_rate_constant). * CONSTANTS[2] is k3 in component rate_constants (first_order_rate_constant). * CONSTANTS[3] is k4 in component rate_constants (first_order_rate_constant). * CONSTANTS[4] is k5 in component rate_constants (first_order_rate_constant). * ALGEBRAIC[1] is k6 in component rate_constants (first_order_rate_constant). * CONSTANTS[5] is k6_ in component rate_constants (first_order_rate_constant). * CONSTANTS[6] is k7 in component rate_constants (first_order_rate_constant). * CONSTANTS[7] is k7r in component rate_constants (first_order_rate_constant). * CONSTANTS[8] is k8 in component rate_constants (first_order_rate_constant). * CONSTANTS[9] is k8r in component rate_constants (first_order_rate_constant). * ALGEBRAIC[2] is kwee in component rate_constants (first_order_rate_constant). * ALGEBRAIC[3] is k25 in component rate_constants (first_order_rate_constant). * CONSTANTS[10] is ku in component rate_constants (first_order_rate_constant). * CONSTANTS[11] is kp in component rate_constants (first_order_rate_constant). * CONSTANTS[12] is kur in component rate_constants (first_order_rate_constant). * CONSTANTS[13] is ku2 in component rate_constants (first_order_rate_constant). * CONSTANTS[14] is kur2 in component rate_constants (first_order_rate_constant). * CONSTANTS[15] is kc in component rate_constants (first_order_rate_constant). * CONSTANTS[16] is kcr in component rate_constants (first_order_rate_constant). * CONSTANTS[17] is kw in component rate_constants (first_order_rate_constant). * CONSTANTS[18] is kwr in component rate_constants (first_order_rate_constant). * CONSTANTS[19] is ki in component rate_constants (first_order_rate_constant). * CONSTANTS[20] is kir in component rate_constants (first_order_rate_constant). * CONSTANTS[21] is mu in component rate_constants (first_order_rate_constant). * CONSTANTS[22] is Kmu2 in component rate_constants (dimensionless). * CONSTANTS[23] is Kmur2 in component rate_constants (dimensionless). * CONSTANTS[24] is Kmi in component rate_constants (dimensionless). * CONSTANTS[25] is Kmir in component rate_constants (dimensionless). * CONSTANTS[26] is Kmw in component rate_constants (dimensionless). * CONSTANTS[27] is Kmwr in component rate_constants (dimensionless). * CONSTANTS[28] is Kmu in component rate_constants (dimensionless). * CONSTANTS[29] is Kmur in component rate_constants (dimensionless). * CONSTANTS[30] is Kmc in component rate_constants (dimensionless). * CONSTANTS[31] is Kmcr in component rate_constants (dimensionless). * CONSTANTS[32] is Kmp in component rate_constants (dimensionless). * CONSTANTS[33] is V2 in component rate_constants (first_order_rate_constant). * CONSTANTS[34] is V2_ in component rate_constants (first_order_rate_constant). * CONSTANTS[35] is V6 in component rate_constants (first_order_rate_constant). * CONSTANTS[36] is V6_ in component rate_constants (first_order_rate_constant). * CONSTANTS[37] is V25 in component rate_constants (first_order_rate_constant). * CONSTANTS[38] is V25_ in component rate_constants (first_order_rate_constant). * CONSTANTS[39] is Vw in component rate_constants (first_order_rate_constant). * CONSTANTS[40] is Vw_ in component rate_constants (first_order_rate_constant). * STATES[0] is Cdc25 in component Cdc25 (dimensionless). * STATES[1] is UbE in component UbE (dimensionless). * STATES[2] is UbE2 in component UbE2 (dimensionless). * STATES[3] is Wee1 in component Wee1 (dimensionless). * ALGEBRAIC[5] is SPF in component concentration_variables (dimensionless). * ALGEBRAIC[4] is MPF in component concentration_variables (dimensionless). * CONSTANTS[41] is alpha in component concentration_variables (dimensionless). * CONSTANTS[42] is beta in component concentration_variables (dimensionless). * STATES[4] is G1K in component G1K (dimensionless). * STATES[5] is G2K in component G2K (dimensionless). * STATES[6] is PG2 in component PG2 (dimensionless). * STATES[7] is G2R in component G2R (dimensionless). * STATES[8] is R in component R (dimensionless). * STATES[9] is G1R in component G1R (dimensionless). * STATES[10] is PG2R in component PG2R (dimensionless). * STATES[11] is mass in component mass (dimensionless). * STATES[12] is IE in component IE (dimensionless). * ALGEBRAIC[6] is Cig2_total in component Cig2_total (dimensionless). * ALGEBRAIC[7] is Rum1_total in component Rum1_total (dimensionless). * ALGEBRAIC[8] is Cdc13_total in component Cdc13_total (dimensionless). * RATES[5] is d/dt G2K in component G2K (dimensionless). * RATES[8] is d/dt R in component R (dimensionless). * RATES[4] is d/dt G1K in component G1K (dimensionless). * RATES[7] is d/dt G2R in component G2R (dimensionless). * RATES[12] is d/dt IE in component IE (dimensionless). * RATES[2] is d/dt UbE2 in component UbE2 (dimensionless). * RATES[3] is d/dt Wee1 in component Wee1 (dimensionless). * RATES[6] is d/dt PG2 in component PG2 (dimensionless). * RATES[9] is d/dt G1R in component G1R (dimensionless). * RATES[10] is d/dt PG2R in component PG2R (dimensionless). * RATES[1] is d/dt UbE in component UbE (dimensionless). * RATES[11] is d/dt mass in component mass (dimensionless). * RATES[0] is d/dt Cdc25 in component Cdc25 (dimensionless). * There are a total of 0 condition variables. */ void initConsts(double* CONSTANTS, double* RATES, double *STATES) { CONSTANTS[0] = 0.015; CONSTANTS[1] = 0.05; CONSTANTS[2] = 0.09375; CONSTANTS[3] = 0.1875; CONSTANTS[4] = 0.00175; CONSTANTS[5] = 0; CONSTANTS[6] = 100; CONSTANTS[7] = 0.1; CONSTANTS[8] = 10; CONSTANTS[9] = 0.1; CONSTANTS[10] = 0.2; CONSTANTS[11] = 3.25; CONSTANTS[12] = 0.1; CONSTANTS[13] = 1; CONSTANTS[14] = 0.3; CONSTANTS[15] = 1; CONSTANTS[16] = 0.25; CONSTANTS[17] = 1; CONSTANTS[18] = 0.25; CONSTANTS[19] = 0.4; CONSTANTS[20] = 0.1; CONSTANTS[21] = 0.00495; CONSTANTS[22] = 0.05; CONSTANTS[23] = 0.05; CONSTANTS[24] = 0.01; CONSTANTS[25] = 0.01; CONSTANTS[26] = 0.1; CONSTANTS[27] = 0.1; CONSTANTS[28] = 0.01; CONSTANTS[29] = 0.01; CONSTANTS[30] = 0.1; CONSTANTS[31] = 0.1; CONSTANTS[32] = 0.001; CONSTANTS[33] = 0.25; CONSTANTS[34] = 0.0075; CONSTANTS[35] = 7.5; CONSTANTS[36] = 0.0375; CONSTANTS[37] = 0.5; CONSTANTS[38] = 0.025; CONSTANTS[39] = 0.35; CONSTANTS[40] = 0.035; STATES[0] = 0; STATES[1] = 1; STATES[2] = 0; STATES[3] = 0; CONSTANTS[41] = 0.25; CONSTANTS[42] = 0.05; STATES[4] = 0; STATES[5] = 0; STATES[6] = 0; STATES[7] = 0; STATES[8] = 0.4; STATES[9] = 0; STATES[10] = 0; STATES[11] = 0.5; STATES[12] = 0; RATES[5] = 0.1001; RATES[8] = 0.1001; RATES[4] = 0.1001; RATES[7] = 0.1001; RATES[12] = 0.1001; RATES[2] = 0.1001; RATES[3] = 0.1001; RATES[6] = 0.1001; RATES[9] = 0.1001; RATES[10] = 0.1001; RATES[1] = 0.1001; RATES[11] = 0.1001; RATES[0] = 0.1001; } void computeResiduals(double VOI, double* CONSTANTS, double* RATES, double* OLDRATES, double* STATES, double* OLDSTATES, double* ALGEBRAIC, double* CONDVARS) { resid[0] = RATES[5] - (CONSTANTS[0]+ ALGEBRAIC[3]*STATES[6]+ (CONSTANTS[7]+CONSTANTS[3])*STATES[7]) - (ALGEBRAIC[0]+ALGEBRAIC[2]+ CONSTANTS[6]*STATES[8])*STATES[5]; resid[1] = RATES[8] - (CONSTANTS[2]+ (CONSTANTS[7]+ALGEBRAIC[0]+CONSTANTS[1])*(STATES[7]+STATES[10])+ (CONSTANTS[9]+CONSTANTS[5])*STATES[9]) - ( CONSTANTS[3]*STATES[8]+ CONSTANTS[6]*STATES[8]*(STATES[5]+STATES[6])+ CONSTANTS[8]*STATES[8]*STATES[4]+( CONSTANTS[11]*STATES[8]*ALGEBRAIC[5]*STATES[11])/(CONSTANTS[32]+STATES[8])); resid[2] = RATES[4] - (CONSTANTS[4]+ (CONSTANTS[9]+CONSTANTS[3])*STATES[9]) - (ALGEBRAIC[1]+ CONSTANTS[8]*STATES[8])*STATES[4]; resid[3] = RATES[7] - CONSTANTS[6]*STATES[8]*STATES[5] - (CONSTANTS[7]+CONSTANTS[3]+ALGEBRAIC[0]+CONSTANTS[1])*STATES[7]; resid[4] = RATES[12] - ( CONSTANTS[19]*ALGEBRAIC[4]*(1.00000 - STATES[12]))/((CONSTANTS[24]+1.00000) - STATES[12]) - ( CONSTANTS[20]*STATES[12])/(CONSTANTS[25]+STATES[12]); resid[5] = RATES[2] - ( CONSTANTS[13]*ALGEBRAIC[4]*(1.00000 - STATES[2]))/((CONSTANTS[22]+1.00000) - STATES[2]) - ( CONSTANTS[14]*STATES[2])/(CONSTANTS[23]+STATES[2]); resid[6] = RATES[3] - ( CONSTANTS[18]*(1.00000 - STATES[3]))/((CONSTANTS[27]+1.00000) - STATES[3]) - ( CONSTANTS[17]*ALGEBRAIC[4]*STATES[3])/(CONSTANTS[26]+STATES[3]); resid[7] = RATES[6] - ( ALGEBRAIC[2]*STATES[5]+ (CONSTANTS[7]+CONSTANTS[3])*STATES[10]) - (ALGEBRAIC[3]+ALGEBRAIC[0]+ CONSTANTS[6]*STATES[8])*STATES[6]; resid[8] = RATES[9] - CONSTANTS[8]*STATES[8]*STATES[4] - (CONSTANTS[9]+CONSTANTS[3]+CONSTANTS[5])*STATES[9]; resid[9] = RATES[10] - CONSTANTS[6]*STATES[8]*STATES[6] - (CONSTANTS[7]+CONSTANTS[3]+ALGEBRAIC[0]+CONSTANTS[1])*STATES[10]; resid[10] = RATES[1] - ( CONSTANTS[10]*STATES[12]*(1.00000 - STATES[1]))/((CONSTANTS[28]+1.00000) - STATES[1]) - ( CONSTANTS[12]*STATES[1])/(CONSTANTS[29]+STATES[1]); resid[11] = RATES[11] - CONSTANTS[21]*STATES[11]; resid[12] = RATES[0] - ( CONSTANTS[15]*ALGEBRAIC[4]*(1.00000 - STATES[0]))/((CONSTANTS[30]+1.00000) - STATES[0]) - ( CONSTANTS[16]*STATES[0])/(CONSTANTS[31]+STATES[0]); } void computeVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC) { ALGEBRAIC[6] = STATES[4]+STATES[9]; ALGEBRAIC[7] = STATES[8]+STATES[9]+STATES[7]+STATES[10]; ALGEBRAIC[8] = STATES[5]+STATES[7]+STATES[6]+STATES[10]; } void computeEssentialVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC) { ALGEBRAIC[0] = CONSTANTS[34]*(1.00000 - STATES[1])+ CONSTANTS[33]*STATES[1]; ALGEBRAIC[1] = CONSTANTS[36]*(1.00000 - STATES[2])+ CONSTANTS[35]*STATES[2]; ALGEBRAIC[2] = CONSTANTS[40]*(1.00000 - STATES[3])+ CONSTANTS[39]*STATES[3]; ALGEBRAIC[3] = CONSTANTS[38]*(1.00000 - STATES[0])+ CONSTANTS[37]*STATES[0]; ALGEBRAIC[4] = STATES[5]+ CONSTANTS[42]*STATES[6]; ALGEBRAIC[5] = ALGEBRAIC[4]+ CONSTANTS[41]*STATES[4]; } 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; SI[11] = 1.0; SI[12] = 1.0; } void computeRoots(double VOI, double* CONSTANTS, double* RATES, double* OLDRATES, double* STATES, double* OLDSTATES, double* ALGEBRAIC, double* CONDVARS) { }