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 5 entries in the algebraic variable array. There are a total of 2 entries in each of the rate and state variable arrays. There are a total of 7 entries in the constant variable array. */ /* * VOI is time in component environment (second). * ALGEBRAIC[0] is kappa_L1 in component rate_constants (per_second). * CONSTANTS[0] is kappa_P1 in component rate_constants (per_second). * ALGEBRAIC[2] is kappa_L2 in component rate_constants (per_second). * CONSTANTS[1] is kappa_P2 in component rate_constants (per_second). * CONSTANTS[2] is kappa_L2_0 in component rate_constants (per_second). * CONSTANTS[3] is kappa_L2_1 in component rate_constants (per_second). * ALGEBRAIC[1] is Kd_Ca in component rate_constants (nanomolar). * CONSTANTS[4] is n in component rate_constants (dimensionless). * STATES[0] is Ca_i in component cytosolic_calcium (nanomolar). * CONSTANTS[5] is Ca_o in component cytosolic_calcium (nanomolar). * ALGEBRAIC[3] is Ca_i_ss in component cytosolic_calcium (nanomolar). * CONSTANTS[6] is gamma in component cytosolic_calcium (dimensionless). * STATES[1] is Ca_s in component subspace_calcium (nanomolar). * ALGEBRAIC[4] is Ca_s_ss in component subspace_calcium (nanomolar). * RATES[0] is d/dt Ca_i in component cytosolic_calcium (nanomolar). * RATES[1] is d/dt Ca_s in component subspace_calcium (nanomolar). */ void initConsts(double* CONSTANTS, double* RATES, double *STATES) { CONSTANTS[0] = 0.132; CONSTANTS[1] = 3.78; CONSTANTS[2] = 0.054; CONSTANTS[3] = 2.4; CONSTANTS[4] = 3; STATES[0] = 100.0; CONSTANTS[5] = 1000000.0; CONSTANTS[6] = 0.24; STATES[1] = 10.0; } void computeRates(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC) { ALGEBRAIC[0] = (VOI>=0.00000&&VOI<30.0000 ? 5.00000e-06 : 2.00000e-05); ALGEBRAIC[1] = (VOI>=0.00000&&VOI<60.0000 ? 1.00000 : 0.500000); ALGEBRAIC[2] = CONSTANTS[2]+CONSTANTS[3]/(1.00000+pow(ALGEBRAIC[1]/STATES[0], CONSTANTS[4])); RATES[0] = - (ALGEBRAIC[0]+CONSTANTS[0]+ CONSTANTS[6]*(ALGEBRAIC[2]+CONSTANTS[1]))*STATES[0]+ CONSTANTS[6]*ALGEBRAIC[2]*STATES[1]+ ALGEBRAIC[0]*CONSTANTS[5]; RATES[1] = (ALGEBRAIC[2]+CONSTANTS[1])*STATES[0] - ALGEBRAIC[2]*STATES[1]; } void computeVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC) { ALGEBRAIC[0] = (VOI>=0.00000&&VOI<30.0000 ? 5.00000e-06 : 2.00000e-05); ALGEBRAIC[1] = (VOI>=0.00000&&VOI<60.0000 ? 1.00000 : 0.500000); ALGEBRAIC[2] = CONSTANTS[2]+CONSTANTS[3]/(1.00000+pow(ALGEBRAIC[1]/STATES[0], CONSTANTS[4])); ALGEBRAIC[3] = CONSTANTS[5]/(1.00000+CONSTANTS[0]/ALGEBRAIC[0]); ALGEBRAIC[4] = ALGEBRAIC[3]*(1.00000+CONSTANTS[1]/ALGEBRAIC[2]); }