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 0 entries in the algebraic variable array.
   There are a total of 5 entries in each of the rate and state variable arrays.
   There are a total of 36 entries in the constant variable array.
 */
/*
 * VOI is time in component environment (minute).
 * STATES[0] is x1 in component x1 (microg_l).
 * CONSTANTS[0] is lambda_1 in component model_parameters (first_order_rate_constant).
 * STATES[1] is x3 in component x3 (microg_l).
 * CONSTANTS[1] is a1 in component model_parameters (flux).
 * CONSTANTS[2] is a2 in component model_parameters (flux).
 * CONSTANTS[3] is a3 in component model_parameters (first_order_rate_constant).
 * CONSTANTS[4] is a4 in component model_parameters (second_order_rate_constant).
 * CONSTANTS[5] is a5 in component model_parameters (per_microg_l).
 * CONSTANTS[6] is a6 in component model_parameters (per_microg_l2).
 * CONSTANTS[7] is a7 in component model_parameters (per_microg_l).
 * CONSTANTS[8] is a8 in component model_parameters (per_microg_l2).
 * STATES[2] is x2 in component x2 (microg_l).
 * CONSTANTS[9] is lambda_2 in component model_parameters (first_order_rate_constant).
 * CONSTANTS[10] is a9 in component model_parameters (flux).
 * CONSTANTS[11] is a10 in component model_parameters (first_order_rate_constant).
 * CONSTANTS[12] is a11 in component model_parameters (second_order_rate_constant).
 * CONSTANTS[13] is a12 in component model_parameters (per_microg_l).
 * CONSTANTS[14] is a13 in component model_parameters (per_microg_l2).
 * CONSTANTS[15] is a14 in component model_parameters (per_microg_l).
 * CONSTANTS[16] is a15 in component model_parameters (per_microg_l2).
 * CONSTANTS[33] is lambda_3_ in component model_parameters (first_order_rate_constant).
 * STATES[3] is x4 in component x4 (microg_l).
 * STATES[4] is x5 in component x5 (microg_l).
 * CONSTANTS[17] is a16 in component model_parameters (flux).
 * CONSTANTS[18] is a17 in component model_parameters (first_order_rate_constant).
 * CONSTANTS[19] is a18 in component model_parameters (second_order_rate_constant).
 * CONSTANTS[20] is a19 in component model_parameters (first_order_rate_constant).
 * CONSTANTS[21] is a20 in component model_parameters (second_order_rate_constant).
 * CONSTANTS[22] is a21 in component model_parameters (per_microg_l).
 * CONSTANTS[23] is a22 in component model_parameters (per_microg_l2).
 * CONSTANTS[24] is a23 in component model_parameters (per_microg_l).
 * CONSTANTS[25] is a24 in component model_parameters (per_microg_l2).
 * CONSTANTS[26] is a25 in component model_parameters (first_order_rate_constant).
 * CONSTANTS[27] is a26 in component model_parameters (first_order_rate_constant).
 * CONSTANTS[34] is lambda_4_ in component model_parameters (first_order_rate_constant).
 * CONSTANTS[28] is a27 in component model_parameters (first_order_rate_constant).
 * CONSTANTS[35] is lambda_5_ in component model_parameters (first_order_rate_constant).
 * CONSTANTS[29] is a28 in component model_parameters (first_order_rate_constant).
 * CONSTANTS[30] is lambda_3 in component model_parameters (first_order_rate_constant).
 * CONSTANTS[31] is lambda_4 in component model_parameters (first_order_rate_constant).
 * CONSTANTS[32] is lambda_5 in component model_parameters (first_order_rate_constant).
 * RATES[0] is d/dt x1 in component x1 (microg_l).
 * RATES[2] is d/dt x2 in component x2 (microg_l).
 * RATES[1] is d/dt x3 in component x3 (microg_l).
 * RATES[3] is d/dt x4 in component x4 (microg_l).
 * RATES[4] is d/dt x5 in component x5 (microg_l).
 */
