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 43 entries in the algebraic variable array. There are a total of 7 entries in each of the rate and state variable arrays. There are a total of 41 entries in the constant variable array. */ /* * VOI is time in component environment (second). * CONSTANTS[0] is k0_12 in component parameters (per_M2_per_second). * CONSTANTS[1] is k0_21 in component parameters (per_second). * CONSTANTS[2] is k0_23 in component parameters (per_M_per_second). * CONSTANTS[3] is k0_32 in component parameters (per_second). * CONSTANTS[4] is k0_34 in component parameters (per_second). * CONSTANTS[5] is k0_43 in component parameters (per_second). * CONSTANTS[6] is k0_45 in component parameters (per_second). * CONSTANTS[7] is k0_54 in component parameters (per_M_per_second). * CONSTANTS[8] is k0_25 in component parameters (per_second). * CONSTANTS[9] is k0_52 in component parameters (per_second). * CONSTANTS[10] is k0_56 in component parameters (per_second). * CONSTANTS[11] is k0_65_f in component parameters (per_M2_per_second). * CONSTANTS[12] is k0_61_f in component parameters (per_second). * CONSTANTS[13] is k0_16_f in component parameters (per_second). * CONSTANTS[14] is k0_65_r in component parameters (per_M2_per_second). * CONSTANTS[15] is k0_61_r in component parameters (per_second). * CONSTANTS[16] is k0_16_r in component parameters (per_second). * CONSTANTS[32] is k0_65 in component parameters (per_M2_per_second). * CONSTANTS[33] is k0_61 in component parameters (per_second). * CONSTANTS[34] is k0_16 in component parameters (per_second). * CONSTANTS[17] is delta in component parameters (dimensionless). * CONSTANTS[35] is alpha_p in component parameters (dimensionless). * CONSTANTS[18] is alpha_pp in component parameters (dimensionless). * CONSTANTS[19] is N_C in component parameters (dimensionless). * CONSTANTS[20] is N_Avo in component parameters (per_mol). * CONSTANTS[21] is area in component parameters (um2). * CONSTANTS[36] is C_T in component parameters (umol). * CONSTANTS[22] is n in component parameters (dimensionless). * CONSTANTS[23] is z_c in component parameters (dimensionless). * CONSTANTS[24] is z_Na in component parameters (dimensionless). * CONSTANTS[25] is F in component parameters (C_per_mol). * CONSTANTS[26] is R in component parameters (J_per_K_per_mol). * CONSTANTS[27] is T in component parameters (kelvin). * STATES[0] is V in component ion_concentrations (volt). * ALGEBRAIC[0] is mu in component parameters (dimensionless). * CONSTANTS[28] is Na_o in component ion_concentrations (M). * CONSTANTS[29] is Na_i in component ion_concentrations (M). * CONSTANTS[30] is glucose_i in component ion_concentrations (M). * CONSTANTS[31] is glucose_o in component ion_concentrations (M). * ALGEBRAIC[2] is k_12 in component rate_constants (per_second). * ALGEBRAIC[3] is k_21 in component rate_constants (per_second). * CONSTANTS[37] is k_23 in component rate_constants (per_second). * CONSTANTS[38] is k_32 in component rate_constants (per_second). * ALGEBRAIC[4] is k_34 in component rate_constants (per_second). * ALGEBRAIC[5] is k_43 in component rate_constants (per_second). * CONSTANTS[39] is k_45 in component rate_constants (per_second). * ALGEBRAIC[17] is k_54 in component rate_constants (per_second). * ALGEBRAIC[6] is k_25 in component rate_constants (per_second). * ALGEBRAIC[12] is k_52 in component rate_constants (per_second). * ALGEBRAIC[8] is k_56 in component rate_constants (per_second). * ALGEBRAIC[9] is k_65 in component rate_constants (per_second). * ALGEBRAIC[10] is k_61 in component rate_constants (per_second). * ALGEBRAIC[11] is k_16 in component rate_constants (per_second). * ALGEBRAIC[1] is ks_12 in component rate_constants (per_M2_per_second). * ALGEBRAIC[13] is k0_54_temp in component rate_constants (per_M_per_second). * ALGEBRAIC[7] is k_52_temp in component rate_constants (per_second). * STATES[1] is C_1 in component kinetic_equations (umol). * STATES[2] is C_2 in component kinetic_equations (umol). * STATES[3] is C_3 in component kinetic_equations (umol). * STATES[4] is C_4 in component kinetic_equations (umol). * STATES[5] is C_5 in component kinetic_equations (umol). * ALGEBRAIC[14] is C_6 in component kinetic_equations (umol). * STATES[6] is C_6_temp in component kinetic_equations (umol). * ALGEBRAIC[18] is C1_sum in component king_altman_states (per_second5). * ALGEBRAIC[19] is C2_sum in component king_altman_states (per_second5). * ALGEBRAIC[20] is C3_sum in component king_altman_states (per_second5). * ALGEBRAIC[21] is C4_sum in component king_altman_states (per_second5). * ALGEBRAIC[15] is C5_sum in component king_altman_states (per_second5). * ALGEBRAIC[22] is C6_sum in component king_altman_states (per_second5). * ALGEBRAIC[23] is C_sum in component king_altman_states (per_second5). * ALGEBRAIC[24] is C1 in component king_altman_states (umol). * ALGEBRAIC[25] is C2 in component king_altman_states (umol). * ALGEBRAIC[26] is C3 in component king_altman_states (umol). * ALGEBRAIC[27] is C4 in component king_altman_states (umol). * ALGEBRAIC[28] is C5 in component king_altman_states (umol). * ALGEBRAIC[29] is C6 in component king_altman_states (umol). * ALGEBRAIC[16] is I_NaGl_pSS in component NBC_current (uA). * ALGEBRAIC[30] is I_NaGl_SS in component NBC_current (uA). * ALGEBRAIC[37] is epsilon in component phenomonological_constants (per_second). * ALGEBRAIC[31] is lambda in component phenomonological_constants (per_M3_per_second5). * ALGEBRAIC[32] is chi in component phenomonological_constants (M). * ALGEBRAIC[34] is alpha in component phenomonological_constants (M3). * ALGEBRAIC[33] is beta in component phenomonological_constants (M2). * ALGEBRAIC[35] is gamma in component phenomonological_constants (M3_per_second). * ALGEBRAIC[36] is phi in component phenomonological_constants (M_per_second). * ALGEBRAIC[39] is Imax_Na in component phenomonological_constants (uA). * ALGEBRAIC[38] is Imax_gluc in component phenomonological_constants (uA). * ALGEBRAIC[41] is Khalf_Na_sq in component phenomonological_constants (M2). * ALGEBRAIC[42] is Khalf_Na in component phenomonological_constants (M). * ALGEBRAIC[40] is Khalf_gluc in component phenomonological_constants (M). * RATES[0] is d/dt V in component ion_concentrations (volt). * RATES[1] is d/dt C_1 in component kinetic_equations (umol). * RATES[2] is d/dt C_2 in component kinetic_equations (umol). * RATES[3] is d/dt C_3 in component kinetic_equations (umol). * RATES[4] is d/dt C_4 in component kinetic_equations (umol). * RATES[5] is d/dt C_5 in component kinetic_equations (umol). * RATES[6] is d/dt C_6_temp in component kinetic_equations (umol). * There are a total of 0 condition variables. */ void initConsts(double* CONSTANTS, double* RATES, double *STATES) { CONSTANTS[0] = 80000; CONSTANTS[1] = 500; CONSTANTS[2] = 1e5; CONSTANTS[3] = 20; CONSTANTS[4] = 50; CONSTANTS[5] = 50; CONSTANTS[6] = 800; CONSTANTS[7] = 1.219e4; CONSTANTS[8] = 0.3; CONSTANTS[9] = 9.1e-4; CONSTANTS[10] = 10; CONSTANTS[11] = 50; CONSTANTS[12] = 5; CONSTANTS[13] = 35; CONSTANTS[14] = 4500; CONSTANTS[15] = 3; CONSTANTS[16] = 350; CONSTANTS[17] = 0.7; CONSTANTS[18] = 0; CONSTANTS[19] = 3e6; CONSTANTS[20] = 6.022e23; CONSTANTS[21] = 1e6; CONSTANTS[22] = 2; CONSTANTS[23] = -2; CONSTANTS[24] = 1; CONSTANTS[25] = 96485.34; CONSTANTS[26] = 8.314; CONSTANTS[27] = 310; STATES[0] = -150e-3; CONSTANTS[28] = 10e-3; CONSTANTS[29] = 500e-3; CONSTANTS[30] = 100e-3; CONSTANTS[31] = 0e-3; STATES[1] = 0; STATES[2] = 0; STATES[3] = 0; STATES[4] = 0; STATES[5] = 0; STATES[6] = 0; CONSTANTS[32] = (CONSTANTS[28]<0.100000 ? CONSTANTS[14] : CONSTANTS[11]); CONSTANTS[40] = 0.200000; CONSTANTS[33] = (CONSTANTS[28]<0.100000 ? CONSTANTS[15] : CONSTANTS[12]); CONSTANTS[34] = (CONSTANTS[28]<0.100000 ? CONSTANTS[16] : CONSTANTS[13]); CONSTANTS[35] = (1.00000 - CONSTANTS[17]) - CONSTANTS[18]; CONSTANTS[36] = ( 1.00000e+06*CONSTANTS[19])/CONSTANTS[20]; CONSTANTS[37] = CONSTANTS[2]*CONSTANTS[31]; CONSTANTS[38] = CONSTANTS[3]; CONSTANTS[39] = CONSTANTS[6]; RATES[1] = 0.1001; RATES[2] = 0.1001; RATES[3] = 0.1001; RATES[4] = 0.1001; RATES[5] = 0.1001; RATES[6] = 0.1001; } void computeResiduals(double VOI, double* CONSTANTS, double* RATES, double* OLDRATES, double* STATES, double* OLDSTATES, double* ALGEBRAIC, double* CONDVARS) { resid[0] = RATES[1] - ( ALGEBRAIC[3]*STATES[2]+ ALGEBRAIC[10]*ALGEBRAIC[14]) - (ALGEBRAIC[2]+ALGEBRAIC[11])*STATES[1]; resid[1] = RATES[2] - ( ALGEBRAIC[2]*STATES[1]+ CONSTANTS[38]*STATES[3]+ ALGEBRAIC[12]*STATES[5]) - (ALGEBRAIC[3]+CONSTANTS[37]+ALGEBRAIC[6])*STATES[2]; resid[2] = RATES[3] - ( CONSTANTS[37]*STATES[2]+ ALGEBRAIC[5]*STATES[4]) - (CONSTANTS[38]+ALGEBRAIC[4])*STATES[3]; resid[3] = RATES[4] - ( ALGEBRAIC[4]*STATES[3]+ ALGEBRAIC[17]*STATES[5]) - (CONSTANTS[39]+ALGEBRAIC[5])*STATES[4]; resid[4] = RATES[5] - ( CONSTANTS[39]*STATES[4]+ ALGEBRAIC[9]*ALGEBRAIC[14]+ ALGEBRAIC[6]*STATES[2]) - (ALGEBRAIC[17]+ALGEBRAIC[12]+ALGEBRAIC[8])*STATES[5]; resid[5] = RATES[6] - ( ALGEBRAIC[11]*STATES[1]+ ALGEBRAIC[8]*STATES[5]) - (ALGEBRAIC[10]+ALGEBRAIC[9])*STATES[6]; resid[6] = RATES[0] - CONSTANTS[40]; } void computeVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC) { ALGEBRAIC[7] = CONSTANTS[9]*exp(( (CONSTANTS[23]+CONSTANTS[22])*CONSTANTS[17]*ALGEBRAIC[0])/2.00000); ALGEBRAIC[15] = ALGEBRAIC[11]*ALGEBRAIC[6]*ALGEBRAIC[4]*CONSTANTS[39]*ALGEBRAIC[9]+ ALGEBRAIC[2]*ALGEBRAIC[6]*ALGEBRAIC[4]*CONSTANTS[39]*ALGEBRAIC[9]+ ALGEBRAIC[11]*CONSTANTS[37]*ALGEBRAIC[4]*CONSTANTS[39]*ALGEBRAIC[9]+ ALGEBRAIC[2]*CONSTANTS[37]*ALGEBRAIC[4]*CONSTANTS[39]*ALGEBRAIC[9]+ ALGEBRAIC[11]*ALGEBRAIC[3]*ALGEBRAIC[4]*CONSTANTS[39]*ALGEBRAIC[9]+ ALGEBRAIC[11]*ALGEBRAIC[6]*CONSTANTS[38]*CONSTANTS[39]*ALGEBRAIC[9]+ ALGEBRAIC[2]*ALGEBRAIC[6]*CONSTANTS[38]*CONSTANTS[39]*ALGEBRAIC[9]+ ALGEBRAIC[11]*ALGEBRAIC[3]*CONSTANTS[38]*CONSTANTS[39]*ALGEBRAIC[9]+ ALGEBRAIC[11]*ALGEBRAIC[6]*CONSTANTS[38]*ALGEBRAIC[5]*ALGEBRAIC[9]+ ALGEBRAIC[2]*ALGEBRAIC[6]*CONSTANTS[38]*ALGEBRAIC[5]*ALGEBRAIC[9]+ ALGEBRAIC[11]*ALGEBRAIC[3]*CONSTANTS[38]*ALGEBRAIC[5]*ALGEBRAIC[9]+ ALGEBRAIC[2]*ALGEBRAIC[6]*ALGEBRAIC[4]*CONSTANTS[39]*ALGEBRAIC[10]+ ALGEBRAIC[2]*CONSTANTS[37]*ALGEBRAIC[4]*CONSTANTS[39]*ALGEBRAIC[10]+ ALGEBRAIC[2]*ALGEBRAIC[6]*CONSTANTS[38]*CONSTANTS[39]*ALGEBRAIC[10]+ ALGEBRAIC[2]*ALGEBRAIC[6]*CONSTANTS[38]*ALGEBRAIC[5]*ALGEBRAIC[10]; ALGEBRAIC[16] = - CONSTANTS[25]*( CONSTANTS[22]*CONSTANTS[24]*CONSTANTS[35]*( ALGEBRAIC[2]*STATES[1] - ALGEBRAIC[3]*STATES[2])+ CONSTANTS[23]*CONSTANTS[17]*( ALGEBRAIC[11]*STATES[1] - ALGEBRAIC[10]*ALGEBRAIC[14])+ CONSTANTS[22]*CONSTANTS[24]*CONSTANTS[18]*( ALGEBRAIC[8]*STATES[5] - ALGEBRAIC[9]*ALGEBRAIC[14])); ALGEBRAIC[18] = ALGEBRAIC[3]*CONSTANTS[38]*ALGEBRAIC[5]*ALGEBRAIC[17]*ALGEBRAIC[9]+ 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RAIC[4]*CONSTANTS[39]*ALGEBRAIC[8]+ ALGEBRAIC[11]*ALGEBRAIC[6]*CONSTANTS[38]*CONSTANTS[39]*ALGEBRAIC[8]+ ALGEBRAIC[2]*ALGEBRAIC[6]*CONSTANTS[38]*CONSTANTS[39]*ALGEBRAIC[8]+ ALGEBRAIC[11]*ALGEBRAIC[3]*CONSTANTS[38]*CONSTANTS[39]*ALGEBRAIC[8]+ ALGEBRAIC[11]*ALGEBRAIC[6]*CONSTANTS[38]*ALGEBRAIC[5]*ALGEBRAIC[8]+ ALGEBRAIC[2]*ALGEBRAIC[6]*CONSTANTS[38]*ALGEBRAIC[5]*ALGEBRAIC[8]+ ALGEBRAIC[11]*ALGEBRAIC[3]*CONSTANTS[38]*ALGEBRAIC[5]*ALGEBRAIC[8]+ ALGEBRAIC[11]*ALGEBRAIC[3]*CONSTANTS[38]*ALGEBRAIC[5]*ALGEBRAIC[17]+ ALGEBRAIC[11]*ALGEBRAIC[3]*ALGEBRAIC[4]*CONSTANTS[39]*ALGEBRAIC[12]+ ALGEBRAIC[11]*ALGEBRAIC[3]*CONSTANTS[38]*CONSTANTS[39]*ALGEBRAIC[12]+ ALGEBRAIC[11]*ALGEBRAIC[3]*CONSTANTS[38]*ALGEBRAIC[5]*ALGEBRAIC[12]; ALGEBRAIC[23] = ALGEBRAIC[18]+ALGEBRAIC[19]+ALGEBRAIC[20]+ALGEBRAIC[21]+ALGEBRAIC[15]+ALGEBRAIC[22]; ALGEBRAIC[24] = ( CONSTANTS[36]*ALGEBRAIC[18])/ALGEBRAIC[23]; ALGEBRAIC[25] = ( CONSTANTS[36]*ALGEBRAIC[19])/ALGEBRAIC[23]; ALGEBRAIC[26] = ( CONSTANTS[36]*ALGEBRAIC[20])/ALGEBRAIC[23]; ALGEBRAIC[27] = ( CONSTANTS[36]*ALGEBRAIC[21])/ALGEBRAIC[23]; ALGEBRAIC[28] = ( CONSTANTS[36]*ALGEBRAIC[15])/ALGEBRAIC[23]; ALGEBRAIC[29] = ( CONSTANTS[36]*ALGEBRAIC[22])/ALGEBRAIC[23]; ALGEBRAIC[30] = - CONSTANTS[25]*( CONSTANTS[23]*( ALGEBRAIC[11]*ALGEBRAIC[24] - ALGEBRAIC[10]*ALGEBRAIC[29])+ (CONSTANTS[23]+ CONSTANTS[24]*CONSTANTS[22])*( ALGEBRAIC[6]*ALGEBRAIC[25] - ALGEBRAIC[12]*ALGEBRAIC[28])+ (CONSTANTS[23]+ CONSTANTS[24]*CONSTANTS[22])*( ALGEBRAIC[4]*ALGEBRAIC[26] - ALGEBRAIC[5]*ALGEBRAIC[27])); ALGEBRAIC[31] = ALGEBRAIC[1]*CONSTANTS[2]*ALGEBRAIC[5]*ALGEBRAIC[17]*ALGEBRAIC[9]+ ALGEBRAIC[1]*CONSTANTS[2]*ALGEBRAIC[4]*ALGEBRAIC[17]*ALGEBRAIC[9]+ ALGEBRAIC[1]*CONSTANTS[2]*CONSTANTS[39]*ALGEBRAIC[12]*ALGEBRAIC[9]+ ALGEBRAIC[1]*CONSTANTS[2]*ALGEBRAIC[5]*ALGEBRAIC[12]*ALGEBRAIC[9]+ ALGEBRAIC[1]*CONSTANTS[2]*ALGEBRAIC[4]*ALGEBRAIC[12]*ALGEBRAIC[9]+ ALGEBRAIC[1]*CONSTANTS[2]*ALGEBRAIC[4]*CONSTANTS[39]*ALGEBRAIC[9]+ ALGEBRAIC[1]*CONSTANTS[2]*CONSTANTS[39]*ALGEBRAIC[8]*ALGEBRAIC[10]+ ALGEBRAIC[1]*CONSTANTS[2]*ALGEBRAIC[5]*ALGEBRAIC[8]*ALGEBRAIC[10]+ ALGEBRAIC[1]*CONSTANTS[2]*ALGEBRAIC[4]*ALGEBRAIC[8]*ALGEBRAIC[10]+ ALGEBRAIC[1]*CONSTANTS[2]*ALGEBRAIC[5]*ALGEBRAIC[17]*ALGEBRAIC[10]+ ALGEBRAIC[1]*CONSTANTS[2]*ALGEBRAIC[4]*ALGEBRAIC[17]*ALGEBRAIC[10]+ AL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ALGEBRAIC[35] = (1.00000/ALGEBRAIC[31])*( ALGEBRAIC[11]*ALGEBRAIC[3]*CONSTANTS[38]*ALGEBRAIC[5]*ALGEBRAIC[17]*ALGEBRAIC[9]+ ALGEBRAIC[11]*ALGEBRAIC[3]*ALGEBRAIC[4]*CONSTANTS[39]*ALGEBRAIC[12]*ALGEBRAIC[9]+ ALGEBRAIC[11]*ALGEBRAIC[3]*CONSTANTS[38]*CONSTANTS[39]*ALGEBRAIC[12]*ALGEBRAIC[9]+ ALGEBRAIC[11]*ALGEBRAIC[3]*CONSTANTS[38]*ALGEBRAIC[5]*ALGEBRAIC[12]*ALGEBRAIC[9]); ALGEBRAIC[36] = (1.00000/ALGEBRAIC[31])*(( - ALGEBRAIC[1]*ALGEBRAIC[6]*ALGEBRAIC[4]*CONSTANTS[39]*ALGEBRAIC[8]*ALGEBRAIC[10] - ALGEBRAIC[1]*ALGEBRAIC[6]*CONSTANTS[38]*CONSTANTS[39]*ALGEBRAIC[8]*ALGEBRAIC[10]) - ALGEBRAIC[1]*ALGEBRAIC[6]*CONSTANTS[38]*ALGEBRAIC[5]*ALGEBRAIC[8]*ALGEBRAIC[10]); ALGEBRAIC[37] = (1.00000/ALGEBRAIC[31])*- ALGEBRAIC[1]*CONSTANTS[2]*ALGEBRAIC[4]*CONSTANTS[39]*ALGEBRAIC[8]*ALGEBRAIC[10]; ALGEBRAIC[38] = ( 2.00000*CONSTANTS[25]*CONSTANTS[36]*ALGEBRAIC[37]*pow(CONSTANTS[28], 2.00000))/(ALGEBRAIC[33]+pow(CONSTANTS[28], 2.00000)); ALGEBRAIC[39] = ( 2.00000*CONSTANTS[25]*CONSTANTS[36]*(ALGEBRAIC[36]+ ALGEBRAIC[37]*CONSTANTS[31]))/(ALGEBRAIC[32]+CONSTANTS[31]); ALGEBRAIC[40] = (ALGEBRAIC[34]+ ALGEBRAIC[32]*pow(CONSTANTS[28], 2.00000))/(ALGEBRAIC[33]+pow(CONSTANTS[28], 2.00000)); ALGEBRAIC[41] = (ALGEBRAIC[34]+ ALGEBRAIC[33]*CONSTANTS[31])/(ALGEBRAIC[32]+CONSTANTS[31]); ALGEBRAIC[42] = pow(ALGEBRAIC[41], 1.0 / 2); } void computeEssentialVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC) { ALGEBRAIC[0] = ( CONSTANTS[25]*STATES[0])/( CONSTANTS[26]*CONSTANTS[27]); ALGEBRAIC[1] = CONSTANTS[0]*exp(( - CONSTANTS[22]*CONSTANTS[35]*ALGEBRAIC[0])/2.00000); ALGEBRAIC[2] = ALGEBRAIC[1]*pow(CONSTANTS[28], CONSTANTS[22]); ALGEBRAIC[3] = CONSTANTS[1]*exp(( CONSTANTS[22]*CONSTANTS[24]*CONSTANTS[35]*ALGEBRAIC[0])/2.00000); ALGEBRAIC[4] = CONSTANTS[4]*exp(( - (CONSTANTS[23]+CONSTANTS[22])*CONSTANTS[17]*ALGEBRAIC[0])/2.00000); ALGEBRAIC[5] = CONSTANTS[5]*exp(( (CONSTANTS[23]+CONSTANTS[22])*CONSTANTS[17]*ALGEBRAIC[0])/2.00000); ALGEBRAIC[6] = CONSTANTS[8]*exp(( - (CONSTANTS[23]+CONSTANTS[22])*CONSTANTS[17]*ALGEBRAIC[0])/2.00000); ALGEBRAIC[8] = CONSTANTS[10]*exp(( - CONSTANTS[22]*CONSTANTS[24]*CONSTANTS[18]*ALGEBRAIC[0])/2.00000); ALGEBRAIC[9] = CONSTANTS[32]*pow(CONSTANTS[29], CONSTANTS[22])*exp(( CONSTANTS[22]*CONSTANTS[24]*CONSTANTS[18]*ALGEBRAIC[0])/2.00000); ALGEBRAIC[10] = CONSTANTS[33]*exp(( CONSTANTS[23]*CONSTANTS[17]*ALGEBRAIC[0])/2.00000); ALGEBRAIC[11] = CONSTANTS[34]*exp(( - CONSTANTS[23]*CONSTANTS[17]*ALGEBRAIC[0])/2.00000); ALGEBRAIC[12] = ( CONSTANTS[0]*ALGEBRAIC[6]*CONSTANTS[10]*CONSTANTS[33])/( CONSTANTS[1]*CONSTANTS[34]*CONSTANTS[32]); ALGEBRAIC[14] = CONSTANTS[36] - (STATES[1]+STATES[2]+STATES[3]+STATES[4]+STATES[5]); ALGEBRAIC[13] = ( CONSTANTS[2]*ALGEBRAIC[4]*CONSTANTS[39]*ALGEBRAIC[12])/( ALGEBRAIC[5]*CONSTANTS[38]*ALGEBRAIC[6]); ALGEBRAIC[17] = ALGEBRAIC[13]*CONSTANTS[30]; } void getStateInformation(double* SI) { SI[0] = 1.0; SI[1] = 1.0; SI[2] = 1.0; SI[3] = 1.0; SI[4] = 1.0; SI[5] = 1.0; SI[6] = 1.0; } void computeRoots(double VOI, double* CONSTANTS, double* RATES, double* OLDRATES, double* STATES, double* OLDSTATES, double* ALGEBRAIC, double* CONDVARS) { }