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 1 entries in the algebraic variable array.
   There are a total of 14 entries in each of the rate and state variable arrays.
   There are a total of 20 entries in the constant variable array.
 */
/*
 * VOI is time in component environment (second).
 * STATES[0] is Fe3 in component Fe3 (micromolar).
 * CONSTANTS[0] is Arg in component model_constants (micromolar).
 * STATES[1] is Fe3_Arg in component Fe3_Arg (micromolar).
 * STATES[2] is Fe3_NO in component Fe3_NO (micromolar).
 * STATES[3] is Fe2_NO in component Fe2_NO (micromolar).
 * CONSTANTS[1] is O2 in component model_constants (micromolar).
 * CONSTANTS[2] is k1 in component model_constants (second_order_rate_constant).
 * CONSTANTS[3] is k_1 in component model_constants (first_order_rate_constant).
 * CONSTANTS[4] is k2 in component model_constants (first_order_rate_constant).
 * CONSTANTS[5] is k13 in component model_constants (first_order_rate_constant).
 * CONSTANTS[6] is k12 in component model_constants (second_order_rate_constant).
 * CONSTANTS[7] is k3 in component model_constants (first_order_rate_constant).
 * STATES[4] is Fe2 in component Fe2 (micromolar).
 * STATES[5] is Fe2_Arg in component Fe2_Arg (micromolar).
 * CONSTANTS[8] is k_4 in component model_constants (first_order_rate_constant).
 * CONSTANTS[9] is k4 in component model_constants (second_order_rate_constant).
 * STATES[6] is Fe3_O2_Arg in component Fe3_O2_Arg (micromolar).
 * CONSTANTS[10] is k5 in component model_constants (second_order_rate_constant).
 * CONSTANTS[11] is k_5 in component model_constants (first_order_rate_constant).
 * CONSTANTS[12] is k6 in component model_constants (first_order_rate_constant).
 * STATES[7] is Fe3_NOHA in component Fe3_NOHA (micromolar).
 * CONSTANTS[13] is k7 in component model_constants (first_order_rate_constant).
 * STATES[8] is Fe2_NOHA in component Fe2_NOHA (micromolar).
 * STATES[9] is NOHA in component NOHA (micromolar).
 * STATES[10] is Fe3_O2_NOHA in component Fe3_O2_NOHA (micromolar).
 * CONSTANTS[14] is k9 in component model_constants (second_order_rate_constant).
 * CONSTANTS[15] is k_9 in component model_constants (first_order_rate_constant).
 * CONSTANTS[16] is k_8 in component model_constants (first_order_rate_constant).
 * CONSTANTS[17] is k8 in component model_constants (second_order_rate_constant).
 * CONSTANTS[18] is k10 in component model_constants (first_order_rate_constant).
 * CONSTANTS[19] is k11 in component model_constants (first_order_rate_constant).
 * STATES[11] is NO in component NO (micromolar).
 * ALGEBRAIC[0] is dNOdt in component NO (flux).
 * STATES[12] is citrulline in component citrulline (micromolar).
 * STATES[13] is NO3 in component NO3 (micromolar).
 * RATES[0] is d/dt Fe3 in component Fe3 (micromolar).
 * RATES[1] is d/dt Fe3_Arg in component Fe3_Arg (micromolar).
 * RATES[4] is d/dt Fe2 in component Fe2 (micromolar).
 * RATES[5] is d/dt Fe2_Arg in component Fe2_Arg (micromolar).
 * RATES[6] is d/dt Fe3_O2_Arg in component Fe3_O2_Arg (micromolar).
 * RATES[7] is d/dt Fe3_NOHA in component Fe3_NOHA (micromolar).
 * RATES[8] is d/dt Fe2_NOHA in component Fe2_NOHA (micromolar).
 * RATES[10] is d/dt Fe3_O2_NOHA in component Fe3_O2_NOHA (micromolar).
 * RATES[2] is d/dt Fe3_NO in component Fe3_NO (micromolar).
 * RATES[3] is d/dt Fe2_NO in component Fe2_NO (micromolar).
 * RATES[11] is d/dt NO in component NO (micromolar).
 * RATES[12] is d/dt citrulline in component citrulline (micromolar).
 * RATES[13] is d/dt NO3 in component NO3 (micromolar).
 * RATES[9] is d/dt NOHA in component NOHA (micromolar).
 */
