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 3 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 20 entries in the constant variable array. */ /* * VOI is time in component environment (minute). * CONSTANTS[0] is V_0 in component Vin (micromolar_per_minute). * CONSTANTS[1] is V_1 in component Vin (micromolar_per_minute). * CONSTANTS[2] is beta in component Vin (dimensionless). * CONSTANTS[19] is V_in in component Vin (micromolar_per_minute). * CONSTANTS[3] is V_M2 in component V2 (micromolar_per_minute). * STATES[0] is Z in component cytosol (micromolar). * CONSTANTS[4] is K_2 in component V2 (micromolar). * ALGEBRAIC[0] is V_2 in component V2 (micromolar_per_minute). * CONSTANTS[5] is V_M3 in component V3 (micromolar_per_minute). * CONSTANTS[6] is K_Z in component V3 (micromolar). * CONSTANTS[7] is K_A in component V3 (micromolar). * CONSTANTS[8] is K_Y in component V3 (micromolar). * CONSTANTS[9] is m in component V3 (dimensionless). * STATES[1] is Y in component internal_pool (micromolar). * STATES[2] is A in component InsP3_conc (micromolar). * ALGEBRAIC[1] is V_3 in component V3 (micromolar_per_minute). * CONSTANTS[10] is V_M5 in component V5 (micromolar_per_minute). * CONSTANTS[11] is K_5 in component V5 (micromolar). * CONSTANTS[12] is K_d in component V5 (micromolar). * CONSTANTS[13] is p in component V5 (dimensionless). * CONSTANTS[14] is n in component V5 (dimensionless). * ALGEBRAIC[2] is V_5 in component V5 (micromolar_per_minute). * CONSTANTS[15] is k in component cytosol (per_minute). * CONSTANTS[16] is k_f in component cytosol (per_minute). * CONSTANTS[17] is epsilon in component InsP3_conc (per_minute). * CONSTANTS[18] is V_4 in component InsP3_conc (micromolar_per_minute). * RATES[0] is d/dt Z in component cytosol (micromolar). * RATES[1] is d/dt Y in component internal_pool (micromolar). * RATES[2] is d/dt A in component InsP3_conc (micromolar). * There are a total of 0 condition variables. */ void initConsts(double* CONSTANTS, double* RATES, double *STATES) { CONSTANTS[0] = 2; CONSTANTS[1] = 2; CONSTANTS[2] = 0.6; CONSTANTS[3] = 6; STATES[0] = 0.15; CONSTANTS[4] = 0.1; CONSTANTS[5] = 20; CONSTANTS[6] = 0.5; CONSTANTS[7] = 0.2; CONSTANTS[8] = 0.2; CONSTANTS[9] = 2; STATES[1] = 1; STATES[2] = 0.42; CONSTANTS[10] = 5; CONSTANTS[11] = 1; CONSTANTS[12] = 0.4; CONSTANTS[13] = 2; CONSTANTS[14] = 4; CONSTANTS[15] = 10; CONSTANTS[16] = 1; CONSTANTS[17] = 0.1; CONSTANTS[18] = 2; CONSTANTS[19] = CONSTANTS[0]+ CONSTANTS[1]*CONSTANTS[2]; RATES[0] = 0.1001; RATES[1] = 0.1001; RATES[2] = 0.1001; } void computeResiduals(double VOI, double* CONSTANTS, double* RATES, double* OLDRATES, double* STATES, double* OLDSTATES, double* ALGEBRAIC, double* CONDVARS) { resid[0] = RATES[0] - ((CONSTANTS[19] - ALGEBRAIC[0])+ALGEBRAIC[1]+ CONSTANTS[16]*STATES[1]) - CONSTANTS[15]*STATES[0]; resid[1] = RATES[1] - (ALGEBRAIC[0] - ALGEBRAIC[1]) - CONSTANTS[16]*STATES[1]; resid[2] = RATES[2] - ( CONSTANTS[2]*CONSTANTS[18] - ALGEBRAIC[2]) - CONSTANTS[17]*STATES[2]; } 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[0] = ( CONSTANTS[3]*pow(STATES[0], 2.00000))/(pow(CONSTANTS[4], 2.00000)+pow(STATES[0], 2.00000)); ALGEBRAIC[1] = ( (( (( CONSTANTS[5]*pow(STATES[0], CONSTANTS[9]))/(pow(CONSTANTS[6], CONSTANTS[9])+pow(STATES[0], CONSTANTS[9])))*pow(STATES[1], 2.00000))/(pow(CONSTANTS[8], 2.00000)+pow(STATES[1], 2.00000)))*pow(STATES[2], 4.00000))/(pow(CONSTANTS[7], 4.00000)+pow(STATES[2], 4.00000)); ALGEBRAIC[2] = ( (( CONSTANTS[10]*pow(STATES[2], CONSTANTS[13]))/(pow(CONSTANTS[11], CONSTANTS[13])+pow(STATES[2], CONSTANTS[13])))*pow(STATES[0], CONSTANTS[14]))/(pow(CONSTANTS[12], CONSTANTS[14])+pow(STATES[0], CONSTANTS[14])); } void getStateInformation(double* SI) { SI[0] = 1.0; SI[1] = 1.0; SI[2] = 1.0; } void computeRoots(double VOI, double* CONSTANTS, double* RATES, double* OLDRATES, double* STATES, double* OLDSTATES, double* ALGEBRAIC, double* CONDVARS) { }