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 17 entries in each of the rate and state variable arrays.
   There are a total of 18 entries in the constant variable array.
 */
/*
 * VOI is time in component environment (second).
 * STATES[0] is T in component T (dimensionless).
 * CONSTANTS[0] is delta in component model_parameters (first_order_rate_constant).
 * CONSTANTS[1] is gamma in component model_parameters (first_order_rate_constant).
 * CONSTANTS[2] is lambda in component model_parameters (first_order_rate_constant).
 * STATES[1] is v in component v (dimensionless).
 * STATES[2] is I in component I (dimensionless).
 * CONSTANTS[3] is alpha in component model_parameters (first_order_rate_constant).
 * CONSTANTS[4] is p in component model_parameters (first_order_rate_constant).
 * STATES[3] is z in component z (dimensionless).
 * STATES[4] is w in component w (dimensionless).
 * STATES[5] is x in component x (dimensionless).
 * CONSTANTS[5] is r in component model_parameters (first_order_rate_constant).
 * STATES[6] is y in component y (dimensionless).
 * CONSTANTS[6] is k in component model_parameters (dimensionless).
 * CONSTANTS[7] is d in component model_parameters (first_order_rate_constant).
 * CONSTANTS[8] is beta in component model_parameters (first_order_rate_constant).
 * CONSTANTS[9] is a in component model_parameters (first_order_rate_constant).
 * CONSTANTS[10] is u in component model_parameters (first_order_rate_constant).
 * CONSTANTS[11] is eta in component model_parameters (first_order_rate_constant).
 * CONSTANTS[12] is xi in component model_parameters (first_order_rate_constant).
 * CONSTANTS[13] is rho in component model_parameters (first_order_rate_constant).
 * CONSTANTS[14] is phi in component model_parameters (first_order_rate_constant).
 * STATES[7] is m_9 in component m_9 (dimensionless).
 * STATES[8] is m_8 in component m_8 (dimensionless).
 * STATES[9] is m_7 in component m_7 (dimensionless).
 * STATES[10] is m_6 in component m_6 (dimensionless).
 * STATES[11] is m_5 in component m_5 (dimensionless).
 * STATES[12] is m_4 in component m_4 (dimensionless).
 * STATES[13] is m_3 in component m_3 (dimensionless).
 * STATES[14] is m_2 in component m_2 (dimensionless).
 * STATES[15] is m_1 in component m_1 (dimensionless).
 * STATES[16] is m_0 in component m_0 (dimensionless).
 * CONSTANTS[15] is b in component model_parameters (first_order_rate_constant).
 * CONSTANTS[16] is epsilon in component model_parameters (dimensionless).
 * CONSTANTS[17] is c in component model_parameters (first_order_rate_constant).
 * RATES[0] is d/dt T in component T (dimensionless).
 * RATES[2] is d/dt I in component I (dimensionless).
 * RATES[5] is d/dt x in component x (dimensionless).
 * RATES[6] is d/dt y in component y (dimensionless).
 * RATES[1] is d/dt v in component v (dimensionless).
 * RATES[4] is d/dt w in component w (dimensionless).
 * RATES[7] is d/dt m_9 in component m_9 (dimensionless).
 * RATES[8] is d/dt m_8 in component m_8 (dimensionless).
 * RATES[9] is d/dt m_7 in component m_7 (dimensionless).
 * RATES[10] is d/dt m_6 in component m_6 (dimensionless).
 * RATES[11] is d/dt m_5 in component m_5 (dimensionless).
 * RATES[12] is d/dt m_4 in component m_4 (dimensionless).
 * RATES[13] is d/dt m_3 in component m_3 (dimensionless).
 * RATES[14] is d/dt m_2 in component m_2 (dimensionless).
 * RATES[15] is d/dt m_1 in component m_1 (dimensionless).
 * RATES[16] is d/dt m_0 in component m_0 (dimensionless).
 * RATES[3] is d/dt z in component z (dimensionless).
 */
