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 31 entries in the algebraic variable array.
   There are a total of 12 entries in each of the rate and state variable arrays.
   There are a total of 32 entries in the constant variable array.
 */
/*
 * VOI is time in component environment (second).
 * ALGEBRAIC[0] is q_L_B1_init in component environment (fmol).
 * CONSTANTS[0] is q_R_B1_init in component environment (fmol).
 * CONSTANTS[1] is q_Gs_init in component environment (fmol).
 * CONSTANTS[2] is q_LR_B1_init in component environment (fmol).
 * CONSTANTS[3] is q_LR_B1Gs_init in component environment (fmol).
 * CONSTANTS[4] is q_B1d_init in component environment (fmol).
 * CONSTANTS[5] is q_BARK_init in component environment (fmol).
 * CONSTANTS[6] is q_LR_B1_BARK_init in component environment (fmol).
 * CONSTANTS[7] is q_LR_B1Gs_BARK_init in component environment (fmol).
 * CONSTANTS[8] is q_B1p_init in component environment (fmol).
 * CONSTANTS[9] is q_PKACI_init in component environment (fmol).
 * CONSTANTS[10] is q_R_PKACI_init in component environment (fmol).
 * ALGEBRAIC[2] is q_L_B1 in component environment (fmol).
 * ALGEBRAIC[1] is q_R_B1 in component environment (fmol).
 * ALGEBRAIC[4] is q_Gs in component environment (fmol).
 * ALGEBRAIC[6] is q_LR_B1 in component environment (fmol).
 * ALGEBRAIC[8] is q_LR_B1Gs in component environment (fmol).
 * ALGEBRAIC[10] is q_B1d in component environment (fmol).
 * ALGEBRAIC[12] is q_BARK in component environment (fmol).
 * ALGEBRAIC[14] is q_LR_B1_BARK in component environment (fmol).
 * ALGEBRAIC[17] is q_LR_B1Gs_BARK in component environment (fmol).
 * ALGEBRAIC[3] is q_B1p in component environment (fmol).
 * ALGEBRAIC[5] is q_PKACI in component environment (fmol).
 * ALGEBRAIC[7] is q_R_PKACI in component environment (fmol).
 * STATES[0] is q_L_B1 in component B1AR (fmol).
 * STATES[1] is q_R_B1 in component B1AR (fmol).
 * STATES[2] is q_Gs in component B1AR (fmol).
 * STATES[3] is q_LR_B1 in component B1AR (fmol).
 * STATES[4] is q_LR_B1Gs in component B1AR (fmol).
 * STATES[5] is q_B1d in component B1AR (fmol).
 * STATES[6] is q_BARK in component B1AR (fmol).
 * STATES[7] is q_LR_B1_BARK in component B1AR (fmol).
 * STATES[8] is q_LR_B1Gs_BARK in component B1AR (fmol).
 * STATES[9] is q_B1p in component B1AR (fmol).
 * STATES[10] is q_PKACI in component B1AR (fmol).
 * STATES[11] is q_R_PKACI in component B1AR (fmol).
 * CONSTANTS[11] is kappa_B11 in component B1AR_parameters (fmol_per_sec).
 * CONSTANTS[12] is kappa_B12 in component B1AR_parameters (fmol_per_sec).
 * CONSTANTS[13] is kappa_B21 in component B1AR_parameters (fmol_per_sec).
 * CONSTANTS[14] is kappa_B22 in component B1AR_parameters (fmol_per_sec).
 * CONSTANTS[15] is kappa_P1 in component B1AR_parameters (fmol_per_sec).
 * CONSTANTS[16] is kappa_P2 in component B1AR_parameters (fmol_per_sec).
 * CONSTANTS[17] is K_L_B1 in component B1AR_parameters (per_fmol).
 * CONSTANTS[18] is K_R_B1 in component B1AR_parameters (per_fmol).
 * CONSTANTS[19] is K_Gs in component B1AR_parameters (per_fmol).
 * CONSTANTS[20] is K_LR_B1 in component B1AR_parameters (per_fmol).
 * CONSTANTS[21] is K_LR_B1Gs in component B1AR_parameters (per_fmol).
 * CONSTANTS[22] is K_B1d in component B1AR_parameters (per_fmol).
 * CONSTANTS[23] is K_BARK in component B1AR_parameters (per_fmol).
 * CONSTANTS[24] is K_LR_B1_BARK in component B1AR_parameters (per_fmol).
 * CONSTANTS[25] is K_LR_B1Gs_BARK in component B1AR_parameters (per_fmol).
 * CONSTANTS[26] is K_B1p in component B1AR_parameters (per_fmol).
 * CONSTANTS[27] is K_PKACI in component B1AR_parameters (per_fmol).
 * CONSTANTS[28] is K_R_PKACI in component B1AR_parameters (per_fmol).
 * CONSTANTS[29] is R in component constants (J_per_K_per_mol).
 * CONSTANTS[30] is T in component constants (kelvin).
 * ALGEBRAIC[27] is vB11 in component B1AR (fmol_per_sec).
 * ALGEBRAIC[28] is vB12 in component B1AR (fmol_per_sec).
 * ALGEBRAIC[29] is vB21 in component B1AR (fmol_per_sec).
 * ALGEBRAIC[30] is vB22 in component B1AR (fmol_per_sec).
 * ALGEBRAIC[16] is vP1 in component B1AR (fmol_per_sec).
 * ALGEBRAIC[18] is vP2 in component B1AR (fmol_per_sec).
 * ALGEBRAIC[19] is mu_L_B1 in component B1AR (J_per_mol).
 * ALGEBRAIC[9] is mu_R_B1 in component B1AR (J_per_mol).
 * ALGEBRAIC[20] is mu_Gs in component B1AR (J_per_mol).
 * ALGEBRAIC[21] is mu_LR_B1 in component B1AR (J_per_mol).
 * ALGEBRAIC[22] is mu_LR_B1Gs in component B1AR (J_per_mol).
 * ALGEBRAIC[23] is mu_B1d in component B1AR (J_per_mol).
 * ALGEBRAIC[24] is mu_BARK in component B1AR (J_per_mol).
 * ALGEBRAIC[25] is mu_LR_B1_BARK in component B1AR (J_per_mol).
 * ALGEBRAIC[26] is mu_LR_B1Gs_BARK in component B1AR (J_per_mol).
 * ALGEBRAIC[11] is mu_B1p in component B1AR (J_per_mol).
 * ALGEBRAIC[13] is mu_PKACI in component B1AR (J_per_mol).
 * ALGEBRAIC[15] is mu_R_PKACI in component B1AR (J_per_mol).
 * CONSTANTS[31] is F in component constants (C_per_mol).
 * RATES[0] is d/dt q_L_B1 in component B1AR (fmol).
 * RATES[1] is d/dt q_R_B1 in component B1AR (fmol).
 * RATES[2] is d/dt q_Gs in component B1AR (fmol).
 * RATES[3] is d/dt q_LR_B1 in component B1AR (fmol).
 * RATES[5] is d/dt q_B1d in component B1AR (fmol).
 * RATES[6] is d/dt q_BARK in component B1AR (fmol).
 * RATES[7] is d/dt q_LR_B1_BARK in component B1AR (fmol).
 * RATES[4] is d/dt q_LR_B1Gs in component B1AR (fmol).
 * RATES[8] is d/dt q_LR_B1Gs_BARK in component B1AR (fmol).
 * RATES[9] is d/dt q_B1p in component B1AR (fmol).
 * RATES[10] is d/dt q_PKACI in component B1AR (fmol).
 * RATES[11] is d/dt q_R_PKACI in component B1AR (fmol).
 */
