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 4 entries in each of the rate and state variable arrays.
   There are a total of 12 entries in the constant variable array.
 */
/*
 * VOI is time in component environment (day).
 * STATES[0] is A in component A (dimensionless).
 * CONSTANTS[0] is v_tilday in component A (first_order_rate_constant).
 * CONSTANTS[1] is f in component A (dimensionless).
 * CONSTANTS[2] is muA in component A (first_order_rate_constant).
 * CONSTANTS[3] is b4 in component A (dimensionless).
 * CONSTANTS[4] is sigma4 in component A (dimensionless).
 * STATES[1] is G in component G (dimensionless).
 * STATES[2] is R in component R (dimensionless).
 * CONSTANTS[5] is pi4 in component R (first_order_rate_constant).
 * CONSTANTS[6] is beta in component R (first_order_rate_constant).
 * CONSTANTS[7] is muR in component R (first_order_rate_constant).
 * STATES[3] is E in component E (dimensionless).
 * CONSTANTS[8] is lambdaE in component E (first_order_rate_constant).
 * CONSTANTS[9] is muE in component E (first_order_rate_constant).
 * CONSTANTS[10] is gamma in component G (first_order_rate_constant).
 * CONSTANTS[11] is muG in component G (first_order_rate_constant).
 * RATES[0] is d/dt A in component A (dimensionless).
 * RATES[2] is d/dt R in component R (dimensionless).
 * RATES[3] is d/dt E in component E (dimensionless).
 * RATES[1] is d/dt G in component G (dimensionless).
 * There are a total of 0 condition variables.
 */
void
initConsts(double* CONSTANTS, double* RATES, double *STATES)
{
STATES[0] = 1.0;
CONSTANTS[0] = 0.0025;
CONSTANTS[1] = 1e-4;
CONSTANTS[2] = 0.25;
CONSTANTS[3] = 1.00;
CONSTANTS[4] = 1.2e-5;
STATES[1] = 1e8;
STATES[2] = 0.0;
CONSTANTS[5] = 0.016;
CONSTANTS[6] = 200.0;
CONSTANTS[7] = 0.25;
STATES[3] = 0.0;
CONSTANTS[8] = 1000.0;
CONSTANTS[9] = 0.25;
CONSTANTS[10] = 2000.0;
CONSTANTS[11] = 5.0;
RATES[0] = 0.1001;
RATES[2] = 0.1001;
RATES[3] = 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[1]*CONSTANTS[0]*STATES[1])/(1.00000+CONSTANTS[3]+ CONSTANTS[4]*STATES[2]) -  CONSTANTS[2]*STATES[0];
resid[1] = RATES[2] -  ( CONSTANTS[5]*STATES[3]+CONSTANTS[6])*STATES[0] -  CONSTANTS[7]*STATES[2];
resid[2] = RATES[3] -  CONSTANTS[8]*STATES[0] -  CONSTANTS[9]*STATES[3];
resid[3] = RATES[1] -  CONSTANTS[10]*STATES[3] - ( CONSTANTS[0]*STATES[1]+ CONSTANTS[11]*STATES[1]);
}
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;
}
void
computeRoots(double VOI, double* CONSTANTS, double* RATES, double* OLDRATES, double* STATES,
             double* OLDSTATES, double* ALGEBRAIC, double* CONDVARS)
{
}