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 8 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).
 * CONSTANTS[0] is vol in component environment (pL).
 * STATES[0] is q_A in component environment (fmol).
 * STATES[1] is q_M in component environment (fmol).
 * STATES[2] is q_Mp in component environment (fmol).
 * STATES[3] is q_AM in component environment (fmol).
 * STATES[4] is q_AMp in component environment (fmol).
 * STATES[5] is q_Pi in component environment (fmol).
 * STATES[6] is q_Ca_i in component environment (fmol).
 * STATES[7] is q_cGMP in component environment (fmol).
 * ALGEBRAIC[9] is v_R_12 in component HaiMurphy (fmol_per_sec).
 * ALGEBRAIC[10] is v_R_34 in component HaiMurphy (fmol_per_sec).
 * ALGEBRAIC[11] is v_R_56 in component HaiMurphy (fmol_per_sec).
 * ALGEBRAIC[12] is v_R_78 in component HaiMurphy (fmol_per_sec).
 * CONSTANTS[1] is n_Cai_SM in component environment (dimensionless).
 * ALGEBRAIC[0] is stress in component environment (dimensionless).
 * CONSTANTS[2] is kappa_R_12 in component HaiMurphy_parameters (fmol_per_sec).
 * CONSTANTS[3] is kappa_R_34 in component HaiMurphy_parameters (fmol_per_sec).
 * CONSTANTS[4] is kappa_R_56 in component HaiMurphy_parameters (fmol_per_sec).
 * CONSTANTS[5] is kappa_R_78 in component HaiMurphy_parameters (fmol_per_sec).
 * CONSTANTS[6] is K_A in component HaiMurphy_parameters (per_fmol).
 * CONSTANTS[7] is K_M in component HaiMurphy_parameters (per_fmol).
 * CONSTANTS[8] is K_Mp in component HaiMurphy_parameters (per_fmol).
 * CONSTANTS[9] is K_AM in component HaiMurphy_parameters (per_fmol).
 * CONSTANTS[10] is K_AMp in component HaiMurphy_parameters (per_fmol).
 * CONSTANTS[11] is K_Pi in component HaiMurphy_parameters (per_fmol).
 * CONSTANTS[12] is K_Ca_i in component HaiMurphy_parameters (per_fmol).
 * CONSTANTS[13] is K_cGMP in component HaiMurphy_parameters (per_fmol).
 * CONSTANTS[14] is R in component constants (J_per_K_per_mol).
 * CONSTANTS[15] is T in component constants (kelvin).
 * ALGEBRAIC[1] is mu_A in component HaiMurphy (J_per_mol).
 * ALGEBRAIC[2] is mu_M in component HaiMurphy (J_per_mol).
 * ALGEBRAIC[3] is mu_Mp in component HaiMurphy (J_per_mol).
 * ALGEBRAIC[4] is mu_AM in component HaiMurphy (J_per_mol).
 * ALGEBRAIC[5] is mu_AMp in component HaiMurphy (J_per_mol).
 * ALGEBRAIC[6] is mu_Pi in component HaiMurphy (J_per_mol).
 * ALGEBRAIC[7] is mu_Ca_i in component HaiMurphy (J_per_mol).
 * ALGEBRAIC[8] is mu_cGMP in component HaiMurphy (J_per_mol).
 * CONSTANTS[16] is F in component constants (C_per_mol).
 * RATES[0] is d/dt q_A in component environment (fmol).
 * RATES[1] is d/dt q_M in component environment (fmol).
 * RATES[2] is d/dt q_Mp in component environment (fmol).
 * RATES[3] is d/dt q_AM in component environment (fmol).
 * RATES[4] is d/dt q_AMp in component environment (fmol).
 * RATES[5] is d/dt q_Pi in component environment (fmol).
 * RATES[6] is d/dt q_Ca_i in component environment (fmol).
 * RATES[7] is d/dt q_cGMP in component environment (fmol).
 * There are a total of 0 condition variables.
 */
