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 17 entries in the algebraic variable array. There are a total of 13 entries in each of the rate and state variable arrays. There are a total of 38 entries in the constant variable array. */ /* * VOI is t in component all (s). * STATES[0] is Ca in component all (uM). * ALGEBRAIC[10] is L in component all (uM). * CONSTANTS[0] is Ls in component all (uM). * CONSTANTS[1] is ts in component all (s). * STATES[1] is Gd in component all (per_um2). * STATES[2] is Gt in component all (per_um2). * STATES[3] is R in component all (per_um2). * STATES[4] is Rl in component all (per_um2). * STATES[5] is Rg in component all (per_um2). * STATES[6] is Rlg in component all (per_um2). * STATES[7] is Rlgp in component all (per_um2). * STATES[8] is IP3 in component all (uM). * CONSTANTS[2] is PIP2 in component all (per_um2). * STATES[9] is Pc in component all (per_um2). * STATES[10] is Pcg in component all (per_um2). * STATES[11] is P in component all (per_um2). * STATES[12] is Pg in component all (per_um2). * ALGEBRAIC[11] is J1 in component all (per_um2_per_s). * CONSTANTS[3] is kf1 in component all (per_uM_per_s). * CONSTANTS[31] is kr1 in component all (per_s). * CONSTANTS[4] is Kd1 in component all (uM). * ALGEBRAIC[12] is J2 in component all (per_um2_per_s). * CONSTANTS[5] is kf2 in component all (um2_per_s). * CONSTANTS[32] is kr2 in component all (per_s). * CONSTANTS[6] is Kd2 in component all (per_um2). * ALGEBRAIC[13] is J3 in component all (per_um2_per_s). * CONSTANTS[7] is kf3 in component all (um2_per_s). * CONSTANTS[8] is kr3 in component all (per_s). * ALGEBRAIC[14] is J4 in component all (per_um2_per_s). * CONSTANTS[9] is kf4 in component all (per_uM_per_s). * CONSTANTS[33] is kr4 in component all (per_s). * CONSTANTS[10] is Kd4 in component all (uM). * ALGEBRAIC[15] is J5 in component all (per_um2_per_s). * CONSTANTS[11] is kf5 in component all (per_s). * ALGEBRAIC[16] is J6 in component all (per_um2_per_s). * CONSTANTS[12] is kf6 in component all (per_s). * ALGEBRAIC[9] is J7 in component all (per_um2_per_s). * CONSTANTS[13] is kf7 in component all (per_s). * ALGEBRAIC[7] is J8 in component all (per_um2_per_s). * CONSTANTS[14] is kf8 in component all (per_uM_per_s). * CONSTANTS[15] is kr8 in component all (per_s). * ALGEBRAIC[8] is J9 in component all (per_um2_per_s). * CONSTANTS[16] is kf9 in component all (um2_per_s). * CONSTANTS[17] is kr9 in component all (per_s). * ALGEBRAIC[6] is J10 in component all (per_um2_per_s). * CONSTANTS[18] is kf10 in component all (um2_per_s). * CONSTANTS[19] is kr10 in component all (per_s). * ALGEBRAIC[4] is J11 in component all (per_um2_per_s). * CONSTANTS[20] is kf11 in component all (per_uM_per_s). * CONSTANTS[34] is kr11 in component all (per_s). * CONSTANTS[21] is Kd11 in component all (uM). * ALGEBRAIC[2] is J12 in component all (per_um2_per_s). * CONSTANTS[22] is kf12 in component all (per_s). * ALGEBRAIC[0] is J13 in component all (per_um2_per_s). * CONSTANTS[23] is kf13 in component all (per_s). * ALGEBRAIC[3] is J14 in component all (per_um2_per_s). * CONSTANTS[24] is kf14 in component all (per_s). * CONSTANTS[25] is Km14 in component all (uM). * ALGEBRAIC[5] is J15 in component all (per_um2_per_s). * CONSTANTS[26] is kf15 in component all (per_s). * CONSTANTS[27] is Km15 in component all (uM). * ALGEBRAIC[1] is J16 in component all (uM_per_s). * CONSTANTS[28] is kf16 in component all (per_s). * CONSTANTS[37] is Cpc in component all (uM_um2). * CONSTANTS[35] is Cc in component all (uM). * CONSTANTS[36] is Cp in component all (per_um2). * CONSTANTS[29] is Vc in component all (um3). * CONSTANTS[30] is Rpc in component all (per_um). * RATES[11] is d/dt P in component all (per_um2). * RATES[12] is d/dt Pg in component all (per_um2). * RATES[9] is d/dt Pc in component all (per_um2). * RATES[10] is d/dt Pcg in component all (per_um2). * RATES[8] is d/dt IP3 in component all (uM). * RATES[1] is d/dt Gd in component all (per_um2). * RATES[2] is d/dt Gt in component all (per_um2). * RATES[0] is d/dt Ca in component all (uM). * RATES[3] is d/dt R in component all (per_um2). * RATES[4] is d/dt Rl in component all (per_um2). * RATES[5] is d/dt Rg in component all (per_um2). * RATES[7] is d/dt Rlgp in component all (per_um2). * RATES[6] is d/dt Rlg in component all (per_um2). */ void initConsts(double* CONSTANTS, double* RATES, double *STATES) { STATES[0] = 0.1; CONSTANTS[0] = 0.1; CONSTANTS[1] = 10; STATES[1] = 10000; STATES[2] = 0; STATES[3] = 13.9; STATES[4] = 0; STATES[5] = 5.06; STATES[6] = 0; STATES[7] = 0; STATES[8] = 0.015; CONSTANTS[2] = 4000; STATES[9] = 9.09; STATES[10] = 0; STATES[11] = 90.9; STATES[12] = 0; CONSTANTS[3] = 0.0003; CONSTANTS[4] = 3e-5; CONSTANTS[5] = 2.75e-4; CONSTANTS[6] = 27500; CONSTANTS[7] = 1; CONSTANTS[8] = 0.001; CONSTANTS[9] = 0.3; CONSTANTS[10] = 3e-5; CONSTANTS[11] = 0.0004; CONSTANTS[12] = 1; CONSTANTS[13] = 0.15; CONSTANTS[14] = 0.0167; CONSTANTS[15] = 0.0167; CONSTANTS[16] = 0.0042; CONSTANTS[17] = 1; CONSTANTS[18] = 0.042; CONSTANTS[19] = 1; CONSTANTS[20] = 0.0334; CONSTANTS[21] = 0.1; CONSTANTS[22] = 6; CONSTANTS[23] = 6; CONSTANTS[24] = 0.444; CONSTANTS[25] = 19.8; CONSTANTS[26] = 3.8; CONSTANTS[27] = 5; CONSTANTS[28] = 1.25; CONSTANTS[29] = 2550; CONSTANTS[30] = 4.61; CONSTANTS[31] = CONSTANTS[3]*CONSTANTS[4]; CONSTANTS[32] = CONSTANTS[5]*CONSTANTS[6]; CONSTANTS[33] = CONSTANTS[9]*CONSTANTS[10]; CONSTANTS[34] = CONSTANTS[20]*CONSTANTS[21]; CONSTANTS[35] = 1.00000/( CONSTANTS[29]*602.200); CONSTANTS[36] = 1.00000/( CONSTANTS[29]*CONSTANTS[30]); CONSTANTS[37] = CONSTANTS[35]/CONSTANTS[36]; } void computeRates(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC) { ALGEBRAIC[3] = ( CONSTANTS[24]*STATES[9]*CONSTANTS[2])/(CONSTANTS[25]/CONSTANTS[37]+CONSTANTS[2]); ALGEBRAIC[5] = ( CONSTANTS[26]*STATES[10]*CONSTANTS[2])/(CONSTANTS[27]/CONSTANTS[37]+CONSTANTS[2]); ALGEBRAIC[1] = CONSTANTS[28]*STATES[8]; RATES[8] = CONSTANTS[37]*(ALGEBRAIC[3]+ALGEBRAIC[5]) - ALGEBRAIC[1]; ALGEBRAIC[6] = CONSTANTS[18]*STATES[9]*STATES[2] - CONSTANTS[19]*STATES[10]; ALGEBRAIC[4] = CONSTANTS[20]*STATES[12]*STATES[0] - CONSTANTS[34]*STATES[10]; ALGEBRAIC[2] = CONSTANTS[22]*STATES[10]; RATES[10] = (ALGEBRAIC[6]+ALGEBRAIC[4]) - ALGEBRAIC[2]; ALGEBRAIC[7] = CONSTANTS[14]*STATES[11]*STATES[0] - CONSTANTS[15]*STATES[9]; RATES[9] = (ALGEBRAIC[7]+ALGEBRAIC[2]) - ALGEBRAIC[6]; RATES[0] = CONSTANTS[37]*- 1.00000*(ALGEBRAIC[7]+ALGEBRAIC[4]); ALGEBRAIC[8] = CONSTANTS[16]*STATES[11]*STATES[2] - CONSTANTS[17]*STATES[12]; ALGEBRAIC[0] = CONSTANTS[23]*STATES[12]; RATES[11] = ALGEBRAIC[0] - (ALGEBRAIC[8]+ALGEBRAIC[7]); RATES[12] = ALGEBRAIC[8] - (ALGEBRAIC[4]+ALGEBRAIC[0]); ALGEBRAIC[10] = (VOI<CONSTANTS[1]+0.150000&&VOI>=CONSTANTS[1] ? CONSTANTS[0]/(1.00000+exp( - 80.0000*((VOI - CONSTANTS[1]) - 0.0500000))) : VOI>=CONSTANTS[1]+0.150000 ? CONSTANTS[0] : 0.00000); ALGEBRAIC[11] = CONSTANTS[3]*STATES[3]*ALGEBRAIC[10] - CONSTANTS[31]*STATES[4]; ALGEBRAIC[12] = CONSTANTS[5]*STATES[3]*STATES[1] - CONSTANTS[32]*STATES[5]; RATES[3] = - 1.00000*(ALGEBRAIC[11]+ALGEBRAIC[12]); ALGEBRAIC[13] = CONSTANTS[7]*STATES[4]*STATES[1] - CONSTANTS[8]*STATES[6]; ALGEBRAIC[9] = CONSTANTS[13]*STATES[2]; RATES[1] = (ALGEBRAIC[9]+ALGEBRAIC[0]+ALGEBRAIC[2]) - (ALGEBRAIC[12]+ALGEBRAIC[13]); ALGEBRAIC[14] = CONSTANTS[9]*ALGEBRAIC[10]*STATES[5] - CONSTANTS[33]*STATES[6]; RATES[5] = ALGEBRAIC[12] - ALGEBRAIC[14]; ALGEBRAIC[15] = CONSTANTS[11]*STATES[6]; RATES[7] = ALGEBRAIC[15]; ALGEBRAIC[16] = CONSTANTS[12]*STATES[6]; RATES[2] = ALGEBRAIC[16] - (ALGEBRAIC[9]+ALGEBRAIC[8]+ALGEBRAIC[6]); RATES[4] = (ALGEBRAIC[11]+ALGEBRAIC[16]) - ALGEBRAIC[13]; RATES[6] = ((ALGEBRAIC[13] - ALGEBRAIC[15])+ALGEBRAIC[14]) - ALGEBRAIC[16]; } void computeVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC) { ALGEBRAIC[3] = ( CONSTANTS[24]*STATES[9]*CONSTANTS[2])/(CONSTANTS[25]/CONSTANTS[37]+CONSTANTS[2]); ALGEBRAIC[5] = ( CONSTANTS[26]*STATES[10]*CONSTANTS[2])/(CONSTANTS[27]/CONSTANTS[37]+CONSTANTS[2]); ALGEBRAIC[1] = CONSTANTS[28]*STATES[8]; ALGEBRAIC[6] = CONSTANTS[18]*STATES[9]*STATES[2] - CONSTANTS[19]*STATES[10]; ALGEBRAIC[4] = CONSTANTS[20]*STATES[12]*STATES[0] - CONSTANTS[34]*STATES[10]; ALGEBRAIC[2] = CONSTANTS[22]*STATES[10]; ALGEBRAIC[7] = CONSTANTS[14]*STATES[11]*STATES[0] - CONSTANTS[15]*STATES[9]; ALGEBRAIC[8] = CONSTANTS[16]*STATES[11]*STATES[2] - CONSTANTS[17]*STATES[12]; ALGEBRAIC[0] = CONSTANTS[23]*STATES[12]; ALGEBRAIC[10] = (VOI<CONSTANTS[1]+0.150000&&VOI>=CONSTANTS[1] ? CONSTANTS[0]/(1.00000+exp( - 80.0000*((VOI - CONSTANTS[1]) - 0.0500000))) : VOI>=CONSTANTS[1]+0.150000 ? CONSTANTS[0] : 0.00000); ALGEBRAIC[11] = CONSTANTS[3]*STATES[3]*ALGEBRAIC[10] - CONSTANTS[31]*STATES[4]; ALGEBRAIC[12] = CONSTANTS[5]*STATES[3]*STATES[1] - CONSTANTS[32]*STATES[5]; ALGEBRAIC[13] = CONSTANTS[7]*STATES[4]*STATES[1] - CONSTANTS[8]*STATES[6]; ALGEBRAIC[9] = CONSTANTS[13]*STATES[2]; ALGEBRAIC[14] = CONSTANTS[9]*ALGEBRAIC[10]*STATES[5] - CONSTANTS[33]*STATES[6]; ALGEBRAIC[15] = CONSTANTS[11]*STATES[6]; ALGEBRAIC[16] = CONSTANTS[12]*STATES[6]; }