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 13 entries in the constant variable array.
 */
/*
 * VOI is time in component environment (hour).
 * STATES[0] is Y in component Y (dimensionless).
 * CONSTANTS[0] is C1 in component model_parameters (dimensionless).
 * CONSTANTS[1] is k1 in component model_parameters (first_order_rate_constant).
 * STATES[1] is P in component P (dimensionless).
 * CONSTANTS[2] is K in component model_parameters (dimensionless).
 * CONSTANTS[3] is C in component model_parameters (dimensionless).
 * CONSTANTS[4] is C2 in component model_parameters (dimensionless).
 * CONSTANTS[5] is k2 in component model_parameters (first_order_rate_constant).
 * CONSTANTS[6] is ky in component model_parameters (first_order_rate_constant).
 * STATES[2] is X in component X (dimensionless).
 * CONSTANTS[7] is k3 in component model_parameters (first_order_rate_constant).
 * CONSTANTS[8] is k4 in component model_parameters (first_order_rate_constant).
 * STATES[3] is Z in component Z (dimensionless).
 * CONSTANTS[9] is C3 in component model_parameters (dimensionless).
 * CONSTANTS[10] is k5 in component model_parameters (first_order_rate_constant).
 * CONSTANTS[11] is K2 in component model_parameters (dimensionless).
 * STATES[4] is IL6 in component IL6 (dimensionless).
 * CONSTANTS[12] is k6 in component model_parameters (first_order_rate_constant).
 * RATES[0] is d/dt Y in component Y (dimensionless).
 * RATES[2] is d/dt X in component X (dimensionless).
 * RATES[1] is d/dt P in component P (dimensionless).
 * RATES[3] is d/dt Z in component Z (dimensionless).
 * RATES[4] is d/dt IL6 in component IL6 (dimensionless).
 */
void
initConsts(double* CONSTANTS, double* RATES, double *STATES)
{
STATES[0] = 10.0;
CONSTANTS[0] = 1.0;
CONSTANTS[1] = 1.0;
STATES[1] = 10.0;
CONSTANTS[2] = 5.0;
CONSTANTS[3] = 50.0;
CONSTANTS[4] = 1.0;
CONSTANTS[5] = 1.3;
CONSTANTS[6] = 0.01;
STATES[2] = 500.0;
CONSTANTS[7] = 0.05;
CONSTANTS[8] = 0.9;
STATES[3] = 200.0;
CONSTANTS[9] = 1.0;
CONSTANTS[10] = 5.0;
CONSTANTS[11] = 2.0;
STATES[4] = 1.9;
CONSTANTS[12] = 0.02;
}
void
computeRates(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
RATES[0] =  CONSTANTS[1]*CONSTANTS[0]*(STATES[1]/(CONSTANTS[2]+STATES[1]))*CONSTANTS[3] - ( CONSTANTS[5]*CONSTANTS[4]*(1.00000 - STATES[1]/(CONSTANTS[2]+STATES[1]))*STATES[0]+ CONSTANTS[6]*STATES[0]);
RATES[2] =  CONSTANTS[5]*CONSTANTS[4]*(1.00000 - STATES[1]/(CONSTANTS[2]+STATES[1]))*STATES[0] -  CONSTANTS[7]*STATES[2];
RATES[1] = (VOI>=0.00000&&VOI<6.00000 ? 10.0000 -  CONSTANTS[8]*STATES[1] : VOI>=6.00000&&VOI<12.0000 ? - ( CONSTANTS[8]*STATES[1]) : VOI>=12.0000&&VOI<18.0000 ? 10.0000 -  CONSTANTS[8]*STATES[1] : VOI>=18.0000&&VOI<24.0000 ? - ( CONSTANTS[8]*STATES[1]) : VOI>=24.0000&&VOI<30.0000 ? 10.0000 -  CONSTANTS[8]*STATES[1] : VOI>=30.0000&&VOI<36.0000 ? - ( CONSTANTS[8]*STATES[1]) : VOI>=36.0000&&VOI<42.0000 ? 10.0000 -  CONSTANTS[8]*STATES[1] : VOI>=42.0000&&VOI<48.0000 ? - ( CONSTANTS[8]*STATES[1]) : VOI>=48.0000&&VOI<54.0000 ? 10.0000 -  CONSTANTS[8]*STATES[1] : VOI>=54.0000&&VOI<60.0000 ? - ( CONSTANTS[8]*STATES[1]) : VOI>=60.0000&&VOI<66.0000 ? 10.0000 -  CONSTANTS[8]*STATES[1] : VOI>=66.0000&&VOI<72.0000 ? - ( CONSTANTS[8]*STATES[1]) : VOI>=72.0000&&VOI<78.0000 ? 10.0000 -  CONSTANTS[8]*STATES[1] : VOI>=78.0000&&VOI<84.0000 ? - ( CONSTANTS[8]*STATES[1]) : VOI>=84.0000&&VOI<90.0000 ? 10.0000 -  CONSTANTS[8]*STATES[1] : VOI>=90.0000&&VOI<96.0000 ? - ( CONSTANTS[8]*STATES[1]) : 0.0/0.0);
RATES[3] =  CONSTANTS[10]*CONSTANTS[9]*(STATES[4]/(CONSTANTS[11]+STATES[4])) -  CONSTANTS[12]*STATES[3];
RATES[4] =  0.100000*STATES[2] -  10.0000*STATES[4];
}
void
computeVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
}