void
initConsts(double* CONSTANTS, double* RATES, double *STATES)
{
STATES[0] = 0.9;
CONSTANTS[0] = 100.0;
STATES[1] = 0.0;
STATES[2] = 0.0;
STATES[3] = 0.0;
CONSTANTS[1] = 100.0;
CONSTANTS[2] = 6.6;
CONSTANTS[3] = 6.6;
CONSTANTS[4] = 20.8;
CONSTANTS[5] = 39.9;
CONSTANTS[6] = 0.01;
CONSTANTS[7] = 20.8;
STATES[4] = 0.0;
STATES[5] = 0.0;
CONSTANTS[8] = 6.6;
CONSTANTS[9] = 6.6;
STATES[6] = 0.0;
CONSTANTS[10] = 8.5;
CONSTANTS[11] = 215.6;
CONSTANTS[12] = 175.6;
STATES[7] = 0.0;
CONSTANTS[13] = 20.8;
STATES[8] = 0.0;
STATES[9] = 0.0;
STATES[10] = 0.0;
CONSTANTS[14] = 8.6;
CONSTANTS[15] = 399.2;
CONSTANTS[16] = 13.2;
CONSTANTS[17] = 13.2;
CONSTANTS[18] = 39.1;
CONSTANTS[19] = 20.8;
STATES[11] = 0.0;
STATES[12] = 0.0;
STATES[13] = 0.0;
}
void
computeRates(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
RATES[11] =  CONSTANTS[5]*STATES[2];
RATES[0] = ( CONSTANTS[3]*STATES[1]+ CONSTANTS[5]*STATES[2]+ CONSTANTS[6]*STATES[3]*CONSTANTS[1]) - ( CONSTANTS[2]*CONSTANTS[0]*STATES[0]+ CONSTANTS[4]*STATES[0]);
RATES[1] =  CONSTANTS[2]*STATES[0]*CONSTANTS[0] - ( CONSTANTS[3]*STATES[1]+ CONSTANTS[7]*STATES[1]);
RATES[4] = ( CONSTANTS[4]*STATES[0]+ CONSTANTS[8]*STATES[5]) -  CONSTANTS[9]*STATES[4]*CONSTANTS[0];
RATES[5] = ( CONSTANTS[7]*STATES[1]+ CONSTANTS[11]*STATES[6]+ CONSTANTS[9]*STATES[4]*CONSTANTS[0]) - ( CONSTANTS[10]*STATES[5]*CONSTANTS[1]+ CONSTANTS[8]*STATES[5]);
RATES[6] =  CONSTANTS[10]*STATES[5]*CONSTANTS[1] - ( CONSTANTS[12]*STATES[6]+ CONSTANTS[11]*STATES[6]);
RATES[7] =  CONSTANTS[12]*STATES[6] -  CONSTANTS[13]*STATES[7];
RATES[8] = ( CONSTANTS[13]*STATES[7]+ CONSTANTS[15]*STATES[10]+ CONSTANTS[17]*STATES[4]*STATES[9]) - ( CONSTANTS[16]*STATES[8]+ CONSTANTS[14]*STATES[8]*CONSTANTS[1]);
RATES[10] =  CONSTANTS[14]*STATES[8]*CONSTANTS[1] - ( CONSTANTS[18]*STATES[10]+ CONSTANTS[15]*STATES[10]);
RATES[2] =  CONSTANTS[18]*STATES[10] - ( CONSTANTS[5]*STATES[2]+ CONSTANTS[19]*STATES[2]);
RATES[3] =  CONSTANTS[19]*STATES[2] -  CONSTANTS[6]*STATES[3]*CONSTANTS[1];
RATES[12] =  CONSTANTS[18]*STATES[10];
RATES[13] =  CONSTANTS[6]*STATES[3]*CONSTANTS[1];
RATES[9] =  CONSTANTS[16]*STATES[8] -  CONSTANTS[17]*STATES[4]*STATES[9];
}
void
computeVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
ALGEBRAIC[0] = RATES[11];
}