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 4 entries in the algebraic variable array. There are a total of 3 entries in each of the rate and state variable arrays. There are a total of 14 entries in the constant variable array. */ /* * VOI is time in component environment (min). * STATES[0] is Z in component Ca (uM). * STATES[1] is Y in component Ca (uM). * CONSTANTS[13] is V_in in component V_in (uM_per_min). * ALGEBRAIC[0] is V_2 in component V_2 (uM_per_min). * ALGEBRAIC[3] is V_3 in component V_3 (uM_per_min). * CONSTANTS[0] is K_f in component Ca (per_min). * CONSTANTS[1] is K in component Ca (per_min). * CONSTANTS[2] is beta in component Ca_flux (dimensionless). * CONSTANTS[3] is v_0 in component V_in (uM_per_min). * CONSTANTS[4] is v_1 in component V_in (uM_per_min). * CONSTANTS[5] is V_M2 in component V_2 (uM_per_min). * CONSTANTS[6] is K_2 in component V_2 (uM). * CONSTANTS[7] is K_y in component V_3 (uM). * CONSTANTS[8] is V_M3 in component V_3 (uM_per_min). * ALGEBRAIC[2] is R_plus in component Ca_channels (dimensionless). * STATES[2] is rho in component Ca_channels (dimensionless). * ALGEBRAIC[1] is gamma in component gamma (dimensionless). * CONSTANTS[9] is k_d in component Ca_channels (per_min). * CONSTANTS[10] is k_r in component Ca_channels (per_min). * CONSTANTS[11] is a in component gamma (per_min). * CONSTANTS[12] is d in component gamma (per_min). * RATES[0] is d/dt Z in component Ca (uM). * RATES[1] is d/dt Y in component Ca (uM). * RATES[2] is d/dt rho in component Ca_channels (dimensionless). */ void initConsts(double* CONSTANTS, double* RATES, double *STATES) { STATES[0] = 0.3; STATES[1] = 2.7; CONSTANTS[0] = 1; CONSTANTS[1] = 10; CONSTANTS[2] = 1; CONSTANTS[3] = 1; CONSTANTS[4] = 1; CONSTANTS[5] = 6.5; CONSTANTS[6] = 0.1; CONSTANTS[7] = 0.2; CONSTANTS[8] = 50; STATES[2] = 0.2; CONSTANTS[9] = 5000.0; CONSTANTS[10] = 5.0; CONSTANTS[11] = 10000.0; CONSTANTS[12] = 100.0; CONSTANTS[13] = CONSTANTS[3]+ CONSTANTS[4]*CONSTANTS[2]; } void computeRates(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC) { RATES[2] = - ( CONSTANTS[9]*pow(STATES[0], 4.00000)*STATES[2]*1.00000)+ CONSTANTS[10]*(1.00000 - STATES[2]); ALGEBRAIC[0] = CONSTANTS[5]*(pow(STATES[0], 2.00000)/(pow(CONSTANTS[6], 2.00000)+pow(STATES[0], 2.00000))); ALGEBRAIC[1] = (CONSTANTS[11]/CONSTANTS[12])*pow(STATES[0], 4.00000)*1.00000; ALGEBRAIC[2] = ALGEBRAIC[1]*(STATES[2]/(1.00000+ALGEBRAIC[1])); ALGEBRAIC[3] = CONSTANTS[2]*ALGEBRAIC[2]*CONSTANTS[8]*(pow(STATES[1], 2.00000)/(pow(CONSTANTS[7], 2.00000)+pow(STATES[1], 2.00000))); RATES[0] = (CONSTANTS[13] - ALGEBRAIC[0])+ALGEBRAIC[3]+( CONSTANTS[0]*STATES[1] - CONSTANTS[1]*STATES[0]); RATES[1] = (ALGEBRAIC[0] - ALGEBRAIC[3]) - CONSTANTS[0]*STATES[1]; } void computeVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC) { ALGEBRAIC[0] = CONSTANTS[5]*(pow(STATES[0], 2.00000)/(pow(CONSTANTS[6], 2.00000)+pow(STATES[0], 2.00000))); ALGEBRAIC[1] = (CONSTANTS[11]/CONSTANTS[12])*pow(STATES[0], 4.00000)*1.00000; ALGEBRAIC[2] = ALGEBRAIC[1]*(STATES[2]/(1.00000+ALGEBRAIC[1])); ALGEBRAIC[3] = CONSTANTS[2]*ALGEBRAIC[2]*CONSTANTS[8]*(pow(STATES[1], 2.00000)/(pow(CONSTANTS[7], 2.00000)+pow(STATES[1], 2.00000))); }