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 10 entries in the algebraic variable array.
   There are a total of 5 entries in each of the rate and state variable arrays.
   There are a total of 27 entries in the constant variable array.
 */
/*
 * VOI is time in component environment (second).
 * CONSTANTS[0] is k_0 in component Constants (flux).
 * CONSTANTS[1] is k_1 in component Constants (per_second).
 * CONSTANTS[2] is k_2 in component Constants (per_second).
 * CONSTANTS[3] is k_3 in component Constants (per_second).
 * CONSTANTS[4] is k_4 in component Constants (per_second).
 * CONSTANTS[5] is k_5 in component Constants (per_second).
 * CONSTANTS[6] is k_6 in component Constants (per_second).
 * CONSTANTS[7] is k_7 in component Constants (per_second).
 * CONSTANTS[8] is k_8 in component Constants (flux).
 * CONSTANTS[9] is k_9 in component Constants (flux).
 * CONSTANTS[10] is k_10 in component Constants (flux).
 * CONSTANTS[11] is k_11 in component Constants (flux).
 * CONSTANTS[12] is C_PLC_T in component Constants (micromolar).
 * CONSTANTS[13] is K_D in component Constants (micromolar).
 * CONSTANTS[14] is K_P in component Constants (micromolar).
 * CONSTANTS[15] is K_R in component Constants (micromolar).
 * CONSTANTS[16] is K_G in component Constants (micromolar).
 * CONSTANTS[17] is K_S in component Constants (micromolar).
 * CONSTANTS[18] is K_ER in component Constants (micromolar).
 * CONSTANTS[19] is K_C1 in component Constants (micromolar).
 * CONSTANTS[20] is K_C2 in component Constants (micromolar).
 * CONSTANTS[21] is beta in component Constants (dimensionless).
 * CONSTANTS[22] is lambda in component Constants (dimensionless).
 * CONSTANTS[23] is rho in component Constants (dimensionless).
 * CONSTANTS[24] is n in component Constants (dimensionless).
 * CONSTANTS[25] is m in component Constants (dimensionless).
 * CONSTANTS[26] is w in component Constants (dimensionless).
 * ALGEBRAIC[0] is R_APLC in component R_values (dimensionless).
 * ALGEBRAIC[8] is R_PKC in component R_values (dimensionless).
 * ALGEBRAIC[1] is R_G in component R_values (dimensionless).
 * ALGEBRAIC[9] is R_DG in component R_values (dimensionless).
 * ALGEBRAIC[2] is R_IP_3 in component R_values (dimensionless).
 * ALGEBRAIC[3] is R_Cyt1 in component R_values (dimensionless).
 * ALGEBRAIC[4] is R_Cyt2 in component R_values (dimensionless).
 * ALGEBRAIC[5] is R_ER in component R_values (dimensionless).
 * STATES[0] is APLC in component APLC (micromolar).
 * ALGEBRAIC[7] is DG in component DG (micromolar).
 * STATES[1] is C_cyt in component C_cyt (micromolar).
 * STATES[2] is G in component G_GTP (micromolar).
 * STATES[3] is IP_3 in component IP_3 (micromolar).
 * STATES[4] is C_ER in component C_ER (micromolar).
 * ALGEBRAIC[6] is PLC in component APLC (micromolar).
 * RATES[2] is d/dt G in component G_GTP (micromolar).
 * RATES[0] is d/dt APLC in component APLC (micromolar).
 * RATES[3] is d/dt IP_3 in component IP_3 (micromolar).
 * RATES[1] is d/dt C_cyt in component C_cyt (micromolar).
 * RATES[4] is d/dt C_ER in component C_ER (micromolar).
 * There are a total of 0 condition variables.
 */
