Generated Code

The following is c code generated by the CellML API from this CellML file. (Back to language selection)

The raw code is available.

/*
   There are a total of 40 entries in the algebraic variable array.
   There are a total of 11 entries in each of the rate and state variable arrays.
   There are a total of 24 entries in the constant variable array.
 */
/*
 * VOI is t in component environment (second).
 * CONSTANTS[0] is R in component environment (J_per_K_per_mol).
 * CONSTANTS[1] is T in component environment (kelvin).
 * CONSTANTS[2] is F in component environment (C_per_mol).
 * CONSTANTS[3] is C_m in component environment (fF).
 * STATES[0] is q_Ca_o in component environment (fmol).
 * STATES[1] is q_Ca_i in component environment (fmol).
 * STATES[2] is q_Na_o in component environment (fmol).
 * STATES[3] is q_Na_i in component environment (fmol).
 * STATES[4] is q_P1_NCX in component environment (fmol).
 * STATES[5] is q_P2_NCX in component environment (fmol).
 * STATES[6] is q_P3_NCX in component environment (fmol).
 * STATES[7] is q_P4_NCX in component environment (fmol).
 * STATES[8] is q_P5_NCX in component environment (fmol).
 * STATES[9] is q_P6_NCX in component environment (fmol).
 * ALGEBRAIC[29] is v_Ca_o_NCX in component NCX (fmol_per_sec).
 * ALGEBRAIC[22] is v_Ca_i_NCX in component NCX (fmol_per_sec).
 * ALGEBRAIC[33] is v_Na_o_NCX in component NCX (fmol_per_sec).
 * ALGEBRAIC[19] is v_Na_i_NCX in component NCX (fmol_per_sec).
 * STATES[10] is q_mem in component environment (fC).
 * ALGEBRAIC[37] is I_mem_NCX in component NCX (fA).
 * CONSTANTS[4] is kappa_1_NCX in component NCX_parameters (fmol_per_sec).
 * CONSTANTS[5] is kappa_2_NCX in component NCX_parameters (fmol_per_sec).
 * CONSTANTS[6] is kappa_3_NCX in component NCX_parameters (fmol_per_sec).
 * CONSTANTS[7] is kappa_4_NCX in component NCX_parameters (fmol_per_sec).
 * CONSTANTS[8] is kappa_5_NCX in component NCX_parameters (fmol_per_sec).
 * CONSTANTS[9] is kappa_6_NCX in component NCX_parameters (fmol_per_sec).
 * CONSTANTS[10] is K_1_NCX in component NCX_parameters (per_fmol).
 * CONSTANTS[11] is K_2_NCX in component NCX_parameters (per_fmol).
 * CONSTANTS[12] is K_3_NCX in component NCX_parameters (per_fmol).
 * CONSTANTS[13] is K_4_NCX in component NCX_parameters (per_fmol).
 * CONSTANTS[14] is K_5_NCX in component NCX_parameters (per_fmol).
 * CONSTANTS[15] is K_6_NCX in component NCX_parameters (per_fmol).
 * CONSTANTS[16] is K_Na_i in component NCX_parameters (per_fmol).
 * CONSTANTS[17] is K_Ca_i in component NCX_parameters (per_fmol).
 * CONSTANTS[18] is K_Na_o in component NCX_parameters (per_fmol).
 * CONSTANTS[19] is K_Ca_o in component NCX_parameters (per_fmol).
 * CONSTANTS[20] is nNa_o_NCX in component NCX_parameters (dimensionless).
 * CONSTANTS[21] is nNa_i_NCX in component NCX_parameters (dimensionless).
 * CONSTANTS[22] is zf_NCX in component NCX_parameters (dimensionless).
 * CONSTANTS[23] is zr_NCX in component NCX_parameters (dimensionless).
 * ALGEBRAIC[1] is mu_Ca_o in component NCX (J_per_mol).
 * ALGEBRAIC[2] is mu_Ca_i in component NCX (J_per_mol).
 * ALGEBRAIC[3] is mu_Na_o in component NCX (J_per_mol).
 * ALGEBRAIC[4] is mu_Na_i in component NCX (J_per_mol).
 * ALGEBRAIC[5] is mu_P1_NCX in component NCX (J_per_mol).
 * ALGEBRAIC[6] is mu_P2_NCX in component NCX (J_per_mol).
 * ALGEBRAIC[7] is mu_P3_NCX in component NCX (J_per_mol).
 * ALGEBRAIC[8] is mu_P4_NCX in component NCX (J_per_mol).
 * ALGEBRAIC[9] is mu_P5_NCX in component NCX (J_per_mol).
 * ALGEBRAIC[10] is mu_P6_NCX in component NCX (J_per_mol).
 * ALGEBRAIC[38] is v_P1_NCX in component NCX (fmol_per_sec).
 * ALGEBRAIC[23] is v_P2_NCX in component NCX (fmol_per_sec).
 * ALGEBRAIC[26] is v_P3_NCX in component NCX (fmol_per_sec).
 * ALGEBRAIC[30] is v_P4_NCX in component NCX (fmol_per_sec).
 * ALGEBRAIC[35] is v_P5_NCX in component NCX (fmol_per_sec).
 * ALGEBRAIC[39] is v_P6_NCX in component NCX (fmol_per_sec).
 * ALGEBRAIC[11] is Af_r1 in component NCX (J_per_mol).
 * ALGEBRAIC[17] is Ar_r1 in component NCX (J_per_mol).
 * ALGEBRAIC[18] is v_r1 in component NCX (fmol_per_sec).
 * ALGEBRAIC[12] is Af_r2 in component NCX (J_per_mol).
 * ALGEBRAIC[20] is Ar_r2 in component NCX (J_per_mol).
 * ALGEBRAIC[21] is v_r2 in component NCX (fmol_per_sec).
 * ALGEBRAIC[13] is Af_r3 in component NCX (J_per_mol).
 * ALGEBRAIC[24] is Ar_r3 in component NCX (J_per_mol).
 * ALGEBRAIC[25] is v_r3 in component NCX (fmol_per_sec).
 * ALGEBRAIC[14] is Af_r4 in component NCX (J_per_mol).
 * ALGEBRAIC[27] is Ar_r4 in component NCX (J_per_mol).
 * ALGEBRAIC[28] is v_r4 in component NCX (fmol_per_sec).
 * ALGEBRAIC[15] is Af_r5 in component NCX (J_per_mol).
 * ALGEBRAIC[31] is Ar_r5 in component NCX (J_per_mol).
 * ALGEBRAIC[32] is v_r5 in component NCX (fmol_per_sec).
 * ALGEBRAIC[16] is Af_r6 in component NCX (J_per_mol).
 * ALGEBRAIC[34] is Ar_r6 in component NCX (J_per_mol).
 * ALGEBRAIC[36] is v_r6 in component NCX (fmol_per_sec).
 * ALGEBRAIC[0] is V_mem in component NCX (volt).
 * RATES[0] is d/dt q_Ca_o in component environment (fmol).
 * RATES[1] is d/dt q_Ca_i in component environment (fmol).
 * RATES[2] is d/dt q_Na_o in component environment (fmol).
 * RATES[3] is d/dt q_Na_i in component environment (fmol).
 * RATES[10] is d/dt q_mem in component environment (fC).
 * RATES[4] is d/dt q_P1_NCX in component environment (fmol).
 * RATES[5] is d/dt q_P2_NCX in component environment (fmol).
 * RATES[6] is d/dt q_P3_NCX in component environment (fmol).
 * RATES[7] is d/dt q_P4_NCX in component environment (fmol).
 * RATES[8] is d/dt q_P5_NCX in component environment (fmol).
 * RATES[9] is d/dt q_P6_NCX in component environment (fmol).
 */
