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 4 entries in the algebraic variable array.
   There are a total of 6 entries in each of the rate and state variable arrays.
   There are a total of 28 entries in the constant variable array.
 */
/*
 * VOI is time in component environment (minute).
 * CONSTANTS[0] is H_1 in component parameters (dimensionless).
 * CONSTANTS[1] is H_2 in component parameters (dimensionless).
 * CONSTANTS[2] is H_3 in component parameters (dimensionless).
 * CONSTANTS[3] is H_4 in component parameters (dimensionless).
 * CONSTANTS[4] is K_1 in component parameters (dimensionless).
 * CONSTANTS[5] is K_2 in component parameters (dimensionless).
 * CONSTANTS[6] is K_3 in component parameters (dimensionless).
 * CONSTANTS[7] is K_4 in component parameters (dimensionless).
 * CONSTANTS[8] is V_M1 in component parameters (first_order_rate_constant).
 * CONSTANTS[9] is V_M3 in component parameters (first_order_rate_constant).
 * CONSTANTS[10] is U_M1 in component parameters (first_order_rate_constant).
 * CONSTANTS[11] is U_M3 in component parameters (first_order_rate_constant).
 * CONSTANTS[12] is V_2 in component parameters (first_order_rate_constant).
 * CONSTANTS[13] is V_4 in component parameters (first_order_rate_constant).
 * CONSTANTS[14] is U_2 in component parameters (first_order_rate_constant).
 * CONSTANTS[15] is U_4 in component parameters (first_order_rate_constant).
 * CONSTANTS[16] is K_c1 in component parameters (micromolar).
 * CONSTANTS[17] is K_c2 in component parameters (micromolar).
 * CONSTANTS[18] is K_d1 in component parameters (micromolar).
 * CONSTANTS[19] is K_d2 in component parameters (micromolar).
 * CONSTANTS[20] is v_d1 in component parameters (flux).
 * CONSTANTS[21] is v_d2 in component parameters (flux).
 * CONSTANTS[22] is v_i1 in component parameters (flux).
 * CONSTANTS[23] is v_i2 in component parameters (flux).
 * CONSTANTS[24] is k_d1 in component parameters (first_order_rate_constant).
 * CONSTANTS[25] is k_d2 in component parameters (first_order_rate_constant).
 * CONSTANTS[26] is K_im1 in component parameters (dimensionless).
 * CONSTANTS[27] is K_im2 in component parameters (dimensionless).
 * STATES[0] is C_1 in component C_1 (micromolar).
 * STATES[1] is M_2 in component M_2 (dimensionless).
 * STATES[2] is X_1 in component X_1 (dimensionless).
 * STATES[3] is M_1 in component M_1 (dimensionless).
 * ALGEBRAIC[0] is V_1 in component V_1 (first_order_rate_constant).
 * ALGEBRAIC[1] is V_3 in component V_3 (first_order_rate_constant).
 * STATES[4] is C_2 in component C_2 (micromolar).
 * STATES[5] is X_2 in component X_2 (dimensionless).
 * ALGEBRAIC[2] is U_1 in component U_1 (first_order_rate_constant).
 * ALGEBRAIC[3] is U_3 in component U_3 (first_order_rate_constant).
 * RATES[0] is d/dt C_1 in component C_1 (micromolar).
 * RATES[3] is d/dt M_1 in component M_1 (dimensionless).
 * RATES[2] is d/dt X_1 in component X_1 (dimensionless).
 * RATES[4] is d/dt C_2 in component C_2 (micromolar).
 * RATES[1] is d/dt M_2 in component M_2 (dimensionless).
 * RATES[5] is d/dt X_2 in component X_2 (dimensionless).
 */
void
initConsts(double* CONSTANTS, double* RATES, double *STATES)
{
CONSTANTS[0] = 0.01;
CONSTANTS[1] = 0.01;
CONSTANTS[2] = 0.01;
CONSTANTS[3] = 0.01;
CONSTANTS[4] = 0.01;
CONSTANTS[5] = 0.01;
CONSTANTS[6] = 0.01;
CONSTANTS[7] = 0.01;
CONSTANTS[8] = 0.3;
CONSTANTS[9] = 0.1;
CONSTANTS[10] = 0.3;
CONSTANTS[11] = 0.1;
CONSTANTS[12] = 0.15;
CONSTANTS[13] = 0.05;
CONSTANTS[14] = 0.15;
CONSTANTS[15] = 0.05;
CONSTANTS[16] = 0.5;
CONSTANTS[17] = 0.5;
CONSTANTS[18] = 0.02;
CONSTANTS[19] = 0.02;
CONSTANTS[20] = 0.025;
CONSTANTS[21] = 0.025;
CONSTANTS[22] = 0.05;
CONSTANTS[23] = 0.05;
CONSTANTS[24] = 0.001;
CONSTANTS[25] = 0.001;
CONSTANTS[26] = 0.03;
CONSTANTS[27] = 0.03;
STATES[0] = 2;
STATES[1] = 0;
STATES[2] = 0;
STATES[3] = 1;
STATES[4] = 0;
STATES[5] = 0;
}
void
computeRates(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
RATES[0] = (( CONSTANTS[22]*CONSTANTS[26])/(CONSTANTS[26]+STATES[1]) - ( CONSTANTS[20]*STATES[2]*STATES[0])/(CONSTANTS[18]+STATES[0])) -  CONSTANTS[24]*STATES[0];
RATES[4] = (( CONSTANTS[23]*CONSTANTS[27])/(CONSTANTS[27]+STATES[3]) - ( CONSTANTS[21]*STATES[5]*STATES[4])/(CONSTANTS[19]+STATES[4])) -  CONSTANTS[25]*STATES[4];
ALGEBRAIC[0] =  (STATES[0]/(CONSTANTS[16]+STATES[0]))*CONSTANTS[8];
RATES[3] = ( ALGEBRAIC[0]*(1.00000 - STATES[3]))/(CONSTANTS[4]+(1.00000 - STATES[3])) - ( CONSTANTS[12]*STATES[3])/(CONSTANTS[5]+STATES[3]);
ALGEBRAIC[1] =  STATES[3]*CONSTANTS[9];
RATES[2] = ( ALGEBRAIC[1]*(1.00000 - STATES[2]))/(CONSTANTS[6]+(1.00000 - STATES[2])) - ( CONSTANTS[13]*STATES[2])/(CONSTANTS[7]+STATES[2]);
ALGEBRAIC[2] =  (STATES[4]/(CONSTANTS[17]+STATES[4]))*CONSTANTS[10];
RATES[1] = ( ALGEBRAIC[2]*(1.00000 - STATES[1]))/(CONSTANTS[0]+(1.00000 - STATES[1])) - ( CONSTANTS[14]*STATES[1])/(CONSTANTS[1]+STATES[1]);
ALGEBRAIC[3] =  STATES[1]*CONSTANTS[11];
RATES[5] = ( ALGEBRAIC[3]*(1.00000 - STATES[5]))/(CONSTANTS[2]+(1.00000 - STATES[5])) - ( CONSTANTS[15]*STATES[5])/(CONSTANTS[3]+STATES[5]);
}
void
computeVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
ALGEBRAIC[0] =  (STATES[0]/(CONSTANTS[16]+STATES[0]))*CONSTANTS[8];
ALGEBRAIC[1] =  STATES[3]*CONSTANTS[9];
ALGEBRAIC[2] =  (STATES[4]/(CONSTANTS[17]+STATES[4]))*CONSTANTS[10];
ALGEBRAIC[3] =  STATES[1]*CONSTANTS[11];
}