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 6 entries in the algebraic variable array.
   There are a total of 12 entries in each of the rate and state variable arrays.
   There are a total of 43 entries in the constant variable array.
 */
/*
 * VOI is time in component environment (minute).
 * STATES[0] is Asp in component Asp (millimolar).
 * ALGEBRAIC[0] is vAKI in component vAKI (flux).
 * ALGEBRAIC[5] is vAKIII in component vAKIII (flux).
 * STATES[1] is aspp in component aspp (millimolar).
 * ALGEBRAIC[1] is vASD in component vASD (flux).
 * STATES[2] is ASA in component ASA (millimolar).
 * ALGEBRAIC[2] is vHDH in component vHDH (flux).
 * STATES[3] is hs in component hs (millimolar).
 * ALGEBRAIC[3] is vHK in component vHK (flux).
 * STATES[4] is hsp in component hsp (millimolar).
 * ALGEBRAIC[4] is vTS in component vTS (flux).
 * STATES[5] is Thr in component Thr (millimolar).
 * STATES[6] is ATP in component ATP (millimolar).
 * STATES[7] is ADP in component ADP (millimolar).
 * STATES[8] is NADPH in component NADPH (millimolar).
 * STATES[9] is NADP in component NADP (millimolar).
 * STATES[10] is Pi in component Pi (millimolar).
 * STATES[11] is Lys in component Lys (millimolar).
 * CONSTANTS[0] is K_asp in component vAKI (millimolar).
 * CONSTANTS[1] is K_ATP in component vAKI (millimolar).
 * CONSTANTS[2] is K_aspp in component vAKI (millimolar).
 * CONSTANTS[3] is K_ADP in component vAKI (millimolar).
 * CONSTANTS[4] is K_iThr in component vAKI (millimolar).
 * CONSTANTS[5] is alpha in component vAKI (dimensionless).
 * CONSTANTS[6] is h_Thr in component vAKI (dimensionless).
 * CONSTANTS[7] is K_eq in component vAKI (dimensionless).
 * CONSTANTS[8] is V_max_AK_I in component vAKI (flux).
 * CONSTANTS[9] is K_aspp in component vASD (millimolar).
 * CONSTANTS[10] is K_NADPH in component vASD (millimolar).
 * CONSTANTS[11] is K_ASA in component vASD (millimolar).
 * CONSTANTS[12] is K_NADP in component vASD (millimolar).
 * CONSTANTS[13] is K_Pi in component vASD (millimolar).
 * CONSTANTS[14] is K_eq in component vASD (millimolar).
 * CONSTANTS[15] is V_max_ASD in component vASD (flux).
 * CONSTANTS[16] is K_ASA in component vHDH (millimolar).
 * CONSTANTS[17] is K_NADPH in component vHDH (millimolar).
 * CONSTANTS[18] is K_hs in component vHDH (millimolar).
 * CONSTANTS[19] is K_NADP in component vHDH (millimolar).
 * CONSTANTS[20] is K_iThr in component vHDH (millimolar).
 * CONSTANTS[21] is alpha in component vHDH (dimensionless).
 * CONSTANTS[22] is h in component vHDH (dimensionless).
 * CONSTANTS[23] is K_eq in component vHDH (dimensionless).
 * CONSTANTS[24] is V_max_HDH in component vHDH (flux).
 * CONSTANTS[25] is K_hs in component vHK (millimolar).
 * CONSTANTS[26] is K_ATP in component vHK (millimolar).
 * CONSTANTS[27] is K_iThr in component vHK (millimolar).
 * CONSTANTS[28] is K_iLys in component vHK (millimolar).
 * CONSTANTS[29] is K_ihs in component vHK (millimolar).
 * CONSTANTS[30] is K_iATP in component vHK (millimolar).
 * CONSTANTS[31] is V_max_HK in component vHK (flux).
 * CONSTANTS[32] is K_hsp in component vTS (millimolar).
 * CONSTANTS[33] is V_max_TS in component vTS (flux).
 * CONSTANTS[34] is K_asp in component vAKIII (millimolar).
 * CONSTANTS[35] is K_ATP in component vAKIII (millimolar).
 * CONSTANTS[36] is K_aspp in component vAKIII (millimolar).
 * CONSTANTS[37] is K_ADP in component vAKIII (millimolar).
 * CONSTANTS[38] is K_iLys in component vAKIII (millimolar).
 * CONSTANTS[39] is h_Lys in component vAKIII (dimensionless).
 * CONSTANTS[40] is K_eq in component vAKIII (dimensionless).
 * CONSTANTS[41] is V_max_AK_III in component vAKIII (flux).
 * RATES[0] is d/dt Asp in component Asp (millimolar).
 * RATES[1] is d/dt aspp in component aspp (millimolar).
 * RATES[2] is d/dt ASA in component ASA (millimolar).
 * RATES[3] is d/dt hs in component hs (millimolar).
 * RATES[4] is d/dt hsp in component hsp (millimolar).
 * RATES[5] is d/dt Thr in component Thr (millimolar).
 * RATES[6] is d/dt ATP in component ATP (millimolar).
 * RATES[7] is d/dt ADP in component ADP (millimolar).
 * RATES[8] is d/dt NADPH in component NADPH (millimolar).
 * RATES[9] is d/dt NADP in component NADP (millimolar).
 * RATES[10] is d/dt Pi in component Pi (millimolar).
 * RATES[11] is d/dt Lys in component Lys (millimolar).
 * There are a total of 0 condition variables.
 */
