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 7 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 10 entries in the constant variable array.
 */
/*
 * VOI is time in component environment (second).
 * STATES[0] is Ca_cyt in component Ca_cyt (micromolar).
 * ALGEBRAIC[0] is J_ERch in component J_ERch (micromolar).
 * ALGEBRAIC[1] is J_ERpump in component J_ERpump (micromolar).
 * ALGEBRAIC[2] is J_ERleak in component J_ERleak (micromolar).
 * ALGEBRAIC[5] is J_CaPr in component J_CaPr (micromolar).
 * ALGEBRAIC[6] is J_Pr in component J_Pr (micromolar).
 * STATES[1] is Ca_ER in component Ca_ER (micromolar).
 * CONSTANTS[0] is beta_ER in component Ca_ER (dimensionless).
 * CONSTANTS[1] is rho_ER in component Ca_ER (dimensionless).
 * CONSTANTS[2] is k_ERch in component J_ERch (micromolar).
 * CONSTANTS[3] is K_ch in component J_ERch (micromolar).
 * CONSTANTS[4] is k_ERpump in component J_ERpump (per_second).
 * CONSTANTS[5] is k_ERleak in component J_ERleak (per_second).
 * CONSTANTS[6] is k_min in component J_CaPr (per_second).
 * ALGEBRAIC[3] is CaPr in component CaPr (micromolar).
 * CONSTANTS[7] is k_plus in component J_Pr (per_micromolar_per_second).
 * ALGEBRAIC[4] is Pr in component Pr (micromolar).
 * CONSTANTS[8] is Ca_tot in component CaPr (micromolar).
 * CONSTANTS[9] is Pr_tot in component Pr (micromolar).
 * RATES[0] is d/dt Ca_cyt in component Ca_cyt (micromolar).
 * RATES[1] is d/dt Ca_ER in component Ca_ER (micromolar).
 * There are a total of 0 condition variables.
 */
void
initConsts(double* CONSTANTS, double* RATES, double *STATES)
{
STATES[0] = 0.01;
STATES[1] = 20;
CONSTANTS[0] = 0.0025;
CONSTANTS[1] = 0.01;
CONSTANTS[2] = 0.001;
CONSTANTS[3] = 5;
CONSTANTS[4] = 20;
CONSTANTS[5] = 0.05;
CONSTANTS[6] = 0.01;
CONSTANTS[7] = 0.1;
CONSTANTS[8] = 90;
CONSTANTS[9] = 120;
RATES[0] = 0.1001;
RATES[1] = 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] - ALGEBRAIC[1])+ALGEBRAIC[2]+ALGEBRAIC[5]) - ALGEBRAIC[6])*1.00000;
resid[1] = RATES[1] -  (CONSTANTS[0]/CONSTANTS[1])*((ALGEBRAIC[1] - ALGEBRAIC[2]) - ALGEBRAIC[0])*1.00000;
}
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[2]*(pow(STATES[0], 2.00000)/(pow(CONSTANTS[3], 2.00000)+pow(STATES[0], 2.00000)))*(STATES[1] - STATES[0]);
ALGEBRAIC[1] =  CONSTANTS[4]*STATES[0];
ALGEBRAIC[2] =  CONSTANTS[5]*(STATES[1] - STATES[0]);
ALGEBRAIC[3] = CONSTANTS[8] - (STATES[0]+ (CONSTANTS[1]/CONSTANTS[0])*STATES[1]);
ALGEBRAIC[5] =  CONSTANTS[6]*ALGEBRAIC[3];
ALGEBRAIC[4] = CONSTANTS[9] - ALGEBRAIC[3];
ALGEBRAIC[6] =  CONSTANTS[7]*STATES[0]*ALGEBRAIC[4];
}
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)
{
}