Generated Code

The following is c_ida code generated by the CellML API from this CellML file. (Back to language selection)

The raw code is available.

/*
   There are a total of 2 entries in the algebraic variable array.
   There are a total of 15 entries in each of the rate and state variable arrays.
   There are a total of 21 entries in the constant variable array.
 */
/*
 * VOI is time in component environment (second).
 * STATES[0] is Arg in component Arg (micromolar).
 * ALGEBRAIC[0] is S in component Arg (flux).
 * STATES[1] is Fe3 in component Fe3 (micromolar).
 * STATES[2] is Fe3_Arg in component Fe3_Arg (micromolar).
 * STATES[3] is Fe2_Arg in component Fe2_Arg (micromolar).
 * STATES[4] is Fe2 in component Fe2 (micromolar).
 * CONSTANTS[0] is k1 in component model_constants (second_order_rate_constant).
 * CONSTANTS[1] is k_1 in component model_constants (first_order_rate_constant).
 * CONSTANTS[2] is k4 in component model_constants (second_order_rate_constant).
 * CONSTANTS[3] is k_4 in component model_constants (first_order_rate_constant).
 * STATES[5] is Fe3_NO in component Fe3_NO (micromolar).
 * STATES[6] is Fe2_NO in component Fe2_NO (micromolar).
 * CONSTANTS[4] is O2 in component model_constants (micromolar).
 * STATES[7] is Fe3_NOHA in component Fe3_NOHA (micromolar).
 * STATES[8] is NOHA in component NOHA (micromolar).
 * CONSTANTS[5] is k2 in component model_constants (first_order_rate_constant).
 * CONSTANTS[6] is k13 in component model_constants (second_order_rate_constant).
 * CONSTANTS[7] is k14 in component model_constants (first_order_rate_constant).
 * CONSTANTS[8] is k8 in component model_constants (first_order_rate_constant).
 * CONSTANTS[9] is k_8 in component model_constants (second_order_rate_constant).
 * CONSTANTS[10] is k3 in component model_constants (first_order_rate_constant).
 * STATES[9] is Fe2_NOHA in component Fe2_NOHA (micromolar).
 * CONSTANTS[11] is k9 in component model_constants (first_order_rate_constant).
 * CONSTANTS[12] is k_9 in component model_constants (second_order_rate_constant).
 * STATES[10] is Fe3_O2_Arg in component Fe3_O2_Arg (micromolar).
 * CONSTANTS[13] is k5 in component model_constants (second_order_rate_constant).
 * CONSTANTS[14] is k_5 in component model_constants (first_order_rate_constant).
 * CONSTANTS[15] is k6 in component model_constants (first_order_rate_constant).
 * CONSTANTS[16] is k7 in component model_constants (first_order_rate_constant).
 * STATES[11] is Fe3_O2_NOHA in component Fe3_O2_NOHA (micromolar).
 * CONSTANTS[17] is k_10 in component model_constants (first_order_rate_constant).
 * CONSTANTS[18] is k10 in component model_constants (second_order_rate_constant).
 * CONSTANTS[19] is k11 in component model_constants (first_order_rate_constant).
 * CONSTANTS[20] is k12 in component model_constants (first_order_rate_constant).
 * STATES[12] is NO in component NO (micromolar).
 * ALGEBRAIC[1] is dNOdt in component NO (flux).
 * STATES[13] is citrulline in component citrulline (micromolar).
 * STATES[14] is NO3 in component NO3 (micromolar).
 * RATES[0] is d/dt Arg in component Arg (micromolar).
 * RATES[1] is d/dt Fe3 in component Fe3 (micromolar).
 * RATES[2] is d/dt Fe3_Arg in component Fe3_Arg (micromolar).
 * RATES[4] is d/dt Fe2 in component Fe2 (micromolar).
 * RATES[3] is d/dt Fe2_Arg in component Fe2_Arg (micromolar).
 * RATES[10] 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[9] is d/dt Fe2_NOHA in component Fe2_NOHA (micromolar).
 * RATES[11] is d/dt Fe3_O2_NOHA in component Fe3_O2_NOHA (micromolar).
 * RATES[5] is d/dt Fe3_NO in component Fe3_NO (micromolar).
 * RATES[6] is d/dt Fe2_NO in component Fe2_NO (micromolar).
 * RATES[12] is d/dt NO in component NO (micromolar).
 * RATES[13] is d/dt citrulline in component citrulline (micromolar).
 * RATES[14] is d/dt NO3 in component NO3 (micromolar).
 * RATES[8] is d/dt NOHA in component NOHA (micromolar).
 * There are a total of 0 condition variables.
 */
