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 0 entries in the algebraic variable array.
   There are a total of 9 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 (hour).
 * STATES[0] is Pfr in component Pfr (micromolar).
 * STATES[1] is Pr in component Pr (micromolar).
 * CONSTANTS[0] is Ifr_sigma_fr_phi_fr in component model_parameters (dimensionless).
 * CONSTANTS[1] is Ir_sigma_r_phi_r in component model_parameters (dimensionless).
 * CONSTANTS[2] is kd in component Pr (first_order_rate_constant).
 * STATES[2] is Xi in component Xi (micromolar).
 * STATES[3] is Xa in component Xa (micromolar).
 * CONSTANTS[3] is kia in component model_parameters (second_order_rate_constant).
 * CONSTANTS[4] is kai in component model_parameters (first_order_rate_constant).
 * STATES[4] is prepreS in component prepreS (micromolar).
 * CONSTANTS[5] is kx in component model_parameters (second_order_rate_constant).
 * STATES[5] is preS in component preS (micromolar).
 * STATES[6] is Ya in component Ya (micromolar).
 * CONSTANTS[6] is ky in component model_parameters (second_order_rate_constant).
 * STATES[7] is S in component S (micromolar).
 * CONSTANTS[7] is alpha1 in component S (micromolar).
 * STATES[8] is V in component V (micromolar).
 * CONSTANTS[8] is alpha2 in component V (micromolar).
 * CONSTANTS[9] is kG in component Ya (second_order_rate_constant).
 * CONSTANTS[10] is glucose in component model_parameters (micromolar).
 * RATES[0] is d/dt Pfr in component Pfr (micromolar).
 * RATES[1] is d/dt Pr in component Pr (micromolar).
 * RATES[2] is d/dt Xi in component Xi (micromolar).
 * RATES[3] is d/dt Xa in component Xa (micromolar).
 * RATES[4] is d/dt prepreS in component prepreS (micromolar).
 * RATES[5] is d/dt preS in component preS (micromolar).
 * RATES[7] is d/dt S in component S (micromolar).
 * RATES[8] is d/dt V in component V (micromolar).
 * RATES[6] is d/dt Ya in component Ya (micromolar).
 * There are a total of 0 condition variables.
 */
void
initConsts(double* CONSTANTS, double* RATES, double *STATES)
{
STATES[0] = 10.0;
STATES[1] = 0.0;
CONSTANTS[0] = 0.1;
CONSTANTS[1] = 0.0;
CONSTANTS[2] = 0.1;
STATES[2] = 6.0;
STATES[3] = 0.0;
CONSTANTS[3] = 0.1;
CONSTANTS[4] = 0.8;
STATES[4] = 200.0;
CONSTANTS[5] = 0.2;
STATES[5] = 0.0;
STATES[6] = 0.9;
CONSTANTS[6] = 1.0;
STATES[7] = 0.0;
CONSTANTS[7] = 30.0;
STATES[8] = 50.0;
CONSTANTS[8] = 50.0;
CONSTANTS[9] = 0.1;
CONSTANTS[10] = 1.0;
RATES[0] = 0.1001;
RATES[1] = 0.1001;
RATES[2] = 0.1001;
RATES[3] = 0.1001;
RATES[4] = 0.1001;
RATES[5] = 0.1001;
RATES[7] = 0.1001;
RATES[8] = 0.1001;
RATES[6] = 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[1] -  CONSTANTS[0]*STATES[0];
resid[1] = RATES[1] -  CONSTANTS[0]*STATES[1] - ( CONSTANTS[1]*STATES[1]+ CONSTANTS[2]*STATES[1]);
resid[2] = RATES[2] -  CONSTANTS[4]*STATES[3] -  CONSTANTS[3]*STATES[1]*STATES[2];
resid[3] = RATES[3] -  CONSTANTS[3]*STATES[1]*STATES[2] -  CONSTANTS[4]*STATES[3];
resid[4] = RATES[4] - - ( CONSTANTS[5]*STATES[3]*STATES[4]);
resid[5] = RATES[5] -  CONSTANTS[5]*STATES[3]*STATES[4] -  CONSTANTS[6]*STATES[6]*STATES[5];
resid[6] = RATES[7] - ( CONSTANTS[6]*STATES[6]*STATES[5]+CONSTANTS[7]/(1.00000+pow(STATES[8], 3.00000))) - STATES[7];
resid[7] = RATES[8] - CONSTANTS[8]/(1.00000+pow(STATES[7], 3.00000)) - STATES[8];
resid[8] = RATES[6] - - ( CONSTANTS[9]*CONSTANTS[10]*STATES[6]);
}
void
computeVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
}
void
computeEssentialVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
}
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;
}
void
computeRoots(double VOI, double* CONSTANTS, double* RATES, double* OLDRATES, double* STATES,
             double* OLDSTATES, double* ALGEBRAIC, double* CONDVARS)
{
}