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 2 entries in each of the rate and state variable arrays.
   There are a total of 6 entries in the constant variable array.
 */
/*
 * VOI is time in component environment (second).
 * STATES[0] is Xi in component Xi (nanomolar).
 * CONSTANTS[0] is ai in component Xi (flux).
 * CONSTANTS[1] is bi in component Xi (flux).
 * CONSTANTS[2] is Ai in component Xi (dimensionless).
 * CONSTANTS[3] is ki in component Xi (per_nanomolar).
 * STATES[1] is Yi in component Yi (nanomolar).
 * CONSTANTS[4] is beta_i in component Yi (flux).
 * CONSTANTS[5] is alpha_i in component Yi (first_order_rate_constant).
 * RATES[0] is d/dt Xi in component Xi (nanomolar).
 * RATES[1] is d/dt Yi in component Yi (nanomolar).
 * There are a total of 0 condition variables.
 */
void
initConsts(double* CONSTANTS, double* RATES, double *STATES)
{
STATES[0] = 7;
CONSTANTS[0] = 72;
CONSTANTS[1] = 2;
CONSTANTS[2] = 36;
CONSTANTS[3] = 1;
STATES[1] = -10;
CONSTANTS[4] = 0;
CONSTANTS[5] = 1;
RATES[0] = 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[0]/(CONSTANTS[2]+ CONSTANTS[3]*STATES[1]) - CONSTANTS[1];
resid[1] = RATES[1] -  CONSTANTS[5]*STATES[0] - CONSTANTS[4];
}
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;
}
void
computeRoots(double VOI, double* CONSTANTS, double* RATES, double* OLDRATES, double* STATES,
             double* OLDSTATES, double* ALGEBRAIC, double* CONDVARS)
{
}