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 6 entries in each of the rate and state variable arrays.
There are a total of 11 entries in the constant variable array.
*/
/*
* VOI is time in component environment (second).
* STATES[0] is C1 in component C1 (dimensionless).
* CONSTANTS[0] is C1C2 in component reaction_constants (second_order_rate_constant).
* CONSTANTS[1] is C2C1 in component reaction_constants (first_order_rate_constant).
* STATES[1] is C2 in component C2 (dimensionless).
* CONSTANTS[2] is Ca in component reaction_constants (micromolar).
* CONSTANTS[3] is C2C3 in component reaction_constants (second_order_rate_constant).
* CONSTANTS[4] is C3C2 in component reaction_constants (first_order_rate_constant).
* CONSTANTS[5] is C2O1 in component reaction_constants (second_order_rate_constant).
* CONSTANTS[6] is O1C2 in component reaction_constants (first_order_rate_constant).
* STATES[2] is C3 in component C3 (dimensionless).
* STATES[3] is O1 in component O1 (dimensionless).
* CONSTANTS[7] is O2C3 in component reaction_constants (first_order_rate_constant).
* CONSTANTS[8] is C3O2 in component reaction_constants (second_order_rate_constant).
* STATES[4] is O2 in component O2 (dimensionless).
* STATES[5] is C4 in component C4 (dimensionless).
* CONSTANTS[9] is O2C4 in component reaction_constants (first_order_rate_constant).
* CONSTANTS[10] is C4O2 in component reaction_constants (first_order_rate_constant).
* RATES[0] is d/dt C1 in component C1 (dimensionless).
* RATES[1] is d/dt C2 in component C2 (dimensionless).
* RATES[2] is d/dt C3 in component C3 (dimensionless).
* RATES[5] is d/dt C4 in component C4 (dimensionless).
* RATES[3] is d/dt O1 in component O1 (dimensionless).
* RATES[4] is d/dt O2 in component O2 (dimensionless).
*/
void
initConsts(double* CONSTANTS, double* RATES, double *STATES)
{
STATES[0] = 0.1667;
CONSTANTS[0] = 3.26;
CONSTANTS[1] = 116.0;
STATES[1] = 0.1667;
CONSTANTS[2] = 50.0;
CONSTANTS[3] = 0.66;
CONSTANTS[4] = 163.0;
CONSTANTS[5] = 7.86;
CONSTANTS[6] = 1480.0;
STATES[2] = 0.1667;
STATES[3] = 0.1667;
CONSTANTS[7] = 330.0;
CONSTANTS[8] = 7.77;
STATES[4] = 0.1667;
STATES[5] = 0.1667;
CONSTANTS[9] = 298.0;
CONSTANTS[10] = 2390.0;
}
void
computeRates(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
RATES[0] = CONSTANTS[1]*STATES[1] - CONSTANTS[0]*CONSTANTS[2]*STATES[1];
RATES[1] = ( CONSTANTS[0]*STATES[0]*CONSTANTS[2]+ CONSTANTS[4]*STATES[2]+ CONSTANTS[6]*STATES[3]) - ( CONSTANTS[1]*STATES[1]+ CONSTANTS[3]*CONSTANTS[2]*STATES[1]+ CONSTANTS[5]*CONSTANTS[2]*STATES[3]);
RATES[2] = ( CONSTANTS[7]*STATES[4]+ CONSTANTS[3]*CONSTANTS[2]*STATES[1]) - ( CONSTANTS[8]*CONSTANTS[2]*STATES[2]+ CONSTANTS[4]*STATES[2]);
RATES[5] = CONSTANTS[9]*STATES[4] - CONSTANTS[10]*STATES[5];
RATES[3] = CONSTANTS[5]*STATES[1]*CONSTANTS[2] - CONSTANTS[6]*STATES[3];
RATES[4] = ( CONSTANTS[8]*CONSTANTS[2]*STATES[2]+ CONSTANTS[10]*STATES[5]) - ( CONSTANTS[7]*STATES[4]+ CONSTANTS[9]*STATES[4]);
}
void
computeVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
}
