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 3 entries in the algebraic variable array.
   There are a total of 2 entries in each of the rate and state variable arrays.
   There are a total of 14 entries in the constant variable array.
 */
/*
 * VOI is time in component environment (min).
 * STATES[0] is Z in component flux (uM).
 * STATES[1] is Y in component flux (uM).
 * CONSTANTS[0] is v0 in component flux (uM_per_min).
 * CONSTANTS[1] is v1 in component flux (uM_per_min).
 * ALGEBRAIC[0] is v2 in component flux (uM_per_min).
 * ALGEBRAIC[1] is v3 in component flux (uM_per_min).
 * ALGEBRAIC[2] is Beta in component flux (dimensionless).
 * CONSTANTS[2] is k_f in component flux (per_min).
 * CONSTANTS[3] is k in component flux (per_min).
 * CONSTANTS[4] is V_M2 in component flux (uM_per_min).
 * CONSTANTS[5] is V_M3 in component flux (uM_per_min).
 * CONSTANTS[6] is K_2 in component flux (uM).
 * CONSTANTS[7] is K_A in component flux (uM).
 * CONSTANTS[8] is K_R in component flux (uM).
 * CONSTANTS[9] is m in component flux (dimensionless).
 * CONSTANTS[10] is p in component flux (dimensionless).
 * CONSTANTS[11] is n in component flux (dimensionless).
 * CONSTANTS[12] is t_c in component flux (min).
 * CONSTANTS[13] is Beta_f in component flux (dimensionless).
 * RATES[0] is d/dt Z in component flux (uM).
 * RATES[1] is d/dt Y in component flux (uM).
 * There are a total of 0 condition variables.
 */
void
initConsts(double* CONSTANTS, double* RATES, double *STATES)
{
STATES[0] = 0.2;
STATES[1] = 0.2;
CONSTANTS[0] = 2.7;
CONSTANTS[1] = 4;
CONSTANTS[2] = 1;
CONSTANTS[3] = 10;
CONSTANTS[4] = 65;
CONSTANTS[5] = 500;
CONSTANTS[6] = 1;
CONSTANTS[7] = 0.9;
CONSTANTS[8] = 2;
CONSTANTS[9] = 2;
CONSTANTS[10] = 4;
CONSTANTS[11] = 2;
CONSTANTS[12] = 0.8;
CONSTANTS[13] = 0.15;
RATES[0] = 0.1001;
RATES[1] = 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[0]+ CONSTANTS[1]*ALGEBRAIC[2]) - ALGEBRAIC[0])+ALGEBRAIC[1]+ CONSTANTS[2]*STATES[1]) -  CONSTANTS[3]*STATES[0];
resid[1] = RATES[1] - (ALGEBRAIC[0] - ALGEBRAIC[1]) -  CONSTANTS[2]*STATES[1];
}
void
computeVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
}
void
computeEssentialVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
ALGEBRAIC[0] =  CONSTANTS[4]*(pow(STATES[0], CONSTANTS[11])/(pow(CONSTANTS[6], CONSTANTS[11])+pow(STATES[0], CONSTANTS[11])));
ALGEBRAIC[1] =  CONSTANTS[5]*(pow(STATES[1], CONSTANTS[9])/(pow(CONSTANTS[8], CONSTANTS[9])+pow(STATES[1], CONSTANTS[9])))*(pow(STATES[0], CONSTANTS[10])/(pow(CONSTANTS[7], CONSTANTS[10])+pow(STATES[0], CONSTANTS[10])));
ALGEBRAIC[2] =  CONSTANTS[13]*(1.00000 - exp(- VOI/CONSTANTS[12]));
}
void
getStateInformation(double* SI)
{
SI[0] = 1.0;
SI[1] = 1.0;
}
void
computeRoots(double VOI, double* CONSTANTS, double* RATES, double* OLDRATES, double* STATES,
             double* OLDSTATES, double* ALGEBRAIC, double* CONDVARS)
{
}