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 3 entries in each of the rate and state variable arrays.
   There are a total of 8 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 (first_order_rate_constant).
 * CONSTANTS[2] is A1 in component X1 (dimensionless).
 * CONSTANTS[3] is k1 in component X1 (per_nanomolar).
 * STATES[1] is Z1 in component Z1 (nanomolar).
 * STATES[2] is Y1 in component Y1 (nanomolar).
 * CONSTANTS[4] is beta_1 in component Y1 (first_order_rate_constant).
 * CONSTANTS[5] is alpha_1 in component Y1 (first_order_rate_constant).
 * CONSTANTS[6] is gamma_1 in component Z1 (first_order_rate_constant).
 * CONSTANTS[7] is delta_1 in component Z1 (first_order_rate_constant).
 * RATES[0] is d/dt X1 in component X1 (nanomolar).
 * RATES[2] is d/dt Y1 in component Y1 (nanomolar).
 * RATES[1] is d/dt Z1 in component Z1 (nanomolar).
 */
void
initConsts(double* CONSTANTS, double* RATES, double *STATES)
{
STATES[0] = 7;
CONSTANTS[0] = 360;
CONSTANTS[1] = 1;
CONSTANTS[2] = 43;
CONSTANTS[3] = 1;
STATES[1] = 0;
STATES[2] = 0;
CONSTANTS[4] = 0.6;
CONSTANTS[5] = 1;
CONSTANTS[6] = 1;
CONSTANTS[7] = 0.8;
}
void
computeRates(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
RATES[0] = CONSTANTS[0]/(CONSTANTS[2]+ CONSTANTS[3]*STATES[1]) -  CONSTANTS[1]*STATES[0];
RATES[2] =  CONSTANTS[5]*STATES[0] -  CONSTANTS[4]*STATES[2];
RATES[1] =  CONSTANTS[6]*STATES[2] -  CONSTANTS[7]*STATES[1];
}
void
computeVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
}