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 2 entries in each of the rate and state variable arrays.
   There are a total of 13 entries in the constant variable array.
 */
/*
 * VOI is time in component environment (second).
 * CONSTANTS[0] is v0 in component parameters (micromolar_s).
 * CONSTANTS[1] is v1 in component parameters (micromolar_s).
 * ALGEBRAIC[0] is v2 in component parameters (micromolar_s).
 * ALGEBRAIC[1] is v3 in component parameters (micromolar_s).
 * CONSTANTS[2] is beta in component parameters (dimensionless).
 * CONSTANTS[3] is VM2 in component parameters (micromolar_s).
 * CONSTANTS[4] is VM3 in component parameters (micromolar_s).
 * CONSTANTS[5] is KR in component parameters (micromolar).
 * CONSTANTS[6] is KA in component parameters (micromolar).
 * CONSTANTS[7] is kf in component parameters (per_second).
 * CONSTANTS[8] is k in component parameters (per_second).
 * CONSTANTS[9] is K2 in component parameters (micromolar).
 * CONSTANTS[10] is n in component parameters (dimensionless).
 * CONSTANTS[11] is m in component parameters (dimensionless).
 * CONSTANTS[12] is p in component parameters (dimensionless).
 * STATES[0] is Z in component cytosol (micromolar).
 * STATES[1] is Y in component insensitive_pool (micromolar).
 * RATES[0] is d/dt Z in component cytosol (micromolar).
 * RATES[1] is d/dt Y in component insensitive_pool (micromolar).
 * There are a total of 0 condition variables.
 */
void
initConsts(double* CONSTANTS, double* RATES, double *STATES)
{
CONSTANTS[0] = 1;
CONSTANTS[1] = 7.3;
CONSTANTS[2] = 0.6;
CONSTANTS[3] = 65;
CONSTANTS[4] = 500;
CONSTANTS[5] = 2;
CONSTANTS[6] = 0.9;
CONSTANTS[7] = 1;
CONSTANTS[8] = 10;
CONSTANTS[9] = 1;
CONSTANTS[10] = 2;
CONSTANTS[11] = 2;
CONSTANTS[12] = 4;
STATES[0] = 0.52;
STATES[1] = 0.93;
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]*CONSTANTS[2]) - ALGEBRAIC[0])+ALGEBRAIC[1]+ CONSTANTS[7]*STATES[1]) -  CONSTANTS[8]*STATES[0];
resid[1] = RATES[1] - (ALGEBRAIC[0] - ALGEBRAIC[1]) -  CONSTANTS[7]*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[3]*pow(STATES[0], CONSTANTS[10]))/(pow(CONSTANTS[9], CONSTANTS[10])+pow(STATES[0], CONSTANTS[10]));
ALGEBRAIC[1] =  CONSTANTS[4]*(pow(STATES[1], CONSTANTS[11])/(pow(CONSTANTS[5], CONSTANTS[11])+pow(STATES[1], CONSTANTS[11])))*(pow(STATES[0], CONSTANTS[12])/(pow(CONSTANTS[6], CONSTANTS[12])+pow(STATES[0], 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)
{
}