/* There are a total of 2 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 30 entries in the constant variable array. */ /* * VOI is time in component environment (minute). * STATES[0] is cAMP in component cAMP (micromolar). * CONSTANTS[0] is Ko in component cAMP (dimensionless). * CONSTANTS[1] is Ka in component cAMP (per_micromolar). * CONSTANTS[2] is Kb in component cAMP (per_micromolar). * CONSTANTS[3] is Kdsm in component cAMP (micromolar). * CONSTANTS[4] is Vmsm in component cAMP (flux). * CONSTANTS[5] is Vdsm in component cAMP (flux). * ALGEBRAIC[0] is ACTH in component cAMP (micromolar). * ALGEBRAIC[1] is IS in component IS (dimensionless). * CONSTANTS[6] is Crpt in component IS (dimensionless). * CONSTANTS[7] is K in component IS (dimensionless). * CONSTANTS[8] is Kd in component IS (micromolar). * CONSTANTS[9] is n in component IS (dimensionless). * STATES[1] is V in component V (flux). * CONSTANTS[10] is P in component V (micromolar_per_minute2). * CONSTANTS[11] is Q in component V (first_order_rate_constant). * STATES[2] is W in component W (flux). * CONSTANTS[12] is T in component W (micromolar2_per_minute2). * CONSTANTS[13] is U in component W (first_order_rate_constant). * STATES[3] is CHOC in component CHOC (micromolar). * CONSTANTS[14] is Lmtr in component model_parameters (first_order_rate_constant). * STATES[4] is Kmtr in component Kmtr (first_order_rate_constant). * STATES[5] is CHOM in component CHOM (micromolar). * CONSTANTS[15] is Kbac in component model_parameters (first_order_rate_constant). * STATES[6] is Kfor in component Kfor (first_order_rate_constant). * CONSTANTS[16] is Kcb in component model_parameters (first_order_rate_constant). * CONSTANTS[17] is Kcf in component model_parameters (first_order_rate_constant). * STATES[7] is CHON in component CHON (micromolar). * STATES[8] is CHOL in component CHOL (micromolar). * CONSTANTS[18] is C in component Kmtr (per_minute2). * CONSTANTS[19] is D in component Kmtr (first_order_rate_constant). * CONSTANTS[20] is R in component Kfor (per_minute2). * CONSTANTS[21] is S in component Kfor (first_order_rate_constant). * CONSTANTS[22] is Vm in component model_parameters (flux). * CONSTANTS[23] is Km in component model_parameters (micromolar). * STATES[9] is PREG in component PREG (micromolar). * CONSTANTS[24] is Vmptr in component model_parameters (flux). * CONSTANTS[25] is Kmptr in component model_parameters (micromolar). * STATES[10] is PRO in component PRO (micromolar). * CONSTANTS[26] is HA in component PRO (dimensionless). * CONSTANTS[27] is AH in component model_parameters (first_order_rate_constant). * STATES[11] is HYPR in component HYPR (micromolar). * CONSTANTS[28] is HY in component model_parameters (first_order_rate_constant). * STATES[12] is CORT in component CORT (micromolar). * CONSTANTS[29] is LH in component CORT (first_order_rate_constant). * RATES[0] is d/dt cAMP in component cAMP (micromolar). * RATES[1] is d/dt V in component V (flux). * RATES[2] is d/dt W in component W (flux). * RATES[3] is d/dt CHOC in component CHOC (micromolar). * RATES[5] is d/dt CHOM in component CHOM (micromolar). * RATES[8] is d/dt CHOL in component CHOL (micromolar). * RATES[4] is d/dt Kmtr in component Kmtr (first_order_rate_constant). * RATES[6] is d/dt Kfor in component Kfor (first_order_rate_constant). * RATES[7] is d/dt CHON in component CHON (micromolar). * RATES[9] is d/dt PREG in component PREG (micromolar). * RATES[10] is d/dt PRO in component PRO (micromolar). * RATES[11] is d/dt HYPR in component HYPR (micromolar). * RATES[12] is d/dt CORT in component CORT (micromolar). */ void initConsts(double* CONSTANTS, double* RATES, double *STATES) { STATES[0] = 0.95; CONSTANTS[0] = 0.013; CONSTANTS[1] = 10; CONSTANTS[2] = 1000000.0; CONSTANTS[3] = 10.0; CONSTANTS[4] = 6.0; CONSTANTS[5] = 10.0; CONSTANTS[6] = 3.0; CONSTANTS[7] = 80.0; CONSTANTS[8] = 2.11; CONSTANTS[9] = 4.0; STATES[1] = 11.3; CONSTANTS[10] = 0.052; CONSTANTS[11] = 0.042; STATES[2] = 10.0; CONSTANTS[12] = 8.0; CONSTANTS[13] = 0.0015; STATES[3] = 532.0; CONSTANTS[14] = 1.65; STATES[4] = 0.446; STATES[5] = 139.0; CONSTANTS[15] = 10.0; STATES[6] = 0.370; CONSTANTS[16] = 0.01; CONSTANTS[17] = 0.00033; STATES[7] = 3.03; STATES[8] = 3000.0; CONSTANTS[18] = 6.25; CONSTANTS[19] = 125.0; CONSTANTS[20] = 3.0; CONSTANTS[21] = 76.0; CONSTANTS[22] = 1890.0; CONSTANTS[23] = 270.0; STATES[9] = 6.56; CONSTANTS[24] = 500.0; CONSTANTS[25] = 150.0; STATES[10] = 0.64; CONSTANTS[26] = 0.5; CONSTANTS[27] = 16.4; STATES[11] = 0.64; CONSTANTS[28] = 16.4; STATES[12] = 5.2; CONSTANTS[29] = 0.724; } void computeRates(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC) { RATES[2] = CONSTANTS[12]*pow(STATES[3], -1.00000) - CONSTANTS[13]*STATES[2]; RATES[3] = (STATES[1]+STATES[2]+ CONSTANTS[14]*STATES[5]) - STATES[4]*STATES[3]; RATES[5] = ( STATES[4]*STATES[3]+ CONSTANTS[15]*STATES[7]+ CONSTANTS[17]*STATES[8]) - ( CONSTANTS[14]*STATES[5]+ CONSTANTS[16]*STATES[5]+ STATES[6]*STATES[5]); RATES[8] = CONSTANTS[16]*STATES[5] - CONSTANTS[17]*STATES[8]; RATES[7] = STATES[6]*STATES[5] - ( CONSTANTS[15]*STATES[7]+( CONSTANTS[22]*STATES[7])/(CONSTANTS[23]+STATES[7])); RATES[9] = ( CONSTANTS[22]*STATES[7])/(CONSTANTS[23]+STATES[7]) - ( CONSTANTS[24]*STATES[9])/(CONSTANTS[25]+STATES[9]); RATES[10] = CONSTANTS[26]*(( CONSTANTS[24]*STATES[9])/(CONSTANTS[25]+STATES[9])) - CONSTANTS[27]*STATES[10]; RATES[11] = CONSTANTS[27]*STATES[10] - CONSTANTS[28]*STATES[11]; RATES[12] = CONSTANTS[28]*STATES[11] - CONSTANTS[29]*STATES[12]; ALGEBRAIC[0] = (VOI>=0.00000&&VOI<10.0000 ? 1.20000e-05 : VOI>=10.0000&&VOI<20.0000 ? 1.60000e-05 : VOI>=20.0000&&VOI<35.0000 ? 1.20000e-05 : VOI>=35.0000&&VOI<45.0000 ? 1.60000e-05 : 1.20000e-05); RATES[0] = ( CONSTANTS[4]*CONSTANTS[0]*(1.00000+ CONSTANTS[2]*ALGEBRAIC[0]))/((1.00000+ CONSTANTS[1]*ALGEBRAIC[0])+ CONSTANTS[0]*(1.00000+ CONSTANTS[2]*ALGEBRAIC[0])) - ( CONSTANTS[5]*STATES[0])/(CONSTANTS[3]+STATES[0]); ALGEBRAIC[1] = ( CONSTANTS[7]*CONSTANTS[6]*pow(STATES[0], CONSTANTS[9]))/(pow(CONSTANTS[8], CONSTANTS[9])+pow(STATES[0], CONSTANTS[9])); RATES[1] = CONSTANTS[10]*ALGEBRAIC[1] - CONSTANTS[11]*STATES[1]; RATES[4] = CONSTANTS[18]*ALGEBRAIC[1] - CONSTANTS[19]*STATES[4]; RATES[6] = CONSTANTS[20]*ALGEBRAIC[1] - CONSTANTS[21]*STATES[6]; } void computeVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC) { ALGEBRAIC[0] = (VOI>=0.00000&&VOI<10.0000 ? 1.20000e-05 : VOI>=10.0000&&VOI<20.0000 ? 1.60000e-05 : VOI>=20.0000&&VOI<35.0000 ? 1.20000e-05 : VOI>=35.0000&&VOI<45.0000 ? 1.60000e-05 : 1.20000e-05); ALGEBRAIC[1] = ( CONSTANTS[7]*CONSTANTS[6]*pow(STATES[0], CONSTANTS[9]))/(pow(CONSTANTS[8], CONSTANTS[9])+pow(STATES[0], CONSTANTS[9])); }