void
initConsts(double* CONSTANTS, double* RATES, double *STATES)
{
CONSTANTS[0] = 1;
STATES[0] = 1e-6;
STATES[1] = 1e-6;
STATES[2] = 0;
STATES[3] = 0;
STATES[4] = 0;
STATES[5] = 15;
STATES[6] = 1e-3;
STATES[7] = 1e-6;
CONSTANTS[1] = 1.66;
CONSTANTS[2] = 0.117606;
CONSTANTS[3] = 6.98167;
CONSTANTS[4] = 2.11691;
CONSTANTS[5] = 0.0270688;
CONSTANTS[6] = 0.532601;
CONSTANTS[7] = 4.08193;
CONSTANTS[8] = 0.0351692;
CONSTANTS[9] = 0.448094;
CONSTANTS[10] = 0.0038607;
CONSTANTS[11] = 250.692;
CONSTANTS[12] = 0.145785;
CONSTANTS[13] = 0.0971738;
CONSTANTS[14] = 8.31;
CONSTANTS[15] = 310;
CONSTANTS[16] = 96485;
RATES[0] = 0.1001;
RATES[1] = 0.1001;
RATES[2] = 0.1001;
RATES[3] = 0.1001;
RATES[4] = 0.1001;
RATES[5] = 0.1001;
RATES[6] = 0.1001;
RATES[7] = 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[10]+ALGEBRAIC[12];
resid[1] = RATES[1] - - ALGEBRAIC[9]+ALGEBRAIC[12];
resid[2] = RATES[2] - ALGEBRAIC[9] - ALGEBRAIC[10];
resid[3] = RATES[3] - ALGEBRAIC[11] - ALGEBRAIC[12];
resid[4] = RATES[4] - ALGEBRAIC[10] - ALGEBRAIC[11];
resid[5] = RATES[5] - - ALGEBRAIC[9]+ALGEBRAIC[11];
resid[6] = RATES[6] -  CONSTANTS[1]*(- ALGEBRAIC[9] - ALGEBRAIC[11]);
resid[7] = RATES[7] - ALGEBRAIC[9]+ALGEBRAIC[11];
}
void
computeVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
ALGEBRAIC[0] = (STATES[3]+STATES[4])/1.00000;
}
void
computeEssentialVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
ALGEBRAIC[2] =  CONSTANTS[14]*CONSTANTS[15]*log( CONSTANTS[7]*STATES[1]);
ALGEBRAIC[3] =  CONSTANTS[14]*CONSTANTS[15]*log( CONSTANTS[8]*STATES[2]);
ALGEBRAIC[6] =  CONSTANTS[14]*CONSTANTS[15]*log( CONSTANTS[11]*STATES[5]);
ALGEBRAIC[7] =  CONSTANTS[14]*CONSTANTS[15]*log( CONSTANTS[12]*STATES[6]);
ALGEBRAIC[8] =  CONSTANTS[14]*CONSTANTS[15]*log( CONSTANTS[13]*STATES[7]);
ALGEBRAIC[9] =  CONSTANTS[2]*(exp((ALGEBRAIC[2]+ALGEBRAIC[6]+ CONSTANTS[1]*ALGEBRAIC[7])/( CONSTANTS[14]*CONSTANTS[15])) - exp((ALGEBRAIC[3]+ALGEBRAIC[8])/( CONSTANTS[14]*CONSTANTS[15])));
ALGEBRAIC[1] =  CONSTANTS[14]*CONSTANTS[15]*log( CONSTANTS[6]*STATES[0]);
ALGEBRAIC[5] =  CONSTANTS[14]*CONSTANTS[15]*log( CONSTANTS[10]*STATES[4]);
ALGEBRAIC[10] =  CONSTANTS[3]*(exp((ALGEBRAIC[1]+ALGEBRAIC[3])/( CONSTANTS[14]*CONSTANTS[15])) - exp(ALGEBRAIC[5]/( CONSTANTS[14]*CONSTANTS[15])));
ALGEBRAIC[4] =  CONSTANTS[14]*CONSTANTS[15]*log( CONSTANTS[9]*STATES[3]);
ALGEBRAIC[11] =  CONSTANTS[4]*(exp((ALGEBRAIC[5]+ CONSTANTS[1]*ALGEBRAIC[7])/( CONSTANTS[14]*CONSTANTS[15])) - exp((ALGEBRAIC[4]+ALGEBRAIC[6]+ALGEBRAIC[8])/( CONSTANTS[14]*CONSTANTS[15])));
ALGEBRAIC[12] =  CONSTANTS[5]*(exp(ALGEBRAIC[4]/( CONSTANTS[14]*CONSTANTS[15])) - exp((ALGEBRAIC[1]+ALGEBRAIC[2])/( CONSTANTS[14]*CONSTANTS[15])));
}
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;
SI[6] = 1.0;
SI[7] = 1.0;
}
void
computeRoots(double VOI, double* CONSTANTS, double* RATES, double* OLDRATES, double* STATES,
             double* OLDSTATES, double* ALGEBRAIC, double* CONDVARS)
{
}