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 7 entries in each of the rate and state variable arrays.
   There are a total of 11 entries in the constant variable array.
 */
/*
 * VOI is time in component environment (hour).
 * STATES[0] is T in component T (cell_ml).
 * CONSTANTS[0] is k1 in component model_parameters (cell_per_ml_molecule2_hour).
 * STATES[1] is Lm in component Lm (molecule_cell).
 * STATES[2] is RT in component RT (molecule_cell).
 * STATES[3] is m in component m (cell_ml).
 * STATES[4] is LT in component LT (molecule_cell).
 * CONSTANTS[1] is k2 in component model_parameters (molecule_ml2_per_cell3_hour).
 * CONSTANTS[2] is k3 in component model_parameters (per_hour).
 * CONSTANTS[3] is k4 in component model_parameters (per_hour).
 * CONSTANTS[4] is k5 in component model_parameters (ml2_per_cell_molecule_hour).
 * STATES[5] is Rm in component Rm (molecule_cell).
 * CONSTANTS[5] is k6 in component model_parameters (molecule_per_cell_hour).
 * CONSTANTS[6] is k7 in component model_parameters (per_hour).
 * CONSTANTS[7] is k8 in component model_parameters (per_molar_per_minute).
 * STATES[6] is SL in component SL (molecule_ml).
 * CONSTANTS[8] is k10 in component model_parameters (molecule_per_cell_hour).
 * CONSTANTS[9] is k11 in component model_parameters (per_hour).
 * CONSTANTS[10] is k9 in component model_parameters (per_molar_per_minute).
 * RATES[0] is d/dt T in component T (cell_ml).
 * RATES[4] is d/dt LT in component LT (molecule_cell).
 * RATES[2] is d/dt RT in component RT (molecule_cell).
 * RATES[3] is d/dt m in component m (cell_ml).
 * RATES[1] is d/dt Lm in component Lm (molecule_cell).
 * RATES[5] is d/dt Rm in component Rm (molecule_cell).
 * RATES[6] is d/dt SL in component SL (molecule_ml).
 * There are a total of 0 condition variables.
 */
void
initConsts(double* CONSTANTS, double* RATES, double *STATES)
{
STATES[0] = 500.0;
CONSTANTS[0] = 8.38E-10;
STATES[1] = 1E3;
STATES[2] = 1E4;
STATES[3] = 500.0;
STATES[4] = 0.0;
CONSTANTS[1] = 6E-3;
CONSTANTS[2] = 5.9413;
CONSTANTS[3] = 0.35;
CONSTANTS[4] = 2.52E-9;
STATES[5] = 1E3;
CONSTANTS[5] = 2.244E3;
CONSTANTS[6] = 0.35;
CONSTANTS[7] = 1.92E10;
STATES[6] = 0.0;
CONSTANTS[8] = 3.11E3;
CONSTANTS[9] = 13.9;
CONSTANTS[10] = 87.3E8;
RATES[0] = 0.1001;
RATES[4] = 0.1001;
RATES[2] = 0.1001;
RATES[3] = 0.1001;
RATES[1] = 0.1001;
RATES[5] = 0.1001;
RATES[6] = 0.1001;
}
void
computeResiduals(double VOI, double* CONSTANTS, double* RATES, double* OLDRATES, double* STATES,
                 double* OLDSTATES, double* ALGEBRAIC, double* CONDVARS)
{
resid[0] = RATES[0] - - ( 1.00000*CONSTANTS[0]*STATES[3]*STATES[0]*STATES[1]*STATES[2]);
resid[1] = RATES[4] -  CONSTANTS[1]*STATES[0]*STATES[3] - ( CONSTANTS[2]*STATES[4]+ CONSTANTS[3]*STATES[4]+ CONSTANTS[4]*STATES[3]*STATES[0]*STATES[4]*STATES[5]);
resid[2] = RATES[2] - CONSTANTS[5] - ( CONSTANTS[6]*STATES[2]+ 1.00000*CONSTANTS[7]*STATES[2]*STATES[6]);
resid[3] = RATES[3] - - ( 1.00000*CONSTANTS[0]*STATES[3]*STATES[0]*STATES[4]*STATES[5]);
resid[4] = RATES[1] - CONSTANTS[8] - ( CONSTANTS[2]*STATES[1]+ CONSTANTS[3]*STATES[1]+ CONSTANTS[4]*STATES[3]*STATES[0]*STATES[1]*STATES[2]);
resid[5] = RATES[5] - CONSTANTS[5] - ( CONSTANTS[6]*STATES[5]+ 1.00000*CONSTANTS[7]*STATES[5]*STATES[6]);
resid[6] = RATES[6] -  CONSTANTS[2]*( STATES[1]*STATES[3]+ STATES[4]*STATES[0]) - ( CONSTANTS[9]*STATES[6]+ 1.00000*CONSTANTS[10]*( STATES[5]*STATES[3]+ STATES[2]*STATES[0])*STATES[6]);
}
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;
SI[6] = 1.0;
}
void
computeRoots(double VOI, double* CONSTANTS, double* RATES, double* OLDRATES, double* STATES,
             double* OLDSTATES, double* ALGEBRAIC, double* CONDVARS)
{
}