void
initConsts(double* CONSTANTS, double* RATES, double *STATES)
{
CONSTANTS[0] = 0.00005;
CONSTANTS[1] = 0.00015;
CONSTANTS[2] = 0;
CONSTANTS[3] = 0.0000508778;
CONSTANTS[4] = 0;
CONSTANTS[5] = 0.0228;
CONSTANTS[6] = 0.0000508778;
CONSTANTS[7] = 0.0000508778;
CONSTANTS[8] = 0;
CONSTANTS[9] = 0.000221209;
CONSTANTS[10] = 0.008778;
STATES[0] = 1e-16;
STATES[1] = 1e-16;
STATES[2] = 1e-16;
STATES[3] = 1e-16;
STATES[4] = 1e-16;
STATES[5] = 1e-16;
STATES[6] = 1e-16;
STATES[7] = 1e-16;
STATES[8] = 1e-16;
STATES[9] = 1e-16;
STATES[10] = 1e-16;
STATES[11] = 1e-16;
CONSTANTS[11] = 0.000282928;
CONSTANTS[12] = 128604;
CONSTANTS[13] = 0.000200356;
CONSTANTS[14] = 91071.1;
CONSTANTS[15] = 2.28764e-05;
CONSTANTS[16] = 10398.4;
CONSTANTS[17] = 2.90698e-08;
CONSTANTS[18] = 1849.44;
CONSTANTS[19] = 0.0410501;
CONSTANTS[20] = 0.0242248;
CONSTANTS[21] = 0.0342084;
CONSTANTS[22] = 2.90698e-08;
CONSTANTS[23] = 0.226042;
CONSTANTS[24] = 0.226042;
CONSTANTS[25] = 0.319199;
CONSTANTS[26] = 1.13021e-09;
CONSTANTS[27] = 7.19049e-05;
CONSTANTS[28] = 2.79561;
CONSTANTS[29] = 8.31;
CONSTANTS[30] = 310;
CONSTANTS[31] = 96485;
}
void
computeRates(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
ALGEBRAIC[1] = STATES[1]+CONSTANTS[0];
ALGEBRAIC[9] =  CONSTANTS[29]*CONSTANTS[30]*log( CONSTANTS[18]*ALGEBRAIC[1]);
ALGEBRAIC[5] = STATES[10]+CONSTANTS[9];
ALGEBRAIC[13] =  CONSTANTS[29]*CONSTANTS[30]*log( CONSTANTS[27]*ALGEBRAIC[5]);
ALGEBRAIC[7] = STATES[11]+CONSTANTS[10];
ALGEBRAIC[15] =  CONSTANTS[29]*CONSTANTS[30]*log( CONSTANTS[28]*ALGEBRAIC[7]);
ALGEBRAIC[16] =  CONSTANTS[15]*(exp((ALGEBRAIC[9]+ALGEBRAIC[13])/( CONSTANTS[29]*CONSTANTS[30])) - exp(ALGEBRAIC[15]/( CONSTANTS[29]*CONSTANTS[30])));
RATES[1] = - ALGEBRAIC[16];
RATES[9] = - ALGEBRAIC[16];
ALGEBRAIC[3] = STATES[9]+CONSTANTS[8];
ALGEBRAIC[11] =  CONSTANTS[29]*CONSTANTS[30]*log( CONSTANTS[26]*ALGEBRAIC[3]);
ALGEBRAIC[18] =  CONSTANTS[16]*(exp(ALGEBRAIC[15]/( CONSTANTS[29]*CONSTANTS[30])) - exp((ALGEBRAIC[13]+ALGEBRAIC[11])/( CONSTANTS[29]*CONSTANTS[30])));
RATES[10] = ALGEBRAIC[18] - ALGEBRAIC[16];
RATES[11] = ALGEBRAIC[16] - ALGEBRAIC[18];
ALGEBRAIC[6] = STATES[3]+CONSTANTS[2];
ALGEBRAIC[21] =  CONSTANTS[29]*CONSTANTS[30]*log( CONSTANTS[20]*ALGEBRAIC[6]);
ALGEBRAIC[12] = STATES[6]+CONSTANTS[5];
ALGEBRAIC[24] =  CONSTANTS[29]*CONSTANTS[30]*log( CONSTANTS[23]*ALGEBRAIC[12]);
ALGEBRAIC[14] = STATES[7]+CONSTANTS[6];
ALGEBRAIC[25] =  CONSTANTS[29]*CONSTANTS[30]*log( CONSTANTS[24]*ALGEBRAIC[14]);
ALGEBRAIC[27] =  CONSTANTS[11]*(exp((ALGEBRAIC[21]+ALGEBRAIC[24])/( CONSTANTS[29]*CONSTANTS[30])) - exp(ALGEBRAIC[25]/( CONSTANTS[29]*CONSTANTS[30])));
RATES[3] = - ALGEBRAIC[27];
ALGEBRAIC[0] = ( sin( 2.00000* 3.14159265358979*VOI)>0.100000 ? 0.000100000 : 1.00000e-06);
ALGEBRAIC[2] = STATES[0]+ALGEBRAIC[0];
ALGEBRAIC[19] =  CONSTANTS[29]*CONSTANTS[30]*log( CONSTANTS[17]*ALGEBRAIC[2]);
ALGEBRAIC[10] = STATES[5]+CONSTANTS[4];
ALGEBRAIC[23] =  CONSTANTS[29]*CONSTANTS[30]*log( CONSTANTS[22]*ALGEBRAIC[10]);
ALGEBRAIC[28] =  CONSTANTS[12]*(exp(ALGEBRAIC[25]/( CONSTANTS[29]*CONSTANTS[30])) - exp((ALGEBRAIC[24]+ALGEBRAIC[23]+ALGEBRAIC[19])/( CONSTANTS[29]*CONSTANTS[30])));
RATES[7] = ALGEBRAIC[27] - ALGEBRAIC[28];
ALGEBRAIC[8] = STATES[4]+CONSTANTS[3];
ALGEBRAIC[22] =  CONSTANTS[29]*CONSTANTS[30]*log( CONSTANTS[21]*ALGEBRAIC[8]);
ALGEBRAIC[17] = STATES[8]+CONSTANTS[7];
ALGEBRAIC[26] =  CONSTANTS[29]*CONSTANTS[30]*log( CONSTANTS[25]*ALGEBRAIC[17]);
ALGEBRAIC[29] =  CONSTANTS[13]*(exp((ALGEBRAIC[22]+ALGEBRAIC[24])/( CONSTANTS[29]*CONSTANTS[30])) - exp(ALGEBRAIC[26]/( CONSTANTS[29]*CONSTANTS[30])));
RATES[4] = - ALGEBRAIC[29];
ALGEBRAIC[4] = STATES[2]+CONSTANTS[1];
ALGEBRAIC[20] =  CONSTANTS[29]*CONSTANTS[30]*log( CONSTANTS[19]*ALGEBRAIC[4]);
ALGEBRAIC[30] =  CONSTANTS[14]*(exp(ALGEBRAIC[26]/( CONSTANTS[29]*CONSTANTS[30])) - exp((ALGEBRAIC[24]+ALGEBRAIC[23]+ALGEBRAIC[19]+ALGEBRAIC[20])/( CONSTANTS[29]*CONSTANTS[30])));
RATES[0] = ALGEBRAIC[28]+ALGEBRAIC[30];
RATES[2] = ALGEBRAIC[30];
RATES[5] = ALGEBRAIC[28]+ALGEBRAIC[30];
RATES[6] = ((ALGEBRAIC[28]+ALGEBRAIC[30]) - ALGEBRAIC[27]) - ALGEBRAIC[29];
RATES[8] = ALGEBRAIC[29] - ALGEBRAIC[30];
}
void
computeVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
ALGEBRAIC[1] = STATES[1]+CONSTANTS[0];
ALGEBRAIC[9] =  CONSTANTS[29]*CONSTANTS[30]*log( CONSTANTS[18]*ALGEBRAIC[1]);
ALGEBRAIC[5] = STATES[10]+CONSTANTS[9];
ALGEBRAIC[13] =  CONSTANTS[29]*CONSTANTS[30]*log( CONSTANTS[27]*ALGEBRAIC[5]);
ALGEBRAIC[7] = STATES[11]+CONSTANTS[10];
ALGEBRAIC[15] =  CONSTANTS[29]*CONSTANTS[30]*log( CONSTANTS[28]*ALGEBRAIC[7]);
ALGEBRAIC[16] =  CONSTANTS[15]*(exp((ALGEBRAIC[9]+ALGEBRAIC[13])/( CONSTANTS[29]*CONSTANTS[30])) - exp(ALGEBRAIC[15]/( CONSTANTS[29]*CONSTANTS[30])));
ALGEBRAIC[3] = STATES[9]+CONSTANTS[8];
ALGEBRAIC[11] =  CONSTANTS[29]*CONSTANTS[30]*log( CONSTANTS[26]*ALGEBRAIC[3]);
ALGEBRAIC[18] =  CONSTANTS[16]*(exp(ALGEBRAIC[15]/( CONSTANTS[29]*CONSTANTS[30])) - exp((ALGEBRAIC[13]+ALGEBRAIC[11])/( CONSTANTS[29]*CONSTANTS[30])));
ALGEBRAIC[6] = STATES[3]+CONSTANTS[2];
ALGEBRAIC[21] =  CONSTANTS[29]*CONSTANTS[30]*log( CONSTANTS[20]*ALGEBRAIC[6]);
ALGEBRAIC[12] = STATES[6]+CONSTANTS[5];
ALGEBRAIC[24] =  CONSTANTS[29]*CONSTANTS[30]*log( CONSTANTS[23]*ALGEBRAIC[12]);
ALGEBRAIC[14] = STATES[7]+CONSTANTS[6];
ALGEBRAIC[25] =  CONSTANTS[29]*CONSTANTS[30]*log( CONSTANTS[24]*ALGEBRAIC[14]);
ALGEBRAIC[27] =  CONSTANTS[11]*(exp((ALGEBRAIC[21]+ALGEBRAIC[24])/( CONSTANTS[29]*CONSTANTS[30])) - exp(ALGEBRAIC[25]/( CONSTANTS[29]*CONSTANTS[30])));
ALGEBRAIC[0] = ( sin( 2.00000* 3.14159265358979*VOI)>0.100000 ? 0.000100000 : 1.00000e-06);
ALGEBRAIC[2] = STATES[0]+ALGEBRAIC[0];
ALGEBRAIC[19] =  CONSTANTS[29]*CONSTANTS[30]*log( CONSTANTS[17]*ALGEBRAIC[2]);
ALGEBRAIC[10] = STATES[5]+CONSTANTS[4];
ALGEBRAIC[23] =  CONSTANTS[29]*CONSTANTS[30]*log( CONSTANTS[22]*ALGEBRAIC[10]);
ALGEBRAIC[28] =  CONSTANTS[12]*(exp(ALGEBRAIC[25]/( CONSTANTS[29]*CONSTANTS[30])) - exp((ALGEBRAIC[24]+ALGEBRAIC[23]+ALGEBRAIC[19])/( CONSTANTS[29]*CONSTANTS[30])));
ALGEBRAIC[8] = STATES[4]+CONSTANTS[3];
ALGEBRAIC[22] =  CONSTANTS[29]*CONSTANTS[30]*log( CONSTANTS[21]*ALGEBRAIC[8]);
ALGEBRAIC[17] = STATES[8]+CONSTANTS[7];
ALGEBRAIC[26] =  CONSTANTS[29]*CONSTANTS[30]*log( CONSTANTS[25]*ALGEBRAIC[17]);
ALGEBRAIC[29] =  CONSTANTS[13]*(exp((ALGEBRAIC[22]+ALGEBRAIC[24])/( CONSTANTS[29]*CONSTANTS[30])) - exp(ALGEBRAIC[26]/( CONSTANTS[29]*CONSTANTS[30])));
ALGEBRAIC[4] = STATES[2]+CONSTANTS[1];
ALGEBRAIC[20] =  CONSTANTS[29]*CONSTANTS[30]*log( CONSTANTS[19]*ALGEBRAIC[4]);
ALGEBRAIC[30] =  CONSTANTS[14]*(exp(ALGEBRAIC[26]/( CONSTANTS[29]*CONSTANTS[30])) - exp((ALGEBRAIC[24]+ALGEBRAIC[23]+ALGEBRAIC[19]+ALGEBRAIC[20])/( CONSTANTS[29]*CONSTANTS[30])));
}
Source
Derived from workspace BG_B1AR at changeset 3a8c75951d44.
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.