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 13 entries in the algebraic variable array.
   There are a total of 6 entries in each of the rate and state variable arrays.
   There are a total of 21 entries in the constant variable array.
 */
/*
 * VOI is t in component environment (second).
 * CONSTANTS[0] is C_m in component environment (fF).
 * ALGEBRAIC[11] is v_RyR in component RyR (fmol_per_sec).
 * CONSTANTS[1] is F in component constants (C_per_mol).
 * STATES[0] is q_Ca_SR in component environment (fmol).
 * STATES[1] is q_Ca_D in component environment (fmol).
 * STATES[2] is q_C_RyR in component environment (fmol).
 * STATES[3] is q_CI_RyR in component environment (fmol).
 * STATES[4] is q_I_RyR in component environment (fmol).
 * STATES[5] is q_O_RyR in component environment (fmol).
 * ALGEBRAIC[12] is v_RyRgate_Ca_D in component RyR (fmol_per_sec).
 * CONSTANTS[2] is kappa_RyR in component RyR_parameters (fmol_per_sec).
 * CONSTANTS[3] is kappa_OC in component RyR_parameters (fmol_per_sec).
 * CONSTANTS[4] is kappa_CCI in component RyR_parameters (fmol_per_sec).
 * CONSTANTS[5] is kappa_CII in component RyR_parameters (fmol_per_sec).
 * CONSTANTS[6] is kappa_IO in component RyR_parameters (fmol_per_sec).
 * CONSTANTS[7] is K_Ca_SR in component RyR_parameters (per_fmol).
 * CONSTANTS[8] is K_Ca_D in component RyR_parameters (per_fmol).
 * CONSTANTS[9] is K_C_RyR in component RyR_parameters (per_fmol).
 * CONSTANTS[10] is K_CI_RyR in component RyR_parameters (per_fmol).
 * CONSTANTS[11] is K_I_RyR in component RyR_parameters (per_fmol).
 * CONSTANTS[12] is K_O_RyR in component RyR_parameters (per_fmol).
 * CONSTANTS[13] is R in component constants (J_per_K_per_mol).
 * CONSTANTS[14] is T in component constants (kelvin).
 * CONSTANTS[15] is nCa_1 in component RyR (dimensionless).
 * CONSTANTS[16] is nCa_2 in component RyR (dimensionless).
 * ALGEBRAIC[0] is mu_Ca_SR in component RyR (J_per_mol).
 * ALGEBRAIC[1] is mu_Ca_D in component RyR (J_per_mol).
 * ALGEBRAIC[2] is q_Ca_gate_complexes in component RyR (fmol).
 * ALGEBRAIC[3] is mu_C_RyR in component RyR (J_per_mol).
 * ALGEBRAIC[4] is mu_CI_RyR in component RyR (J_per_mol).
 * ALGEBRAIC[5] is mu_I_RyR in component RyR (J_per_mol).
 * ALGEBRAIC[6] is mu_O_RyR in component RyR (J_per_mol).
 * ALGEBRAIC[7] is v_OC in component RyR (fmol_per_sec).
 * ALGEBRAIC[8] is v_CCI in component RyR (fmol_per_sec).
 * ALGEBRAIC[9] is v_CII in component RyR (fmol_per_sec).
 * ALGEBRAIC[10] is v_IO in component RyR (fmol_per_sec).
 * CONSTANTS[17] is zNa in component ion_valences (dimensionless).
 * CONSTANTS[18] is zCl in component ion_valences (dimensionless).
 * CONSTANTS[19] is zK in component ion_valences (dimensionless).
 * CONSTANTS[20] is zCa in component ion_valences (dimensionless).
 * RATES[0] is d/dt q_Ca_SR in component environment (fmol).
 * RATES[1] is d/dt q_Ca_D in component environment (fmol).
 * RATES[5] is d/dt q_O_RyR in component environment (fmol).
 * RATES[2] is d/dt q_C_RyR in component environment (fmol).
 * RATES[3] is d/dt q_CI_RyR in component environment (fmol).
 * RATES[4] is d/dt q_I_RyR in component environment (fmol).
 * There are a total of 0 condition variables.
 */
