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 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 8 entries in the constant variable array.
 */
/*
 * VOI is time in component environment (minute).
 * CONSTANTS[0] is n in component parameters (dimensionless).
 * CONSTANTS[1] is alpha_0 in component parameters (dimensionless).
 * CONSTANTS[2] is alpha in component parameters (dimensionless).
 * CONSTANTS[3] is beta in component parameters (dimensionless).
 * CONSTANTS[4] is K_m in component parameters (dimensionless).
 * CONSTANTS[5] is efficiency in component parameters (dimensionless).
 * CONSTANTS[6] is mRNA_halflife in component parameters (minute).
 * CONSTANTS[7] is t_ave in component parameters (minute).
 * 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).
 * There are a total of 0 condition variables.
 */
void
initConsts(double* CONSTANTS, double* RATES, double *STATES)
{
CONSTANTS[0] = 2;
CONSTANTS[1] = 0.216;
CONSTANTS[2] = 216;
CONSTANTS[3] = 0.2;
CONSTANTS[4] = 40;
CONSTANTS[5] = 20;
CONSTANTS[6] = 2;
STATES[0] = 5;
STATES[1] = 0;
STATES[2] = 0;
STATES[3] = 0;
STATES[4] = 15;
STATES[5] = 0;
CONSTANTS[7] = CONSTANTS[6]/log(2.00000);
RATES[0] = 0.1001;
RATES[2] = 0.1001;
RATES[4] = 0.1001;
RATES[3] = 0.1001;
RATES[5] = 0.1001;
RATES[1] = 0.1001;
}
void
computeResiduals(double VOI, double* CONSTANTS, double* RATES, double* OLDRATES, double* STATES,
                 double* OLDSTATES, double* ALGEBRAIC, double* CONDVARS)
{
resid[0] = RATES[0] -  (CONSTANTS[4]/( CONSTANTS[5]*CONSTANTS[7]))*(( CONSTANTS[2]*pow(CONSTANTS[4], CONSTANTS[0]))/(pow(CONSTANTS[4], CONSTANTS[0])+pow(STATES[1], CONSTANTS[0]))+CONSTANTS[1]) - STATES[0]/CONSTANTS[7];
resid[1] = RATES[2] -  (CONSTANTS[4]/( CONSTANTS[5]*CONSTANTS[7]))*(( CONSTANTS[2]*pow(CONSTANTS[4], CONSTANTS[0]))/(pow(CONSTANTS[4], CONSTANTS[0])+pow(STATES[3], CONSTANTS[0]))+CONSTANTS[1]) - STATES[2]/CONSTANTS[7];
resid[2] = RATES[4] -  (CONSTANTS[4]/( CONSTANTS[5]*CONSTANTS[7]))*(( CONSTANTS[2]*pow(CONSTANTS[4], CONSTANTS[0]))/(pow(CONSTANTS[4], CONSTANTS[0])+pow(STATES[5], CONSTANTS[0]))+CONSTANTS[1]) - STATES[4]/CONSTANTS[7];
resid[3] = RATES[3] -  CONSTANTS[3]*(( STATES[0]*CONSTANTS[5])/CONSTANTS[7] - STATES[3]/CONSTANTS[7]);
resid[4] = RATES[5] -  CONSTANTS[3]*(( STATES[2]*CONSTANTS[5])/CONSTANTS[7] - STATES[5]/CONSTANTS[7]);
resid[5] = RATES[1] -  CONSTANTS[3]*(( STATES[4]*CONSTANTS[5])/CONSTANTS[7] - STATES[1]/CONSTANTS[7]);
}
void
computeVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
}
void
computeEssentialVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
}
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;
}
void
computeRoots(double VOI, double* CONSTANTS, double* RATES, double* OLDRATES, double* STATES,
             double* OLDSTATES, double* ALGEBRAIC, double* CONDVARS)
{
}