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 3 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).
 * ALGEBRAIC[0] is Ca_Pr in component total_calcium (micromolar).
 * CONSTANTS[0] is Ca_tot in component total_calcium (micromolar).
 * CONSTANTS[1] is rho_ER in component ER_calcium (dimensionless).
 * CONSTANTS[2] is beta_ER in component ER_calcium (dimensionless).
 * CONSTANTS[3] is rho_m in component mitochondrial_calcium (dimensionless).
 * CONSTANTS[4] is beta_m in component mitochondrial_calcium (dimensionless).
 * STATES[0] is Ca_cyt in component cytosolic_calcium (micromolar).
 * STATES[1] is Ca_ER in component ER_calcium (micromolar).
 * STATES[2] is Ca_m in component mitochondrial_calcium (micromolar).
 * ALGEBRAIC[1] is Pr in component total_protein (micromolar).
 * CONSTANTS[5] is Pr_tot in component total_protein (micromolar).
 * CONSTANTS[6] is k_plus in component cytosolic_calcium (second_order_rate_constant).
 * CONSTANTS[7] is k_minus in component cytosolic_calcium (first_order_rate_constant).
 * ALGEBRAIC[3] is J_ch in component Ca_efflux_from_the_ER (flux).
 * ALGEBRAIC[4] is J_leak in component Ca_leak_flux_from_the_ER (flux).
 * ALGEBRAIC[2] is J_pump in component ATP_dependent_Ca_uptake_into_the_ER (flux).
 * ALGEBRAIC[6] is J_out in component mitochondrial_Ca_release (flux).
 * ALGEBRAIC[5] is J_in in component mitochondrial_Ca_uptake (flux).
 * CONSTANTS[8] is k_pump in component ATP_dependent_Ca_uptake_into_the_ER (first_order_rate_constant).
 * CONSTANTS[9] is k_ch in component Ca_efflux_from_the_ER (first_order_rate_constant).
 * CONSTANTS[10] is K1 in component Ca_efflux_from_the_ER (micromolar).
 * CONSTANTS[11] is k_leak in component Ca_leak_flux_from_the_ER (first_order_rate_constant).
 * CONSTANTS[12] is k_in in component mitochondrial_Ca_uptake (flux).
 * CONSTANTS[13] is K2 in component mitochondrial_Ca_uptake (micromolar).
 * CONSTANTS[14] is k_out in component mitochondrial_Ca_release (first_order_rate_constant).
 * CONSTANTS[15] is k_m in component mitochondrial_Ca_release (first_order_rate_constant).
 * CONSTANTS[16] is K3 in component mitochondrial_Ca_release (micromolar).
 * RATES[0] is d/dt Ca_cyt in component cytosolic_calcium (micromolar).
 * RATES[1] is d/dt Ca_ER in component ER_calcium (micromolar).
 * RATES[2] is d/dt Ca_m in component mitochondrial_calcium (micromolar).
 * There are a total of 0 condition variables.
 */
void
initConsts(double* CONSTANTS, double* RATES, double *STATES)
{
CONSTANTS[0] = 90.0;
CONSTANTS[1] = 0.01;
CONSTANTS[2] = 0.0025;
CONSTANTS[3] = 0.01;
CONSTANTS[4] = 0.0025;
STATES[0] = 0.05;
STATES[1] = 1.0;
STATES[2] = 0.4;
CONSTANTS[5] = 120.0;
CONSTANTS[6] = 0.1;
CONSTANTS[7] = 0.01;
CONSTANTS[8] = 20.0;
CONSTANTS[9] = 4100.0;
CONSTANTS[10] = 5.0;
CONSTANTS[11] = 0.05;
CONSTANTS[12] = 300.0;
CONSTANTS[13] = 0.8;
CONSTANTS[14] = 125.0;
CONSTANTS[15] = 0.00625;
CONSTANTS[16] = 5.0;
RATES[0] = 0.1001;
RATES[1] = 0.1001;
RATES[2] = 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[3]+ALGEBRAIC[4]+ALGEBRAIC[6]+ CONSTANTS[7]*ALGEBRAIC[0]) - (ALGEBRAIC[2]+ALGEBRAIC[5]+ CONSTANTS[6]*STATES[0]*ALGEBRAIC[1]);
resid[1] = RATES[1] -  (CONSTANTS[2]/CONSTANTS[1])*(ALGEBRAIC[2] - (ALGEBRAIC[3]+ALGEBRAIC[4]));
resid[2] = RATES[2] -  (CONSTANTS[4]/CONSTANTS[3])*(ALGEBRAIC[5] - ALGEBRAIC[6]);
}
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[0] - (STATES[0]+ (CONSTANTS[1]/CONSTANTS[2])*STATES[1]+ (CONSTANTS[3]/CONSTANTS[4])*STATES[2]);
ALGEBRAIC[1] = CONSTANTS[5] - ALGEBRAIC[0];
ALGEBRAIC[2] =  CONSTANTS[8]*STATES[0];
ALGEBRAIC[3] =  CONSTANTS[9]*(pow(STATES[0], 2.00000)/(pow(CONSTANTS[10], 2.00000)+pow(STATES[0], 2.00000)))*(STATES[1] - STATES[0]);
ALGEBRAIC[4] =  CONSTANTS[11]*(STATES[1] - STATES[0]);
ALGEBRAIC[5] =  CONSTANTS[12]*(pow(STATES[0], 8.00000)/(pow(CONSTANTS[13], 8.00000)+pow(STATES[0], 8.00000)));
ALGEBRAIC[6] =  ( CONSTANTS[14]*(pow(STATES[0], 2.00000)/(pow(CONSTANTS[16], 2.00000)+pow(STATES[0], 2.00000)))+CONSTANTS[15])*STATES[2];
}
void
getStateInformation(double* SI)
{
SI[0] = 1.0;
SI[1] = 1.0;
SI[2] = 1.0;
}
void
computeRoots(double VOI, double* CONSTANTS, double* RATES, double* OLDRATES, double* STATES,
             double* OLDSTATES, double* ALGEBRAIC, double* CONDVARS)
{
}