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 0 entries in the algebraic variable array.
   There are a total of 6 entries in each of the rate and state variable arrays.
   There are a total of 16 entries in the constant variable array.
 */
/*
 * VOI is time in component environment (minute).
 * CONSTANTS[0] is n in component parameters (dimensionless).
 * CONSTANTS[12] is alpha_0 in component parameters (dimensionless).
 * CONSTANTS[13] is alpha in component parameters (dimensionless).
 * CONSTANTS[14] is beta in component parameters (dimensionless).
 * CONSTANTS[1] is K_m in component parameters (dimensionless).
 * CONSTANTS[2] is efficiency in component parameters (dimensionless).
 * CONSTANTS[3] is mRNA_halflife in component parameters (minute).
 * CONSTANTS[7] is t_ave in component parameters (minute).
 * CONSTANTS[8] is kd_prot in component parameters (first_order_rate_constant).
 * CONSTANTS[9] is kd_mRNA in component parameters (first_order_rate_constant).
 * CONSTANTS[4] is prot_halflife in component parameters (minute).
 * CONSTANTS[5] is tps_repr in component parameters (per_sec).
 * CONSTANTS[6] is tps_active in component parameters (per_sec).
 * CONSTANTS[15] is k_tl in component parameters (first_order_rate_constant).
 * CONSTANTS[10] is a_tr in component parameters (first_order_rate_constant).
 * CONSTANTS[11] is a0_tr in component parameters (first_order_rate_constant).
 * STATES[0] is M_lacl in component M_lacl (dimensionless).
 * STATES[1] is P_cl in component P_cl (dimensionless).
 * STATES[2] is M_tetR in component M_tetR (dimensionless).
 * STATES[3] is P_lacl in component P_lacl (dimensionless).
 * STATES[4] is M_cl in component M_cl (dimensionless).
 * STATES[5] is P_tetR in component P_tetR (dimensionless).
 * RATES[0] is d/dt M_lacl in component M_lacl (dimensionless).
 * RATES[2] is d/dt M_tetR in component M_tetR (dimensionless).
 * RATES[4] is d/dt M_cl in component M_cl (dimensionless).
 * RATES[3] is d/dt P_lacl in component P_lacl (dimensionless).
 * RATES[5] is d/dt P_tetR in component P_tetR (dimensionless).
 * RATES[1] is d/dt P_cl in component P_cl (dimensionless).
 */
void
initConsts(double* CONSTANTS, double* RATES, double *STATES)
{
CONSTANTS[0] = 2;
CONSTANTS[1] = 40;
CONSTANTS[2] = 20;
CONSTANTS[3] = 2;
CONSTANTS[4] = 10;
CONSTANTS[5] = 5e-4;
CONSTANTS[6] = 0.5;
STATES[0] = 0;
STATES[1] = 0;
STATES[2] = 20;
STATES[3] = 0;
STATES[4] = 0;
STATES[5] = 0;
CONSTANTS[7] = CONSTANTS[3]/log(2.00000);
CONSTANTS[8] = log(2.00000)/CONSTANTS[4];
CONSTANTS[9] = log(2.00000)/CONSTANTS[3];
CONSTANTS[10] =  (CONSTANTS[6] - CONSTANTS[5])*60.0000;
CONSTANTS[11] =  CONSTANTS[5]*60.0000;
CONSTANTS[12] = ( CONSTANTS[11]*CONSTANTS[2])/( CONSTANTS[8]*CONSTANTS[1]);
CONSTANTS[13] = ( CONSTANTS[10]*CONSTANTS[2])/( CONSTANTS[8]*CONSTANTS[1]);
CONSTANTS[14] = CONSTANTS[8]/CONSTANTS[9];
CONSTANTS[15] =  CONSTANTS[2]*CONSTANTS[9];
}
void
computeRates(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
RATES[0] = (CONSTANTS[11]+( CONSTANTS[10]*pow(CONSTANTS[1], CONSTANTS[0]))/(pow(CONSTANTS[1], CONSTANTS[0])+pow(STATES[1], CONSTANTS[0]))) -  CONSTANTS[9]*STATES[0];
RATES[2] = (( CONSTANTS[10]*pow(CONSTANTS[1], CONSTANTS[0]))/(pow(CONSTANTS[1], CONSTANTS[0])+pow(STATES[3], CONSTANTS[0]))+CONSTANTS[11]) -  CONSTANTS[9]*STATES[2];
RATES[4] = (( CONSTANTS[10]*pow(CONSTANTS[1], CONSTANTS[0]))/(pow(CONSTANTS[1], CONSTANTS[0])+pow(STATES[5], CONSTANTS[0]))+CONSTANTS[11]) -  CONSTANTS[9]*STATES[4];
RATES[3] =  CONSTANTS[15]*STATES[0] -  CONSTANTS[8]*STATES[3];
RATES[5] =  CONSTANTS[15]*STATES[2] -  CONSTANTS[8]*STATES[5];
RATES[1] =  CONSTANTS[15]*STATES[4] -  CONSTANTS[8]*STATES[1];
}
void
computeVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
}