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 5 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 12 entries in the constant variable array.
 */
/*
 * VOI is time in component environment (second).
 * ALGEBRAIC[0] is H_int in component concentrations (mM).
 * ALGEBRAIC[1] is H_ext in component concentrations (mM).
 * CONSTANTS[0] is psi_int in component concentrations (volt).
 * CONSTANTS[1] is psi_ext in component concentrations (volt).
 * CONSTANTS[9] is psi in component concentrations (volt).
 * STATES[0] is pH_int in component concentrations (dimensionless).
 * STATES[1] is pH_ext in component concentrations (dimensionless).
 * CONSTANTS[2] is J_Vtype_H_Max in component H_ATPase (mM_per_s).
 * ALGEBRAIC[3] is J_Vtype_H in component H_ATPase (mM_per_s).
 * ALGEBRAIC[4] is plot in component fluxes (dimensionless).
 * ALGEBRAIC[2] is mu_H in component H_ATPase (joule_per_mmole).
 * CONSTANTS[3] is mu_0 in component H_ATPase (joule_per_mmole).
 * CONSTANTS[4] is xi in component H_ATPase (mmole_per_joule).
 * CONSTANTS[5] is F in component H_ATPase (coulomb_per_mmole).
 * CONSTANTS[6] is R in component H_ATPase (joule_per_mmole_kelvin).
 * CONSTANTS[7] is T in component H_ATPase (kelvin).
 * CONSTANTS[8] is z in component H_ATPase (dimensionless).
 * RATES[0] is d/dt pH_int in component concentrations (dimensionless).
 * RATES[1] is d/dt pH_ext in component concentrations (dimensionless).
 * There are a total of 0 condition variables.
 */
void
initConsts(double* CONSTANTS, double* RATES, double *STATES)
{
CONSTANTS[0] = -0.03;
CONSTANTS[1] = 0.0;
STATES[0] = 7.5;
STATES[1] = 4.0;
CONSTANTS[2] = 1.8;
CONSTANTS[3] = 4.0;
CONSTANTS[4] = 0.4;
CONSTANTS[5] = 96.5;
CONSTANTS[6] = 0.008315;
CONSTANTS[7] = 300;
CONSTANTS[8] = -1.57;
CONSTANTS[9] = CONSTANTS[1] - CONSTANTS[0];
CONSTANTS[10] = 0.00000;
CONSTANTS[11] = 0.100000;
}
void
computeResiduals(double VOI, double* CONSTANTS, double* RATES, double* OLDRATES, double* STATES,
                 double* OLDSTATES, double* ALGEBRAIC, double* CONDVARS)
{
resid[0] = RATES[0] - CONSTANTS[10];
resid[1] = RATES[1] - CONSTANTS[11];
}
void
computeVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
ALGEBRAIC[0] =  1000.00*pow(10.0000, - STATES[0]);
ALGEBRAIC[1] =  1000.00*pow(10.0000, - STATES[1]);
ALGEBRAIC[2] =  CONSTANTS[6]*CONSTANTS[7]*log(ALGEBRAIC[1]/ALGEBRAIC[0])+ CONSTANTS[8]*CONSTANTS[5]*CONSTANTS[9];
ALGEBRAIC[3] = CONSTANTS[2]/(1.00000+exp( CONSTANTS[4]*(ALGEBRAIC[2] - CONSTANTS[3])));
ALGEBRAIC[4] = ALGEBRAIC[3]/CONSTANTS[2];
}
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)
{
}