void
initConsts(double* CONSTANTS, double* RATES, double *STATES)
{
STATES[0] = 1000.0;
CONSTANTS[0] = 0.01;
CONSTANTS[1] = 0.01;
CONSTANTS[2] = 1.0;
STATES[1] = 0.0001;
STATES[2] = 0.0001;
CONSTANTS[3] = 0.2;
CONSTANTS[4] = 45.0;
STATES[3] = 0.0;
STATES[4] = 0.0;
STATES[5] = 10.0;
CONSTANTS[5] = 1.0;
STATES[6] = 0.0;
CONSTANTS[6] = 10.0;
CONSTANTS[7] = 0.001;
CONSTANTS[8] = 0.3;
CONSTANTS[9] = 0.2;
CONSTANTS[10] = 1.0;
CONSTANTS[11] = 1.0;
CONSTANTS[12] = 0.01;
CONSTANTS[13] = 0.3;
CONSTANTS[14] = 1.5;
STATES[7] = 0.0;
STATES[8] = 0.0;
STATES[9] = 0.0;
STATES[10] = 0.0;
STATES[11] = 0.0;
STATES[12] = 0.0;
STATES[13] = 0.0;
STATES[14] = 0.0;
STATES[15] = 0.0;
STATES[16] = 0.1;
CONSTANTS[15] = 0.1;
CONSTANTS[16] = 1.0;
CONSTANTS[17] = 1.0;
}
void
computeRates(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
RATES[0] = CONSTANTS[2] - ( CONSTANTS[0]*STATES[0]+ CONSTANTS[1]*STATES[0]*STATES[1]);
RATES[2] =  CONSTANTS[1]*STATES[0]*STATES[1] - ( CONSTANTS[3]*STATES[2]+ CONSTANTS[4]*STATES[2]*(STATES[3]+STATES[4]));
RATES[5] =  CONSTANTS[5]*STATES[5]*STATES[1]*(1.00000 - (STATES[5]+STATES[6])/CONSTANTS[6]) - ( CONSTANTS[7]*STATES[5]+ CONSTANTS[8]*STATES[5]*STATES[1]);
RATES[6] = ( CONSTANTS[8]*STATES[5]*STATES[1]+ CONSTANTS[5]*STATES[6]*STATES[1]*(1.00000 - (STATES[5]+STATES[6])/CONSTANTS[6])) - ( CONSTANTS[9]*STATES[6]+ CONSTANTS[4]*STATES[6]*(STATES[3]+STATES[4]));
RATES[1] =  CONSTANTS[11]*(STATES[6]+STATES[2]) -  CONSTANTS[10]*STATES[1];
RATES[4] =  2.00000*CONSTANTS[13]*STATES[7] - ( CONSTANTS[12]*STATES[4]+ CONSTANTS[14]*STATES[4]);
RATES[7] =  2.00000*CONSTANTS[13]*STATES[8] -  CONSTANTS[13]*STATES[7];
RATES[8] =  2.00000*CONSTANTS[13]*STATES[9] -  CONSTANTS[13]*STATES[8];
RATES[9] =  2.00000*CONSTANTS[13]*STATES[10] -  CONSTANTS[13]*STATES[9];
RATES[10] =  2.00000*CONSTANTS[13]*STATES[11] -  CONSTANTS[13]*STATES[10];
RATES[11] =  2.00000*CONSTANTS[13]*STATES[12] -  CONSTANTS[13]*STATES[11];
RATES[12] =  2.00000*CONSTANTS[13]*STATES[13] -  CONSTANTS[13]*STATES[12];
RATES[13] =  2.00000*CONSTANTS[13]*STATES[14] -  CONSTANTS[13]*STATES[13];
RATES[14] =  2.00000*CONSTANTS[13]*STATES[15] -  CONSTANTS[13]*STATES[14];
RATES[15] =  2.00000*CONSTANTS[13]*STATES[16] -  CONSTANTS[13]*STATES[15];
RATES[16] = - ( CONSTANTS[13]*STATES[16]);
RATES[3] = ( CONSTANTS[12]*STATES[4]+ CONSTANTS[17]*STATES[5]*(STATES[6]+STATES[2])*(STATES[3]/( CONSTANTS[16]*STATES[5]+1.00000))) -  CONSTANTS[15]*STATES[3];
}
void
computeVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
}