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 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[1] is q_L_B1 in component environment (fmol). * ALGEBRAIC[2] is q_R_B1 in component environment (fmol). * ALGEBRAIC[3] is q_Gs in component environment (fmol). * ALGEBRAIC[4] is q_LR_B1 in component environment (fmol). * ALGEBRAIC[5] is q_LR_B1Gs in component environment (fmol). * ALGEBRAIC[6] is q_B1d in component environment (fmol). * ALGEBRAIC[7] is q_BARK in component environment (fmol). * ALGEBRAIC[8] is q_LR_B1_BARK in component environment (fmol). * ALGEBRAIC[9] is q_LR_B1Gs_BARK in component environment (fmol). * ALGEBRAIC[10] is q_B1p in component environment (fmol). * ALGEBRAIC[11] is q_PKACI in component environment (fmol). * ALGEBRAIC[12] 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[25] is vB11 in component B1AR (fmol_per_sec). * ALGEBRAIC[26] is vB12 in component B1AR (fmol_per_sec). * ALGEBRAIC[27] is vB21 in component B1AR (fmol_per_sec). * ALGEBRAIC[28] is vB22 in component B1AR (fmol_per_sec). * ALGEBRAIC[29] is vP1 in component B1AR (fmol_per_sec). * ALGEBRAIC[30] is vP2 in component B1AR (fmol_per_sec). * ALGEBRAIC[13] is mu_L_B1 in component B1AR (J_per_mol). * ALGEBRAIC[14] is mu_R_B1 in component B1AR (J_per_mol). * ALGEBRAIC[15] is mu_Gs in component B1AR (J_per_mol). * ALGEBRAIC[16] is mu_LR_B1 in component B1AR (J_per_mol). * ALGEBRAIC[17] is mu_LR_B1Gs in component B1AR (J_per_mol). * ALGEBRAIC[18] is mu_B1d in component B1AR (J_per_mol). * ALGEBRAIC[19] is mu_BARK in component B1AR (J_per_mol). * ALGEBRAIC[20] is mu_LR_B1_BARK in component B1AR (J_per_mol). * ALGEBRAIC[21] is mu_LR_B1Gs_BARK in component B1AR (J_per_mol). * ALGEBRAIC[22] is mu_B1p in component B1AR (J_per_mol). * ALGEBRAIC[23] is mu_PKACI in component B1AR (J_per_mol). * ALGEBRAIC[24] 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). * There are a total of 1 condition variables. */ 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; RATES[0] = 0.1001; RATES[1] = 0.1001; RATES[2] = 0.1001; RATES[3] = 0.1001; RATES[5] = 0.1001; RATES[6] = 0.1001; RATES[7] = 0.1001; RATES[4] = 0.1001; RATES[8] = 0.1001; RATES[9] = 0.1001; RATES[10] = 0.1001; RATES[11] = 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[26]+ALGEBRAIC[28]; resid[1] = RATES[1] - - ALGEBRAIC[29]; resid[2] = RATES[2] - ALGEBRAIC[28]; resid[3] = RATES[3] - - ALGEBRAIC[25]; resid[4] = RATES[5] - ALGEBRAIC[26]+ALGEBRAIC[28]; resid[5] = RATES[6] - ((ALGEBRAIC[26]+ALGEBRAIC[28]) - ALGEBRAIC[25]) - ALGEBRAIC[27]; resid[6] = RATES[7] - ALGEBRAIC[25] - ALGEBRAIC[26]; resid[7] = RATES[4] - - ALGEBRAIC[27]; resid[8] = RATES[8] - ALGEBRAIC[27] - ALGEBRAIC[28]; resid[9] = RATES[9] - - ALGEBRAIC[29]; resid[10] = RATES[10] - ALGEBRAIC[30] - ALGEBRAIC[29]; resid[11] = RATES[11] - ALGEBRAIC[29] - ALGEBRAIC[30]; } void computeVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC) { } void computeEssentialVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC) { ALGEBRAIC[4] = STATES[3]+CONSTANTS[2]; ALGEBRAIC[16] = CONSTANTS[29]*CONSTANTS[30]*log( CONSTANTS[20]*ALGEBRAIC[4]); ALGEBRAIC[7] = STATES[6]+CONSTANTS[5]; ALGEBRAIC[19] = CONSTANTS[29]*CONSTANTS[30]*log( CONSTANTS[23]*ALGEBRAIC[7]); ALGEBRAIC[8] = STATES[7]+CONSTANTS[6]; ALGEBRAIC[20] = CONSTANTS[29]*CONSTANTS[30]*log( CONSTANTS[24]*ALGEBRAIC[8]); ALGEBRAIC[25] = CONSTANTS[11]*(exp((ALGEBRAIC[16]+ALGEBRAIC[19])/( CONSTANTS[29]*CONSTANTS[30])) - exp(ALGEBRAIC[20]/( CONSTANTS[29]*CONSTANTS[30]))); ALGEBRAIC[0] = (CONDVAR[0]>0.00000 ? 0.000100000 : 1.00000e-06); ALGEBRAIC[1] = STATES[0]+ALGEBRAIC[0]; ALGEBRAIC[13] = CONSTANTS[29]*CONSTANTS[30]*log( CONSTANTS[17]*ALGEBRAIC[1]); ALGEBRAIC[6] = STATES[5]+CONSTANTS[4]; ALGEBRAIC[18] = CONSTANTS[29]*CONSTANTS[30]*log( CONSTANTS[22]*ALGEBRAIC[6]); ALGEBRAIC[26] = CONSTANTS[12]*(exp(ALGEBRAIC[20]/( CONSTANTS[29]*CONSTANTS[30])) - exp((ALGEBRAIC[19]+ALGEBRAIC[18]+ALGEBRAIC[13])/( CONSTANTS[29]*CONSTANTS[30]))); ALGEBRAIC[5] = STATES[4]+CONSTANTS[3]; ALGEBRAIC[17] = CONSTANTS[29]*CONSTANTS[30]*log( CONSTANTS[21]*ALGEBRAIC[5]); ALGEBRAIC[9] = STATES[8]+CONSTANTS[7]; ALGEBRAIC[21] = CONSTANTS[29]*CONSTANTS[30]*log( CONSTANTS[25]*ALGEBRAIC[9]); ALGEBRAIC[27] = CONSTANTS[13]*(exp((ALGEBRAIC[17]+ALGEBRAIC[19])/( CONSTANTS[29]*CONSTANTS[30])) - exp(ALGEBRAIC[21]/( CONSTANTS[29]*CONSTANTS[30]))); ALGEBRAIC[3] = STATES[2]+CONSTANTS[1]; ALGEBRAIC[15] = CONSTANTS[29]*CONSTANTS[30]*log( CONSTANTS[19]*ALGEBRAIC[3]); ALGEBRAIC[28] = CONSTANTS[14]*(exp(ALGEBRAIC[21]/( CONSTANTS[29]*CONSTANTS[30])) - exp((ALGEBRAIC[19]+ALGEBRAIC[18]+ALGEBRAIC[13]+ALGEBRAIC[15])/( CONSTANTS[29]*CONSTANTS[30]))); ALGEBRAIC[2] = STATES[1]+CONSTANTS[0]; ALGEBRAIC[14] = CONSTANTS[29]*CONSTANTS[30]*log( CONSTANTS[18]*ALGEBRAIC[2]); ALGEBRAIC[11] = STATES[10]+CONSTANTS[9]; ALGEBRAIC[23] = CONSTANTS[29]*CONSTANTS[30]*log( CONSTANTS[27]*ALGEBRAIC[11]); ALGEBRAIC[12] = STATES[11]+CONSTANTS[10]; ALGEBRAIC[24] = CONSTANTS[29]*CONSTANTS[30]*log( CONSTANTS[28]*ALGEBRAIC[12]); ALGEBRAIC[29] = CONSTANTS[15]*(exp((ALGEBRAIC[14]+ALGEBRAIC[23])/( CONSTANTS[29]*CONSTANTS[30])) - exp(ALGEBRAIC[24]/( CONSTANTS[29]*CONSTANTS[30]))); ALGEBRAIC[10] = STATES[9]+CONSTANTS[8]; ALGEBRAIC[22] = CONSTANTS[29]*CONSTANTS[30]*log( CONSTANTS[26]*ALGEBRAIC[10]); ALGEBRAIC[30] = CONSTANTS[16]*(exp(ALGEBRAIC[24]/( CONSTANTS[29]*CONSTANTS[30])) - exp((ALGEBRAIC[23]+ALGEBRAIC[22])/( CONSTANTS[29]*CONSTANTS[30]))); } 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; SI[8] = 1.0; SI[9] = 1.0; SI[10] = 1.0; SI[11] = 1.0; } void computeRoots(double VOI, double* CONSTANTS, double* RATES, double* OLDRATES, double* STATES, double* OLDSTATES, double* ALGEBRAIC, double* CONDVARS) { CONDVAR[0] = sin( 2.00000* 3.14159265358979*VOI) - 0.100000; }