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 20 entries in the algebraic variable array.
   There are a total of 17 entries in each of the rate and state variable arrays.
   There are a total of 33 entries in the constant variable array.
 */
/*
 * VOI is time in component environment (second).
 * ALGEBRAIC[0] is v1 in component v1 (flux).
 * STATES[0] is pM9 in component pM9 (molar).
 * STATES[1] is M3 in component M3 (molar).
 * STATES[2] is M3_pM9 in component M3_pM9 (molar).
 * CONSTANTS[0] is kon_M3pM9 in component kinetic_parameters (second_order_rate_constant).
 * CONSTANTS[1] is koff_M3pM9 in component kinetic_parameters (first_order_rate_constant).
 * ALGEBRAIC[1] is v2 in component v2 (flux).
 * CONSTANTS[2] is kact_M3pM9 in component kinetic_parameters (first_order_rate_constant).
 * ALGEBRAIC[2] is v3 in component v3 (flux).
 * STATES[3] is M3_T1 in component M3_T1 (molar).
 * STATES[4] is T1 in component T1 (molar).
 * CONSTANTS[3] is kon_M3T1 in component kinetic_parameters (second_order_rate_constant).
 * CONSTANTS[4] is koff_M3T1 in component kinetic_parameters (first_order_rate_constant).
 * ALGEBRAIC[3] is v4 in component v4 (flux).
 * STATES[5] is pM9_T1 in component pM9_T1 (molar).
 * CONSTANTS[5] is kon_pM9T1 in component kinetic_parameters (second_order_rate_constant).
 * CONSTANTS[6] is koff_pM9T1 in component kinetic_parameters (first_order_rate_constant).
 * ALGEBRAIC[4] is v5 in component v5 (flux).
 * STATES[6] is M3_pM9_T1 in component M3_pM9_T1 (molar).
 * CONSTANTS[7] is kon_M3pM9T1 in component kinetic_parameters (second_order_rate_constant).
 * CONSTANTS[8] is koff_M3pM9T1 in component kinetic_parameters (first_order_rate_constant).
 * ALGEBRAIC[5] is v6 in component v6 (flux).
 * CONSTANTS[9] is kact_M3pM9T1 in component kinetic_parameters (first_order_rate_constant).
 * ALGEBRAIC[6] is v7 in component v7 (flux).
 * STATES[7] is M9_T1_star in component M9_T1_star (molar).
 * STATES[8] is M9 in component M9 (molar).
 * CONSTANTS[10] is kon_M9T1_star in component kinetic_parameters (second_order_rate_constant).
 * CONSTANTS[11] is koff_M9T1_star in component kinetic_parameters (first_order_rate_constant).
 * ALGEBRAIC[7] is v8 in component v8 (flux).
 * STATES[9] is M9_T1 in component M9_T1 (molar).
 * CONSTANTS[12] is kon_M9T1 in component kinetic_parameters (first_order_rate_constant).
 * CONSTANTS[13] is koff_M9T1 in component kinetic_parameters (first_order_rate_constant).
 * ALGEBRAIC[8] is v9 in component v9 (flux).
 * STATES[10] is M9_T1_M3 in component M9_T1_M3 (molar).
 * CONSTANTS[14] is kon_M9_M3T1 in component kinetic_parameters (first_order_rate_constant).
 * CONSTANTS[15] is koff_M9_M3T1 in component kinetic_parameters (second_order_rate_constant).
 * ALGEBRAIC[9] is v10 in component v10 (flux).
 * STATES[11] is pM9_T1_M3 in component pM9_T1_M3 (molar).
 * CONSTANTS[16] is kon_M3_pM9T1 in component kinetic_parameters (second_order_rate_constant).
 * CONSTANTS[17] is koff_M3_pM9T1 in component kinetic_parameters (first_order_rate_constant).
 * ALGEBRAIC[10] is v11 in component v11 (flux).
 * CONSTANTS[18] is kon_pM9T1M3 in component kinetic_parameters (second_order_rate_constant).
 * CONSTANTS[19] is koff_pM9T1M3 in component kinetic_parameters (first_order_rate_constant).
 * ALGEBRAIC[11] is v12 in component v12 (flux).
 * STATES[12] is M3_pM9_T1_M3 in component M3_pM9_T1_M3 (molar).
 * CONSTANTS[20] is kon_M3pM9T1M3 in component kinetic_parameters (second_order_rate_constant).
 * CONSTANTS[21] is koff_M3pM9T1M3 in component kinetic_parameters (first_order_rate_constant).
 * ALGEBRAIC[12] is v13 in component v13 (flux).
 * CONSTANTS[22] is kact_M3pM9T1M3 in component kinetic_parameters (first_order_rate_constant).
 * ALGEBRAIC[13] is v14 in component v14 (flux).
 * CONSTANTS[23] is kact_M9T1M3 in component kinetic_parameters (first_order_rate_constant).
 * ALGEBRAIC[14] is v15 in component v15 (flux).
 * STATES[13] is Tr in component Tr (molar).
 * STATES[14] is Tr_pM9 in component Tr_pM9 (molar).
 * CONSTANTS[24] is kon_TrpM9 in component kinetic_parameters (second_order_rate_constant).
 * CONSTANTS[25] is koff_TrpM9 in component kinetic_parameters (first_order_rate_constant).
 * ALGEBRAIC[15] is v16 in component v16 (flux).
 * CONSTANTS[26] is kact_TrpM9 in component kinetic_parameters (first_order_rate_constant).
 * ALGEBRAIC[16] is v17 in component v17 (flux).
 * STATES[15] is Tr_pM9_T1 in component Tr_pM9_T1 (molar).
 * CONSTANTS[27] is kon_TrpM9T1 in component kinetic_parameters (second_order_rate_constant).
 * CONSTANTS[28] is koff_TrpM9T1 in component kinetic_parameters (first_order_rate_constant).
 * ALGEBRAIC[17] is v18 in component v18 (flux).
 * CONSTANTS[29] is kact_TrpM9T1 in component kinetic_parameters (first_order_rate_constant).
 * ALGEBRAIC[18] is v19 in component v19 (flux).
 * STATES[16] is Tr_pM9_T1_M3 in component Tr_pM9_T1_M3 (molar).
 * CONSTANTS[30] is kon_TrpM9T1M3 in component kinetic_parameters (second_order_rate_constant).
 * CONSTANTS[31] is koff_TrpM9T1M3 in component kinetic_parameters (first_order_rate_constant).
 * ALGEBRAIC[19] is v20 in component v20 (flux).
 * CONSTANTS[32] is kact_TrpM9T1M3 in component kinetic_parameters (first_order_rate_constant).
 * RATES[0] is d/dt pM9 in component pM9 (molar).
 * RATES[1] is d/dt M3 in component M3 (molar).
 * RATES[2] is d/dt M3_pM9 in component M3_pM9 (molar).
 * RATES[4] is d/dt T1 in component T1 (molar).
 * RATES[3] is d/dt M3_T1 in component M3_T1 (molar).
 * RATES[5] is d/dt pM9_T1 in component pM9_T1 (molar).
 * RATES[6] is d/dt M3_pM9_T1 in component M3_pM9_T1 (molar).
 * RATES[7] is d/dt M9_T1_star in component M9_T1_star (molar).
 * RATES[8] is d/dt M9 in component M9 (molar).
 * RATES[9] is d/dt M9_T1 in component M9_T1 (molar).
 * RATES[11] is d/dt pM9_T1_M3 in component pM9_T1_M3 (molar).
 * RATES[12] is d/dt M3_pM9_T1_M3 in component M3_pM9_T1_M3 (molar).
 * RATES[10] is d/dt M9_T1_M3 in component M9_T1_M3 (molar).
 * RATES[13] is d/dt Tr in component Tr (molar).
 * RATES[14] is d/dt Tr_pM9 in component Tr_pM9 (molar).
 * RATES[15] is d/dt Tr_pM9_T1 in component Tr_pM9_T1 (molar).
 * RATES[16] is d/dt Tr_pM9_T1_M3 in component Tr_pM9_T1_M3 (molar).
 * There are a total of 0 condition variables.
 */
