Generated Code

The following is c code generated by the CellML API from this CellML file. (Back to language selection)

The raw code is available.

/*
   There are a total of 20 entries in the algebraic variable array.
   There are a total of 14 entries in each of the rate and state variable arrays.
   There are a total of 24 entries in the constant variable array.
 */
/*
 * VOI is time in component environment (second).
 * STATES[0] is NatP in component NatP (molecules).
 * CONSTANTS[22] is v1 in component v1 (flux).
 * ALGEBRAIC[0] is v2 in component v2 (flux).
 * ALGEBRAIC[4] is v5 in component v5 (flux).
 * STATES[1] is MisP in component MisP (molecules).
 * ALGEBRAIC[1] is v3 in component v3 (flux).
 * ALGEBRAIC[3] is v4 in component v4 (flux).
 * ALGEBRAIC[5] is v6 in component v6 (flux).
 * ALGEBRAIC[6] is v7 in component v7 (flux).
 * STATES[2] is MCom in component MCom (molecules).
 * STATES[3] is Hsp90 in component Hsp90 (molecules).
 * ALGEBRAIC[8] is v9 in component v9 (flux).
 * ALGEBRAIC[16] is v16 in component v16 (flux).
 * ALGEBRAIC[7] is v8 in component v8 (flux).
 * ALGEBRAIC[17] is v17 in component v17 (flux).
 * STATES[4] is HCom in component HCom (molecules).
 * STATES[5] is HSF1 in component HSF1 (molecules).
 * ALGEBRAIC[14] is v13 in component v13 (flux).
 * ALGEBRAIC[12] is v12 in component v12 (flux).
 * ALGEBRAIC[10] is v10 in component v10 (flux).
 * ALGEBRAIC[11] is v11 in component v11 (flux).
 * STATES[6] is DiH in component DiH (molecules).
 * STATES[7] is TriH in component TriH (molecules).
 * ALGEBRAIC[13] is v14 in component v14 (flux).
 * ALGEBRAIC[15] is v15 in component v15 (flux).
 * STATES[8] is HSE_TriH in component HSE_TriH (molecules).
 * STATES[9] is HSE in component HSE (molecules).
 * STATES[10] is AggP in component AggP (molecules).
 * ALGEBRAIC[9] is v7b in component v7b (flux).
 * STATES[11] is ROS in component ROS (molecules).
 * CONSTANTS[23] is v20 in component v20 (flux).
 * ALGEBRAIC[2] is v21 in component v21 (flux).
 * STATES[12] is ATP in component ATP (molecules).
 * ALGEBRAIC[18] is v18 in component v18 (flux).
 * ALGEBRAIC[19] is v19 in component v19 (flux).
 * STATES[13] is ADP in component ADP (molecules).
 * CONSTANTS[0] is k1 in component v1 (flux).
 * CONSTANTS[1] is k2 in component v2 (second_order_rate_constant).
 * CONSTANTS[2] is k3 in component v3 (second_order_rate_constant).
 * CONSTANTS[3] is k4 in component v4 (first_order_rate_constant).
 * CONSTANTS[4] is k5 in component v5 (second_order_rate_constant).
 * CONSTANTS[5] is k6 in component v6 (second_order_rate_constant).
 * CONSTANTS[6] is k7 in component v7 (second_order_rate_constant).
 * CONSTANTS[7] is k7 in component v7b (second_order_rate_constant).
 * CONSTANTS[8] is k8 in component v8 (second_order_rate_constant).
 * CONSTANTS[9] is k9 in component v9 (first_order_rate_constant).
 * CONSTANTS[10] is k10 in component v10 (second_order_rate_constant).
 * CONSTANTS[11] is k11 in component v11 (second_order_rate_constant).
 * CONSTANTS[12] is k12 in component v12 (first_order_rate_constant).
 * CONSTANTS[13] is k13 in component v13 (first_order_rate_constant).
 * CONSTANTS[14] is k14 in component v14 (second_order_rate_constant).
 * CONSTANTS[15] is k15 in component v15 (first_order_rate_constant).
 * CONSTANTS[16] is k16 in component v16 (first_order_rate_constant).
 * CONSTANTS[17] is k17 in component v17 (second_order_rate_constant).
 * CONSTANTS[18] is k18 in component v18 (first_order_rate_constant).
 * CONSTANTS[19] is k19 in component v19 (first_order_rate_constant).
 * CONSTANTS[20] is k20 in component v20 (flux).
 * CONSTANTS[21] is k21 in component v21 (first_order_rate_constant).
 * RATES[0] is d/dt NatP in component NatP (molecules).
 * RATES[1] is d/dt MisP in component MisP (molecules).
 * RATES[2] is d/dt MCom in component MCom (molecules).
 * RATES[3] is d/dt Hsp90 in component Hsp90 (molecules).
 * RATES[4] is d/dt HCom in component HCom (molecules).
 * RATES[5] is d/dt HSF1 in component HSF1 (molecules).
 * RATES[6] is d/dt DiH in component DiH (molecules).
 * RATES[7] is d/dt TriH in component TriH (molecules).
 * RATES[8] is d/dt HSE_TriH in component HSE_TriH (molecules).
 * RATES[9] is d/dt HSE in component HSE (molecules).
 * RATES[10] is d/dt AggP in component AggP (molecules).
 * RATES[11] is d/dt ROS in component ROS (molecules).
 * RATES[12] is d/dt ATP in component ATP (molecules).
 * RATES[13] is d/dt ADP in component ADP (molecules).
 */