void
initConsts(double* CONSTANTS, double* RATES, double *STATES)
{
STATES[0] = 100.0;
STATES[1] = 0.045;
STATES[2] = 0.0;
STATES[3] = 0.0;
STATES[4] = 0.0;
CONSTANTS[0] = 0.1;
CONSTANTS[1] = 0.1;
CONSTANTS[2] = 1.89;
CONSTANTS[3] = 11.4;
STATES[5] = 0.0;
STATES[6] = 0.0;
CONSTANTS[4] = 172.0;
STATES[7] = 0.0;
STATES[8] = 0.0;
CONSTANTS[5] = 0.91;
CONSTANTS[6] = 0.033;
CONSTANTS[7] = 53.9;
CONSTANTS[8] = 0.1;
CONSTANTS[9] = 0.1;
CONSTANTS[10] = 0.91;
STATES[9] = 0.0;
CONSTANTS[11] = 11.4;
CONSTANTS[12] = 1.89;
STATES[10] = 0.0;
CONSTANTS[13] = 2.58;
CONSTANTS[14] = 98.0;
CONSTANTS[15] = 12.6;
CONSTANTS[16] = 0.91;
STATES[11] = 0.0;
CONSTANTS[17] = 89.9;
CONSTANTS[18] = 3.33;
CONSTANTS[19] = 29.4;
CONSTANTS[20] = 0.91;
STATES[12] = 0.0;
STATES[13] = 0.0;
STATES[14] = 0.0;
RATES[0] = 0.1001;
RATES[1] = 0.1001;
RATES[2] = 0.1001;
RATES[4] = 0.1001;
RATES[3] = 0.1001;
RATES[10] = 0.1001;
RATES[7] = 0.1001;
RATES[9] = 0.1001;
RATES[11] = 0.1001;
RATES[5] = 0.1001;
RATES[6] = 0.1001;
RATES[12] = 0.1001;
RATES[13] = 0.1001;
RATES[14] = 0.1001;
RATES[8] = 0.1001;
}
void
computeResiduals(double VOI, double* CONSTANTS, double* RATES, double* OLDRATES, double* STATES,
                 double* OLDSTATES, double* ALGEBRAIC, double* CONDVARS)
{
resid[0] = RATES[0] - ( CONSTANTS[1]*STATES[2]+ CONSTANTS[3]*STATES[3]+ALGEBRAIC[0]) - ( CONSTANTS[0]*STATES[0]*STATES[1]+ CONSTANTS[2]*STATES[0]*STATES[4]);
resid[1] = RATES[1] - ( CONSTANTS[1]*STATES[2]+ CONSTANTS[7]*STATES[5]+ CONSTANTS[6]*STATES[6]*CONSTANTS[4]+ CONSTANTS[8]*STATES[7]) - ( CONSTANTS[0]*STATES[0]*STATES[1]+ CONSTANTS[5]*STATES[1]+ CONSTANTS[9]*STATES[8]*STATES[1]);
resid[2] = RATES[2] -  CONSTANTS[0]*STATES[1]*STATES[0] - ( CONSTANTS[1]*STATES[2]+ CONSTANTS[10]*STATES[2]);
resid[3] = RATES[4] - ( CONSTANTS[5]*STATES[1]+ CONSTANTS[3]*STATES[3]+ CONSTANTS[11]*STATES[9]) - ( CONSTANTS[2]*STATES[4]*STATES[0]+ CONSTANTS[12]*STATES[4]*STATES[8]);
resid[4] = RATES[3] - ( CONSTANTS[10]*STATES[2]+ CONSTANTS[14]*STATES[10]+ CONSTANTS[2]*STATES[4]*STATES[0]) - ( CONSTANTS[13]*STATES[3]*CONSTANTS[4]+ CONSTANTS[3]*STATES[3]);
resid[5] = RATES[10] -  CONSTANTS[13]*STATES[3]*CONSTANTS[4] - ( CONSTANTS[15]*STATES[10]+ CONSTANTS[14]*STATES[10]);
resid[6] = RATES[7] - ( CONSTANTS[15]*STATES[10]+ CONSTANTS[9]*STATES[1]*STATES[8]) - ( CONSTANTS[16]*STATES[7]+ CONSTANTS[8]*STATES[7]);
resid[7] = RATES[9] - ( CONSTANTS[16]*STATES[7]+ CONSTANTS[17]*STATES[11]+ CONSTANTS[12]*STATES[4]*STATES[8]) - ( CONSTANTS[11]*STATES[9]+ CONSTANTS[18]*STATES[9]*CONSTANTS[4]);
resid[8] = RATES[11] -  CONSTANTS[18]*STATES[9]*CONSTANTS[4] - ( CONSTANTS[19]*STATES[11]+ CONSTANTS[17]*STATES[11]);
resid[9] = RATES[5] -  CONSTANTS[19]*STATES[11] - ( CONSTANTS[7]*STATES[5]+ CONSTANTS[20]*STATES[5]);
resid[10] = RATES[6] -  CONSTANTS[20]*STATES[5] -  CONSTANTS[6]*STATES[6]*CONSTANTS[4];
resid[11] = RATES[12] -  CONSTANTS[7]*STATES[5];
resid[12] = RATES[13] -  CONSTANTS[19]*STATES[11];
resid[13] = RATES[14] -  CONSTANTS[6]*STATES[6]*CONSTANTS[4];
resid[14] = RATES[8] - ( CONSTANTS[8]*STATES[7]+ CONSTANTS[11]*STATES[9]) - ( CONSTANTS[9]*STATES[1]*STATES[8]+ CONSTANTS[12]*STATES[4]*STATES[8]);
}
void
computeVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
ALGEBRAIC[1] =  CONSTANTS[7]*STATES[5];
}
void
computeEssentialVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
ALGEBRAIC[0] = ( CONSTANTS[0]*STATES[0]*STATES[1]+ CONSTANTS[2]*STATES[0]*STATES[4]) - ( CONSTANTS[1]*STATES[2]+ CONSTANTS[3]*STATES[3]);
}
void
getStateInformation(double* SI)
{
SI[0] = 1.0;
SI[1] = 1.0;
SI[2] = 1.0;
SI[3] = 1.0;
SI[4] = 1.0;
SI[5] = 1.0;
SI[6] = 1.0;
SI[7] = 1.0;
SI[8] = 1.0;
SI[9] = 1.0;
SI[10] = 1.0;
SI[11] = 1.0;
SI[12] = 1.0;
SI[13] = 1.0;
SI[14] = 1.0;
}
void
computeRoots(double VOI, double* CONSTANTS, double* RATES, double* OLDRATES, double* STATES,
             double* OLDSTATES, double* ALGEBRAIC, double* CONDVARS)
{
}