void
initConsts(double* CONSTANTS, double* RATES, double *STATES)
{
STATES[0] = 10;
STATES[1] = 0;
STATES[2] = 0;
STATES[3] = 0;
STATES[4] = 0;
STATES[5] = 0;
STATES[6] = 30;
STATES[7] = 0;
STATES[8] = 0;
STATES[9] = 0;
STATES[10] = 0;
STATES[11] = 0;
CONSTANTS[0] = 0.97;
CONSTANTS[1] = 0.98;
CONSTANTS[2] = 0.017;
CONSTANTS[3] = 0.25;
CONSTANTS[4] = 0.167;
CONSTANTS[5] = 2.47;
CONSTANTS[6] = 4.09;
CONSTANTS[7] = 0.00064;
CONSTANTS[8] = 463;
CONSTANTS[9] = 0.022;
CONSTANTS[10] = 0.029;
CONSTANTS[11] = 0.11;
CONSTANTS[12] = 0.144;
CONSTANTS[13] = 10.2;
CONSTANTS[14] = 284000;
CONSTANTS[15] = 598;
CONSTANTS[16] = 0.24;
CONSTANTS[17] = 0.037;
CONSTANTS[18] = 3.39;
CONSTANTS[19] = 0.067;
CONSTANTS[20] = 0.097;
CONSTANTS[21] = 3.93;
CONSTANTS[22] = 1.41;
CONSTANTS[23] = 100000000000;
CONSTANTS[24] = 2585;
CONSTANTS[25] = 0.11;
CONSTANTS[26] = 0.072;
CONSTANTS[27] = 1.09;
CONSTANTS[28] = 9.45;
CONSTANTS[29] = 4.7;
CONSTANTS[30] = 4.35;
CONSTANTS[31] = 483;
CONSTANTS[32] = 0.31;
CONSTANTS[33] = 208;
CONSTANTS[34] = 0.32;
CONSTANTS[35] = 0.22;
CONSTANTS[36] = 0.017;
CONSTANTS[37] = 0.25;
CONSTANTS[38] = 0.391;
CONSTANTS[39] = 2.8;
CONSTANTS[40] = 0.00064;
CONSTANTS[41] = 299;
CONSTANTS[42] = 0.00000;
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;
RATES[10] = 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[0] - ALGEBRAIC[5];
resid[1] = RATES[1] - (ALGEBRAIC[0]+ALGEBRAIC[5]) - ALGEBRAIC[1];
resid[2] = RATES[2] - ALGEBRAIC[1] - ALGEBRAIC[2];
resid[3] = RATES[3] - ALGEBRAIC[2] - ALGEBRAIC[3];
resid[4] = RATES[4] - ALGEBRAIC[3]+ALGEBRAIC[4];
resid[5] = RATES[5] - ALGEBRAIC[4];
resid[6] = RATES[6] - (- ALGEBRAIC[0] - ALGEBRAIC[5]) - ALGEBRAIC[3];
resid[7] = RATES[7] - ALGEBRAIC[0]+ALGEBRAIC[5]+ALGEBRAIC[3];
resid[8] = RATES[8] - - ALGEBRAIC[1] - ALGEBRAIC[2];
resid[9] = RATES[9] - ALGEBRAIC[1]+ALGEBRAIC[2];
resid[10] = RATES[10] - ALGEBRAIC[1]+ALGEBRAIC[4];
resid[11] = RATES[11] - CONSTANTS[42];
}
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[8]*( STATES[0]*STATES[6] - ( STATES[1]*STATES[7])/CONSTANTS[7]))/( (( CONSTANTS[0]*(1.00000+pow(STATES[5]/CONSTANTS[4], CONSTANTS[6])))/(1.00000+pow(STATES[5]/( CONSTANTS[4]*CONSTANTS[5]), CONSTANTS[6]))+( STATES[1]*CONSTANTS[0])/CONSTANTS[2]+STATES[0])*( CONSTANTS[1]*(1.00000+STATES[7]/CONSTANTS[3])+STATES[6]));
ALGEBRAIC[1] = ( CONSTANTS[15]*( STATES[1]*STATES[8] - ( STATES[2]*STATES[9]*STATES[10])/CONSTANTS[14]))/( ( CONSTANTS[9]*(1.00000+STATES[2]/CONSTANTS[11])*(1.00000+STATES[10]/CONSTANTS[13])+STATES[1])*( CONSTANTS[10]*(1.00000+STATES[9]/CONSTANTS[12])+STATES[8]));
ALGEBRAIC[2] = ( CONSTANTS[24]*( STATES[2]*STATES[8] - ( STATES[3]*STATES[9])/CONSTANTS[23]))/( ((1.00000+pow(STATES[5]/CONSTANTS[20], CONSTANTS[22]))/(1.00000+pow(STATES[5]/( CONSTANTS[21]*CONSTANTS[20]), CONSTANTS[22])))*(CONSTANTS[16]+( STATES[3]*CONSTANTS[16])/CONSTANTS[18]+STATES[2])*( CONSTANTS[17]*(1.00000+STATES[9]/CONSTANTS[19])+STATES[8]));
ALGEBRAIC[3] = ( CONSTANTS[31]*STATES[3]*STATES[6])/( (( CONSTANTS[25]*(1.00000+STATES[6]/CONSTANTS[30]))/(1.00000+STATES[5]/CONSTANTS[27])+STATES[3])*( CONSTANTS[26]*(1.00000+STATES[3]/CONSTANTS[29])+STATES[6])*(1.00000+STATES[11]/CONSTANTS[28]));
ALGEBRAIC[4] = ( CONSTANTS[33]*STATES[4])/(CONSTANTS[32]+STATES[4]);
ALGEBRAIC[5] = ( CONSTANTS[41]*( STATES[0]*STATES[6] - ( STATES[1]*STATES[7])/CONSTANTS[40]))/( (1.00000+pow(STATES[11]/CONSTANTS[38], CONSTANTS[39]))*( CONSTANTS[34]*(1.00000+STATES[1]/CONSTANTS[36])+STATES[0])*( CONSTANTS[35]*(1.00000+STATES[7]/CONSTANTS[37])+STATES[6]));
}
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;
SI[10] = 1.0;
SI[11] = 1.0;
}
void
computeRoots(double VOI, double* CONSTANTS, double* RATES, double* OLDRATES, double* STATES,
             double* OLDSTATES, double* ALGEBRAIC, double* CONDVARS)
{
}