void
initConsts(double* CONSTANTS, double* RATES, double *STATES)
{
STATES[0] = 3e-7;
STATES[1] = 5e-8;
STATES[2] = 0;
CONSTANTS[0] = 1e4;
CONSTANTS[1] = 0.001;
CONSTANTS[2] = 0.0019;
STATES[3] = 0;
STATES[4] = 3e-7;
CONSTANTS[3] = 1.9e6;
CONSTANTS[4] = 1.26e-4;
STATES[5] = 0;
CONSTANTS[5] = 3.4e4;
CONSTANTS[6] = 7.48e-5;
STATES[6] = 0;
CONSTANTS[7] = 1e4;
CONSTANTS[8] = 0.001;
CONSTANTS[9] = 0.00057;
STATES[7] = 0;
STATES[8] = 0;
CONSTANTS[10] = 5.6e6;
CONSTANTS[11] = 1.6e-5;
STATES[9] = 0;
CONSTANTS[12] = 6.3e-4;
CONSTANTS[13] = 2.5e-4;
STATES[10] = 0;
CONSTANTS[14] = 7.48e-5;
CONSTANTS[15] = 3.4e4;
STATES[11] = 0;
CONSTANTS[16] = 1.9e6;
CONSTANTS[17] = 1.26e-4;
CONSTANTS[18] = 3.4e4;
CONSTANTS[19] = 7.48e-5;
STATES[12] = 0;
CONSTANTS[20] = 1e4;
CONSTANTS[21] = 0.001;
CONSTANTS[22] = 0.00057;
CONSTANTS[23] = 1.26e-4;
STATES[13] = 1e-7;
STATES[14] = 0;
CONSTANTS[24] = 1e4;
CONSTANTS[25] = 0.007;
CONSTANTS[26] = 0.002;
STATES[15] = 0;
CONSTANTS[27] = 1e4;
CONSTANTS[28] = 0.007;
CONSTANTS[29] = 0.0006;
STATES[16] = 0;
CONSTANTS[30] = 1e4;
CONSTANTS[31] = 0.007;
CONSTANTS[32] = 0.0006;
RATES[0] = 0.1001;
RATES[1] = 0.1001;
RATES[2] = 0.1001;
RATES[4] = 0.1001;
RATES[3] = 0.1001;
RATES[5] = 0.1001;
RATES[6] = 0.1001;
RATES[7] = 0.1001;
RATES[8] = 0.1001;
RATES[9] = 0.1001;
RATES[11] = 0.1001;
RATES[12] = 0.1001;
RATES[10] = 0.1001;
RATES[13] = 0.1001;
RATES[14] = 0.1001;
RATES[15] = 0.1001;
RATES[16] = 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[3]+ALGEBRAIC[14]+ALGEBRAIC[10]);
resid[1] = RATES[1] - (ALGEBRAIC[1]+ALGEBRAIC[5]+ALGEBRAIC[12]+ALGEBRAIC[13]) - (ALGEBRAIC[0]+ALGEBRAIC[2]+ALGEBRAIC[4]+ALGEBRAIC[9]+ALGEBRAIC[11]);
resid[2] = RATES[2] - ALGEBRAIC[0] - ALGEBRAIC[1];
resid[3] = RATES[4] - - (ALGEBRAIC[2]+ALGEBRAIC[3]+ALGEBRAIC[6]);
resid[4] = RATES[3] - (ALGEBRAIC[2]+ALGEBRAIC[8]) - ALGEBRAIC[10];
resid[5] = RATES[5] - ALGEBRAIC[3] - (ALGEBRAIC[4]+ALGEBRAIC[9]+ALGEBRAIC[16]);
resid[6] = RATES[6] - ALGEBRAIC[4] - ALGEBRAIC[5];
resid[7] = RATES[7] - (ALGEBRAIC[6]+ALGEBRAIC[13]) - ALGEBRAIC[7];
resid[8] = RATES[8] - (ALGEBRAIC[1]+ALGEBRAIC[8]+ALGEBRAIC[15]) - ALGEBRAIC[6];
resid[9] = RATES[9] - ALGEBRAIC[7]+ALGEBRAIC[17];
resid[10] = RATES[11] - (ALGEBRAIC[9]+ALGEBRAIC[10]) - (ALGEBRAIC[11]+ALGEBRAIC[18]);
resid[11] = RATES[12] - ALGEBRAIC[11] - ALGEBRAIC[12];
resid[12] = RATES[10] - (ALGEBRAIC[12]+ALGEBRAIC[19]) - (ALGEBRAIC[13]+ALGEBRAIC[8]);
resid[13] = RATES[13] - (ALGEBRAIC[15]+ALGEBRAIC[17]+ALGEBRAIC[19]) - (ALGEBRAIC[14]+ALGEBRAIC[16]+ALGEBRAIC[18]);
resid[14] = RATES[14] - ALGEBRAIC[14] - ALGEBRAIC[15];
resid[15] = RATES[15] - ALGEBRAIC[16] - ALGEBRAIC[17];
resid[16] = RATES[16] - ALGEBRAIC[18] - ALGEBRAIC[19];
}
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[0]*STATES[1]*STATES[0] -  CONSTANTS[1]*STATES[2];
ALGEBRAIC[1] =  CONSTANTS[2]*STATES[2];
ALGEBRAIC[2] =  CONSTANTS[3]*STATES[1]*STATES[4] -  CONSTANTS[4]*STATES[3];
ALGEBRAIC[3] =  CONSTANTS[5]*STATES[0]*STATES[4] -  CONSTANTS[6]*STATES[5];
ALGEBRAIC[4] =  CONSTANTS[7]*STATES[5]*STATES[1] -  CONSTANTS[8]*STATES[6];
ALGEBRAIC[5] =  CONSTANTS[9]*STATES[6];
ALGEBRAIC[6] =  CONSTANTS[10]*STATES[4]*STATES[8] -  CONSTANTS[11]*STATES[7];
ALGEBRAIC[7] =  CONSTANTS[12]*STATES[7] -  CONSTANTS[13]*STATES[9];
ALGEBRAIC[8] =  CONSTANTS[14]*STATES[10] -  CONSTANTS[15]*STATES[8]*STATES[3];
ALGEBRAIC[9] =  CONSTANTS[16]*STATES[5]*STATES[1] -  CONSTANTS[17]*STATES[11];
ALGEBRAIC[10] =  CONSTANTS[18]*STATES[0]*STATES[3] -  CONSTANTS[19]*STATES[11];
ALGEBRAIC[11] =  CONSTANTS[20]*STATES[1]*STATES[11] -  CONSTANTS[21]*STATES[12];
ALGEBRAIC[12] =  CONSTANTS[22]*STATES[12];
ALGEBRAIC[13] =  CONSTANTS[23]*STATES[10];
ALGEBRAIC[14] =  CONSTANTS[24]*STATES[13]*STATES[0] -  CONSTANTS[25]*STATES[14];
ALGEBRAIC[15] =  CONSTANTS[26]*STATES[14];
ALGEBRAIC[16] =  CONSTANTS[27]*STATES[5]*STATES[13] -  CONSTANTS[28]*STATES[15];
ALGEBRAIC[17] =  CONSTANTS[29]*STATES[15];
ALGEBRAIC[18] =  CONSTANTS[30]*STATES[13]*STATES[11] -  CONSTANTS[31]*STATES[16];
ALGEBRAIC[19] =  CONSTANTS[32]*STATES[16];
}
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;
SI[12] = 1.0;
SI[13] = 1.0;
SI[14] = 1.0;
SI[15] = 1.0;
SI[16] = 1.0;
}
void
computeRoots(double VOI, double* CONSTANTS, double* RATES, double* OLDRATES, double* STATES,
             double* OLDSTATES, double* ALGEBRAIC, double* CONDVARS)
{
}