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 19 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 29 entries in the constant variable array. */ /* * VOI is time in component environment (hour). * ALGEBRAIC[1] is v_1 in component main (pmol_per_ug_DNA_per_hour). * CONSTANTS[25] is v_2 in component main (pmol_per_ug_DNA_per_hour). * CONSTANTS[26] is v_3 in component main (pmol_per_ug_DNA_per_hour). * ALGEBRAIC[2] is v_4 in component main (pmol_per_ug_DNA_per_hour). * CONSTANTS[27] is v_5 in component main (pmol_per_ug_DNA_per_hour). * ALGEBRAIC[3] is v_6 in component main (pmol_per_ug_DNA_per_hour). * CONSTANTS[28] is v_7 in component main (pmol_per_ug_DNA_per_hour). * ALGEBRAIC[4] is v_8 in component main (pmol_per_ug_DNA_per_hour). * ALGEBRAIC[5] is v_9 in component main (pmol_per_ug_DNA_per_hour). * ALGEBRAIC[6] is v_10 in component main (pmol_per_ug_DNA_per_hour). * ALGEBRAIC[7] is v_11 in component main (pmol_per_ug_DNA_per_hour). * ALGEBRAIC[8] is v_12 in component main (pmol_per_ug_DNA_per_hour). * ALGEBRAIC[9] is v_13 in component main (pmol_per_ug_DNA_per_hour). * ALGEBRAIC[10] is v_14 in component main (pmol_per_ug_DNA_per_hour). * ALGEBRAIC[11] is v_15 in component main (pmol_per_ug_DNA_per_hour). * ALGEBRAIC[12] is v_16 in component main (pmol_per_ug_DNA_per_hour). * ALGEBRAIC[13] is v_17 in component main (pmol_per_ug_DNA_per_hour). * ALGEBRAIC[14] is v_18 in component main (pmol_per_ug_DNA_per_hour). * ALGEBRAIC[15] is v_19 in component main (pmol_per_ug_DNA_per_hour). * ALGEBRAIC[16] is v_20 in component main (pmol_per_ug_DNA_per_hour). * ALGEBRAIC[17] is v_21 in component main (pmol_per_ug_DNA_per_hour). * ALGEBRAIC[18] is v_22 in component main (pmol_per_ug_DNA_per_hour). * CONSTANTS[0] is k_1 in component main (pmol_per_ug_DNA_per_hour). * CONSTANTS[1] is k_2 in component main (pmol_per_ug_DNA_per_hour). * CONSTANTS[2] is k_3 in component main (per_hour). * CONSTANTS[3] is k_4 in component main (per_hour). * CONSTANTS[4] is k_5 in component main (ug_DNA_per_pmol_per_hour). * CONSTANTS[5] is k_6 in component main (per_hour). * CONSTANTS[6] is k_7 in component main (per_hour). * CONSTANTS[7] is k_8 in component main (per_hour). * CONSTANTS[8] is k_9 in component main (per_hour). * CONSTANTS[9] is k_10 in component main (ug_DNA_per_pmol_per_hour). * CONSTANTS[10] is k_11 in component main (per_hour). * CONSTANTS[11] is k_12 in component main (per_hour). * CONSTANTS[12] is k_13 in component main (per_hour). * CONSTANTS[13] is k_14 in component main (per_hour). * CONSTANTS[14] is k_15 in component main (per_hour). * CONSTANTS[15] is k_16 in component main (per_hour). * CONSTANTS[16] is k_17 in component main (per_hour). * CONSTANTS[17] is k_18 in component main (per_hour). * CONSTANTS[18] is k_19 in component main (per_hour). * CONSTANTS[19] is k_20 in component main (per_hour). * CONSTANTS[20] is k_21 in component main (per_hour). * CONSTANTS[21] is k_22 in component main (per_hour). * ALGEBRAIC[0] is LPS in component main (dimensionless). * CONSTANTS[22] is PIP_2 in component main (dimensionless). * CONSTANTS[23] is DG in component main (pmol_per_ug_DNA). * CONSTANTS[24] is GPCho in component main (pmol_per_ug_DNA). * STATES[0] is AA in component main (pmol_per_ug_DNA). * STATES[1] is HETE in component main (pmol_per_ug_DNA). * STATES[2] is PGH_2 in component main (pmol_per_ug_DNA). * STATES[3] is PGE_2 in component main (pmol_per_ug_DNA). * STATES[4] is PGF_2a in component main (pmol_per_ug_DNA). * STATES[5] is PGD_2 in component main (pmol_per_ug_DNA). * STATES[6] is PGJ_2 in component main (pmol_per_ug_DNA). * STATES[7] is dPGD_2 in component main (pmol_per_ug_DNA). * STATES[8] is dPGJ_2 in component main (pmol_per_ug_DNA). * RATES[0] is d/dt AA in component main (pmol_per_ug_DNA). * RATES[1] is d/dt HETE in component main (pmol_per_ug_DNA). * RATES[2] is d/dt PGH_2 in component main (pmol_per_ug_DNA). * RATES[3] is d/dt PGE_2 in component main (pmol_per_ug_DNA). * RATES[4] is d/dt PGF_2a in component main (pmol_per_ug_DNA). * RATES[5] is d/dt PGD_2 in component main (pmol_per_ug_DNA). * RATES[6] is d/dt PGJ_2 in component main (pmol_per_ug_DNA). * RATES[7] is d/dt dPGD_2 in component main (pmol_per_ug_DNA). * RATES[8] is d/dt dPGJ_2 in component main (pmol_per_ug_DNA). * There are a total of 3 condition variables. */ void initConsts(double* CONSTANTS, double* RATES, double *STATES) { CONSTANTS[0] = 355.637; CONSTANTS[1] = 1e-15; CONSTANTS[2] = 1e-15; CONSTANTS[3] = 1e-15; CONSTANTS[4] = 1e-15; CONSTANTS[5] = 0.33; CONSTANTS[6] = 1e-15; CONSTANTS[7] = 0.007; CONSTANTS[8] = 0.187; CONSTANTS[9] = 0.024; CONSTANTS[10] = 0.111; CONSTANTS[11] = 0.098; CONSTANTS[12] = 0.204; CONSTANTS[13] = 1e-15; CONSTANTS[14] = 0.061; CONSTANTS[15] = 1e-15; CONSTANTS[16] = 3.116; CONSTANTS[17] = 0.054; CONSTANTS[18] = 0.029; CONSTANTS[19] = 0.014; CONSTANTS[20] = 0.034; CONSTANTS[21] = 0.116; CONSTANTS[22] = 1; CONSTANTS[23] = 0; CONSTANTS[24] = 1; STATES[0] = 25; STATES[1] = 0; STATES[2] = 0; STATES[3] = 0; STATES[4] = 0; STATES[5] = 0; STATES[6] = 0; STATES[7] = 0; STATES[8] = 0; CONSTANTS[25] = CONSTANTS[22]*CONSTANTS[1]; CONSTANTS[26] = CONSTANTS[23]*CONSTANTS[2]; CONSTANTS[27] = CONSTANTS[23]*CONSTANTS[24]*CONSTANTS[4]; CONSTANTS[28] = CONSTANTS[24]*CONSTANTS[6]; 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; } void computeResiduals(double VOI, double* CONSTANTS, double* RATES, double* OLDRATES, double* STATES, double* OLDSTATES, double* ALGEBRAIC, double* CONDVARS) { resid[0] = RATES[0] - ((((((ALGEBRAIC[1]+CONSTANTS[25]+CONSTANTS[26]) - ALGEBRAIC[2])+CONSTANTS[27]+ALGEBRAIC[3]+CONSTANTS[28]) - ALGEBRAIC[4]) - ALGEBRAIC[6]) - ALGEBRAIC[7]) - ALGEBRAIC[8]; resid[1] = RATES[1] - ALGEBRAIC[4] - ALGEBRAIC[5]; resid[2] = RATES[2] - (((ALGEBRAIC[6]+ALGEBRAIC[7]+ALGEBRAIC[8]) - ALGEBRAIC[9]) - ALGEBRAIC[11]) - ALGEBRAIC[13]; resid[3] = RATES[3] - ALGEBRAIC[9] - ALGEBRAIC[10]; resid[4] = RATES[4] - ALGEBRAIC[11] - ALGEBRAIC[12]; resid[5] = RATES[5] - (ALGEBRAIC[13] - ALGEBRAIC[14]) - ALGEBRAIC[15]; resid[6] = RATES[6] - ALGEBRAIC[14] - ALGEBRAIC[17]; resid[7] = RATES[7] - ALGEBRAIC[15] - ALGEBRAIC[16]; resid[8] = RATES[8] - ALGEBRAIC[17] - ALGEBRAIC[18]; } 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] = (CONDVAR[0]<=0.00000 ? VOI*2.00000 : CONDVAR[1]>0.00000&&CONDVAR[2]<0.00000 ? 1.00000 - (VOI - 0.500000)/1.50000 : 0.00000); ALGEBRAIC[1] = ALGEBRAIC[0]*CONSTANTS[22]*CONSTANTS[0]; ALGEBRAIC[2] = STATES[0]*CONSTANTS[3]; ALGEBRAIC[3] = ALGEBRAIC[0]*CONSTANTS[24]*CONSTANTS[5]; ALGEBRAIC[4] = STATES[0]*CONSTANTS[7]; ALGEBRAIC[5] = STATES[1]*CONSTANTS[8]; ALGEBRAIC[6] = CONSTANTS[23]*STATES[0]*CONSTANTS[9]; ALGEBRAIC[7] = ALGEBRAIC[0]*STATES[0]*CONSTANTS[10]; ALGEBRAIC[8] = STATES[0]*CONSTANTS[11]; ALGEBRAIC[9] = STATES[2]*CONSTANTS[12]; ALGEBRAIC[10] = STATES[3]*CONSTANTS[13]; ALGEBRAIC[11] = STATES[2]*CONSTANTS[14]; ALGEBRAIC[12] = STATES[4]*CONSTANTS[15]; ALGEBRAIC[13] = STATES[2]*CONSTANTS[16]; ALGEBRAIC[14] = STATES[5]*CONSTANTS[17]; ALGEBRAIC[15] = STATES[5]*CONSTANTS[18]; ALGEBRAIC[16] = STATES[7]*CONSTANTS[19]; ALGEBRAIC[17] = STATES[6]*CONSTANTS[20]; ALGEBRAIC[18] = STATES[8]*CONSTANTS[21]; } 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) { CONDVAR[0] = VOI - 0.500000; CONDVAR[1] = VOI - 0.500000; CONDVAR[2] = VOI - 2.00000; }