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 11 entries in the algebraic variable array.
   There are a total of 10 entries in each of the rate and state variable arrays.
   There are a total of 31 entries in the constant variable array.
 */
/*
 * VOI is time in component environment (second).
 * STATES[0] is ATP in component ATP (micromolar).
 * CONSTANTS[0] is V_hyd in component V_hyd (flux).
 * ALGEBRAIC[8] is V_MMCK in component V_MMCK (flux).
 * ALGEBRAIC[3] is J_ATP in component J_ATP (flux).
 * CONSTANTS[1] is V_cyt in component fractional_volumes (dimensionless).
 * STATES[1] is ADP in component ADP (micromolar).
 * ALGEBRAIC[4] is J_ADP in component J_ADP (flux).
 * STATES[2] is PCr in component PCr (micromolar).
 * ALGEBRAIC[5] is J_PCr in component J_PCr (flux).
 * STATES[3] is Cr in component Cr (micromolar).
 * ALGEBRAIC[6] is J_Cr in component J_Cr (flux).
 * STATES[4] is Pi in component Pi (micromolar).
 * ALGEBRAIC[7] is J_Pi in component J_Pi (flux).
 * STATES[5] is ATP_i in component ATP_i (micromolar).
 * ALGEBRAIC[9] is V_MiCK in component V_MiCK (flux).
 * ALGEBRAIC[10] is V_syn in component V_syn (flux).
 * CONSTANTS[2] is V_ims in component fractional_volumes (dimensionless).
 * STATES[6] is ADP_i in component ADP_i (micromolar).
 * STATES[7] is PCr_i in component PCr_i (micromolar).
 * STATES[8] is Cr_i in component Cr_i (micromolar).
 * STATES[9] is Pi_i in component Pi_i (micromolar).
 * ALGEBRAIC[0] is Den_MMCK in component V_MMCK (dimensionless).
 * CONSTANTS[3] is Kia in component V_MMCK (micromolar).
 * CONSTANTS[4] is Kb in component V_MMCK (micromolar).
 * CONSTANTS[5] is Kib in component V_MMCK (micromolar).
 * CONSTANTS[27] is KIb in component V_MMCK (micromolar).
 * CONSTANTS[28] is Kc in component V_MMCK (micromolar).
 * CONSTANTS[6] is Kic in component V_MMCK (micromolar).
 * CONSTANTS[7] is Kd in component V_MMCK (micromolar).
 * CONSTANTS[8] is Kid in component V_MMCK (micromolar).
 * CONSTANTS[9] is Vf in component V_MMCK (flux).
 * CONSTANTS[10] is Vb in component V_MMCK (flux).
 * ALGEBRAIC[1] is Den_MiCK in component V_MiCK (dimensionless).
 * CONSTANTS[11] is Kia in component V_MiCK (micromolar).
 * CONSTANTS[12] is Kb in component V_MiCK (micromolar).
 * CONSTANTS[13] is Kib in component V_MiCK (micromolar).
 * CONSTANTS[29] is KIb in component V_MiCK (micromolar).
 * CONSTANTS[30] is Kc in component V_MiCK (micromolar).
 * CONSTANTS[14] is Kic in component V_MiCK (micromolar).
 * CONSTANTS[15] is Kd in component V_MiCK (micromolar).
 * CONSTANTS[16] is Kid in component V_MiCK (micromolar).
 * CONSTANTS[17] is Vf in component V_MiCK (flux).
 * CONSTANTS[18] is Vb in component V_MiCK (flux).
 * ALGEBRAIC[2] is Den_syn in component V_syn (dimensionless).
 * CONSTANTS[19] is KPi in component V_syn (micromolar).
 * CONSTANTS[20] is KADP in component V_syn (micromolar).
 * CONSTANTS[21] is V_syn_max in component V_syn (flux).
 * CONSTANTS[22] is R_ATP in component J_ATP (first_order_rate_constant).
 * CONSTANTS[23] is R_ADP in component J_ADP (first_order_rate_constant).
 * CONSTANTS[24] is R_PCr in component J_PCr (first_order_rate_constant).
 * CONSTANTS[25] is R_Cr in component J_Cr (first_order_rate_constant).
 * CONSTANTS[26] is R_Pi in component J_Pi (first_order_rate_constant).
 * RATES[0] is d/dt ATP in component ATP (micromolar).
 * RATES[1] is d/dt ADP in component ADP (micromolar).
 * RATES[2] is d/dt PCr in component PCr (micromolar).
 * RATES[3] is d/dt Cr in component Cr (micromolar).
 * RATES[4] is d/dt Pi in component Pi (micromolar).
 * RATES[5] is d/dt ATP_i in component ATP_i (micromolar).
 * RATES[6] is d/dt ADP_i in component ADP_i (micromolar).
 * RATES[7] is d/dt PCr_i in component PCr_i (micromolar).
 * RATES[8] is d/dt Cr_i in component Cr_i (micromolar).
 * RATES[9] is d/dt Pi_i in component Pi_i (micromolar).
 * There are a total of 0 condition variables.
 */
