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 15 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 17 entries in the constant variable array.
 */
/*
 * VOI is time in component environment (second).
 * STATES[0] is HCO3_i in component Concentrations (mM).
 * CONSTANTS[0] is HCO3_e in component Concentrations (mM).
 * CONSTANTS[1] is Cl_i in component Concentrations (mM).
 * CONSTANTS[2] is Cl_e in component Concentrations (mM).
 * CONSTANTS[3] is x_Tmax in component Concentrations (nmol_per_cm2).
 * ALGEBRAIC[0] is x_T in component Concentrations (nmol_per_cm2).
 * CONSTANTS[4] is K_I in component AE1_rate_constants (mM).
 * CONSTANTS[5] is Kc_p in component AE1_rate_constants (mM).
 * CONSTANTS[6] is Kc_pp in component AE1_rate_constants (mM).
 * CONSTANTS[7] is Kb_p in component AE1_rate_constants (mM).
 * CONSTANTS[8] is Kb_pp in component AE1_rate_constants (mM).
 * CONSTANTS[9] is Pc_p in component AE1_rate_constants (per_s).
 * CONSTANTS[10] is Pc_pp in component AE1_rate_constants (per_s).
 * CONSTANTS[11] is Pb_p in component AE1_rate_constants (per_s).
 * CONSTANTS[12] is Pb_pp in component AE1_rate_constants (per_s).
 * CONSTANTS[13] is beta_p in component AE1 (dimensionless).
 * ALGEBRAIC[1] is beta_pp in component AE1 (dimensionless).
 * CONSTANTS[14] is gamma_p in component AE1 (dimensionless).
 * CONSTANTS[15] is gamma_pp in component AE1 (dimensionless).
 * ALGEBRAIC[2] is sigma in component AE1 (per_s).
 * ALGEBRAIC[3] is x_p in component AE1 (nmol_per_cm2).
 * ALGEBRAIC[4] is x_pp in component AE1 (nmol_per_cm2).
 * ALGEBRAIC[7] is J_HCO3 in component AE1 (nmol_per_s_per_cm2).
 * ALGEBRAIC[8] is J_Cl in component AE1 (nmol_per_s_per_cm2).
 * ALGEBRAIC[5] is Jb_influx in component AE1 (nmol_per_s_per_cm2).
 * ALGEBRAIC[6] is Jc_influx in component AE1 (nmol_per_s_per_cm2).
 * ALGEBRAIC[9] is Jo_bm in component AE1 (nmol_per_s_per_cm2).
 * ALGEBRAIC[10] is Ji_bm in component AE1 (nmol_per_s_per_cm2).
 * ALGEBRAIC[11] is Js_bm in component AE1 (nmol_per_s_per_cm2).
 * ALGEBRAIC[12] is Jo_cm in component AE1 (nmol_per_s_per_cm2).
 * ALGEBRAIC[13] is Ji_cm in component AE1 (nmol_per_s_per_cm2).
 * ALGEBRAIC[14] is Js_cm in component AE1 (nmol_per_s_per_cm2).
 * RATES[0] is d/dt HCO3_i in component Concentrations (mM).
 * There are a total of 0 condition variables.
 */
