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 3 entries in the algebraic variable array.
   There are a total of 5 entries in each of the rate and state variable arrays.
   There are a total of 6 entries in the constant variable array.
 */
/*
 * VOI is t in component time (second).
 * CONSTANTS[0] is R in component geometry (per_um).
 * ALGEBRAIC[0] is J1 in component Cformation (uM_per_s).
 * ALGEBRAIC[1] is J2 in component Eformation (per_um2_per_s).
 * CONSTANTS[5] is Cpc in component C_interface (uM_um2).
 * ALGEBRAIC[2] is JTotal in component C_interface (uM_per_s).
 * STATES[0] is C in component C (uM).
 * STATES[1] is A in component Cformation (uM).
 * STATES[2] is B in component Cformation (uM).
 * CONSTANTS[1] is kf1 in component Cformation (per_uM_per_s).
 * CONSTANTS[2] is kr1 in component Cformation (per_s).
 * STATES[3] is D in component Eformation (per_um2).
 * STATES[4] is E in component Eformation (per_um2).
 * CONSTANTS[3] is kf2 in component Eformation (per_uM_per_s).
 * CONSTANTS[4] is kr2 in component Eformation (per_s).
 * RATES[0] is d/dt C in component C (uM).
 * RATES[1] is d/dt A in component Cformation (uM).
 * RATES[2] is d/dt B in component Cformation (uM).
 * RATES[3] is d/dt D in component Eformation (per_um2).
 * RATES[4] is d/dt E in component Eformation (per_um2).
 * There are a total of 0 condition variables.
 */
void
initConsts(double* CONSTANTS, double* RATES, double *STATES)
{
CONSTANTS[0] = 5;
STATES[0] = 0;
STATES[1] = 10;
STATES[2] = 5;
CONSTANTS[1] = 0.2;
CONSTANTS[2] = 0.05;
STATES[3] = 4;
STATES[4] = 0;
CONSTANTS[3] = 0.006;
CONSTANTS[4] = 0.001;
CONSTANTS[5] = CONSTANTS[0]/602.200;
RATES[0] = 0.1001;
RATES[1] = 0.1001;
RATES[2] = 0.1001;
RATES[3] = 0.1001;
RATES[4] = 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[2];
resid[1] = RATES[1] - - ALGEBRAIC[0];
resid[2] = RATES[2] - - ALGEBRAIC[0];
resid[3] = RATES[3] - - ALGEBRAIC[1];
resid[4] = RATES[4] - ALGEBRAIC[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)
{
ALGEBRAIC[0] =  CONSTANTS[1]*STATES[1]*STATES[2] -  CONSTANTS[2]*STATES[0];
ALGEBRAIC[1] =  CONSTANTS[3]*STATES[0]*STATES[3] -  CONSTANTS[4]*STATES[4];
ALGEBRAIC[2] = ALGEBRAIC[0] -  CONSTANTS[5]*ALGEBRAIC[1];
}
void
getStateInformation(double* SI)
{
SI[0] = 1.0;
SI[1] = 1.0;
SI[2] = 1.0;
SI[3] = 1.0;
SI[4] = 1.0;
}
void
computeRoots(double VOI, double* CONSTANTS, double* RATES, double* OLDRATES, double* STATES,
             double* OLDSTATES, double* ALGEBRAIC, double* CONDVARS)
{
}