/* There are a total of 4 entries in the algebraic variable array. There are a total of 1 entries in each of the rate and state variable arrays. There are a total of 17 entries in the constant variable array. */ /* * VOI is time in component environment (minute). * CONSTANTS[0] is CNA in component antidiuretic_hormone (monovalent_mEq_per_litre). * CONSTANTS[1] is PA1 in component antidiuretic_hormone (mmHg). * CONSTANTS[12] is ADHNA in component osmotic_control_of_ADH_secretion (dimensionless). * CONSTANTS[2] is CNR in component parameter_values (monovalent_mEq_per_litre). * CONSTANTS[11] is ADHNA1 in component osmotic_control_of_ADH_secretion (dimensionless). * CONSTANTS[14] is ADHPR in component pressure_control_of_ADH_secretion (dimensionless). * CONSTANTS[3] is ADHPUL in component parameter_values (mmHg). * CONSTANTS[4] is ADHPAM in component parameter_values (per_mmHg2). * CONSTANTS[13] is ADHPA in component pressure_control_of_ADH_secretion (mmHg). * CONSTANTS[16] is ADH in component total_ADH_secretion (dimensionless). * CONSTANTS[5] is ADHINF in component parameter_values (dimensionless). * CONSTANTS[15] is ADH1 in component total_ADH_secretion (dimensionless). * STATES[0] is ADHC in component ADH_in_blood (dimensionless). * CONSTANTS[6] is ADHTC in component parameter_values (minute). * ALGEBRAIC[1] is ADHMV in component ADH_effect_on_nonrenal_vascular_resistance (dimensionless). * CONSTANTS[7] is ADHVUL in component parameter_values (dimensionless). * CONSTANTS[8] is ADHVLL in component parameter_values (dimensionless). * ALGEBRAIC[0] is ADHMV1 in component ADH_effect_on_nonrenal_vascular_resistance (dimensionless). * ALGEBRAIC[3] is ADHMK in component ADH_effect_on_kidney (dimensionless). * CONSTANTS[9] is ADHKLL in component parameter_values (dimensionless). * CONSTANTS[10] is ADHKUL in component parameter_values (dimensionless). * ALGEBRAIC[2] is ADHMK1 in component ADH_effect_on_kidney (dimensionless). * RATES[0] is d/dt ADHC in component ADH_in_blood (dimensionless). * There are a total of 2 condition variables. */ void initConsts(double* CONSTANTS, double* RATES, double *STATES) { CONSTANTS[0] = 142.035; CONSTANTS[1] = 103.525; CONSTANTS[2] = 139; CONSTANTS[3] = 85; CONSTANTS[4] = 0.3; CONSTANTS[5] = 0; STATES[0] = 1.0; CONSTANTS[6] = 15; CONSTANTS[7] = 2.5; CONSTANTS[8] = 0.93617; CONSTANTS[9] = 0.2; CONSTANTS[10] = 5; CONSTANTS[11] = (CONSTANTS[0] - CONSTANTS[2])/(142.000 - CONSTANTS[2]); CONSTANTS[12] = (CONSTANTS[11]<0.00000 ? 0.00000 : CONSTANTS[11]); CONSTANTS[13] = (CONSTANTS[1]>CONSTANTS[3] ? CONSTANTS[3] : CONSTANTS[1]); CONSTANTS[14] = pow(CONSTANTS[3] - CONSTANTS[13], 2.00000)*CONSTANTS[4]; CONSTANTS[15] = CONSTANTS[12]+CONSTANTS[14]+CONSTANTS[5]; CONSTANTS[16] = (CONSTANTS[15]<0.00000 ? 0.00000 : CONSTANTS[15]); RATES[0] = 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[16] - STATES[0])/CONSTANTS[6]; } void computeVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC) { ALGEBRAIC[0] = CONSTANTS[7] - (CONSTANTS[7] - 1.00000)/( ((CONSTANTS[8] - 1.00000)/(CONSTANTS[8] - CONSTANTS[7]))*(STATES[0] - 1.00000)+1.00000); ALGEBRAIC[1] = (CONDVAR[0]<0.00000 ? CONSTANTS[8] : ALGEBRAIC[0]); ALGEBRAIC[2] = CONSTANTS[10] - (CONSTANTS[10] - 1.00000)/( ((CONSTANTS[9] - 1.00000)/(CONSTANTS[9] - CONSTANTS[10]))*(STATES[0] - 1.00000)+1.00000); ALGEBRAIC[3] = (CONDVAR[1]<0.00000 ? CONSTANTS[9] : ALGEBRAIC[2]); } void computeEssentialVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC) { } void getStateInformation(double* SI) { SI[0] = 1.0; } void computeRoots(double VOI, double* CONSTANTS, double* RATES, double* OLDRATES, double* STATES, double* OLDSTATES, double* ALGEBRAIC, double* CONDVARS) { CONDVAR[0] = ALGEBRAIC[0] - CONSTANTS[8]; CONDVAR[1] = ALGEBRAIC[2] - CONSTANTS[9]; }