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 6 entries in the algebraic variable array.
   There are a total of 1 entries in each of the rate and state variable arrays.
   There are a total of 22 entries in the constant variable array.
 */
/*
 * VOI is time in component environment (second).
 * STATES[0] is C_ext_Na in component Concentrations (mM).
 * CONSTANTS[0] is C_ext_H in component Concentrations (mM).
 * CONSTANTS[1] is C_ext_NH4 in component Concentrations (mM).
 * CONSTANTS[2] is C_int_Na in component Concentrations (mM).
 * CONSTANTS[3] is C_int_H in component Concentrations (mM).
 * CONSTANTS[4] is C_int_NH4 in component Concentrations (mM).
 * CONSTANTS[5] is XTxP0_NHE3_Na in component NHE3_Parameters (nmol_per_s_per_cm2).
 * CONSTANTS[6] is XTxP0_NHE3_H in component NHE3_Parameters (nmol_per_s_per_cm2).
 * CONSTANTS[7] is XTxP0_NHE3_NH4 in component NHE3_Parameters (nmol_per_s_per_cm2).
 * CONSTANTS[8] is K_NHE3_Na in component NHE3_Parameters (mM).
 * CONSTANTS[9] is K_NHE3_H in component NHE3_Parameters (mM).
 * CONSTANTS[10] is K_NHE3_NH4 in component NHE3_Parameters (mM).
 * CONSTANTS[16] is XTxP_NHE3_Na in component NHE3 (nmol_per_s_per_cm2).
 * CONSTANTS[17] is XTxP_NHE3_H in component NHE3 (nmol_per_s_per_cm2).
 * CONSTANTS[18] is XTxP_NHE3_NH4 in component NHE3 (nmol_per_s_per_cm2).
 * ALGEBRAIC[0] is alpha_ext_Na in component NHE3 (dimensionless).
 * CONSTANTS[11] is beta_ext_H in component NHE3 (dimensionless).
 * CONSTANTS[12] is gamma_ext_NH4 in component NHE3 (dimensionless).
 * CONSTANTS[13] is alpha_int_Na in component NHE3 (dimensionless).
 * CONSTANTS[14] is beta_int_H in component NHE3 (dimensionless).
 * CONSTANTS[15] is gamma_int_NH4 in component NHE3 (dimensionless).
 * ALGEBRAIC[1] is sum_NHE3 in component NHE3 (nmol_per_s_per_cm2).
 * ALGEBRAIC[2] is J_NHE3_Na in component NHE3 (nmol_per_s_per_cm2).
 * ALGEBRAIC[3] is J_NHE3_H in component NHE3 (nmol_per_s_per_cm2).
 * ALGEBRAIC[4] is J_NHE3_NH4 in component NHE3 (nmol_per_s_per_cm2).
 * CONSTANTS[19] is J_NHE3_Na_Max in component NHE3 (nmol_per_s_per_cm2).
 * CONSTANTS[20] is K_Na in component NHE3 (dimensionless).
 * ALGEBRAIC[5] is plot in component NHE3 (mM).
 * RATES[0] is d/dt C_ext_Na in component Concentrations (mM).
 * There are a total of 0 condition variables.
 */