void
initConsts(double* CONSTANTS, double* RATES, double *STATES)
{
STATES[0] = 0;
CONSTANTS[0] = 26;
CONSTANTS[1] = 29;
CONSTANTS[2] = 114;
CONSTANTS[3] = 1;
CONSTANTS[4] = 172;
CONSTANTS[5] = 50;
CONSTANTS[6] = 50;
CONSTANTS[7] = 198;
CONSTANTS[8] = 198;
CONSTANTS[9] = 562;
CONSTANTS[10] = 61;
CONSTANTS[11] = 1247;
CONSTANTS[12] = 135;
CONSTANTS[13] = CONSTANTS[0]/CONSTANTS[7];
CONSTANTS[16] = 60.0000;
CONSTANTS[14] = CONSTANTS[2]/CONSTANTS[5];
CONSTANTS[15] = CONSTANTS[1]/CONSTANTS[6];
}
void
computeResiduals(double VOI, double* CONSTANTS, double* RATES, double* OLDRATES, double* STATES,
                 double* OLDSTATES, double* ALGEBRAIC, double* CONDVARS)
{
resid[0] = RATES[0] - CONSTANTS[16];
}
void
computeVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
ALGEBRAIC[0] = CONSTANTS[3]/(1.00000+STATES[0]/CONSTANTS[4]);
ALGEBRAIC[1] = STATES[0]/CONSTANTS[8];
ALGEBRAIC[2] =  (1.00000+CONSTANTS[13]+CONSTANTS[14])*( CONSTANTS[12]*ALGEBRAIC[1]+ CONSTANTS[10]*CONSTANTS[15])+ (1.00000+ALGEBRAIC[1]+CONSTANTS[15])*( CONSTANTS[11]*CONSTANTS[13]+ CONSTANTS[9]*CONSTANTS[14]);
ALGEBRAIC[3] = ( ALGEBRAIC[0]*( CONSTANTS[12]*ALGEBRAIC[1]+ CONSTANTS[10]*CONSTANTS[15]))/ALGEBRAIC[2];
ALGEBRAIC[4] = ( ALGEBRAIC[0]*( CONSTANTS[11]*CONSTANTS[13]+ CONSTANTS[9]*CONSTANTS[14]))/ALGEBRAIC[2];
ALGEBRAIC[5] =  (ALGEBRAIC[0]/ALGEBRAIC[2])*CONSTANTS[11]*CONSTANTS[13]*( CONSTANTS[12]*ALGEBRAIC[1]+ CONSTANTS[10]*CONSTANTS[15]);
ALGEBRAIC[6] =  (ALGEBRAIC[0]/ALGEBRAIC[2])*CONSTANTS[9]*CONSTANTS[14]*( CONSTANTS[12]*ALGEBRAIC[1]+ CONSTANTS[10]*CONSTANTS[15]);
ALGEBRAIC[7] =  (ALGEBRAIC[0]/ALGEBRAIC[2])*( CONSTANTS[12]*ALGEBRAIC[1]*CONSTANTS[9]*CONSTANTS[14] -  CONSTANTS[11]*CONSTANTS[13]*CONSTANTS[10]*CONSTANTS[15]);
ALGEBRAIC[8] = - ALGEBRAIC[7];
ALGEBRAIC[9] = pow( (1.00000/ALGEBRAIC[0])*(1.00000/CONSTANTS[11]+1.00000/CONSTANTS[12]+CONSTANTS[8]/( CONSTANTS[12]*STATES[0])), - 1.00000);
ALGEBRAIC[10] = pow( (1.00000/ALGEBRAIC[0])*(1.00000/CONSTANTS[11]+1.00000/CONSTANTS[12]+CONSTANTS[7]/( CONSTANTS[11]*CONSTANTS[0])), - 1.00000);
ALGEBRAIC[11] = pow( (1.00000/ALGEBRAIC[0])*(1.00000/CONSTANTS[11]+1.00000/CONSTANTS[12]), - 1.00000);
ALGEBRAIC[12] = pow( (1.00000/ALGEBRAIC[0])*(1.00000/CONSTANTS[9]+1.00000/CONSTANTS[10]+CONSTANTS[6]/( CONSTANTS[10]*CONSTANTS[1])), - 1.00000);
ALGEBRAIC[13] = pow( (1.00000/ALGEBRAIC[0])*(1.00000/CONSTANTS[9]+1.00000/CONSTANTS[10]+CONSTANTS[5]/( CONSTANTS[9]*CONSTANTS[2])), - 1.00000);
ALGEBRAIC[14] = pow( (1.00000/ALGEBRAIC[0])*(1.00000/CONSTANTS[9]+1.00000/CONSTANTS[10]), - 1.00000);
}
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)
{
}