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 2 entries in the algebraic variable array.
   There are a total of 58 entries in each of the rate and state variable arrays.
   There are a total of 72 entries in the constant variable array.
 */
/*
 * VOI is time in component environment (minute).
 * CONSTANTS[0] is ADHMK in component kidney (dimensionless).
 * CONSTANTS[1] is AMK in component kidney (dimensionless).
 * CONSTANTS[2] is AMNA in component kidney (dimensionless).
 * CONSTANTS[3] is ANM in component kidney (dimensionless).
 * CONSTANTS[4] is ANPX in component kidney (dimensionless).
 * CONSTANTS[5] is AUM in component kidney (dimensionless).
 * CONSTANTS[6] is CKE in component kidney (monovalent_mEq_per_litre).
 * CONSTANTS[7] is CNA in component kidney (monovalent_mEq_per_litre).
 * CONSTANTS[8] is HM1 in component kidney (dimensionless).
 * CONSTANTS[9] is MYOGRS in component kidney (dimensionless).
 * CONSTANTS[10] is PA in component kidney (mmHg).
 * CONSTANTS[11] is PAMKRN in component kidney (dimensionless).
 * CONSTANTS[12] is PPC in component kidney (mmHg).
 * CONSTANTS[13] is VTW in component kidney (litre).
 * ALGEBRAIC[0] is PAR in component perfusion_pressure (mmHg).
 * CONSTANTS[14] is GBL in component parameter_values (mmHg).
 * CONSTANTS[15] is RAPRSP in component parameter_values (mmHg).
 * CONSTANTS[16] is RFCDFT in component parameter_values (dimensionless).
 * CONSTANTS[17] is RCDFPC in component parameter_values (dimensionless).
 * CONSTANTS[18] is RCDFDP in component parameter_values (minute).
 * STATES[0] is PAR1 in component perfusion_pressure (mmHg).
 * STATES[4] is MDFLW in component proximal_tubular_and_macula_densa_flow (L_per_minute).
 * STATES[5] is RNAUG2 in component renal_autoregulatory_feedback_factor (dimensionless).
 * CONSTANTS[19] is RNAUGN in component parameter_values (minute_per_L).
 * CONSTANTS[20] is RNAULL in component parameter_values (dimensionless).
 * CONSTANTS[21] is RNAUUL in component parameter_values (dimensionless).
 * CONSTANTS[22] is RNAUAD in component parameter_values (per_minute).
 * STATES[6] is RNAUG1 in component renal_autoregulatory_feedback_factor (dimensionless).
 * STATES[7] is RNAUG1T in component renal_autoregulatory_feedback_factor (dimensionless).
 * STATES[1] is RNAUG3 in component renal_autoregulatory_feedback_factor (dimensionless).
 * CONSTANTS[63] is AUMK in component autonomic_effect_on_AAR (dimensionless).
 * CONSTANTS[23] is ARF in component parameter_values (dimensionless).
 * CONSTANTS[62] is AUMKT in component autonomic_effect_on_AAR (dimensionless).
 * CONSTANTS[65] is ANMAR in component angiotensin_effect_on_AAR (dimensionless).
 * CONSTANTS[24] is ANMAM in component parameter_values (dimensionless).
 * CONSTANTS[25] is ANMARL in component parameter_values (dimensionless).
 * CONSTANTS[64] is ANMAR1 in component angiotensin_effect_on_AAR (dimensionless).
 * STATES[8] is AAR1 in component AAR_calculation (mmHg_minute_per_L).
 * CONSTANTS[26] is AARK in component parameter_values (mmHg_minute_per_L).
 * STATES[9] is AAR in component atrial_natriuretic_peptide_effect_on_AAR (mmHg_minute_per_L).
 * CONSTANTS[27] is ANPXAF in component parameter_values (mmHg_minute_per_L).
 * CONSTANTS[28] is AARLL in component parameter_values (mmHg_minute_per_L).
 * STATES[10] is AART in component atrial_natriuretic_peptide_effect_on_AAR (mmHg_minute_per_L).
 * CONSTANTS[66] is AUMK2 in component autonomic_effect_on_EAR (dimensionless).
 * CONSTANTS[29] is AUMK1 in component parameter_values (dimensionless).
 * CONSTANTS[67] is ANMER in component angiotensin_effect_on_EAR (dimensionless).
 * CONSTANTS[30] is ANMEM in component parameter_values (dimensionless).
 * STATES[11] is RNAUG4 in component effect_of_renal_autoregulatory_feedback_on_EAR (dimensionless).
 * CONSTANTS[31] is EFAFR in component parameter_values (dimensionless).
 * STATES[12] is EAR in component EAR_calculation (mmHg_minute_per_L).
 * CONSTANTS[32] is EARK in component parameter_values (mmHg_minute_per_L).
 * CONSTANTS[33] is EARLL in component parameter_values (mmHg_minute_per_L).
 * STATES[13] is EAR1 in component EAR_calculation (mmHg_minute_per_L).
 * STATES[14] is RR in component total_renal_resistance (mmHg_minute_per_L).
 * STATES[15] is RFN in component normal_renal_blood_flow (L_per_minute).
 * STATES[16] is RBF in component actual_renal_blood_flow (L_per_minute).
 * CONSTANTS[34] is REK in component parameter_values (dimensionless).
 * STATES[17] is GFN in component glomerular_filtration_rate (L_per_minute).
 * STATES[18] is GLPC in component glomerular_colloid_osmotic_pressure (mmHg).
 * CONSTANTS[35] is GPPD in component parameter_values (dimensionless).
 * CONSTANTS[36] is GLPCA in component parameter_values (mmHg).
 * STATES[19] is EFAFPR in component glomerular_colloid_osmotic_pressure (dimensionless).
 * STATES[20] is EFAFPR1 in component glomerular_colloid_osmotic_pressure (dimensionless).
 * STATES[21] is GLP in component glomerular_pressure (mmHg).
 * STATES[22] is APD in component glomerular_pressure (mmHg).
 * STATES[23] is GFR in component glomerular_filtration_rate (L_per_minute).
 * CONSTANTS[37] is PXTP in component parameter_values (mmHg).
 * CONSTANTS[38] is GFLC in component parameter_values (L_per_minute_per_mmHg).
 * CONSTANTS[39] is GFNLL in component parameter_values (L_per_minute).
 * STATES[24] is PFL in component glomerular_filtration_rate (mmHg).
 * STATES[25] is GFN1 in component glomerular_filtration_rate (L_per_minute).
 * CONSTANTS[40] is MDFL1 in component parameter_values (dimensionless).
 * STATES[26] is PTFL in component proximal_tubular_and_macula_densa_flow (L_per_minute).
 * STATES[27] is MDFLWT in component proximal_tubular_and_macula_densa_flow (L_per_minute).
 * STATES[28] is RTSPPC in component renal_tissue_osmotic_pressure (mmHg).
 * CONSTANTS[41] is RTPPR in component parameter_values (dimensionless).
 * CONSTANTS[42] is RTPPRS in component parameter_values (mmHg).
 * STATES[29] is RTSPPC1 in component renal_tissue_osmotic_pressure (mmHg).
 * STATES[30] is UROD in component actual_urea_excretion_rate (mOsm_per_minute).
 * STATES[2] is PLUR in component glomerular_urea_concentration (mOsm).
 * CONSTANTS[43] is URFORM in component parameter_values (mOsm_per_minute).
 * ALGEBRAIC[1] is PLURC in component plasma_urea_concentration (mOsm_per_litre).
 * STATES[31] is RCPRS in component peritubular_capillary_pressure (mmHg).
 * CONSTANTS[44] is RFABX in component parameter_values (dimensionless).
 * CONSTANTS[45] is RVRS in component parameter_values (mmHg_minute_per_L).
 * STATES[32] is RFABD in component peritubular_capillary_reabsorption_factor (dimensionless).
 * CONSTANTS[46] is RTSPRS in component parameter_values (mmHg).
 * CONSTANTS[47] is RABSC in component parameter_values (per_mmHg).
 * CONSTANTS[48] is RFABDP in component parameter_values (dimensionless).
 * CONSTANTS[49] is RFABDM in component parameter_values (dimensionless).
 * STATES[33] is RABSPR in component peritubular_capillary_reabsorption_factor (mmHg).
 * STATES[34] is RFAB1 in component peritubular_capillary_reabsorption_factor (dimensionless).
 * STATES[35] is RFAB in component peritubular_capillary_reabsorption_factor (dimensionless).
 * STATES[36] is RFABD1 in component peritubular_capillary_reabsorption_factor (dimensionless).
 * STATES[37] is DTNAI in component distal_tubular_Na_delivery (monovalent_mEq_per_minute).
 * STATES[38] is DTNARA in component Na_reabsorption_into_distal_tubules (monovalent_mEq_per_minute).
 * CONSTANTS[50] is DTNAR in component parameter_values (monovalent_mEq_per_minute).
 * CONSTANTS[51] is DIURET in component parameter_values (dimensionless).
 * CONSTANTS[52] is AHMNAR in component parameter_values (dimensionless).
 * CONSTANTS[53] is DTNARL in component parameter_values (monovalent_mEq_per_minute).
 * STATES[39] is DTNARA1 in component Na_reabsorption_into_distal_tubules (monovalent_mEq_per_minute).
 * CONSTANTS[69] is DTNANG in component angiotensin_induced_Na_reabsorption_into_distal_tubules (monovalent_mEq_per_minute).
 * CONSTANTS[54] is ANMNAM in component parameter_values (dimensionless).
 * CONSTANTS[68] is DTNANG1 in component angiotensin_induced_Na_reabsorption_into_distal_tubules (monovalent_mEq_per_minute).
 * STATES[40] is DTKI in component distal_tubular_K_delivery (monovalent_mEq_per_minute).
 * STATES[41] is RFABK in component effect_of_physical_forces_on_distal_K_reabsorption (monovalent_mEq_per_minute).
 * CONSTANTS[55] is RFABKM in component parameter_values (monovalent_mEq_per_minute).
 * STATES[42] is MDFLK in component effect_of_fluid_flow_on_distal_K_reabsorption (monovalent_mEq_per_minute).
 * CONSTANTS[56] is MDFLKM in component parameter_values (monovalent_mEq_per_litre).
 * STATES[43] is MDFLK1 in component effect_of_fluid_flow_on_distal_K_reabsorption (monovalent_mEq_per_minute).
 * STATES[44] is KODN in component normal_K_excretion (monovalent_mEq_per_minute).
 * STATES[45] is VUDN in component normal_urine_volume (L_per_minute).
 * STATES[3] is DTKA in component K_reabsorption_into_distal_tubules (monovalent_mEq_per_minute).
 * STATES[46] is DTKSC in component K_secretion_from_distal_tubules (monovalent_mEq_per_minute).
 * CONSTANTS[57] is ANMKEM in component parameter_values (dimensionless).
 * CONSTANTS[58] is ANMKEL in component parameter_values (dimensionless).
 * CONSTANTS[59] is CKEEX in component parameter_values (dimensionless).
 * CONSTANTS[70] is ANMKE1 in component K_secretion_from_distal_tubules (dimensionless).
 * CONSTANTS[71] is ANMKE in component K_secretion_from_distal_tubules (dimensionless).
 * STATES[47] is NODN in component normal_Na_excretion (monovalent_mEq_per_minute).
 * STATES[48] is NODN1 in component normal_Na_excretion (monovalent_mEq_per_minute).
 * STATES[49] is KODN1 in component normal_K_excretion (monovalent_mEq_per_minute).
 * STATES[50] is DTURI in component normal_urea_excretion (mOsm_per_minute).
 * STATES[51] is OSMOPN1 in component normal_osmolar_and_water_excretion (mOsm_per_minute).
 * STATES[52] is OSMOPN in component normal_osmolar_and_water_excretion (mOsm_per_minute).
 * STATES[53] is OSMOP1T in component normal_urine_volume (mOsm_per_minute).
 * STATES[54] is OSMOP1 in component normal_urine_volume (mOsm_per_minute).
 * STATES[55] is NOD in component actual_Na_excretion_rate (monovalent_mEq_per_minute).
 * STATES[56] is KOD in component actual_K_excretion_rate (monovalent_mEq_per_minute).
 * STATES[57] is VUD in component actual_urine_volume (L_per_minute).
 * CONSTANTS[60] is RNAGTC in component parameter_values (minute).
 * CONSTANTS[61] is GFNDMP in component parameter_values (dimensionless).
 * RATES[0] is d/dt PAR1 in component perfusion_pressure (mmHg).
 * RATES[1] is d/dt RNAUG3 in component renal_autoregulatory_feedback_factor (dimensionless).
 * RATES[2] is d/dt PLUR in component glomerular_urea_concentration (mOsm).
 * RATES[3] is d/dt DTKA in component K_reabsorption_into_distal_tubules (monovalent_mEq_per_minute).
 * There are a total of 19 condition variables.
 */
