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 43 entries in the algebraic variable array.
   There are a total of 7 entries in each of the rate and state variable arrays.
   There are a total of 35 entries in the constant variable array.
 */
/*
 * VOI is time in component environment (second).
 * CONSTANTS[0] is k0_12 in component parameters (per_M_per_second).
 * CONSTANTS[1] is k0_21 in component parameters (per_second).
 * CONSTANTS[2] is k0_23 in component parameters (per_M_per_second).
 * CONSTANTS[3] is k0_32 in component parameters (per_second).
 * CONSTANTS[4] is k0_34 in component parameters (per_second).
 * CONSTANTS[5] is k0_43 in component parameters (per_second).
 * CONSTANTS[6] is k0_45 in component parameters (per_second).
 * CONSTANTS[7] is k0_54 in component parameters (per_M_per_second).
 * CONSTANTS[8] is k0_25 in component parameters (per_second).
 * CONSTANTS[9] is k0_52 in component parameters (per_second).
 * CONSTANTS[10] is k0_56 in component parameters (per_second).
 * CONSTANTS[11] is k0_65 in component parameters (per_M_per_second).
 * CONSTANTS[12] is k0_61 in component parameters (per_second).
 * CONSTANTS[13] is k0_16 in component parameters (per_second).
 * CONSTANTS[14] is delta in component parameters (dimensionless).
 * CONSTANTS[29] is alpha_p in component parameters (dimensionless).
 * CONSTANTS[15] is alpha_pp in component parameters (dimensionless).
 * CONSTANTS[16] is N_C in component parameters (dimensionless).
 * CONSTANTS[17] is N_Avo in component parameters (per_mol).
 * CONSTANTS[18] is area in component parameters (um2).
 * CONSTANTS[30] is C_T in component parameters (umol).
 * CONSTANTS[19] is n in component parameters (dimensionless).
 * CONSTANTS[20] is z_c in component parameters (dimensionless).
 * CONSTANTS[21] is z_Na in component parameters (dimensionless).
 * CONSTANTS[22] is F in component parameters (C_per_mol).
 * CONSTANTS[23] is R in component parameters (J_per_K_per_mol).
 * CONSTANTS[24] is T in component parameters (kelvin).
 * STATES[0] is V in component ion_concentrations (volt).
 * ALGEBRAIC[0] is mu in component parameters (dimensionless).
 * CONSTANTS[25] is Na_i in component ion_concentrations (M).
 * CONSTANTS[26] is Na_o in component ion_concentrations (M).
 * CONSTANTS[27] is glucose_i in component ion_concentrations (M).
 * CONSTANTS[28] is glucose_o in component ion_concentrations (M).
 * ALGEBRAIC[2] is k_12 in component rate_constants (per_second).
 * ALGEBRAIC[3] is k_21 in component rate_constants (per_second).
 * CONSTANTS[31] is k_23 in component rate_constants (per_second).
 * CONSTANTS[32] is k_32 in component rate_constants (per_second).
 * ALGEBRAIC[4] is k_34 in component rate_constants (per_second).
 * ALGEBRAIC[5] is k_43 in component rate_constants (per_second).
 * CONSTANTS[33] is k_45 in component rate_constants (per_second).
 * ALGEBRAIC[17] is k_54 in component rate_constants (per_second).
 * ALGEBRAIC[6] is k_25 in component rate_constants (per_second).
 * ALGEBRAIC[12] is k_52 in component rate_constants (per_second).
 * ALGEBRAIC[8] is k_56 in component rate_constants (per_second).
 * ALGEBRAIC[9] is k_65 in component rate_constants (per_second).
 * ALGEBRAIC[10] is k_61 in component rate_constants (per_second).
 * ALGEBRAIC[11] is k_16 in component rate_constants (per_second).
 * ALGEBRAIC[1] is ks_12 in component rate_constants (per_M_per_second).
 * ALGEBRAIC[13] is k0_54_temp in component rate_constants (per_M_per_second).
 * ALGEBRAIC[7] is k_52_temp in component rate_constants (per_second).
 * STATES[1] is C_1 in component kinetic_equations (umol).
 * STATES[2] is C_2 in component kinetic_equations (umol).
 * STATES[3] is C_3 in component kinetic_equations (umol).
 * STATES[4] is C_4 in component kinetic_equations (umol).
 * STATES[5] is C_5 in component kinetic_equations (umol).
 * ALGEBRAIC[14] is C_6 in component kinetic_equations (umol).
 * STATES[6] is C_6_temp in component kinetic_equations (umol).
 * ALGEBRAIC[18] is C1_sum in component king_altman_states (per_second5).
 * ALGEBRAIC[19] is C2_sum in component king_altman_states (per_second5).
 * ALGEBRAIC[20] is C3_sum in component king_altman_states (per_second5).
 * ALGEBRAIC[21] is C4_sum in component king_altman_states (per_second5).
 * ALGEBRAIC[15] is C5_sum in component king_altman_states (per_second5).
 * ALGEBRAIC[22] is C6_sum in component king_altman_states (per_second5).
 * ALGEBRAIC[23] is C_sum in component king_altman_states (per_second5).
 * ALGEBRAIC[24] is C1 in component king_altman_states (umol).
 * ALGEBRAIC[25] is C2 in component king_altman_states (umol).
 * ALGEBRAIC[26] is C3 in component king_altman_states (umol).
 * ALGEBRAIC[27] is C4 in component king_altman_states (umol).
 * ALGEBRAIC[28] is C5 in component king_altman_states (umol).
 * ALGEBRAIC[29] is C6 in component king_altman_states (umol).
 * ALGEBRAIC[16] is I_NaGl_pSS in component NBC_current (uA).
 * ALGEBRAIC[30] is I_NaGl_SS in component NBC_current (uA).
 * ALGEBRAIC[31] is J_Na in component NBC_current (umol_per_second).
 * ALGEBRAIC[38] is epsilon in component phenomonological_constants (per_second).
 * ALGEBRAIC[32] is lambda in component phenomonological_constants (per_M2_per_second5).
 * ALGEBRAIC[33] is chi in component phenomonological_constants (M).
 * ALGEBRAIC[35] is alpha in component phenomonological_constants (M2).
 * ALGEBRAIC[34] is beta in component phenomonological_constants (M).
 * ALGEBRAIC[36] is gamma in component phenomonological_constants (M2_per_second).
 * ALGEBRAIC[37] is phi in component phenomonological_constants (M_per_second).
 * ALGEBRAIC[40] is Imax_Na in component phenomonological_constants (uA).
 * ALGEBRAIC[39] is Imax_gluc in component phenomonological_constants (uA).
 * ALGEBRAIC[42] is Khalf_Na in component phenomonological_constants (M).
 * ALGEBRAIC[41] is Khalf_gluc in component phenomonological_constants (M).
 * RATES[0] is d/dt V in component ion_concentrations (volt).
 * RATES[1] is d/dt C_1 in component kinetic_equations (umol).
 * RATES[2] is d/dt C_2 in component kinetic_equations (umol).
 * RATES[3] is d/dt C_3 in component kinetic_equations (umol).
 * RATES[4] is d/dt C_4 in component kinetic_equations (umol).
 * RATES[5] is d/dt C_5 in component kinetic_equations (umol).
 * RATES[6] is d/dt C_6_temp in component kinetic_equations (umol).
 * There are a total of 0 condition variables.
 */