void
initConsts(double* CONSTANTS, double* RATES, double *STATES)
{
STATES[0] = 1;
CONSTANTS[0] = 3.1623e-5;
CONSTANTS[1] = 0;
CONSTANTS[2] = 0;
CONSTANTS[3] = 1e-3;
CONSTANTS[4] = 0;
CONSTANTS[5] = 1.6e-3;
CONSTANTS[6] = 0.48e-3;
CONSTANTS[7] = 1.6e-3;
CONSTANTS[8] = 30;
CONSTANTS[9] = 72e-6;
CONSTANTS[10] = 0.027e3;
CONSTANTS[11] = CONSTANTS[0]/CONSTANTS[9];
CONSTANTS[21] = 100.000;
CONSTANTS[12] = CONSTANTS[1]/CONSTANTS[10];
CONSTANTS[13] = CONSTANTS[2]/CONSTANTS[8];
CONSTANTS[14] = CONSTANTS[3]/CONSTANTS[9];
CONSTANTS[15] = CONSTANTS[4]/CONSTANTS[10];
CONSTANTS[16] = ( CONSTANTS[5]*2.00000*CONSTANTS[3])/(CONSTANTS[3]+1.00000e-06);
CONSTANTS[17] = ( CONSTANTS[6]*2.00000*CONSTANTS[3])/(CONSTANTS[3]+1.00000e-06);
CONSTANTS[18] = ( CONSTANTS[7]*2.00000*CONSTANTS[3])/(CONSTANTS[3]+1.00000e-06);
CONSTANTS[19] = ( CONSTANTS[16]*CONSTANTS[17])/(CONSTANTS[16]+CONSTANTS[17]);
CONSTANTS[20] = (CONSTANTS[14]+ 2.00000*CONSTANTS[14]*CONSTANTS[11]+CONSTANTS[11])/(CONSTANTS[14]+( (1.00000+CONSTANTS[14])*CONSTANTS[16])/CONSTANTS[17]);
CONSTANTS[21] = 0.1;
}
void
computeResiduals(double VOI, double* CONSTANTS, double* RATES, double* OLDRATES, double* STATES,
                 double* OLDSTATES, double* ALGEBRAIC, double* CONDVARS)
{
resid[0] = RATES[0] - CONSTANTS[21];
}
void
computeVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
ALGEBRAIC[0] = STATES[0]/CONSTANTS[8];
ALGEBRAIC[1] =  (1.00000+ALGEBRAIC[0]+CONSTANTS[11]+CONSTANTS[12])*( CONSTANTS[16]*CONSTANTS[13]+ CONSTANTS[17]*CONSTANTS[14]+ CONSTANTS[18]*CONSTANTS[15])+ (1.00000+CONSTANTS[13]+CONSTANTS[14]+CONSTANTS[15])*( CONSTANTS[16]*ALGEBRAIC[0]+ CONSTANTS[17]*CONSTANTS[11]+ CONSTANTS[18]*CONSTANTS[12]);
ALGEBRAIC[2] =  (( CONSTANTS[16]*CONSTANTS[17])/ALGEBRAIC[1])*( ALGEBRAIC[0]*CONSTANTS[14] -  CONSTANTS[13]*CONSTANTS[11])+ (( CONSTANTS[16]*CONSTANTS[18])/ALGEBRAIC[1])*( ALGEBRAIC[0]*CONSTANTS[15] -  CONSTANTS[13]*CONSTANTS[12]);
ALGEBRAIC[3] =  (( CONSTANTS[16]*CONSTANTS[17])/ALGEBRAIC[1])*( CONSTANTS[13]*CONSTANTS[11] -  ALGEBRAIC[0]*CONSTANTS[14])+ (( CONSTANTS[17]*CONSTANTS[18])/ALGEBRAIC[1])*( CONSTANTS[11]*CONSTANTS[15] -  CONSTANTS[14]*CONSTANTS[12]);
ALGEBRAIC[4] =  (( CONSTANTS[16]*CONSTANTS[18])/ALGEBRAIC[1])*( CONSTANTS[13]*CONSTANTS[12] -  ALGEBRAIC[0]*CONSTANTS[15])+ (( CONSTANTS[17]*CONSTANTS[18])/ALGEBRAIC[1])*( CONSTANTS[12]*CONSTANTS[14] -  CONSTANTS[11]*CONSTANTS[15]);
ALGEBRAIC[5] = STATES[0]/(ALGEBRAIC[2]/CONSTANTS[19]);
}
void
computeEssentialVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
}
void
getStateInformation(double* SI)
{
SI[0] = 1.0;
}
void
computeRoots(double VOI, double* CONSTANTS, double* RATES, double* OLDRATES, double* STATES,
             double* OLDSTATES, double* ALGEBRAIC, double* CONDVARS)
{
}