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 5 entries in the constant variable array.
 */
/*
 * VOI is time in component environment (millisecond).
 * STATES[0] is R in component R (dimensionless).
 * CONSTANTS[0] is ki in component reaction_constants (second_order_rate_constant).
 * CONSTANTS[1] is ko in component reaction_constants (third_order_rate_constant).
 * CONSTANTS[2] is kim in component reaction_constants (first_order_rate_constant).
 * CONSTANTS[3] is kom in component reaction_constants (first_order_rate_constant).
 * STATES[1] is RI in component RI (dimensionless).
 * STATES[2] is O in component O (dimensionless).
 * CONSTANTS[4] is Ca in component reaction_constants (millimolar).
 * STATES[3] is I in component I (dimensionless).
 * RATES[0] is d/dt R in component R (dimensionless).
 * RATES[2] is d/dt O in component O (dimensionless).
 * RATES[3] is d/dt I in component I (dimensionless).
 * RATES[1] is d/dt RI in component RI (dimensionless).
 */
void
initConsts(double* CONSTANTS, double* RATES, double *STATES)
{
STATES[0] = 1;
CONSTANTS[0] = 0.5;
CONSTANTS[1] = 35;
CONSTANTS[2] = 0.005;
CONSTANTS[3] = 0.06;
STATES[1] = 1;
STATES[2] = 1;
CONSTANTS[4] = 0.0001;
STATES[3] = 1;
}
void
computeRates(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
RATES[0] = ( CONSTANTS[3]*STATES[2]+ CONSTANTS[2]*STATES[1]) - ( CONSTANTS[1]*pow(CONSTANTS[4], 2.00000)*STATES[0]+ CONSTANTS[0]*CONSTANTS[4]*STATES[0]);
RATES[2] = ( CONSTANTS[2]*STATES[3]+ CONSTANTS[1]*pow(CONSTANTS[4], 2.00000)*STATES[0]) - ( CONSTANTS[3]*STATES[2]+ CONSTANTS[0]*CONSTANTS[4]*STATES[2]);
RATES[3] = ( CONSTANTS[0]*CONSTANTS[4]*STATES[2]+ CONSTANTS[1]*pow(CONSTANTS[4], 2.00000)*STATES[1]) - ( CONSTANTS[2]*STATES[3]+ CONSTANTS[3]*STATES[3]);
RATES[1] = ( CONSTANTS[0]*CONSTANTS[4]*STATES[0]+ CONSTANTS[3]*STATES[3]) - ( CONSTANTS[2]*STATES[1]+ CONSTANTS[1]*pow(CONSTANTS[4], 2.00000)*STATES[1]);
}
void
computeVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
}