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 4 entries in each of the rate and state variable arrays.
   There are a total of 10 entries in the constant variable array.
 */
/*
 * VOI is time in component environment (day).
 * STATES[0] is x in component x (dimensionless).
 * CONSTANTS[0] is d1 in component model_parameters (first_order_rate_constant).
 * CONSTANTS[1] is a in component model_parameters (first_order_rate_constant).
 * CONSTANTS[8] is alpha in component model_parameters (first_order_rate_constant).
 * CONSTANTS[2] is mu in component model_parameters (first_order_rate_constant).
 * CONSTANTS[3] is r in component model_parameters (first_order_rate_constant).
 * STATES[1] is y in component y (dimensionless).
 * STATES[2] is w in component w (dimensionless).
 * CONSTANTS[4] is kappa in component model_parameters (dimensionless).
 * CONSTANTS[9] is d2 in component y (first_order_rate_constant).
 * CONSTANTS[5] is p in component model_parameters (first_order_rate_constant).
 * STATES[3] is z in component z (dimensionless).
 * CONSTANTS[6] is f in component w (dimensionless).
 * CONSTANTS[7] is v in component z (first_order_rate_constant).
 * RATES[0] is d/dt x in component x (dimensionless).
 * RATES[1] is d/dt y in component y (dimensionless).
 * RATES[2] is d/dt w in component w (dimensionless).
 * RATES[3] is d/dt z in component z (dimensionless).
 */
void
initConsts(double* CONSTANTS, double* RATES, double *STATES)
{
STATES[0] = 10E-1;
CONSTANTS[0] = 0.005;
CONSTANTS[1] = 0.03333;
CONSTANTS[2] = 0.023;
CONSTANTS[3] = 1.0;
STATES[1] = 0.0;
STATES[2] = 0.0;
CONSTANTS[4] = 1.0;
CONSTANTS[5] = 200.0;
STATES[3] = 0.01;
CONSTANTS[6] = 100.0;
CONSTANTS[7] = 0.5;
CONSTANTS[8] =  0.0100000*CONSTANTS[1];
CONSTANTS[9] = (- ( 99.0000*CONSTANTS[1]*CONSTANTS[0])+ CONSTANTS[1]*CONSTANTS[3]+ CONSTANTS[0]*CONSTANTS[3])/(CONSTANTS[1] - CONSTANTS[0]);
}
void
computeRates(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
RATES[0] = ( 2.00000*CONSTANTS[3]*STATES[1]+ 0.100000*CONSTANTS[2]*STATES[2]) - ( CONSTANTS[1]*STATES[0]*(1.00000 - STATES[0]/CONSTANTS[4])+ CONSTANTS[0]*STATES[0]*(STATES[0]/CONSTANTS[4])+ CONSTANTS[8]*STATES[0]);
RATES[1] =  CONSTANTS[1]*STATES[0]*(1.00000 - STATES[0]/CONSTANTS[4]) - ( (CONSTANTS[3]+CONSTANTS[9])*STATES[1]+ CONSTANTS[5]*STATES[3]*STATES[1]);
RATES[2] =  CONSTANTS[6]*CONSTANTS[8]*STATES[0] - ( CONSTANTS[2]*STATES[2]+ CONSTANTS[5]*STATES[2]*STATES[3]);
RATES[3] =  CONSTANTS[5]*STATES[3]*(STATES[1]+STATES[2]) -  CONSTANTS[7]*STATES[3];
}
void
computeVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
}