void
initConsts(double* CONSTANTS, double* RATES, double *STATES)
{
STATES[0] = 0.01067;
CONSTANTS[0] = 0.059;
STATES[1] = 6.51;
CONSTANTS[1] = 0.000017;
CONSTANTS[2] = 0.0023;
CONSTANTS[3] = 0.6;
CONSTANTS[4] = 45;
CONSTANTS[5] = 36;
CONSTANTS[6] = 216;
CONSTANTS[7] = 0.28;
CONSTANTS[8] = 0.36;
STATES[2] = 0.04665;
CONSTANTS[9] = 0.028;
CONSTANTS[10] = 0.0003;
CONSTANTS[11] = 0.18;
CONSTANTS[12] = 150;
CONSTANTS[13] = 18;
CONSTANTS[14] = 460;
CONSTANTS[15] = 0.46;
CONSTANTS[16] = 0.1;
STATES[3] = 60.61;
STATES[4] = 12.61;
CONSTANTS[17] = 0.04;
CONSTANTS[18] = 150;
CONSTANTS[19] = 3800;
CONSTANTS[20] = 57;
CONSTANTS[21] = 2600;
CONSTANTS[22] = 200;
CONSTANTS[23] = 9400;
CONSTANTS[24] = 10;
CONSTANTS[25] = 320;
CONSTANTS[26] = 0.04;
CONSTANTS[27] = 0.00097;
CONSTANTS[28] = 0.57;
CONSTANTS[29] = 0.0017;
CONSTANTS[30] = 0.0986;
CONSTANTS[31] = 0.024;
CONSTANTS[32] = 3e-5;
CONSTANTS[33] = CONSTANTS[30]+CONSTANTS[28]+CONSTANTS[29];
CONSTANTS[34] = CONSTANTS[31]+CONSTANTS[26];
CONSTANTS[35] = CONSTANTS[32]+CONSTANTS[27];
}
void
computeRates(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
RATES[0] = (CONSTANTS[1]+(CONSTANTS[2]+ CONSTANTS[3]*STATES[0]+ CONSTANTS[4]*pow(STATES[0], 2.00000))/(1.00000+ CONSTANTS[5]*STATES[0]+ CONSTANTS[6]*pow(STATES[0], 2.00000)+ CONSTANTS[7]*STATES[1]+ CONSTANTS[8]*pow(STATES[1], 2.00000))) -  CONSTANTS[0]*STATES[0];
RATES[2] = (CONSTANTS[10]+ CONSTANTS[11]*STATES[0]+ CONSTANTS[12]*pow(STATES[0], 2.00000))/(1.00000+ CONSTANTS[13]*STATES[0]+ CONSTANTS[14]*pow(STATES[0], 2.00000)+ CONSTANTS[15]*STATES[1]+ CONSTANTS[16]*pow(STATES[1], 2.00000)) -  CONSTANTS[9]*STATES[2];
RATES[1] = (CONSTANTS[17]+( CONSTANTS[18]*STATES[0]+ CONSTANTS[19]*pow(STATES[0], 2.00000)+ CONSTANTS[20]*STATES[2]+ CONSTANTS[21]*pow(STATES[2], 2.00000))/(1.00000+ CONSTANTS[22]*STATES[0]+ CONSTANTS[23]*pow(STATES[0], 2.00000)+ CONSTANTS[24]*STATES[2]+ CONSTANTS[25]*pow(STATES[2], 2.00000))+ CONSTANTS[26]*STATES[3]+ CONSTANTS[27]*STATES[4]) -  CONSTANTS[33]*STATES[1];
RATES[3] =  CONSTANTS[28]*STATES[1] -  CONSTANTS[34]*STATES[3];
RATES[4] =  CONSTANTS[29]*STATES[1] -  CONSTANTS[35]*STATES[4];
}
void
computeVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
}