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 70 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 46 entries in the constant variable array. */ /* * VOI is time in component environment (millisecond). * STATES[0] is V in component membrane (millivolt). * ALGEBRAIC[0] is IK in component membrane (femtoA). * ALGEBRAIC[18] is ICa in component membrane (femtoA). * ALGEBRAIC[1] is IKCa in component membrane (femtoA). * ALGEBRAIC[68] is IKATP in component KATP (femtoA). * CONSTANTS[0] is Cm in component membrane (femtoF). * CONSTANTS[1] is gK in component membrane (picoS). * CONSTANTS[2] is VK in component KATP (millivolt). * STATES[1] is n in component membrane (dimensionless). * CONSTANTS[3] is gKCa in component membrane (picoS). * CONSTANTS[4] is kd in component membrane (micromolar). * STATES[2] is c in component calcium_handling (micromolar). * CONSTANTS[5] is gCa in component membrane (picoS). * ALGEBRAIC[2] is minf in component membrane (dimensionless). * CONSTANTS[6] is VCa in component membrane (millivolt). * CONSTANTS[7] is taun in component membrane (millisecond). * ALGEBRAIC[3] is ninf in component membrane (dimensionless). * STATES[3] is cer in component calcium_handling (micromolar). * CONSTANTS[8] is fcyt in component calcium_handling (dimensionless). * ALGEBRAIC[19] is Jmem in component calcium_handling (flux). * ALGEBRAIC[6] is Jer in component calcium_handling (flux). * CONSTANTS[9] is fer in component calcium_handling (dimensionless). * CONSTANTS[10] is sigmaV in component calcium_handling (dimensionless). * CONSTANTS[11] is pleak in component calcium_handling (first_order_rate_constant). * CONSTANTS[12] is Kserca in component calcium_handling (first_order_rate_constant). * CONSTANTS[13] is lambdaer in component calcium_handling (dimensionless). * CONSTANTS[14] is epser in component calcium_handling (dimensionless). * CONSTANTS[15] is alpha in component calcium_handling (micromolar_per_femtoA_millisecond). * CONSTANTS[16] is kpmca in component calcium_handling (first_order_rate_constant). * ALGEBRAIC[4] is Jserca in component calcium_handling (flux). * ALGEBRAIC[5] is Jleak in component calcium_handling (flux). * ALGEBRAIC[8] is rgpdh in component glycolysis (flux). * CONSTANTS[17] is Rgk in component glycolysis (per_second). * CONSTANTS[18] is atot in component glycolysis (micromolar). * CONSTANTS[19] is pfkbas in component glycolysis (dimensionless). * CONSTANTS[20] is Katpase in component glycolysis (micromolar). * CONSTANTS[21] is kg in component glycolysis (flux). * ALGEBRAIC[7] is f6p in component glycolysis (micromolar). * CONSTANTS[22] is lambda in component glycolysis (dimensionless). * ALGEBRAIC[69] is pfk in component pfk (micromolar). * STATES[4] is g6p in component glycolysis (micromolar). * STATES[5] is fbp in component glycolysis (micromolar). * CONSTANTS[23] is bottom1 in component pfk (dimensionless). * CONSTANTS[24] is weight1 in component pfk (dimensionless). * CONSTANTS[25] is topa1 in component pfk (dimensionless). * CONSTANTS[26] is k1 in component pfk (micromolar). * CONSTANTS[27] is k2 in component pfk (micromolar). * CONSTANTS[28] is k3 in component pfk (micromolar). * CONSTANTS[29] is k4 in component pfk (micromolar). * CONSTANTS[30] is cat in component pfk (dimensionless). * ALGEBRAIC[21] is atp in component nucleotides (micromolar). * ALGEBRAIC[24] is weight2 in component pfk (dimensionless). * CONSTANTS[45] is topa2 in component pfk (dimensionless). * ALGEBRAIC[25] is bottom2 in component pfk (dimensionless). * ALGEBRAIC[10] is topa3 in component pfk (dimensionless). * ALGEBRAIC[9] is weight3 in component pfk (dimensionless). * ALGEBRAIC[26] is bottom3 in component pfk (dimensionless). * CONSTANTS[31] is famp in component pfk (dimensionless). * CONSTANTS[32] is fatp in component pfk (dimensionless). * CONSTANTS[33] is ffbp in component pfk (dimensionless). * CONSTANTS[34] is fbt in component pfk (dimensionless). * CONSTANTS[35] is fmt in component pfk (dimensionless). * ALGEBRAIC[27] is weight4 in component pfk (dimensionless). * ALGEBRAIC[28] is topa4 in component pfk (dimensionless). * ALGEBRAIC[29] is bottom4 in component pfk (dimensionless). * ALGEBRAIC[11] is weight5 in component pfk (dimensionless). * ALGEBRAIC[30] is topa5 in component pfk (dimensionless). * ALGEBRAIC[31] is bottom5 in component pfk (dimensionless). * ALGEBRAIC[32] is weight6 in component pfk (dimensionless). * ALGEBRAIC[33] is topa6 in component pfk (dimensionless). * ALGEBRAIC[34] is bottom6 in component pfk (dimensionless). * ALGEBRAIC[12] is weight7 in component pfk (dimensionless). * ALGEBRAIC[35] is topa7 in component pfk (dimensionless). * ALGEBRAIC[36] is bottom7 in component pfk (dimensionless). * ALGEBRAIC[37] is weight8 in component pfk (dimensionless). * ALGEBRAIC[38] is topa8 in component pfk (dimensionless). * ALGEBRAIC[39] is bottom8 in component pfk (dimensionless). * ALGEBRAIC[40] is weight9 in component pfk (dimensionless). * ALGEBRAIC[41] is topa9 in component pfk (dimensionless). * ALGEBRAIC[42] is bottom9 in component pfk (dimensionless). * ALGEBRAIC[43] is weight10 in component pfk (dimensionless). * ALGEBRAIC[44] is topa10 in component pfk (dimensionless). * ALGEBRAIC[45] is bottom10 in component pfk (dimensionless). * ALGEBRAIC[46] is weight11 in component pfk (dimensionless). * ALGEBRAIC[47] is topa11 in component pfk (dimensionless). * ALGEBRAIC[48] is bottom11 in component pfk (dimensionless). * ALGEBRAIC[49] is weight12 in component pfk (dimensionless). * ALGEBRAIC[50] is topa12 in component pfk (dimensionless). * ALGEBRAIC[51] is bottom12 in component pfk (dimensionless). * ALGEBRAIC[52] is weight13 in component pfk (dimensionless). * ALGEBRAIC[53] is topa13 in component pfk (dimensionless). * ALGEBRAIC[54] is bottom13 in component pfk (dimensionless). * ALGEBRAIC[55] is weight14 in component pfk (dimensionless). * ALGEBRAIC[56] is topa14 in component pfk (dimensionless). * ALGEBRAIC[57] is bottom14 in component pfk (dimensionless). * ALGEBRAIC[58] is weight15 in component pfk (dimensionless). * ALGEBRAIC[59] is topa15 in component pfk (dimensionless). * ALGEBRAIC[60] is bottom15 in component pfk (dimensionless). * ALGEBRAIC[62] is weight16 in component pfk (dimensionless). * ALGEBRAIC[63] is topa16 in component pfk (dimensionless). * ALGEBRAIC[64] is bottom16 in component pfk (dimensionless). * ALGEBRAIC[61] is topb in component pfk (dimensionless). * ALGEBRAIC[22] is amp in component nucleotides (micromolar). * ALGEBRAIC[13] is mgadp in component KATP (micromolar). * ALGEBRAIC[14] is adp3m in component KATP (micromolar). * ALGEBRAIC[65] is atp4m in component KATP (micromolar). * ALGEBRAIC[15] is topo in component KATP (dimensionless). * ALGEBRAIC[66] is bottomo in component KATP (dimensionless). * ALGEBRAIC[67] is katpo in component KATP (dimensionless). * CONSTANTS[36] is gkatpbar in component KATP (picoS). * STATES[6] is adp in component nucleotides (micromolar). * CONSTANTS[37] is kdd in component KATP (dimensionless). * CONSTANTS[38] is ktd in component KATP (dimensionless). * CONSTANTS[39] is ktt in component KATP (dimensionless). * ALGEBRAIC[20] is fback in component nucleotides (dimensionless). * CONSTANTS[40] is taua in component nucleotides (dimensionless). * CONSTANTS[41] is r1 in component nucleotides (micromolar). * CONSTANTS[42] is r in component nucleotides (dimensionless). * ALGEBRAIC[16] is y in component nucleotides (dimensionless). * CONSTANTS[43] is vg in component nucleotides (dimensionless). * CONSTANTS[44] is kg in component nucleotides (flux). * ALGEBRAIC[17] is rad in component nucleotides (dimensionless). * ALGEBRAIC[23] is ratio in component nucleotides (dimensionless). * RATES[0] is d/dt V in component membrane (millivolt). * RATES[1] is d/dt n in component membrane (dimensionless). * RATES[2] is d/dt c in component calcium_handling (micromolar). * RATES[3] is d/dt cer in component calcium_handling (micromolar). * RATES[5] is d/dt fbp in component glycolysis (micromolar). * RATES[4] is d/dt g6p in component glycolysis (micromolar). * RATES[6] is d/dt adp in component nucleotides (micromolar). * There are a total of 0 condition variables. */ void initConsts(double* CONSTANTS, double* RATES, double *STATES) { STATES[0] = -60; CONSTANTS[0] = 5300; CONSTANTS[1] = 2700; CONSTANTS[2] = -75; STATES[1] = 0; CONSTANTS[3] = 600; CONSTANTS[4] = 0.5; STATES[2] = 0.25; CONSTANTS[5] = 1000; CONSTANTS[6] = 25; CONSTANTS[7] = 20; STATES[3] = 185; CONSTANTS[8] = 0.01; CONSTANTS[9] = 0.01; CONSTANTS[10] = 31; CONSTANTS[11] = 0.0002; CONSTANTS[12] = 0.4; CONSTANTS[13] = 1; CONSTANTS[14] = 1; CONSTANTS[15] = 0.00000450; CONSTANTS[16] = 0.2; CONSTANTS[17] = 0.2; CONSTANTS[18] = 3000; CONSTANTS[19] = 0.06; CONSTANTS[20] = 0.0003; CONSTANTS[21] = 10; CONSTANTS[22] = 0.005; STATES[4] = 200; STATES[5] = 40; CONSTANTS[23] = 1; CONSTANTS[24] = 1; CONSTANTS[25] = 0; CONSTANTS[26] = 30; CONSTANTS[27] = 1; CONSTANTS[28] = 50000; CONSTANTS[29] = 1000; CONSTANTS[30] = 2; CONSTANTS[31] = 0.02; CONSTANTS[32] = 20; CONSTANTS[33] = 0.2; CONSTANTS[34] = 20; CONSTANTS[35] = 20; CONSTANTS[36] = 25000; STATES[6] = 780; CONSTANTS[37] = 17; CONSTANTS[38] = 26; CONSTANTS[39] = 1; CONSTANTS[40] = 300000; CONSTANTS[41] = 0.35; CONSTANTS[42] = 1; CONSTANTS[43] = 2.2; CONSTANTS[44] = 10; CONSTANTS[45] = CONSTANTS[25]; RATES[0] = 0.1001; RATES[1] = 0.1001; RATES[2] = 0.1001; RATES[3] = 0.1001; RATES[5] = 0.1001; RATES[4] = 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[0] - - (ALGEBRAIC[0]+ALGEBRAIC[18]+ALGEBRAIC[1]+ALGEBRAIC[68])/CONSTANTS[0]; resid[1] = RATES[1] - (ALGEBRAIC[3] - STATES[1])/CONSTANTS[7]; resid[2] = RATES[2] - CONSTANTS[8]*(ALGEBRAIC[19]+ALGEBRAIC[6]); resid[3] = RATES[3] - - CONSTANTS[9]*CONSTANTS[10]*ALGEBRAIC[6]; resid[4] = RATES[5] - CONSTANTS[22]*(ALGEBRAIC[69] - 0.500000*ALGEBRAIC[8]); resid[5] = RATES[4] - CONSTANTS[22]*(CONSTANTS[17] - ALGEBRAIC[69]); resid[6] = RATES[6] - (ALGEBRAIC[21] - STATES[6]*exp( ALGEBRAIC[20]*(1.00000 - STATES[2]/CONSTANTS[41])))/CONSTANTS[40]; } void computeVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC) { ALGEBRAIC[23] = ALGEBRAIC[21]/STATES[6]; } void computeEssentialVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC) { ALGEBRAIC[0] = CONSTANTS[1]*STATES[1]*(STATES[0] - CONSTANTS[2]); ALGEBRAIC[1] = (CONSTANTS[3]/(1.00000+pow(CONSTANTS[4]/STATES[2], 2.00000)))*(STATES[0] - CONSTANTS[2]); ALGEBRAIC[3] = 1.00000/(1.00000+exp(- (16.0000+STATES[0])/5.00000)); ALGEBRAIC[4] = CONSTANTS[12]*STATES[2]; ALGEBRAIC[5] = CONSTANTS[11]*(STATES[3] - STATES[2]); ALGEBRAIC[6] = ( CONSTANTS[14]*(ALGEBRAIC[5] - ALGEBRAIC[4]))/CONSTANTS[13]; ALGEBRAIC[8] = 0.200000* pow(fabs(STATES[5]), 1.0 / 2); ALGEBRAIC[2] = 1.00000/(1.00000+exp(- (20.0000+STATES[0])/12.0000)); ALGEBRAIC[18] = CONSTANTS[5]*ALGEBRAIC[2]*(STATES[0] - CONSTANTS[6]); ALGEBRAIC[19] = - ( CONSTANTS[15]*ALGEBRAIC[18]+ CONSTANTS[16]*STATES[2]); ALGEBRAIC[16] = CONSTANTS[43]*(ALGEBRAIC[8]/(CONSTANTS[44]+ALGEBRAIC[8])); ALGEBRAIC[20] = CONSTANTS[42]+ALGEBRAIC[16]; ALGEBRAIC[17] = pow(fabs(pow(STATES[6] - CONSTANTS[18], 2.00000) - 4.00000*pow(STATES[6], 2.00000)), 1.0 / 2); ALGEBRAIC[21] = 0.500000*((CONSTANTS[18] - STATES[6])+ALGEBRAIC[17]); ALGEBRAIC[13] = 0.165000*STATES[6]; ALGEBRAIC[15] = 0.0800000*(1.00000+( 2.00000*ALGEBRAIC[13])/CONSTANTS[37])+ 0.890000*pow(ALGEBRAIC[13]/CONSTANTS[37], 2.00000); ALGEBRAIC[14] = 0.135000*STATES[6]; ALGEBRAIC[65] = 0.0500000*ALGEBRAIC[21]; ALGEBRAIC[66] = pow(1.00000+ALGEBRAIC[13]/CONSTANTS[37], 2.00000)*(1.00000+ALGEBRAIC[14]/CONSTANTS[38]+ALGEBRAIC[65]/CONSTANTS[39]); ALGEBRAIC[67] = ALGEBRAIC[15]/ALGEBRAIC[66]; ALGEBRAIC[68] = CONSTANTS[36]*ALGEBRAIC[67]*(STATES[0] - CONSTANTS[2]); ALGEBRAIC[7] = 0.300000*STATES[4]; ALGEBRAIC[9] = pow(ALGEBRAIC[7], 2.00000)/CONSTANTS[28]; ALGEBRAIC[10] = CONSTANTS[45]+ALGEBRAIC[9]; ALGEBRAIC[27] = pow( ALGEBRAIC[7]*ALGEBRAIC[21], 2.00000)/( CONSTANTS[32]*CONSTANTS[28]*CONSTANTS[29]); ALGEBRAIC[28] = ALGEBRAIC[10]+ALGEBRAIC[27]; ALGEBRAIC[30] = ALGEBRAIC[28]; ALGEBRAIC[33] = ALGEBRAIC[30]; ALGEBRAIC[12] = ( STATES[5]*pow(ALGEBRAIC[7], 2.00000))/( CONSTANTS[27]*CONSTANTS[28]*CONSTANTS[33]); ALGEBRAIC[35] = ALGEBRAIC[33]+ALGEBRAIC[12]; ALGEBRAIC[37] = ( STATES[5]*pow(ALGEBRAIC[7], 2.00000)*pow(ALGEBRAIC[21], 2.00000))/( CONSTANTS[27]*CONSTANTS[28]*CONSTANTS[29]*CONSTANTS[33]*CONSTANTS[34]*CONSTANTS[32]); ALGEBRAIC[38] = ALGEBRAIC[35]+ALGEBRAIC[37]; ALGEBRAIC[41] = ALGEBRAIC[38]; ALGEBRAIC[44] = ALGEBRAIC[41]; ALGEBRAIC[22] = ( STATES[6]*STATES[6])/ALGEBRAIC[21]; ALGEBRAIC[46] = ( ALGEBRAIC[22]*pow(ALGEBRAIC[7], 2.00000))/( CONSTANTS[26]*CONSTANTS[28]*CONSTANTS[31]); ALGEBRAIC[47] = ALGEBRAIC[44]+ALGEBRAIC[46]; ALGEBRAIC[49] = ( ALGEBRAIC[22]*pow(ALGEBRAIC[7], 2.00000)*pow(ALGEBRAIC[21], 2.00000))/( CONSTANTS[26]*CONSTANTS[28]*CONSTANTS[29]*CONSTANTS[31]*CONSTANTS[35]*CONSTANTS[32]); ALGEBRAIC[50] = ALGEBRAIC[47]+ALGEBRAIC[49]; ALGEBRAIC[53] = ALGEBRAIC[50]; ALGEBRAIC[56] = ALGEBRAIC[53]; ALGEBRAIC[59] = ALGEBRAIC[56]; ALGEBRAIC[62] = ( ALGEBRAIC[22]*STATES[5]*pow(ALGEBRAIC[7], 2.00000)*pow(ALGEBRAIC[21], 2.00000))/( CONSTANTS[26]*CONSTANTS[27]*CONSTANTS[28]*CONSTANTS[29]*CONSTANTS[33]*CONSTANTS[31]*CONSTANTS[34]*CONSTANTS[35]*CONSTANTS[32]); ALGEBRAIC[63] = ALGEBRAIC[59]+ALGEBRAIC[62]; ALGEBRAIC[24] = pow(ALGEBRAIC[21], 2.00000)/CONSTANTS[29]; ALGEBRAIC[25] = CONSTANTS[23]+ALGEBRAIC[24]; ALGEBRAIC[26] = ALGEBRAIC[25]+ALGEBRAIC[9]; ALGEBRAIC[29] = ALGEBRAIC[26]+ALGEBRAIC[27]; ALGEBRAIC[11] = STATES[5]/CONSTANTS[27]; ALGEBRAIC[31] = ALGEBRAIC[29]+ALGEBRAIC[11]; ALGEBRAIC[32] = ( STATES[5]*pow(ALGEBRAIC[21], 2.00000))/( CONSTANTS[27]*CONSTANTS[29]*CONSTANTS[34]); ALGEBRAIC[34] = ALGEBRAIC[31]+ALGEBRAIC[32]; ALGEBRAIC[36] = ALGEBRAIC[34]+ALGEBRAIC[12]; ALGEBRAIC[39] = ALGEBRAIC[36]+ALGEBRAIC[37]; ALGEBRAIC[40] = ALGEBRAIC[22]/CONSTANTS[26]; ALGEBRAIC[42] = ALGEBRAIC[39]+ALGEBRAIC[40]; ALGEBRAIC[43] = ( ALGEBRAIC[22]*pow(ALGEBRAIC[21], 2.00000))/( CONSTANTS[26]*CONSTANTS[29]*CONSTANTS[35]); ALGEBRAIC[45] = ALGEBRAIC[42]+ALGEBRAIC[43]; ALGEBRAIC[48] = ALGEBRAIC[45]+ALGEBRAIC[46]; ALGEBRAIC[51] = ALGEBRAIC[48]+ALGEBRAIC[49]; ALGEBRAIC[52] = ( ALGEBRAIC[22]*STATES[5])/( CONSTANTS[26]*CONSTANTS[27]); ALGEBRAIC[54] = ALGEBRAIC[51]+ALGEBRAIC[52]; ALGEBRAIC[55] = ( ALGEBRAIC[22]*STATES[5]*pow(ALGEBRAIC[21], 2.00000))/( CONSTANTS[26]*CONSTANTS[27]*CONSTANTS[29]*CONSTANTS[34]*CONSTANTS[35]); ALGEBRAIC[57] = ALGEBRAIC[54]+ALGEBRAIC[55]; ALGEBRAIC[58] = ( ALGEBRAIC[22]*STATES[5]*pow(ALGEBRAIC[7], 2.00000))/( CONSTANTS[26]*CONSTANTS[27]*CONSTANTS[28]*CONSTANTS[33]*CONSTANTS[31]); ALGEBRAIC[60] = ALGEBRAIC[57]+ALGEBRAIC[58]; ALGEBRAIC[64] = ALGEBRAIC[60]+ALGEBRAIC[62]; ALGEBRAIC[61] = ALGEBRAIC[58]; ALGEBRAIC[69] = ( CONSTANTS[19]*CONSTANTS[30]*ALGEBRAIC[63]+ CONSTANTS[30]*ALGEBRAIC[61])/ALGEBRAIC[64]; } 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) { }