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 14 entries in the constant variable array.
 */
/*
 * VOI is time in component environment (second).
 * STATES[0] is X1 in component X1 (nanomolar).
 * CONSTANTS[0] is a1 in component X1 (flux).
 * CONSTANTS[1] is b1 in component X1 (flux).
 * CONSTANTS[2] is A1 in component X1 (dimensionless).
 * CONSTANTS[3] is k11 in component X1 (per_nanomolar).
 * CONSTANTS[4] is k12 in component X1 (per_nanomolar).
 * STATES[1] is Y1 in component Y1 (nanomolar).
 * STATES[2] is Y2 in component Y2 (nanomolar).
 * CONSTANTS[5] is beta_1 in component Y1 (flux).
 * CONSTANTS[6] is alpha_1 in component Y1 (first_order_rate_constant).
 * STATES[3] is X2 in component X2 (nanomolar).
 * CONSTANTS[7] is a2 in component X2 (flux).
 * CONSTANTS[8] is b2 in component X2 (flux).
 * CONSTANTS[9] is A2 in component X2 (dimensionless).
 * CONSTANTS[10] is k21 in component X2 (per_nanomolar).
 * CONSTANTS[11] is k22 in component X2 (per_nanomolar).
 * CONSTANTS[12] is beta_2 in component Y2 (flux).
 * CONSTANTS[13] is alpha_2 in component Y2 (first_order_rate_constant).
 * RATES[0] is d/dt X1 in component X1 (nanomolar).
 * RATES[1] is d/dt Y1 in component Y1 (nanomolar).
 * RATES[3] is d/dt X2 in component X2 (nanomolar).
 * RATES[2] is d/dt Y2 in component Y2 (nanomolar).
 */
void
initConsts(double* CONSTANTS, double* RATES, double *STATES)
{
STATES[0] = 7;
CONSTANTS[0] = 360;
CONSTANTS[1] = 10;
CONSTANTS[2] = 36;
CONSTANTS[3] = 1;
CONSTANTS[4] = 0;
STATES[1] = -10;
STATES[2] = -10;
CONSTANTS[5] = 0;
CONSTANTS[6] = 0.5;
STATES[3] = 7;
CONSTANTS[7] = 360;
CONSTANTS[8] = 10;
CONSTANTS[9] = 43;
CONSTANTS[10] = 0;
CONSTANTS[11] = 1;
CONSTANTS[12] = 0;
CONSTANTS[13] = 0.6;
}
void
computeRates(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
RATES[0] = CONSTANTS[0]/(CONSTANTS[2]+ CONSTANTS[3]*STATES[1]+ CONSTANTS[4]*STATES[2]) - CONSTANTS[1];
RATES[1] =  CONSTANTS[6]*STATES[0] - CONSTANTS[5];
RATES[3] = CONSTANTS[7]/(CONSTANTS[9]+ CONSTANTS[10]*STATES[1]+ CONSTANTS[11]*STATES[2]) - CONSTANTS[8];
RATES[2] =  CONSTANTS[13]*STATES[3] - CONSTANTS[12];
}
void
computeVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
}