/* There are a total of 3 entries in the algebraic variable array. There are a total of 4 entries in each of the rate and state variable arrays. There are a total of 23 entries in the constant variable array. */ /* * VOI is time in component environment (minute). * STATES[0] is RA in component RA (nanomolar). * CONSTANTS[21] is v_s1 in component v_s1 (flux). * CONSTANTS[0] is k_d1 in component model_parameters (second_order_rate_constant). * CONSTANTS[1] is C in component RA (nanomolar). * CONSTANTS[2] is k_d5 in component RA (first_order_rate_constant). * STATES[1] is M_C in component M_C (nanomolar). * CONSTANTS[3] is V_0 in component M_C (flux). * CONSTANTS[4] is V_sC in component M_C (flux). * STATES[2] is F in component F (nanomolar). * CONSTANTS[5] is n in component M_C (dimensionless). * CONSTANTS[6] is K_A in component M_C (nanomolar). * CONSTANTS[7] is k_d3 in component model_parameters (first_order_rate_constant). * STATES[3] is C in component C (nanomolar). * CONSTANTS[8] is k_s2 in component model_parameters (first_order_rate_constant). * CONSTANTS[9] is k_d2 in component model_parameters (first_order_rate_constant). * CONSTANTS[10] is k_s3 in component model_parameters (first_order_rate_constant). * CONSTANTS[22] is M_F in component M_F (nanomolar). * CONSTANTS[11] is m in component F (dimensionless). * CONSTANTS[12] is K_I in component F (nanomolar). * CONSTANTS[13] is k_d4 in component model_parameters (first_order_rate_constant). * CONSTANTS[14] is k_s1 in component model_parameters (first_order_rate_constant). * CONSTANTS[15] is RALDH2_0 in component model_parameters (nanomolar). * CONSTANTS[16] is x in component model_parameters (dimensionless). * CONSTANTS[17] is L in component model_parameters (dimensionless). * CONSTANTS[18] is M_0 in component model_parameters (nanomolar). * ALGEBRAIC[0] is alpha_1 in component alpha_1 (dimensionless). * CONSTANTS[19] is K_r1 in component model_parameters (nanomolar). * ALGEBRAIC[1] is alpha_2 in component alpha_2 (dimensionless). * CONSTANTS[20] is K_r2 in component model_parameters (nanomolar). * ALGEBRAIC[2] is rho in component rho (dimensionless). * RATES[0] is d/dt RA in component RA (nanomolar). * RATES[1] is d/dt M_C in component M_C (nanomolar). * RATES[3] is d/dt C in component C (nanomolar). * RATES[2] is d/dt F in component F (nanomolar). */ void initConsts(double* CONSTANTS, double* RATES, double *STATES) { STATES[0] = 0.1; CONSTANTS[0] = 1; CONSTANTS[1] = 0.1; CONSTANTS[2] = 0; STATES[1] = 0.1; CONSTANTS[3] = 0.365; CONSTANTS[4] = 7.1; STATES[2] = 0.0001; CONSTANTS[5] = 2; CONSTANTS[6] = 0.2; CONSTANTS[7] = 1; STATES[3] = 0.1; CONSTANTS[8] = 1; CONSTANTS[9] = 0.28; CONSTANTS[10] = 1; CONSTANTS[11] = 2; CONSTANTS[12] = 0.2; CONSTANTS[13] = 1; CONSTANTS[14] = 1; CONSTANTS[15] = 7.1; CONSTANTS[16] = 15; CONSTANTS[17] = 50; CONSTANTS[18] = 5; CONSTANTS[19] = 1; CONSTANTS[20] = 1; CONSTANTS[21] = CONSTANTS[14]*CONSTANTS[15]*(1.00000 - CONSTANTS[16]/CONSTANTS[17]); CONSTANTS[22] = ( CONSTANTS[18]*CONSTANTS[16])/CONSTANTS[17]; } void computeRates(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC) { RATES[0] = (CONSTANTS[21] - CONSTANTS[0]*CONSTANTS[1]*STATES[0]) - CONSTANTS[2]*STATES[0]; RATES[1] = (CONSTANTS[3]+( CONSTANTS[4]*pow(STATES[2], CONSTANTS[5]))/(pow(CONSTANTS[6], CONSTANTS[5])+pow(STATES[2], CONSTANTS[5]))) - CONSTANTS[7]*STATES[1]; RATES[3] = CONSTANTS[8]*STATES[1] - CONSTANTS[9]*STATES[3]; RATES[2] = ( CONSTANTS[10]*CONSTANTS[22]*pow(CONSTANTS[12], CONSTANTS[11]))/(pow(CONSTANTS[12], CONSTANTS[11])+pow(STATES[0], CONSTANTS[11])) - CONSTANTS[13]*STATES[2]; } void computeVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC) { ALGEBRAIC[0] = STATES[0]/(STATES[0]+CONSTANTS[19]); ALGEBRAIC[1] = STATES[2]/(STATES[2]+CONSTANTS[20]); ALGEBRAIC[2] = ALGEBRAIC[1]/ALGEBRAIC[0]; }