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 1 entries in the algebraic variable array. There are a total of 10 entries in each of the rate and state variable arrays. There are a total of 38 entries in the constant variable array. */ /* * VOI is time in component environment (hour). * STATES[0] is MP in component MP (nanomolar). * CONSTANTS[0] is vsP in component MP (flux). * CONSTANTS[1] is vmP in component MP (flux). * CONSTANTS[2] is KmP in component MP (nanomolar). * CONSTANTS[3] is KIP in component MP (nanomolar). * CONSTANTS[4] is kd in component parameters (first_order_rate_constant). * STATES[1] is CN in component CN (nanomolar). * CONSTANTS[5] is n in component parameters (dimensionless). * STATES[2] is P0 in component P0 (nanomolar). * CONSTANTS[6] is ksP in component P0 (first_order_rate_constant). * CONSTANTS[7] is V1P in component parameters (flux). * CONSTANTS[8] is V2P in component parameters (flux). * CONSTANTS[9] is K1P in component parameters (nanomolar). * CONSTANTS[10] is K2P in component parameters (nanomolar). * STATES[3] is P1 in component P1 (nanomolar). * CONSTANTS[11] is V3P in component parameters (flux). * CONSTANTS[12] is V4P in component parameters (flux). * CONSTANTS[13] is K3P in component parameters (nanomolar). * CONSTANTS[14] is K4P in component parameters (nanomolar). * STATES[4] is P2 in component P2 (nanomolar). * CONSTANTS[15] is vdP in component P2 (flux). * CONSTANTS[16] is KdP in component P2 (nanomolar). * ALGEBRAIC[0] is Pt in component P2 (nanomolar). * CONSTANTS[17] is k3 in component parameters (second_order_rate_constant). * CONSTANTS[18] is k4 in component parameters (first_order_rate_constant). * STATES[5] is T2 in component T2 (nanomolar). * STATES[6] is C in component C (nanomolar). * STATES[7] is MT in component MT (nanomolar). * CONSTANTS[19] is vsT in component MT (flux). * CONSTANTS[20] is vmT in component MT (flux). * CONSTANTS[21] is KmT in component MT (nanomolar). * CONSTANTS[22] is KIT in component MT (nanomolar). * STATES[8] is T0 in component T0 (nanomolar). * CONSTANTS[23] is ksT in component T0 (first_order_rate_constant). * CONSTANTS[24] is V1T in component parameters (flux). * CONSTANTS[25] is V2T in component parameters (flux). * CONSTANTS[26] is K1T in component parameters (nanomolar). * CONSTANTS[27] is K2T in component parameters (nanomolar). * STATES[9] is T1 in component T1 (nanomolar). * CONSTANTS[28] is V3T in component parameters (flux). * CONSTANTS[29] is V4T in component parameters (flux). * CONSTANTS[30] is K3T in component parameters (nanomolar). * CONSTANTS[31] is K4T in component parameters (nanomolar). * CONSTANTS[32] is vdT in component T2 (flux). * CONSTANTS[33] is KdT in component T2 (nanomolar). * CONSTANTS[34] is kdC in component C (first_order_rate_constant). * CONSTANTS[35] is k1 in component parameters (first_order_rate_constant). * CONSTANTS[36] is k2 in component parameters (first_order_rate_constant). * CONSTANTS[37] is kdN in component CN (first_order_rate_constant). * RATES[0] is d/dt MP in component MP (nanomolar). * RATES[2] is d/dt P0 in component P0 (nanomolar). * RATES[3] is d/dt P1 in component P1 (nanomolar). * RATES[4] is d/dt P2 in component P2 (nanomolar). * RATES[7] is d/dt MT in component MT (nanomolar). * RATES[8] is d/dt T0 in component T0 (nanomolar). * RATES[9] is d/dt T1 in component T1 (nanomolar). * RATES[5] is d/dt T2 in component T2 (nanomolar). * RATES[6] is d/dt C in component C (nanomolar). * RATES[1] is d/dt CN in component CN (nanomolar). * There are a total of 0 condition variables. */ void initConsts(double* CONSTANTS, double* RATES, double *STATES) { STATES[0] = 0.1; CONSTANTS[0] = 1; CONSTANTS[1] = 0.7; CONSTANTS[2] = 0.2; CONSTANTS[3] = 1.0; CONSTANTS[4] = 0.01; STATES[1] = 1.25; CONSTANTS[5] = 4.0; STATES[2] = 0.1; CONSTANTS[6] = 0.9; CONSTANTS[7] = 8.0; CONSTANTS[8] = 1.0; CONSTANTS[9] = 2.0; CONSTANTS[10] = 2.0; STATES[3] = 0.1; CONSTANTS[11] = 8.0; CONSTANTS[12] = 1.0; CONSTANTS[13] = 2.0; CONSTANTS[14] = 1; STATES[4] = 0.1; CONSTANTS[15] = 2; CONSTANTS[16] = 0.2; CONSTANTS[17] = 1.2; CONSTANTS[18] = 0.6; STATES[5] = 0.1; STATES[6] = 0.1; STATES[7] = 1.6; CONSTANTS[19] = 1.0; CONSTANTS[20] = 0.7; CONSTANTS[21] = 0.2; CONSTANTS[22] = 1.0; STATES[8] = 0.1; CONSTANTS[23] = 0.9; CONSTANTS[24] = 8.0; CONSTANTS[25] = 1.0; CONSTANTS[26] = 2.0; CONSTANTS[27] = 2.0; STATES[9] = 0.1; CONSTANTS[28] = 8.0; CONSTANTS[29] = 1.0; CONSTANTS[30] = 2.0; CONSTANTS[31] = 1; CONSTANTS[32] = 2; CONSTANTS[33] = 0.2; CONSTANTS[34] = 0.01; CONSTANTS[35] = 0.6; CONSTANTS[36] = 0.2; CONSTANTS[37] = 0.01; RATES[0] = 0.1001; RATES[2] = 0.1001; RATES[3] = 0.1001; RATES[4] = 0.1001; RATES[7] = 0.1001; RATES[8] = 0.1001; RATES[9] = 0.1001; RATES[5] = 0.1001; RATES[6] = 0.1001; RATES[1] = 0.1001; } void computeResiduals(double VOI, double* CONSTANTS, double* RATES, double* OLDRATES, double* STATES, double* OLDSTATES, double* ALGEBRAIC, double* CONDVARS) { resid[0] = RATES[0] - CONSTANTS[0]*(pow(CONSTANTS[3], CONSTANTS[5])/(pow(CONSTANTS[3], CONSTANTS[5])+pow(STATES[1], CONSTANTS[5]))) - ( CONSTANTS[1]*(STATES[0]/(CONSTANTS[2]+STATES[0]))+ CONSTANTS[4]*STATES[0]); resid[1] = RATES[2] - ( CONSTANTS[6]*STATES[0]+ CONSTANTS[8]*(STATES[3]/(CONSTANTS[10]+STATES[3]))) - ( CONSTANTS[7]*(STATES[2]/(CONSTANTS[9]+STATES[2]))+ CONSTANTS[4]*STATES[2]); resid[2] = RATES[3] - ( CONSTANTS[7]*(STATES[2]/(CONSTANTS[9]+STATES[2]))+ CONSTANTS[12]*(STATES[4]/(CONSTANTS[14]+STATES[4]))) - ( CONSTANTS[8]*(STATES[3]/(CONSTANTS[10]+STATES[3]))+ CONSTANTS[11]*(STATES[3]/(CONSTANTS[13]+STATES[3]))+ CONSTANTS[4]*STATES[3]); resid[3] = RATES[4] - ( CONSTANTS[11]*(STATES[3]/(CONSTANTS[13]+STATES[3]))+ CONSTANTS[18]*STATES[6]) - ( CONSTANTS[12]*(STATES[4]/(CONSTANTS[14]+STATES[4]))+ CONSTANTS[17]*STATES[4]*STATES[5]+ CONSTANTS[15]*(STATES[4]/(CONSTANTS[16]+STATES[4]))+ CONSTANTS[4]*STATES[4]); resid[4] = RATES[7] - CONSTANTS[19]*(pow(CONSTANTS[22], CONSTANTS[5])/(pow(CONSTANTS[22], CONSTANTS[5])+pow(STATES[1], CONSTANTS[5]))) - ( CONSTANTS[20]*(STATES[7]/(CONSTANTS[21]+STATES[7]))+ CONSTANTS[4]*STATES[7]); resid[5] = RATES[8] - ( CONSTANTS[23]*STATES[7]+ CONSTANTS[25]*(STATES[9]/(CONSTANTS[27]+STATES[9]))) - ( CONSTANTS[24]*(STATES[8]/(CONSTANTS[26]+STATES[8]))+ CONSTANTS[4]*STATES[8]); resid[6] = RATES[9] - ( CONSTANTS[24]*(STATES[8]/(CONSTANTS[26]+STATES[8]))+ CONSTANTS[29]*(STATES[5]/(CONSTANTS[31]+STATES[5]))) - ( CONSTANTS[25]*(STATES[9]/(CONSTANTS[27]+STATES[9]))+ CONSTANTS[28]*(STATES[9]/(CONSTANTS[30]+STATES[9]))+ CONSTANTS[4]*STATES[9]); resid[7] = RATES[5] - ( CONSTANTS[28]*(STATES[9]/(CONSTANTS[30]+STATES[9]))+ CONSTANTS[18]*STATES[6]) - ( CONSTANTS[29]*(STATES[5]/(CONSTANTS[31]+STATES[5]))+ CONSTANTS[17]*STATES[4]*STATES[5]+ CONSTANTS[32]*(STATES[5]/(CONSTANTS[33]+STATES[5]))+ CONSTANTS[4]*STATES[5]); resid[8] = RATES[6] - ( CONSTANTS[17]*STATES[4]*STATES[5]+ CONSTANTS[36]*STATES[1]) - ( CONSTANTS[18]*STATES[6]+ CONSTANTS[35]*STATES[6]+ CONSTANTS[34]*STATES[6]); resid[9] = RATES[1] - CONSTANTS[35]*STATES[6] - ( CONSTANTS[36]*STATES[1]+ CONSTANTS[37]*STATES[1]); } void computeVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC) { ALGEBRAIC[0] = STATES[2]+STATES[3]+STATES[4]+STATES[6]+STATES[1]; } void computeEssentialVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC) { } 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; } void computeRoots(double VOI, double* CONSTANTS, double* RATES, double* OLDRATES, double* STATES, double* OLDSTATES, double* ALGEBRAIC, double* CONDVARS) { }