void
initConsts(double* CONSTANTS, double* RATES, double *STATES)
{
CONSTANTS[0] = 8.314;
CONSTANTS[1] = 310;
CONSTANTS[2] = 96485;
CONSTANTS[3] = 153400;
STATES[0] = 9.3276;
STATES[1] = 0.00456;
STATES[2] = 725.48;
STATES[3] = 380;
STATES[4] = 0.000103509;
STATES[5] = 0.000103509;
STATES[6] = 0.000103509;
STATES[7] = 0.000103509;
STATES[8] = 0.000103509;
STATES[9] = 0.000103509;
STATES[10] = -13039;
CONSTANTS[4] = 417309;
CONSTANTS[5] = 1.39522e+07;
CONSTANTS[6] = 472.755;
CONSTANTS[7] = 1.39522e+07;
CONSTANTS[8] = 417309;
CONSTANTS[9] = 0.370405;
CONSTANTS[10] = 2.93394e+08;
CONSTANTS[11] = 14.1045;
CONSTANTS[12] = 263471;
CONSTANTS[13] = 2.39875e+06;
CONSTANTS[14] = 2373.73;
CONSTANTS[15] = 956.214;
CONSTANTS[16] = 0.0137751;
CONSTANTS[17] = 10.2446;
CONSTANTS[18] = 0.470129;
CONSTANTS[19] = 7572.91;
CONSTANTS[20] = 3;
CONSTANTS[21] = 3;
CONSTANTS[22] = -0.55679;
CONSTANTS[23] = 0.44321;
}
void
computeRates(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
ALGEBRAIC[5] =  CONSTANTS[0]*CONSTANTS[1]*log( CONSTANTS[10]*STATES[4]);
ALGEBRAIC[11] = ALGEBRAIC[5];
ALGEBRAIC[4] =  CONSTANTS[0]*CONSTANTS[1]*log( CONSTANTS[16]*STATES[3]);
ALGEBRAIC[6] =  CONSTANTS[0]*CONSTANTS[1]*log( CONSTANTS[11]*STATES[5]);
ALGEBRAIC[17] =  CONSTANTS[21]*ALGEBRAIC[4]+ALGEBRAIC[6];
ALGEBRAIC[18] =  CONSTANTS[4]*(exp(ALGEBRAIC[11]/( CONSTANTS[0]*CONSTANTS[1])) - exp(ALGEBRAIC[17]/( CONSTANTS[0]*CONSTANTS[1])));
ALGEBRAIC[19] =  CONSTANTS[21]*ALGEBRAIC[18];
RATES[3] = ALGEBRAIC[19];
ALGEBRAIC[2] =  CONSTANTS[0]*CONSTANTS[1]*log( CONSTANTS[17]*STATES[1]);
ALGEBRAIC[12] = ALGEBRAIC[6]+ALGEBRAIC[2];
ALGEBRAIC[7] =  CONSTANTS[0]*CONSTANTS[1]*log( CONSTANTS[12]*STATES[6]);
ALGEBRAIC[20] = ALGEBRAIC[7];
ALGEBRAIC[21] =  CONSTANTS[5]*(exp(ALGEBRAIC[12]/( CONSTANTS[0]*CONSTANTS[1])) - exp(ALGEBRAIC[20]/( CONSTANTS[0]*CONSTANTS[1])));
ALGEBRAIC[22] = - ALGEBRAIC[21];
RATES[1] = ALGEBRAIC[22];
ALGEBRAIC[23] = ALGEBRAIC[18] - ALGEBRAIC[21];
RATES[5] = ALGEBRAIC[23];
ALGEBRAIC[13] = ALGEBRAIC[7];
ALGEBRAIC[8] =  CONSTANTS[0]*CONSTANTS[1]*log( CONSTANTS[13]*STATES[7]);
ALGEBRAIC[24] = ALGEBRAIC[8];
ALGEBRAIC[25] =  CONSTANTS[6]*(exp(ALGEBRAIC[13]/( CONSTANTS[0]*CONSTANTS[1])) - exp(ALGEBRAIC[24]/( CONSTANTS[0]*CONSTANTS[1])));
ALGEBRAIC[26] = ALGEBRAIC[21] - ALGEBRAIC[25];
RATES[6] = ALGEBRAIC[26];
ALGEBRAIC[14] = ALGEBRAIC[8];
ALGEBRAIC[1] =  CONSTANTS[0]*CONSTANTS[1]*log( CONSTANTS[19]*STATES[0]);
ALGEBRAIC[9] =  CONSTANTS[0]*CONSTANTS[1]*log( CONSTANTS[14]*STATES[8]);
ALGEBRAIC[27] = ALGEBRAIC[9]+ALGEBRAIC[1];
ALGEBRAIC[28] =  CONSTANTS[7]*(exp(ALGEBRAIC[14]/( CONSTANTS[0]*CONSTANTS[1])) - exp(ALGEBRAIC[27]/( CONSTANTS[0]*CONSTANTS[1])));
ALGEBRAIC[29] = ALGEBRAIC[28];
RATES[0] = ALGEBRAIC[29];
ALGEBRAIC[30] = - ALGEBRAIC[28]+ALGEBRAIC[25];
RATES[7] = ALGEBRAIC[30];
ALGEBRAIC[3] =  CONSTANTS[0]*CONSTANTS[1]*log( CONSTANTS[18]*STATES[2]);
ALGEBRAIC[15] = ALGEBRAIC[9]+ CONSTANTS[20]*ALGEBRAIC[3];
ALGEBRAIC[10] =  CONSTANTS[0]*CONSTANTS[1]*log( CONSTANTS[15]*STATES[9]);
ALGEBRAIC[31] = ALGEBRAIC[10];
ALGEBRAIC[32] =  CONSTANTS[8]*(exp(ALGEBRAIC[15]/( CONSTANTS[0]*CONSTANTS[1])) - exp(ALGEBRAIC[31]/( CONSTANTS[0]*CONSTANTS[1])));
ALGEBRAIC[33] =  - CONSTANTS[20]*ALGEBRAIC[32];
RATES[2] = ALGEBRAIC[33];
ALGEBRAIC[35] = - ALGEBRAIC[32]+ALGEBRAIC[28];
RATES[8] = ALGEBRAIC[35];
ALGEBRAIC[0] = STATES[10]/CONSTANTS[3];
ALGEBRAIC[16] =  CONSTANTS[0]*CONSTANTS[1]*log( CONSTANTS[15]*STATES[9])+ CONSTANTS[22]*CONSTANTS[2]*ALGEBRAIC[0];
ALGEBRAIC[34] =  CONSTANTS[0]*CONSTANTS[1]*log( CONSTANTS[10]*STATES[4])+ CONSTANTS[23]*CONSTANTS[2]*ALGEBRAIC[0];
ALGEBRAIC[36] =  CONSTANTS[9]*(exp(ALGEBRAIC[16]/( CONSTANTS[0]*CONSTANTS[1])) - exp(ALGEBRAIC[34]/( CONSTANTS[0]*CONSTANTS[1])));
ALGEBRAIC[37] =  CONSTANTS[2]*( - CONSTANTS[22]*ALGEBRAIC[36]+ CONSTANTS[23]*ALGEBRAIC[36]);
RATES[10] = ALGEBRAIC[37];
ALGEBRAIC[38] = ALGEBRAIC[36] - ALGEBRAIC[18];
RATES[4] = ALGEBRAIC[38];
ALGEBRAIC[39] = - ALGEBRAIC[36]+ALGEBRAIC[32];
RATES[9] = ALGEBRAIC[39];
}
void
computeVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
ALGEBRAIC[5] =  CONSTANTS[0]*CONSTANTS[1]*log( CONSTANTS[10]*STATES[4]);
ALGEBRAIC[11] = ALGEBRAIC[5];
ALGEBRAIC[4] =  CONSTANTS[0]*CONSTANTS[1]*log( CONSTANTS[16]*STATES[3]);
ALGEBRAIC[6] =  CONSTANTS[0]*CONSTANTS[1]*log( CONSTANTS[11]*STATES[5]);
ALGEBRAIC[17] =  CONSTANTS[21]*ALGEBRAIC[4]+ALGEBRAIC[6];
ALGEBRAIC[18] =  CONSTANTS[4]*(exp(ALGEBRAIC[11]/( CONSTANTS[0]*CONSTANTS[1])) - exp(ALGEBRAIC[17]/( CONSTANTS[0]*CONSTANTS[1])));
ALGEBRAIC[19] =  CONSTANTS[21]*ALGEBRAIC[18];
ALGEBRAIC[2] =  CONSTANTS[0]*CONSTANTS[1]*log( CONSTANTS[17]*STATES[1]);
ALGEBRAIC[12] = ALGEBRAIC[6]+ALGEBRAIC[2];
ALGEBRAIC[7] =  CONSTANTS[0]*CONSTANTS[1]*log( CONSTANTS[12]*STATES[6]);
ALGEBRAIC[20] = ALGEBRAIC[7];
ALGEBRAIC[21] =  CONSTANTS[5]*(exp(ALGEBRAIC[12]/( CONSTANTS[0]*CONSTANTS[1])) - exp(ALGEBRAIC[20]/( CONSTANTS[0]*CONSTANTS[1])));
ALGEBRAIC[22] = - ALGEBRAIC[21];
ALGEBRAIC[23] = ALGEBRAIC[18] - ALGEBRAIC[21];
ALGEBRAIC[13] = ALGEBRAIC[7];
ALGEBRAIC[8] =  CONSTANTS[0]*CONSTANTS[1]*log( CONSTANTS[13]*STATES[7]);
ALGEBRAIC[24] = ALGEBRAIC[8];
ALGEBRAIC[25] =  CONSTANTS[6]*(exp(ALGEBRAIC[13]/( CONSTANTS[0]*CONSTANTS[1])) - exp(ALGEBRAIC[24]/( CONSTANTS[0]*CONSTANTS[1])));
ALGEBRAIC[26] = ALGEBRAIC[21] - ALGEBRAIC[25];
ALGEBRAIC[14] = ALGEBRAIC[8];
ALGEBRAIC[1] =  CONSTANTS[0]*CONSTANTS[1]*log( CONSTANTS[19]*STATES[0]);
ALGEBRAIC[9] =  CONSTANTS[0]*CONSTANTS[1]*log( CONSTANTS[14]*STATES[8]);
ALGEBRAIC[27] = ALGEBRAIC[9]+ALGEBRAIC[1];
ALGEBRAIC[28] =  CONSTANTS[7]*(exp(ALGEBRAIC[14]/( CONSTANTS[0]*CONSTANTS[1])) - exp(ALGEBRAIC[27]/( CONSTANTS[0]*CONSTANTS[1])));
ALGEBRAIC[29] = ALGEBRAIC[28];
ALGEBRAIC[30] = - ALGEBRAIC[28]+ALGEBRAIC[25];
ALGEBRAIC[3] =  CONSTANTS[0]*CONSTANTS[1]*log( CONSTANTS[18]*STATES[2]);
ALGEBRAIC[15] = ALGEBRAIC[9]+ CONSTANTS[20]*ALGEBRAIC[3];
ALGEBRAIC[10] =  CONSTANTS[0]*CONSTANTS[1]*log( CONSTANTS[15]*STATES[9]);
ALGEBRAIC[31] = ALGEBRAIC[10];
ALGEBRAIC[32] =  CONSTANTS[8]*(exp(ALGEBRAIC[15]/( CONSTANTS[0]*CONSTANTS[1])) - exp(ALGEBRAIC[31]/( CONSTANTS[0]*CONSTANTS[1])));
ALGEBRAIC[33] =  - CONSTANTS[20]*ALGEBRAIC[32];
ALGEBRAIC[35] = - ALGEBRAIC[32]+ALGEBRAIC[28];
ALGEBRAIC[0] = STATES[10]/CONSTANTS[3];
ALGEBRAIC[16] =  CONSTANTS[0]*CONSTANTS[1]*log( CONSTANTS[15]*STATES[9])+ CONSTANTS[22]*CONSTANTS[2]*ALGEBRAIC[0];
ALGEBRAIC[34] =  CONSTANTS[0]*CONSTANTS[1]*log( CONSTANTS[10]*STATES[4])+ CONSTANTS[23]*CONSTANTS[2]*ALGEBRAIC[0];
ALGEBRAIC[36] =  CONSTANTS[9]*(exp(ALGEBRAIC[16]/( CONSTANTS[0]*CONSTANTS[1])) - exp(ALGEBRAIC[34]/( CONSTANTS[0]*CONSTANTS[1])));
ALGEBRAIC[37] =  CONSTANTS[2]*( - CONSTANTS[22]*ALGEBRAIC[36]+ CONSTANTS[23]*ALGEBRAIC[36]);
ALGEBRAIC[38] = ALGEBRAIC[36] - ALGEBRAIC[18];
ALGEBRAIC[39] = - ALGEBRAIC[36]+ALGEBRAIC[32];
}
Source
Derived from workspace NCX protein knowledge page at changeset 56f23193d87b.
Collaboration
To begin collaborating on this work, please use your git client and issue this command:
License
The terms of use/license for this work is unspecified.