void
initConsts(double* CONSTANTS, double* RATES, double *STATES)
{
CONSTANTS[0] = 20000;
CONSTANTS[1] = 400;
CONSTANTS[2] = 1e4;
CONSTANTS[3] = 20;
CONSTANTS[4] = 50;
CONSTANTS[5] = 50;
CONSTANTS[6] = 800;
CONSTANTS[7] = 6.7e6;
CONSTANTS[8] = 0.01;
CONSTANTS[9] = 0.17;
CONSTANTS[10] = 48;
CONSTANTS[11] = 50;
CONSTANTS[12] = 35;
CONSTANTS[13] = 100;
CONSTANTS[14] = 0.7;
CONSTANTS[15] = 0;
CONSTANTS[16] = 8.4e10;
CONSTANTS[17] = 6.022e23;
CONSTANTS[18] = 1e6;
CONSTANTS[19] = 1;
CONSTANTS[20] = -1;
CONSTANTS[21] = 1;
CONSTANTS[22] = 96485.34;
CONSTANTS[23] = 8.314;
CONSTANTS[24] = 310;
STATES[0] = -150e-3;
CONSTANTS[25] = 10e-3;
CONSTANTS[26] = 100e-3;
CONSTANTS[27] = 0e-3;
CONSTANTS[28] = 1e-3;
STATES[1] = 3.923e-9;
STATES[2] = 1.016e-7;
STATES[3] = 1.515e-8;
STATES[4] = 8.912e-10;
STATES[5] = 1.485e-8;
STATES[6] = 3.06798e-9;
CONSTANTS[29] = (1.00000 - CONSTANTS[14]) - CONSTANTS[15];
CONSTANTS[34] = 0.000100000;
CONSTANTS[30] = ( 1.00000e+06*CONSTANTS[16])/CONSTANTS[17];
CONSTANTS[31] =  CONSTANTS[2]*CONSTANTS[28];
CONSTANTS[32] = CONSTANTS[3];
CONSTANTS[33] = CONSTANTS[6];
RATES[1] = 0.1001;
RATES[2] = 0.1001;
RATES[3] = 0.1001;
RATES[4] = 0.1001;
RATES[5] = 0.1001;
RATES[6] = 0.1001;
}
void
computeResiduals(double VOI, double* CONSTANTS, double* RATES, double* OLDRATES, double* STATES,
                 double* OLDSTATES, double* ALGEBRAIC, double* CONDVARS)
{
resid[0] = RATES[1] - ( ALGEBRAIC[3]*STATES[2]+ ALGEBRAIC[10]*ALGEBRAIC[14]) -  (ALGEBRAIC[2]+ALGEBRAIC[11])*STATES[1];
resid[1] = RATES[2] - ( ALGEBRAIC[2]*STATES[1]+ CONSTANTS[32]*STATES[3]+ ALGEBRAIC[12]*STATES[5]) -  (ALGEBRAIC[3]+CONSTANTS[31]+ALGEBRAIC[6])*STATES[2];
resid[2] = RATES[3] - ( CONSTANTS[31]*STATES[2]+ ALGEBRAIC[5]*STATES[4]) -  (CONSTANTS[32]+ALGEBRAIC[4])*STATES[3];
resid[3] = RATES[4] - ( ALGEBRAIC[4]*STATES[3]+ ALGEBRAIC[17]*STATES[5]) -  (CONSTANTS[33]+ALGEBRAIC[5])*STATES[4];
resid[4] = RATES[5] - ( CONSTANTS[33]*STATES[4]+ ALGEBRAIC[9]*ALGEBRAIC[14]+ ALGEBRAIC[6]*STATES[2]) -  (ALGEBRAIC[17]+ALGEBRAIC[12]+ALGEBRAIC[8])*STATES[5];
resid[5] = RATES[6] - ( ALGEBRAIC[11]*STATES[1]+ ALGEBRAIC[8]*STATES[5]) -  (ALGEBRAIC[10]+ALGEBRAIC[9])*STATES[6];
resid[6] = RATES[0] - CONSTANTS[34];
}
void
computeVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
ALGEBRAIC[7] =  CONSTANTS[9]*exp(( (CONSTANTS[20]+CONSTANTS[19])*CONSTANTS[14]*ALGEBRAIC[0])/2.00000);
ALGEBRAIC[15] =  ALGEBRAIC[11]*ALGEBRAIC[6]*ALGEBRAIC[4]*CONSTANTS[33]*ALGEBRAIC[9]+ ALGEBRAIC[2]*ALGEBRAIC[6]*ALGEBRAIC[4]*CONSTANTS[33]*ALGEBRAIC[9]+ ALGEBRAIC[11]*CONSTANTS[31]*ALGEBRAIC[4]*CONSTANTS[33]*ALGEBRAIC[9]+ ALGEBRAIC[2]*CONSTANTS[31]*ALGEBRAIC[4]*CONSTANTS[33]*ALGEBRAIC[9]+ ALGEBRAIC[11]*ALGEBRAIC[3]*ALGEBRAIC[4]*CONSTANTS[33]*ALGEBRAIC[9]+ ALGEBRAIC[11]*ALGEBRAIC[6]*CONSTANTS[32]*CONSTANTS[33]*ALGEBRAIC[9]+ ALGEBRAIC[2]*ALGEBRAIC[6]*CONSTANTS[32]*CONSTANTS[33]*ALGEBRAIC[9]+ ALGEBRAIC[11]*ALGEBRAIC[3]*CONSTANTS[32]*CONSTANTS[33]*ALGEBRAIC[9]+ ALGEBRAIC[11]*ALGEBRAIC[6]*CONSTANTS[32]*ALGEBRAIC[5]*ALGEBRAIC[9]+ ALGEBRAIC[2]*ALGEBRAIC[6]*CONSTANTS[32]*ALGEBRAIC[5]*ALGEBRAIC[9]+ ALGEBRAIC[11]*ALGEBRAIC[3]*CONSTANTS[32]*ALGEBRAIC[5]*ALGEBRAIC[9]+ ALGEBRAIC[2]*ALGEBRAIC[6]*ALGEBRAIC[4]*CONSTANTS[33]*ALGEBRAIC[10]+ ALGEBRAIC[2]*CONSTANTS[31]*ALGEBRAIC[4]*CONSTANTS[33]*ALGEBRAIC[10]+ ALGEBRAIC[2]*ALGEBRAIC[6]*CONSTANTS[32]*CONSTANTS[33]*ALGEBRAIC[10]+ ALGEBRAIC[2]*ALGEBRAIC[6]*CONSTANTS[32]*ALGEBRAIC[5]*ALGEBRAIC[10];
ALGEBRAIC[16] =  - CONSTANTS[22]*( CONSTANTS[19]*CONSTANTS[21]*CONSTANTS[29]*( ALGEBRAIC[2]*STATES[1] -  ALGEBRAIC[3]*STATES[2])+ CONSTANTS[20]*CONSTANTS[14]*( ALGEBRAIC[11]*STATES[1] -  ALGEBRAIC[10]*ALGEBRAIC[14])+ CONSTANTS[19]*CONSTANTS[21]*CONSTANTS[15]*( ALGEBRAIC[8]*STATES[5] -  ALGEBRAIC[9]*ALGEBRAIC[14]));
ALGEBRAIC[18] =  ALGEBRAIC[3]*CONSTANTS[32]*ALGEBRAIC[5]*ALGEBRAIC[17]*ALGEBRAIC[9]+ ALGEBRAIC[3]*ALGEBRAIC[4]*CONSTANTS[33]*ALGEBRAIC[12]*ALGEBRAIC[9]+ ALGEBRAIC[3]*CONSTANTS[32]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ALGEBRAIC[8]+ ALGEBRAIC[2]*ALGEBRAIC[6]*CONSTANTS[32]*CONSTANTS[33]*ALGEBRAIC[8]+ ALGEBRAIC[11]*ALGEBRAIC[3]*CONSTANTS[32]*CONSTANTS[33]*ALGEBRAIC[8]+ ALGEBRAIC[11]*ALGEBRAIC[6]*CONSTANTS[32]*ALGEBRAIC[5]*ALGEBRAIC[8]+ ALGEBRAIC[2]*ALGEBRAIC[6]*CONSTANTS[32]*ALGEBRAIC[5]*ALGEBRAIC[8]+ ALGEBRAIC[11]*ALGEBRAIC[3]*CONSTANTS[32]*ALGEBRAIC[5]*ALGEBRAIC[8]+ ALGEBRAIC[11]*ALGEBRAIC[3]*CONSTANTS[32]*ALGEBRAIC[5]*ALGEBRAIC[17]+ ALGEBRAIC[11]*ALGEBRAIC[3]*ALGEBRAIC[4]*CONSTANTS[33]*ALGEBRAIC[12]+ ALGEBRAIC[11]*ALGEBRAIC[3]*CONSTANTS[32]*CONSTANTS[33]*ALGEBRAIC[12]+ ALGEBRAIC[11]*ALGEBRAIC[3]*CONSTANTS[32]*ALGEBRAIC[5]*ALGEBRAIC[12];
ALGEBRAIC[23] = ALGEBRAIC[18]+ALGEBRAIC[19]+ALGEBRAIC[20]+ALGEBRAIC[21]+ALGEBRAIC[15]+ALGEBRAIC[22];
ALGEBRAIC[24] = ( CONSTANTS[30]*ALGEBRAIC[18])/ALGEBRAIC[23];
ALGEBRAIC[25] = ( CONSTANTS[30]*ALGEBRAIC[19])/ALGEBRAIC[23];
ALGEBRAIC[26] = ( CONSTANTS[30]*ALGEBRAIC[20])/ALGEBRAIC[23];
ALGEBRAIC[27] = ( CONSTANTS[30]*ALGEBRAIC[21])/ALGEBRAIC[23];
ALGEBRAIC[28] = ( CONSTANTS[30]*ALGEBRAIC[15])/ALGEBRAIC[23];
ALGEBRAIC[29] = ( CONSTANTS[30]*ALGEBRAIC[22])/ALGEBRAIC[23];
ALGEBRAIC[30] =  - CONSTANTS[22]*( CONSTANTS[20]*(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*ALGEBRAIC[3]*CONSTANTS[32]*ALGEBRAIC[5]*ALGEBRAIC[12]);
ALGEBRAIC[36] =  (1.00000/ALGEBRAIC[32])*( ALGEBRAIC[11]*ALGEBRAIC[3]*CONSTANTS[32]*ALGEBRAIC[5]*ALGEBRAIC[17]*ALGEBRAIC[9]+ ALGEBRAIC[11]*ALGEBRAIC[3]*ALGEBRAIC[4]*CONSTANTS[33]*ALGEBRAIC[12]*ALGEBRAIC[9]+ ALGEBRAIC[11]*ALGEBRAIC[3]*CONSTANTS[32]*CONSTANTS[33]*ALGEBRAIC[12]*ALGEBRAIC[9]+ ALGEBRAIC[11]*ALGEBRAIC[3]*CONSTANTS[32]*ALGEBRAIC[5]*ALGEBRAIC[12]*ALGEBRAIC[9]);
ALGEBRAIC[37] =  (1.00000/ALGEBRAIC[32])*(( - ALGEBRAIC[1]*ALGEBRAIC[6]*ALGEBRAIC[4]*CONSTANTS[33]*ALGEBRAIC[8]*ALGEBRAIC[10] -  ALGEBRAIC[1]*ALGEBRAIC[6]*CONSTANTS[32]*CONSTANTS[33]*ALGEBRAIC[8]*ALGEBRAIC[10]) -  ALGEBRAIC[1]*ALGEBRAIC[6]*CONSTANTS[32]*ALGEBRAIC[5]*ALGEBRAIC[8]*ALGEBRAIC[10]);
ALGEBRAIC[38] =  (1.00000/ALGEBRAIC[32])*- ALGEBRAIC[1]*CONSTANTS[2]*ALGEBRAIC[4]*CONSTANTS[33]*ALGEBRAIC[8]*ALGEBRAIC[10];
ALGEBRAIC[39] = ( 2.00000*CONSTANTS[22]*CONSTANTS[30]*ALGEBRAIC[38]*CONSTANTS[26])/(ALGEBRAIC[34]+CONSTANTS[26]);
ALGEBRAIC[40] = ( 2.00000*CONSTANTS[22]*CONSTANTS[30]*(ALGEBRAIC[37]+ ALGEBRAIC[38]*CONSTANTS[28]))/(ALGEBRAIC[33]+CONSTANTS[28]);
ALGEBRAIC[41] = (ALGEBRAIC[35]+ ALGEBRAIC[33]*CONSTANTS[26])/(ALGEBRAIC[34]+CONSTANTS[26]);
ALGEBRAIC[42] = (ALGEBRAIC[35]+ ALGEBRAIC[34]*CONSTANTS[28])/(ALGEBRAIC[33]+CONSTANTS[28]);
}
void
computeEssentialVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
ALGEBRAIC[0] = ( CONSTANTS[22]*STATES[0])/( CONSTANTS[23]*CONSTANTS[24]);
ALGEBRAIC[1] =  CONSTANTS[0]*exp(( - CONSTANTS[19]*CONSTANTS[29]*ALGEBRAIC[0])/2.00000);
ALGEBRAIC[2] =  ALGEBRAIC[1]*pow(CONSTANTS[26], CONSTANTS[19]);
ALGEBRAIC[3] =  CONSTANTS[1]*exp(( CONSTANTS[19]*CONSTANTS[21]*CONSTANTS[29]*ALGEBRAIC[0])/2.00000);
ALGEBRAIC[4] =  CONSTANTS[4]*exp(( - (CONSTANTS[20]+CONSTANTS[19])*CONSTANTS[14]*ALGEBRAIC[0])/2.00000);
ALGEBRAIC[5] =  CONSTANTS[5]*exp(( (CONSTANTS[20]+CONSTANTS[19])*CONSTANTS[14]*ALGEBRAIC[0])/2.00000);
ALGEBRAIC[6] =  CONSTANTS[8]*exp(( - (CONSTANTS[20]+CONSTANTS[19])*CONSTANTS[14]*ALGEBRAIC[0])/2.00000);
ALGEBRAIC[8] =  CONSTANTS[10]*exp(( - CONSTANTS[19]*CONSTANTS[21]*CONSTANTS[15]*ALGEBRAIC[0])/2.00000);
ALGEBRAIC[9] =  CONSTANTS[11]*pow(CONSTANTS[25], CONSTANTS[19])*exp(( CONSTANTS[19]*CONSTANTS[21]*CONSTANTS[15]*ALGEBRAIC[0])/2.00000);
ALGEBRAIC[10] =  CONSTANTS[12]*exp(( CONSTANTS[20]*CONSTANTS[14]*ALGEBRAIC[0])/2.00000);
ALGEBRAIC[11] =  CONSTANTS[13]*exp(( - CONSTANTS[20]*CONSTANTS[14]*ALGEBRAIC[0])/2.00000);
ALGEBRAIC[12] = ( CONSTANTS[0]*ALGEBRAIC[6]*CONSTANTS[10]*CONSTANTS[12])/( CONSTANTS[1]*CONSTANTS[13]*CONSTANTS[11]);
ALGEBRAIC[14] = CONSTANTS[30] - (STATES[1]+STATES[2]+STATES[3]+STATES[4]+STATES[5]);
ALGEBRAIC[13] = ( CONSTANTS[2]*ALGEBRAIC[4]*CONSTANTS[33]*ALGEBRAIC[12])/( ALGEBRAIC[5]*CONSTANTS[32]*ALGEBRAIC[6]);
ALGEBRAIC[17] =  ALGEBRAIC[13]*CONSTANTS[27];
}
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;
}
void
computeRoots(double VOI, double* CONSTANTS, double* RATES, double* OLDRATES, double* STATES,
             double* OLDSTATES, double* ALGEBRAIC, double* CONDVARS)
{
}