void
initConsts(double* CONSTANTS, double* RATES, double *STATES)
{
CONSTANTS[0] = 1e-4;
CONSTANTS[1] = 3.4;
CONSTANTS[2] = 4;
CONSTANTS[3] = 4.5;
CONSTANTS[4] = 1.2;
CONSTANTS[5] = 0.12;
CONSTANTS[6] = 14;
CONSTANTS[7] = 2;
CONSTANTS[8] = 10.5;
CONSTANTS[9] = 0.6;
CONSTANTS[10] = 3;
CONSTANTS[11] = 0.26;
CONSTANTS[12] = 0.01;
CONSTANTS[13] = 0.01;
CONSTANTS[14] = 0.004;
CONSTANTS[15] = 0.2;
CONSTANTS[16] = 0.025;
CONSTANTS[17] = 0.025;
CONSTANTS[18] = 0.075;
CONSTANTS[19] = 1;
CONSTANTS[20] = 2;
CONSTANTS[21] = 0.05;
CONSTANTS[22] = 0.001;
CONSTANTS[23] = 0.2;
CONSTANTS[24] = 4;
CONSTANTS[25] = 2;
CONSTANTS[26] = 3;
STATES[0] = 0.001;
STATES[1] = 0.2;
STATES[2] = 0.001;
STATES[3] = 0.001;
STATES[4] = 1;
RATES[2] = 0.1001;
RATES[0] = 0.1001;
RATES[3] = 0.1001;
RATES[1] = 0.1001;
RATES[4] = 0.1001;
}
void
computeResiduals(double VOI, double* CONSTANTS, double* RATES, double* OLDRATES, double* STATES,
                 double* OLDSTATES, double* ALGEBRAIC, double* CONDVARS)
{
resid[0] = RATES[2] - ((CONSTANTS[0]+ CONSTANTS[1]*STATES[2]) -  CONSTANTS[2]*ALGEBRAIC[0]*STATES[2]) -  CONSTANTS[3]*ALGEBRAIC[8]*STATES[2];
resid[1] = RATES[0] -  CONSTANTS[4]*ALGEBRAIC[1]*ALGEBRAIC[9]*ALGEBRAIC[6] -  CONSTANTS[5]*STATES[0];
resid[2] = RATES[3] -  CONSTANTS[6]*STATES[0] -  CONSTANTS[7]*STATES[3];
resid[3] = RATES[1] -  CONSTANTS[21]*(( CONSTANTS[23]*( CONSTANTS[8]*ALGEBRAIC[2]*ALGEBRAIC[5] -  CONSTANTS[9]*ALGEBRAIC[3]) -  CONSTANTS[10]*ALGEBRAIC[4])+CONSTANTS[11]);
resid[4] = RATES[4] -  CONSTANTS[22]*( - CONSTANTS[8]*ALGEBRAIC[2]*ALGEBRAIC[5]+ CONSTANTS[9]*ALGEBRAIC[3]);
}
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] = STATES[0]/(CONSTANTS[14]+STATES[0]);
ALGEBRAIC[1] = pow(STATES[2], CONSTANTS[24])/(pow(CONSTANTS[16], CONSTANTS[24])+pow(STATES[2], CONSTANTS[24]));
ALGEBRAIC[2] = pow(STATES[3], 3.00000)/(pow(CONSTANTS[17], 3.00000)+pow(STATES[3], 3.00000));
ALGEBRAIC[3] = STATES[1]/(CONSTANTS[19]+STATES[1]);
ALGEBRAIC[4] = STATES[1]/(CONSTANTS[20]+STATES[1]);
ALGEBRAIC[5] = pow(STATES[4], CONSTANTS[26])/(pow(CONSTANTS[18], CONSTANTS[26])+pow(STATES[4], CONSTANTS[26]));
ALGEBRAIC[6] = CONSTANTS[12] - STATES[0];
ALGEBRAIC[7] = STATES[3];
ALGEBRAIC[8] = ( (ALGEBRAIC[7]/(CONSTANTS[13]+ALGEBRAIC[7]))*STATES[1])/(CONSTANTS[15]+STATES[1]);
ALGEBRAIC[9] = pow(ALGEBRAIC[7], CONSTANTS[25])/(pow(CONSTANTS[13], CONSTANTS[25])+pow(ALGEBRAIC[7], CONSTANTS[25]));
}
void
getStateInformation(double* SI)
{
SI[0] = 1.0;
SI[1] = 1.0;
SI[2] = 1.0;
SI[3] = 1.0;
SI[4] = 1.0;
}
void
computeRoots(double VOI, double* CONSTANTS, double* RATES, double* OLDRATES, double* STATES,
             double* OLDSTATES, double* ALGEBRAIC, double* CONDVARS)
{
}