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 1 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 9 entries in the constant variable array.
 */
/*
 * VOI is t in component Test (second).
 * ALGEBRAIC[0] is J in component PingPongBiBi (mM_per_second).
 * STATES[0] is S1 in component Test (mM).
 * STATES[1] is S2 in component Test (mM).
 * STATES[2] is P1 in component Test (mM).
 * STATES[3] is P2 in component Test (mM).
 * CONSTANTS[0] is V_f in component Test (mM_per_second).
 * CONSTANTS[1] is V_b in component Test (mM_per_second).
 * CONSTANTS[2] is Keq in component Test (dimensionless).
 * CONSTANTS[3] is Km_S1 in component Test (mM).
 * CONSTANTS[4] is Km_S2 in component Test (mM).
 * CONSTANTS[5] is Km_P1 in component Test (mM).
 * CONSTANTS[6] is Km_P2 in component Test (mM).
 * CONSTANTS[7] is Ki_S1 in component Test (mM).
 * CONSTANTS[8] is Ki_P2 in component Test (mM).
 * RATES[0] is d/dt S1 in component Test (mM).
 * RATES[1] is d/dt S2 in component Test (mM).
 * RATES[2] is d/dt P1 in component Test (mM).
 * RATES[3] is d/dt P2 in component Test (mM).
 * There are a total of 0 condition variables.
 */
void
initConsts(double* CONSTANTS, double* RATES, double *STATES)
{
STATES[0] = 2;
STATES[1] = 1;
STATES[2] = 1;
STATES[3] = 0;
CONSTANTS[0] = 10.0000;
CONSTANTS[1] = 3.00000;
CONSTANTS[2] = 0.200000;
CONSTANTS[3] = 0.100000;
CONSTANTS[4] = 0.500000;
CONSTANTS[5] = 0.100000;
CONSTANTS[6] = 0.500000;
CONSTANTS[7] = 0.500000;
CONSTANTS[8] = 0.500000;
RATES[0] = 0.1001;
RATES[1] = 0.1001;
RATES[2] = 0.1001;
RATES[3] = 0.1001;
}
void
computeResiduals(double VOI, double* CONSTANTS, double* RATES, double* OLDRATES, double* STATES,
                 double* OLDSTATES, double* ALGEBRAIC, double* CONDVARS)
{
resid[0] = RATES[0] - - ALGEBRAIC[0];
resid[1] = RATES[1] - - ALGEBRAIC[0];
resid[2] = RATES[2] - ALGEBRAIC[0];
resid[3] = RATES[3] - ALGEBRAIC[0];
}
void
computeVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
}
void
computeEssentialVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
ALGEBRAIC[0] = ( CONSTANTS[0]*( STATES[0]*STATES[0] - ( STATES[2]*STATES[3])/CONSTANTS[2]))/( STATES[0]*STATES[0]+ CONSTANTS[4]*STATES[0]+ CONSTANTS[3]*STATES[0]*(1.00000+STATES[3]/CONSTANTS[8])+ (CONSTANTS[0]/( CONSTANTS[1]*CONSTANTS[2]))*( CONSTANTS[6]*STATES[2]*(1.00000+STATES[0]/CONSTANTS[7])+ STATES[3]*(CONSTANTS[5]+STATES[2])));
}
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)
{
}