void
initConsts(double* CONSTANTS, double* RATES, double *STATES)
{
CONSTANTS[0] = 1.0;
CONSTANTS[1] = 1.037;
CONSTANTS[2] = 1.0;
CONSTANTS[3] = 0.987545;
CONSTANTS[4] = 1.0;
CONSTANTS[5] = 1.00066;
CONSTANTS[6] = 4.44092;
CONSTANTS[7] = 142.035;
CONSTANTS[8] = 0.39984739;
CONSTANTS[9] = 1.0;
CONSTANTS[10] = 103.525;
CONSTANTS[11] = 1.0;
CONSTANTS[12] = 29.9941;
CONSTANTS[13] = 39.8952;
CONSTANTS[14] = 0;
CONSTANTS[15] = 0;
CONSTANTS[16] = 0;
CONSTANTS[17] = 0;
CONSTANTS[18] = 2000;
STATES[0] = 103.525;
CONSTANTS[19] = 0.6;
CONSTANTS[20] = 0.3;
CONSTANTS[21] = 10;
CONSTANTS[22] = 0;
STATES[1] = 0.0;
CONSTANTS[23] = 0.5;
CONSTANTS[24] = 1.4;
CONSTANTS[25] = 0.86;
CONSTANTS[26] = 1;
CONSTANTS[27] = 1.5;
CONSTANTS[28] = 4;
CONSTANTS[29] = 0.3;
CONSTANTS[30] = 1.6;
CONSTANTS[31] = 0;
CONSTANTS[32] = 1;
CONSTANTS[33] = 24;
CONSTANTS[34] = 1;
CONSTANTS[35] = 1.0;
CONSTANTS[36] = 1.0;
CONSTANTS[37] = 8;
CONSTANTS[38] = 0.0208333;
CONSTANTS[39] = 0.001;
CONSTANTS[40] = 10;
CONSTANTS[41] = 0.9;
CONSTANTS[42] = 15.2;
STATES[2] = 159.549;
CONSTANTS[43] = 0.24;
CONSTANTS[44] = 0.8;
CONSTANTS[45] = 19.167;
CONSTANTS[46] = 6;
CONSTANTS[47] = 0.5;
CONSTANTS[48] = 1;
CONSTANTS[49] = 0.3;
CONSTANTS[50] = 0.675;
CONSTANTS[51] = 1;
CONSTANTS[52] = 0.3;
CONSTANTS[53] = 1e-06;
CONSTANTS[54] = 1;
CONSTANTS[55] = 0.03;
CONSTANTS[56] = 0.667;
STATES[3] = 0.0367573;
CONSTANTS[57] = 2;
CONSTANTS[58] = 0.3;
CONSTANTS[59] = 4;
CONSTANTS[60] = 15;
CONSTANTS[61] = 3;
CONSTANTS[62] =  (CONSTANTS[5] - 1.00000)*CONSTANTS[23]+1.00000;
CONSTANTS[63] = (CONSTANTS[62]<0.800000 ? 0.800000 : CONSTANTS[62]);
CONSTANTS[64] =  (CONSTANTS[3] - 1.00000)*CONSTANTS[24]+1.00000;
CONSTANTS[65] = (CONSTANTS[64]<CONSTANTS[25] ? CONSTANTS[25] : CONSTANTS[64]);
CONSTANTS[66] =  (CONSTANTS[63] - 1.00000)*CONSTANTS[29]+1.00000;
CONSTANTS[67] =  (CONSTANTS[3] - 1.00000)*CONSTANTS[30]+1.00000;
CONSTANTS[68] =  ( (CONSTANTS[3] - 1.00000)*CONSTANTS[54]+1.00000)*0.100000;
CONSTANTS[69] = (CONSTANTS[68]<0.00000 ? 0.00000 : CONSTANTS[68]);
CONSTANTS[70] =  (CONSTANTS[3] - 1.00000)*CONSTANTS[57]+1.00000;
CONSTANTS[71] = (CONSTANTS[70]<CONSTANTS[58] ? CONSTANTS[58] : CONSTANTS[70]);
STATES[4] = 1.00051;
STATES[5] = 1.00071;
STATES[6] = 1.00071;
STATES[7] = 1.00071;
STATES[8] = 40;
STATES[9] = 40;
STATES[10] = 40;
STATES[11] = 0.6;
STATES[12] = 42.4737;
STATES[13] = 42.4737;
STATES[14] = 84.8171;
STATES[15] = 1.22057;
STATES[16] = 0.1001;
STATES[17] = 0.125006;
STATES[18] = 37.8383;
STATES[19] = 1.20569;
STATES[20] = 1.20569;
STATES[21] = 51.842;
STATES[22] = 47.88;
STATES[23] = 0.1001;
STATES[24] = 6.00368;
STATES[25] = 0.125006;
STATES[26] = 1.00005;
STATES[27] = 1.00051;
STATES[28] = 0.1001;
STATES[29] = 0.1001;
STATES[30] = 0.1001;
STATES[31] = 0.1001;
STATES[32] = 0.1001;
STATES[33] = 0.1001;
STATES[34] = 0.1001;
STATES[35] = 0.1001;
STATES[36] = 0.1001;
STATES[37] = 0.1001;
STATES[38] = 0.1001;
STATES[39] = 0.1001;
STATES[40] = 0.1001;
STATES[41] = 0.1001;
STATES[42] = 0.1001;
STATES[43] = 0.1001;
STATES[44] = 0.1001;
STATES[45] = 0.1001;
STATES[46] = 0.1001;
STATES[47] = 0.1001;
STATES[48] = 0.1001;
STATES[49] = 0.1001;
STATES[50] = 0.1001;
STATES[51] = 0.1001;
STATES[52] = 0.1001;
STATES[53] = 0.1001;
STATES[54] = 0.1001;
STATES[55] = 0.1001;
STATES[56] = 0.1001;
STATES[57] = 0.1001;
RATES[0] = 0.1001;
RATES[1] = 0.1001;
RATES[2] = 0.1001;
RATES[3] = 0.1001;
}
void
computeResiduals(double VOI, double* CONSTANTS, double* RATES, double* OLDRATES, double* STATES,
                 double* OLDSTATES, double* ALGEBRAIC, double* CONDVARS)
{
resid[0] = RATES[0] - ((100.000+ (CONSTANTS[10] - 100.000)*CONSTANTS[17]) - STATES[0])/CONSTANTS[18];
resid[1] = STATES[7] -  (STATES[4] - 1.00000)*CONSTANTS[19]+1.00000;
resid[2] = STATES[6] - (CONDVAR[3]<0.00000 ? CONSTANTS[20] : CONDVAR[4]>0.00000 ? CONSTANTS[21] : STATES[7]);
resid[3] = STATES[5] - STATES[6] - STATES[1];
resid[4] = RATES[1] -  (STATES[5] - 1.00000)*CONSTANTS[22];
resid[5] = STATES[8] -  CONSTANTS[26]*CONSTANTS[11]*CONSTANTS[63]*STATES[5]*CONSTANTS[65]*40.0000*CONSTANTS[9];
resid[6] = STATES[10] - (STATES[8] -  CONSTANTS[4]*CONSTANTS[27])+CONSTANTS[27];
resid[7] = STATES[9] - (CONDVAR[5]<0.00000 ? CONSTANTS[28] : STATES[10]);
resid[8] = STATES[11] -  (STATES[5] - 1.00000)*CONSTANTS[31]+1.00000;
resid[9] = STATES[13] -  43.3330*CONSTANTS[32]*CONSTANTS[67]*STATES[11]*CONSTANTS[9]*CONSTANTS[66];
resid[10] = STATES[12] - (CONDVAR[6]<0.00000 ? CONSTANTS[33] : STATES[13]);
resid[11] = STATES[14] - STATES[9]+STATES[12];
resid[12] = STATES[15] - ALGEBRAIC[0]/STATES[14];
resid[13] = STATES[16] -  CONSTANTS[34]*STATES[15];
resid[14] = STATES[20] - ( STATES[15]*(1.00000 - CONSTANTS[8]))/( STATES[15]*(1.00000 - CONSTANTS[8]) - STATES[17]);
resid[15] = STATES[19] - (CONDVAR[7]<0.00000 ? 1.00000 : STATES[20]);
resid[16] = STATES[18] - (CONDVAR[8]>0.00000 ?  pow(STATES[19], 1.35000)*CONSTANTS[12]*0.980000 : CONSTANTS[12]+4.00000);
resid[17] = STATES[22] -  STATES[9]*STATES[15];
resid[18] = STATES[21] - ALGEBRAIC[0] - STATES[22];
resid[19] = STATES[24] - (STATES[21] - STATES[18]) - CONSTANTS[37];
resid[20] = STATES[25] -  STATES[24]*CONSTANTS[38];
resid[21] = STATES[17] - (CONDVAR[9]<0.00000 ? CONSTANTS[39] : STATES[25]);
resid[22] = STATES[23] -  STATES[17]*CONSTANTS[34];
resid[23] = STATES[26] -  STATES[17]*8.00000;
resid[24] = STATES[27] -  (STATES[26] - 1.00000)*CONSTANTS[40]+1.00000;
resid[25] = STATES[4] - (CONDVAR[10]<0.00000 ? 0.00000 : STATES[27]);
resid[26] = STATES[29] -  STATES[18]*CONSTANTS[41] - CONSTANTS[42];
resid[27] = STATES[28] - (CONDVAR[11]<0.00000 ? 1.00000 : STATES[29]);
resid[28] = RATES[2] - CONSTANTS[43] - STATES[30];
resid[29] = STATES[31] -  ( (STATES[15] - 1.20000)*CONSTANTS[44]+1.20000)*CONSTANTS[45];
resid[30] = STATES[33] - ((STATES[18]+CONSTANTS[46]) - STATES[31]) - STATES[28];
resid[31] = STATES[34] -  STATES[33]*CONSTANTS[47];
resid[32] = STATES[35] - STATES[34];
resid[33] = STATES[36] -  (STATES[35] - 1.00000)*CONSTANTS[49]+1.00000;
resid[34] = STATES[32] - (CONDVAR[12]<0.00000 ? 0.000100000 : STATES[36]);
resid[35] = STATES[37] -  STATES[4]*CONSTANTS[7]*0.00616190;
resid[36] = STATES[39] -  (( CONSTANTS[2]*STATES[32]*CONSTANTS[50])/CONSTANTS[51])*( (CONSTANTS[0] - 1.00000)*CONSTANTS[52]+1.00000);
resid[37] = STATES[38] - (CONDVAR[13]<0.00000 ? CONSTANTS[53] : STATES[39]);
resid[38] = STATES[40] - ( STATES[37]*CONSTANTS[6])/CONSTANTS[7];
resid[39] = STATES[41] -  (STATES[32] - 1.00000)*CONSTANTS[55];
resid[40] = STATES[43] -  (STATES[4] - 1.00000)*CONSTANTS[56]+1.00000;
resid[41] = STATES[42] - (CONDVAR[14]<0.00000 ? 0.100000 : STATES[43]);
resid[42] = RATES[3] -  ( (STATES[44]/STATES[45])*0.000451800 - STATES[3])*1.00000;
resid[43] = STATES[46] - ( pow(CONSTANTS[6]/4.40000, CONSTANTS[59])*CONSTANTS[1]*0.0800000*STATES[42])/CONSTANTS[71];
resid[44] = STATES[48] - (STATES[37] - STATES[38]) - CONSTANTS[69];
resid[45] = STATES[47] - (CONDVAR[15]<0.00000 ? 1.00000e-08 : STATES[48]);
resid[46] = STATES[49] - ((STATES[40]+STATES[46]) - STATES[3]) - STATES[41];
resid[47] = STATES[44] - (CONDVAR[16]<0.00000 ? 0.00000 : STATES[49]);
resid[48] = STATES[50] -  pow(STATES[17], 2.00000)*ALGEBRAIC[1]*3.84000;
resid[49] = STATES[51] - STATES[50]+ 2.00000*(STATES[47]+STATES[44]);
resid[50] = STATES[52] - (CONDVAR[17]>0.00000 ? 0.600000 : STATES[51]);
resid[51] = STATES[53] - STATES[51] - 0.600000;
resid[52] = STATES[54] - (CONDVAR[18]<0.00000 ? 0.00000 : STATES[53]);
resid[53] = STATES[45] - STATES[52]/( 600.000*CONSTANTS[0])+STATES[54]/360.000;
resid[54] = STATES[55] -  STATES[47]*CONSTANTS[34];
resid[55] = STATES[56] -  STATES[44]*CONSTANTS[34];
resid[56] = STATES[30] -  STATES[50]*CONSTANTS[34];
resid[57] = STATES[57] -  STATES[45]*CONSTANTS[34];
}
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] = (CONDVAR[0]>0.00000&&CONDVAR[1]<=0.00000 ? CONSTANTS[15] : CONDVAR[2]>0.00000 ? STATES[0] : CONSTANTS[10] - CONSTANTS[14]);
ALGEBRAIC[1] = STATES[2]/CONSTANTS[13];
}
void
getStateInformation(double* SI)
{
SI[0] = 1.0;
SI[4] = 0.0;
SI[5] = 0.0;
SI[6] = 0.0;
SI[7] = 0.0;
SI[1] = 1.0;
SI[8] = 0.0;
SI[9] = 0.0;
SI[10] = 0.0;
SI[11] = 0.0;
SI[12] = 0.0;
SI[13] = 0.0;
SI[14] = 0.0;
SI[15] = 0.0;
SI[16] = 0.0;
SI[17] = 0.0;
SI[18] = 0.0;
SI[19] = 0.0;
SI[20] = 0.0;
SI[21] = 0.0;
SI[22] = 0.0;
SI[23] = 0.0;
SI[24] = 0.0;
SI[25] = 0.0;
SI[26] = 0.0;
SI[27] = 0.0;
SI[28] = 0.0;
SI[29] = 0.0;
SI[30] = 0.0;
SI[2] = 1.0;
SI[31] = 0.0;
SI[32] = 0.0;
SI[33] = 0.0;
SI[34] = 0.0;
SI[35] = 0.0;
SI[36] = 0.0;
SI[37] = 0.0;
SI[38] = 0.0;
SI[39] = 0.0;
SI[40] = 0.0;
SI[41] = 0.0;
SI[42] = 0.0;
SI[43] = 0.0;
SI[44] = 0.0;
SI[45] = 0.0;
SI[3] = 1.0;
SI[46] = 0.0;
SI[47] = 0.0;
SI[48] = 0.0;
SI[49] = 0.0;
SI[50] = 0.0;
SI[51] = 0.0;
SI[52] = 0.0;
SI[53] = 0.0;
SI[54] = 0.0;
SI[55] = 0.0;
SI[56] = 0.0;
SI[57] = 0.0;
}
void
computeRoots(double VOI, double* CONSTANTS, double* RATES, double* OLDRATES, double* STATES,
             double* OLDSTATES, double* ALGEBRAIC, double* CONDVARS)
{
CONDVAR[0] = CONSTANTS[15] - 0.00000;
CONDVAR[1] = CONSTANTS[16] - 0.00000;
CONDVAR[2] = CONSTANTS[16] - 0.00000;
CONDVAR[3] = STATES[7] - CONSTANTS[20];
CONDVAR[4] = STATES[7] - CONSTANTS[21];
CONDVAR[5] = STATES[10] - CONSTANTS[28];
CONDVAR[6] = STATES[13] - CONSTANTS[33];
CONDVAR[7] = STATES[20] - 1.00000;
CONDVAR[8] = CONSTANTS[36] - 0.00000;
CONDVAR[9] = STATES[25] - CONSTANTS[39];
CONDVAR[10] = STATES[27] - 0.00000;
CONDVAR[11] = STATES[29] - 1.00000;
CONDVAR[12] = STATES[36] - 0.000100000;
CONDVAR[13] = STATES[39] - CONSTANTS[53];
CONDVAR[14] = STATES[43] - 0.100000;
CONDVAR[15] = STATES[48] - 1.00000e-08;
CONDVAR[16] = STATES[49] - 0.00000;
CONDVAR[17] = STATES[51] - 0.600000;
CONDVAR[18] = STATES[53] - 0.00000;
}