void
initConsts(double* CONSTANTS, double* RATES, double *STATES)
{
STATES[0] = 9644.425;
CONSTANTS[0] = 4.6E3;
CONSTANTS[1] = 0.75;
STATES[1] = 60.0;
STATES[2] = 12500.0;
STATES[3] = 13500.0;
STATES[4] = 8000.0;
STATES[5] = 9644.425;
CONSTANTS[2] = 0.0625;
STATES[6] = 2.5;
STATES[7] = 12500.0;
STATES[8] = 13500.0;
STATES[9] = 8000.0;
CONSTANTS[3] = 9.0E2;
CONSTANTS[4] = 1.55E4;
CONSTANTS[5] = 3.49E4;
CONSTANTS[6] = 2.224E2;
CONSTANTS[7] = 1.67E3;
CONSTANTS[8] = 4.73E3;
CONSTANTS[9] = 6.966E3;
CONSTANTS[10] = 2.925E4;
CONSTANTS[11] = 7.5E2;
CONSTANTS[12] = 5.2E3;
CONSTANTS[13] = 2.88E4;
CONSTANTS[14] = 2.048E2;
CONSTANTS[15] = 5.0E2;
CONSTANTS[16] = 1.6E3;
CONSTANTS[17] = 2.658E3;
CONSTANTS[18] = 1.116E4;
CONSTANTS[19] = 20.0;
CONSTANTS[20] = 8.0E2;
CONSTANTS[21] = 4.6E3;
CONSTANTS[22] = 8.16;
CONSTANTS[23] = 8.16;
CONSTANTS[24] = 14.6;
CONSTANTS[25] = 14.6;
CONSTANTS[26] = 18.4;
CONSTANTS[27] = CONSTANTS[5];
CONSTANTS[28] = ( CONSTANTS[6]*CONSTANTS[7])/CONSTANTS[8];
CONSTANTS[29] = CONSTANTS[13];
CONSTANTS[30] = ( CONSTANTS[14]*CONSTANTS[15])/CONSTANTS[16];
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[6] = 0.1001;
RATES[7] = 0.1001;
RATES[8] = 0.1001;
RATES[9] = 0.1001;
}
void
computeResiduals(double VOI, double* CONSTANTS, double* RATES, double* OLDRATES, double* STATES,
                 double* OLDSTATES, double* ALGEBRAIC, double* CONDVARS)
{
resid[0] = RATES[0] - (ALGEBRAIC[3] - (CONSTANTS[0]+ALGEBRAIC[8]))/CONSTANTS[1];
resid[1] = RATES[1] - (ALGEBRAIC[4]+CONSTANTS[0]+ALGEBRAIC[8])/CONSTANTS[1];
resid[2] = RATES[2] - (ALGEBRAIC[5]+ALGEBRAIC[8])/CONSTANTS[1];
resid[3] = RATES[3] - (ALGEBRAIC[6] - ALGEBRAIC[8])/CONSTANTS[1];
resid[4] = RATES[4] - (ALGEBRAIC[7]+CONSTANTS[0])/CONSTANTS[1];
resid[5] = RATES[5] - - (ALGEBRAIC[3]+ALGEBRAIC[10]+ALGEBRAIC[9])/CONSTANTS[2];
resid[6] = RATES[6] - ((ALGEBRAIC[10]+ALGEBRAIC[9]) - ALGEBRAIC[4])/CONSTANTS[2];
resid[7] = RATES[7] - (ALGEBRAIC[9] - ALGEBRAIC[5])/CONSTANTS[2];
resid[8] = RATES[8] - - (ALGEBRAIC[9]+ALGEBRAIC[6])/CONSTANTS[2];
resid[9] = RATES[9] - (ALGEBRAIC[10] - ALGEBRAIC[7])/CONSTANTS[2];
}
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[3] =  CONSTANTS[22]*(STATES[5] - STATES[0]);
ALGEBRAIC[4] =  CONSTANTS[23]*(STATES[6] - STATES[1]);
ALGEBRAIC[5] =  CONSTANTS[24]*(STATES[7] - STATES[2]);
ALGEBRAIC[6] =  CONSTANTS[25]*(STATES[8] - STATES[3]);
ALGEBRAIC[7] =  CONSTANTS[26]*(STATES[9] - STATES[4]);
ALGEBRAIC[0] = 1.00000+STATES[3]/CONSTANTS[5]+STATES[2]/CONSTANTS[8]+ STATES[0]*(1.00000/CONSTANTS[3]+STATES[3]/( CONSTANTS[3]*CONSTANTS[4]))+ STATES[1]*(1.00000/CONSTANTS[6]+STATES[2]/( CONSTANTS[8]*CONSTANTS[28])+STATES[3]/( CONSTANTS[6]*CONSTANTS[27]));
ALGEBRAIC[8] = ( CONSTANTS[9]*(( STATES[0]*STATES[3])/( CONSTANTS[3]*CONSTANTS[4])) -  CONSTANTS[10]*(( STATES[1]*STATES[2])/( CONSTANTS[6]*CONSTANTS[7])))/ALGEBRAIC[0];
ALGEBRAIC[1] = 1.00000+STATES[8]/CONSTANTS[13]+STATES[7]/CONSTANTS[16]+ STATES[5]*(1.00000/CONSTANTS[11]+STATES[8]/( CONSTANTS[11]*CONSTANTS[12]))+ STATES[6]*(1.00000/CONSTANTS[14]+STATES[7]/( CONSTANTS[16]*CONSTANTS[30])+STATES[8]/( CONSTANTS[14]*CONSTANTS[29]));
ALGEBRAIC[9] = ( CONSTANTS[17]*(( STATES[5]*STATES[8])/( CONSTANTS[11]*CONSTANTS[12])) -  CONSTANTS[18]*(( STATES[6]*STATES[7])/( CONSTANTS[14]*CONSTANTS[15])))/ALGEBRAIC[1];
ALGEBRAIC[2] = 1.00000+STATES[6]/CONSTANTS[20]+STATES[9]/CONSTANTS[19]+( STATES[6]*STATES[9])/( CONSTANTS[20]*CONSTANTS[19]);
ALGEBRAIC[10] =  CONSTANTS[21]*(( STATES[6]*STATES[9])/( CONSTANTS[19]*CONSTANTS[20]*ALGEBRAIC[2]));
}
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;
}
void
computeRoots(double VOI, double* CONSTANTS, double* RATES, double* OLDRATES, double* STATES,
             double* OLDSTATES, double* ALGEBRAIC, double* CONDVARS)
{
}