void
initConsts(double* CONSTANTS, double* RATES, double *STATES)
{
CONSTANTS[0] = 1.381e5;
CONSTANTS[1] = 96485;
STATES[0] = 6.41e-1;
STATES[1] = 3.68876E-07;
STATES[2] = 2.9682830E-06;
STATES[3] = 2.9682830E-06;
STATES[4] = 2.9682830E-06;
STATES[5] = 2.9682830E-06;
CONSTANTS[2] = 498020;
CONSTANTS[3] = 5.01701;
CONSTANTS[4] = 6.61466;
CONSTANTS[5] = 5.43605;
CONSTANTS[6] = 0.453004;
CONSTANTS[7] = 102.047;
CONSTANTS[8] = 66.2643;
CONSTANTS[9] = 0.819033;
CONSTANTS[10] = 0.755897;
CONSTANTS[11] = 11.0374;
CONSTANTS[12] = 11.9593;
CONSTANTS[13] = 8.31;
CONSTANTS[14] = 310;
CONSTANTS[15] = 1;
CONSTANTS[16] = 2;
CONSTANTS[17] = 1;
CONSTANTS[18] = -1;
CONSTANTS[19] = 1;
CONSTANTS[20] = 2;
RATES[0] = 0.1001;
RATES[1] = 0.1001;
RATES[5] = 0.1001;
RATES[2] = 0.1001;
RATES[3] = 0.1001;
RATES[4] = 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[11];
resid[1] = RATES[1] - ALGEBRAIC[11]+ALGEBRAIC[12];
resid[2] = RATES[5] - ALGEBRAIC[10] - ALGEBRAIC[7];
resid[3] = RATES[2] - ALGEBRAIC[7] - ALGEBRAIC[8];
resid[4] = RATES[3] - ALGEBRAIC[8] - ALGEBRAIC[9];
resid[5] = RATES[4] - ALGEBRAIC[9] - ALGEBRAIC[10];
}
void
computeVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
ALGEBRAIC[2] =  CONSTANTS[16]*STATES[5]+ CONSTANTS[15]*STATES[3]+ (CONSTANTS[15]+CONSTANTS[16])*STATES[4];
}
void
computeEssentialVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
ALGEBRAIC[1] =  CONSTANTS[13]*CONSTANTS[14]*log( CONSTANTS[8]*STATES[1]);
ALGEBRAIC[3] =  CONSTANTS[13]*CONSTANTS[14]*log( CONSTANTS[9]*STATES[2]);
ALGEBRAIC[6] =  CONSTANTS[13]*CONSTANTS[14]*log( CONSTANTS[12]*STATES[5]);
ALGEBRAIC[7] =  CONSTANTS[3]*(exp(ALGEBRAIC[6]/( CONSTANTS[13]*CONSTANTS[14])) - exp((ALGEBRAIC[3]+ CONSTANTS[16]*ALGEBRAIC[1])/( CONSTANTS[13]*CONSTANTS[14])));
ALGEBRAIC[4] =  CONSTANTS[13]*CONSTANTS[14]*log( CONSTANTS[10]*STATES[3]);
ALGEBRAIC[8] =  CONSTANTS[4]*(exp((ALGEBRAIC[3]+ CONSTANTS[15]*ALGEBRAIC[1])/( CONSTANTS[13]*CONSTANTS[14])) - exp(ALGEBRAIC[4]/( CONSTANTS[13]*CONSTANTS[14])));
ALGEBRAIC[5] =  CONSTANTS[13]*CONSTANTS[14]*log( CONSTANTS[11]*STATES[4]);
ALGEBRAIC[9] =  CONSTANTS[5]*(exp((ALGEBRAIC[4]+ CONSTANTS[16]*ALGEBRAIC[1])/( CONSTANTS[13]*CONSTANTS[14])) - exp(ALGEBRAIC[5]/( CONSTANTS[13]*CONSTANTS[14])));
ALGEBRAIC[10] =  CONSTANTS[6]*(exp(ALGEBRAIC[5]/( CONSTANTS[13]*CONSTANTS[14])) - exp((ALGEBRAIC[6]+ CONSTANTS[15]*ALGEBRAIC[1])/( CONSTANTS[13]*CONSTANTS[14])));
ALGEBRAIC[0] =  CONSTANTS[13]*CONSTANTS[14]*log( CONSTANTS[7]*STATES[0]);
ALGEBRAIC[11] =  CONSTANTS[2]*exp(ALGEBRAIC[6]/( CONSTANTS[13]*CONSTANTS[14]))*(exp(ALGEBRAIC[0]/( CONSTANTS[13]*CONSTANTS[14])) - exp(ALGEBRAIC[1]/( CONSTANTS[13]*CONSTANTS[14])));
ALGEBRAIC[12] = (( CONSTANTS[16]*ALGEBRAIC[7] -  CONSTANTS[15]*ALGEBRAIC[8]) -  CONSTANTS[16]*ALGEBRAIC[9])+ CONSTANTS[15]*ALGEBRAIC[10];
}
void
getStateInformation(double* SI)
{
SI[0] = 1.0;
SI[1] = 1.0;
SI[2] = 1.0;
SI[3] = 1.0;
SI[4] = 1.0;
SI[5] = 1.0;
}
void
computeRoots(double VOI, double* CONSTANTS, double* RATES, double* OLDRATES, double* STATES,
             double* OLDSTATES, double* ALGEBRAIC, double* CONDVARS)
{
}