void
initConsts(double* CONSTANTS, double* RATES, double *STATES)
{
STATES[0] = 6000000;
STATES[1] = 0;
STATES[2] = 0;
STATES[3] = 300000;
STATES[4] = 5900;
STATES[5] = 100;
STATES[6] = 0;
STATES[7] = 0;
STATES[8] = 0;
STATES[9] = 1;
STATES[10] = 0;
STATES[11] = 100;
STATES[12] = 10000;
STATES[13] = 1000;
CONSTANTS[0] = 10;
CONSTANTS[1] = 0.00002;
CONSTANTS[2] = 50;
CONSTANTS[3] = 0.00001;
CONSTANTS[4] = 4e-6;
CONSTANTS[5] = 6e-7;
CONSTANTS[6] = 1e-7;
CONSTANTS[7] = 1e-7;
CONSTANTS[8] = 500;
CONSTANTS[9] = 1;
CONSTANTS[10] = 0.01;
CONSTANTS[11] = 100;
CONSTANTS[12] = 0.5;
CONSTANTS[13] = 0.5;
CONSTANTS[14] = 0.05;
CONSTANTS[15] = 0.08;
CONSTANTS[16] = 1000;
CONSTANTS[17] = 8.02e-9;
CONSTANTS[18] = 12;
CONSTANTS[19] = 0.02;
CONSTANTS[20] = 0.1;
CONSTANTS[21] = 0.00001;
CONSTANTS[22] = CONSTANTS[0];
CONSTANTS[23] = CONSTANTS[20];
}
void
computeRates(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
ALGEBRAIC[0] =  CONSTANTS[1]*STATES[0]*STATES[11];
ALGEBRAIC[2] =  CONSTANTS[21]*STATES[11];
RATES[11] = (ALGEBRAIC[0]+CONSTANTS[23]) - (ALGEBRAIC[0]+ALGEBRAIC[2]);
ALGEBRAIC[4] =  CONSTANTS[4]*STATES[2]*STATES[12];
RATES[0] = (CONSTANTS[22]+ALGEBRAIC[4]) - ALGEBRAIC[0];
ALGEBRAIC[1] =  CONSTANTS[2]*STATES[1]*STATES[3];
ALGEBRAIC[3] =  CONSTANTS[3]*STATES[2];
RATES[2] = ALGEBRAIC[1] - (ALGEBRAIC[3]+ALGEBRAIC[4]);
ALGEBRAIC[5] =  CONSTANTS[5]*STATES[1]*STATES[12];
ALGEBRAIC[6] =  CONSTANTS[6]*STATES[1]*STATES[1];
RATES[1] = (ALGEBRAIC[0]+ALGEBRAIC[3]) - (ALGEBRAIC[1]+ALGEBRAIC[5]+ 2.00000*ALGEBRAIC[6]);
ALGEBRAIC[8] =  CONSTANTS[9]*STATES[4];
ALGEBRAIC[7] =  CONSTANTS[8]*STATES[5]*STATES[3];
RATES[4] = ALGEBRAIC[7] - ALGEBRAIC[8];
ALGEBRAIC[9] =  CONSTANTS[7]*STATES[1]*STATES[10];
RATES[10] = (ALGEBRAIC[6]+ 2.00000*ALGEBRAIC[9]) - ALGEBRAIC[9];
ALGEBRAIC[14] =  CONSTANTS[13]*STATES[6];
ALGEBRAIC[12] =  CONSTANTS[12]*STATES[7];
ALGEBRAIC[10] =  CONSTANTS[10]*STATES[5]*STATES[5];
ALGEBRAIC[11] =  CONSTANTS[11]*STATES[6]*STATES[5];
RATES[5] = (ALGEBRAIC[8]+ 2.00000*ALGEBRAIC[14]+ALGEBRAIC[12]) - (ALGEBRAIC[7]+ 2.00000*ALGEBRAIC[10]+ALGEBRAIC[11]);
RATES[6] = (ALGEBRAIC[10]+ALGEBRAIC[12]) - (ALGEBRAIC[11]+ALGEBRAIC[14]);
ALGEBRAIC[13] =  CONSTANTS[14]*STATES[9]*STATES[7];
ALGEBRAIC[15] =  CONSTANTS[15]*STATES[8];
RATES[7] = (ALGEBRAIC[11]+ALGEBRAIC[15]) - (ALGEBRAIC[12]+ALGEBRAIC[13]);
RATES[9] = ALGEBRAIC[15] - ALGEBRAIC[13];
ALGEBRAIC[16] =  CONSTANTS[16]*STATES[8];
RATES[8] = (ALGEBRAIC[13]+ALGEBRAIC[16]) - (ALGEBRAIC[15]+ALGEBRAIC[16]);
ALGEBRAIC[17] =  CONSTANTS[17]*STATES[3]*STATES[12];
RATES[3] = (ALGEBRAIC[4]+ALGEBRAIC[3]+ALGEBRAIC[8]+ALGEBRAIC[16]) - (ALGEBRAIC[1]+ALGEBRAIC[7]+ALGEBRAIC[17]);
ALGEBRAIC[18] =  CONSTANTS[18]*STATES[13];
ALGEBRAIC[19] =  CONSTANTS[19]*STATES[12];
RATES[12] = ALGEBRAIC[18] - (ALGEBRAIC[4]+ALGEBRAIC[5]+ALGEBRAIC[17]+ALGEBRAIC[19]);
RATES[13] = (ALGEBRAIC[4]+ALGEBRAIC[5]+ALGEBRAIC[17]+ALGEBRAIC[19]) - ALGEBRAIC[18];
}
void
computeVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
ALGEBRAIC[0] =  CONSTANTS[1]*STATES[0]*STATES[11];
ALGEBRAIC[2] =  CONSTANTS[21]*STATES[11];
ALGEBRAIC[4] =  CONSTANTS[4]*STATES[2]*STATES[12];
ALGEBRAIC[1] =  CONSTANTS[2]*STATES[1]*STATES[3];
ALGEBRAIC[3] =  CONSTANTS[3]*STATES[2];
ALGEBRAIC[5] =  CONSTANTS[5]*STATES[1]*STATES[12];
ALGEBRAIC[6] =  CONSTANTS[6]*STATES[1]*STATES[1];
ALGEBRAIC[8] =  CONSTANTS[9]*STATES[4];
ALGEBRAIC[7] =  CONSTANTS[8]*STATES[5]*STATES[3];
ALGEBRAIC[9] =  CONSTANTS[7]*STATES[1]*STATES[10];
ALGEBRAIC[14] =  CONSTANTS[13]*STATES[6];
ALGEBRAIC[12] =  CONSTANTS[12]*STATES[7];
ALGEBRAIC[10] =  CONSTANTS[10]*STATES[5]*STATES[5];
ALGEBRAIC[11] =  CONSTANTS[11]*STATES[6]*STATES[5];
ALGEBRAIC[13] =  CONSTANTS[14]*STATES[9]*STATES[7];
ALGEBRAIC[15] =  CONSTANTS[15]*STATES[8];
ALGEBRAIC[16] =  CONSTANTS[16]*STATES[8];
ALGEBRAIC[17] =  CONSTANTS[17]*STATES[3]*STATES[12];
ALGEBRAIC[18] =  CONSTANTS[18]*STATES[13];
ALGEBRAIC[19] =  CONSTANTS[19]*STATES[12];
}