/* There are a total of 45 entries in the algebraic variable array. There are a total of 11 entries in each of the rate and state variable arrays. There are a total of 64 entries in the constant variable array. */ /* * VOI is time in component environment (millisecond). * ALGEBRAIC[3] is SOVFThick in component sarcomere_geometry (dimensionless). * ALGEBRAIC[4] is SOVFThin in component sarcomere_geometry (dimensionless). * ALGEBRAIC[0] is sovr_ze in component sarcomere_geometry (micrometre). * ALGEBRAIC[1] is sovr_cle in component sarcomere_geometry (micrometre). * ALGEBRAIC[2] is len_sovr in component sarcomere_geometry (micrometre). * CONSTANTS[0] is SLmax in component normalised_active_and_passive_force (micrometre). * CONSTANTS[1] is SLmin in component normalised_active_and_passive_force (micrometre). * CONSTANTS[2] is len_thin in component model_parameters (micrometre). * CONSTANTS[3] is len_thick in component model_parameters (micrometre). * CONSTANTS[4] is len_hbare in component model_parameters (micrometre). * STATES[0] is SL in component normalised_active_and_passive_force (micrometre). * STATES[1] is TRPNCaL in component Ca_binding_to_troponin_to_thin_filament_regulation (dimensionless). * STATES[2] is TRPNCaH in component Ca_binding_to_troponin_to_thin_filament_regulation (dimensionless). * ALGEBRAIC[35] is dTRPNCaL in component Ca_binding_to_troponin_to_thin_filament_regulation (first_order_rate_constant). * ALGEBRAIC[36] is dTRPNCaH in component Ca_binding_to_troponin_to_thin_filament_regulation (first_order_rate_constant). * ALGEBRAIC[43] is kn_pT in component Ca_binding_to_troponin_to_thin_filament_regulation (first_order_rate_constant). * ALGEBRAIC[44] is kp_nT in component Ca_binding_to_troponin_to_thin_filament_regulation (first_order_rate_constant). * CONSTANTS[55] is konT in component Ca_binding_to_troponin_to_thin_filament_regulation (second_order_rate_constant). * CONSTANTS[56] is koffLT in component Ca_binding_to_troponin_to_thin_filament_regulation (first_order_rate_constant). * CONSTANTS[57] is koffHT in component Ca_binding_to_troponin_to_thin_filament_regulation (first_order_rate_constant). * CONSTANTS[5] is Qkon in component Ca_binding_to_troponin_to_thin_filament_regulation (dimensionless). * CONSTANTS[6] is Qkoff in component Ca_binding_to_troponin_to_thin_filament_regulation (dimensionless). * CONSTANTS[7] is Qkn_p in component Ca_binding_to_troponin_to_thin_filament_regulation (dimensionless). * CONSTANTS[8] is Qkp_n in component Ca_binding_to_troponin_to_thin_filament_regulation (dimensionless). * CONSTANTS[9] is kon in component Ca_binding_to_troponin_to_thin_filament_regulation (second_order_rate_constant). * CONSTANTS[10] is koffL in component Ca_binding_to_troponin_to_thin_filament_regulation (first_order_rate_constant). * CONSTANTS[11] is koffH in component Ca_binding_to_troponin_to_thin_filament_regulation (first_order_rate_constant). * CONSTANTS[12] is perm50 in component Ca_binding_to_troponin_to_thin_filament_regulation (dimensionless). * CONSTANTS[13] is nperm in component Ca_binding_to_troponin_to_thin_filament_regulation (dimensionless). * CONSTANTS[14] is kn_p in component Ca_binding_to_troponin_to_thin_filament_regulation (first_order_rate_constant). * CONSTANTS[15] is kp_n in component Ca_binding_to_troponin_to_thin_filament_regulation (first_order_rate_constant). * CONSTANTS[16] is koffmod in component Ca_binding_to_troponin_to_thin_filament_regulation (dimensionless). * ALGEBRAIC[5] is Tropreg in component Ca_binding_to_troponin_to_thin_filament_regulation (dimensionless). * ALGEBRAIC[33] is permtot in component Ca_binding_to_troponin_to_thin_filament_regulation (dimensionless). * ALGEBRAIC[34] is inprmt in component Ca_binding_to_troponin_to_thin_filament_regulation (dimensionless). * CONSTANTS[17] is TmpC in component model_parameters (celsius). * ALGEBRAIC[32] is Cai in component equation_for_simulated_calcium_transient (micromolar). * CONSTANTS[58] is fappT in component thin_filament_regulation_and_crossbridge_cycling_rates (first_order_rate_constant). * ALGEBRAIC[7] is gappT in component thin_filament_regulation_and_crossbridge_cycling_rates (first_order_rate_constant). * ALGEBRAIC[10] is hfT in component thin_filament_regulation_and_crossbridge_cycling_rates (first_order_rate_constant). * ALGEBRAIC[11] is hbT in component thin_filament_regulation_and_crossbridge_cycling_rates (first_order_rate_constant). * ALGEBRAIC[13] is gxbT in component thin_filament_regulation_and_crossbridge_cycling_rates (first_order_rate_constant). * CONSTANTS[18] is fapp in component thin_filament_regulation_and_crossbridge_cycling_rates (first_order_rate_constant). * CONSTANTS[19] is gapp in component thin_filament_regulation_and_crossbridge_cycling_rates (first_order_rate_constant). * CONSTANTS[20] is hf in component thin_filament_regulation_and_crossbridge_cycling_rates (first_order_rate_constant). * CONSTANTS[21] is hb in component thin_filament_regulation_and_crossbridge_cycling_rates (first_order_rate_constant). * CONSTANTS[22] is gxb in component thin_filament_regulation_and_crossbridge_cycling_rates (first_order_rate_constant). * CONSTANTS[23] is gslmod in component thin_filament_regulation_and_crossbridge_cycling_rates (dimensionless). * ALGEBRAIC[8] is hfmd in component thin_filament_regulation_and_crossbridge_cycling_rates (dimensionless). * ALGEBRAIC[9] is hbmd in component thin_filament_regulation_and_crossbridge_cycling_rates (dimensionless). * CONSTANTS[24] is hfmdc in component thin_filament_regulation_and_crossbridge_cycling_rates (dimensionless). * CONSTANTS[25] is hbmdc in component thin_filament_regulation_and_crossbridge_cycling_rates (dimensionless). * CONSTANTS[26] is sigmap in component thin_filament_regulation_and_crossbridge_cycling_rates (dimensionless). * CONSTANTS[27] is sigman in component thin_filament_regulation_and_crossbridge_cycling_rates (dimensionless). * CONSTANTS[28] is xbmodsp in component thin_filament_regulation_and_crossbridge_cycling_rates (dimensionless). * CONSTANTS[29] is Qfapp in component thin_filament_regulation_and_crossbridge_cycling_rates (dimensionless). * CONSTANTS[30] is Qgapp in component thin_filament_regulation_and_crossbridge_cycling_rates (dimensionless). * CONSTANTS[31] is Qhf in component thin_filament_regulation_and_crossbridge_cycling_rates (dimensionless). * CONSTANTS[32] is Qhb in component thin_filament_regulation_and_crossbridge_cycling_rates (dimensionless). * CONSTANTS[33] is Qgxb in component thin_filament_regulation_and_crossbridge_cycling_rates (dimensionless). * ALGEBRAIC[12] is gxbmd in component thin_filament_regulation_and_crossbridge_cycling_rates (dimensionless). * ALGEBRAIC[6] is gapslmd in component thin_filament_regulation_and_crossbridge_cycling_rates (dimensionless). * CONSTANTS[34] is x_0 in component model_parameters (micrometre). * STATES[3] is xXBpostr in component mean_strain_of_strongly_bound_states (micrometre). * STATES[4] is xXBprer in component mean_strain_of_strongly_bound_states (micrometre). * STATES[5] is XBpostr in component regulation_and_crossbridge_cycling_state_equations (dimensionless). * STATES[6] is XBprer in component regulation_and_crossbridge_cycling_state_equations (dimensionless). * ALGEBRAIC[14] is dXBpostr in component regulation_and_crossbridge_cycling_state_equations (first_order_rate_constant). * ALGEBRAIC[37] is dXBprer in component regulation_and_crossbridge_cycling_state_equations (first_order_rate_constant). * STATES[7] is N_NoXB in component regulation_and_crossbridge_cycling_state_equations (dimensionless). * STATES[8] is P_NoXB in component regulation_and_crossbridge_cycling_state_equations (dimensionless). * ALGEBRAIC[15] is P in component regulation_and_crossbridge_cycling_state_equations (dimensionless). * STATES[9] is N in component regulation_and_crossbridge_cycling_state_equations (dimensionless). * ALGEBRAIC[39] is dxXBpostr in component mean_strain_of_strongly_bound_states (micrometre_per_millisecond). * ALGEBRAIC[38] is dxXBprer in component mean_strain_of_strongly_bound_states (micrometre_per_millisecond). * CONSTANTS[35] is xPsi in component mean_strain_of_strongly_bound_states (dimensionless). * ALGEBRAIC[16] is dutyprer in component mean_strain_of_strongly_bound_states (dimensionless). * ALGEBRAIC[17] is dutypostr in component mean_strain_of_strongly_bound_states (dimensionless). * ALGEBRAIC[24] is dSL in component normalised_active_and_passive_force (micrometre_per_millisecond). * CONSTANTS[61] is SSXBpostr in component normalised_active_and_passive_force (dimensionless). * CONSTANTS[59] is SSXBprer in component normalised_active_and_passive_force (dimensionless). * CONSTANTS[36] is kxb in component normalised_active_and_passive_force (millinewton_per_millimetre2). * CONSTANTS[62] is Fnordv in component normalised_active_and_passive_force (millinewton_micrometre_per_millimetre2). * ALGEBRAIC[18] is force in component normalised_active_and_passive_force (millinewton_micrometre_per_millimetre2). * ALGEBRAIC[19] is active in component normalised_active_and_passive_force (unit_normalised_force). * ALGEBRAIC[22] is ppforce in component normalised_active_and_passive_force (unit_normalised_force). * ALGEBRAIC[20] is ppforce_t in component normalised_active_and_passive_force (unit_normalised_force). * ALGEBRAIC[21] is ppforce_c in component normalised_active_and_passive_force (unit_normalised_force). * CONSTANTS[63] is preload in component normalised_active_and_passive_force (unit_normalised_force). * ALGEBRAIC[23] is afterload in component normalised_active_and_passive_force (unit_normalised_force). * STATES[10] is intf in component normalised_active_and_passive_force (unit_normalised_force_millisecond). * CONSTANTS[37] is SL_c in component normalised_active_and_passive_force (micrometre). * CONSTANTS[38] is SLrest in component normalised_active_and_passive_force (micrometre). * CONSTANTS[39] is SLset in component normalised_active_and_passive_force (micrometre). * CONSTANTS[40] is PCon_t in component normalised_active_and_passive_force (unit_normalised_force). * CONSTANTS[41] is PExp_t in component normalised_active_and_passive_force (per_micrometre). * CONSTANTS[42] is PCon_c in component normalised_active_and_passive_force (unit_normalised_force). * CONSTANTS[43] is PExp_c in component normalised_active_and_passive_force (per_micrometre). * CONSTANTS[44] is massf in component normalised_active_and_passive_force (unit_normalised_force_millisecond2_per_micrometre). * CONSTANTS[45] is visc in component normalised_active_and_passive_force (unit_normalised_force_millisecond_per_micrometre). * CONSTANTS[46] is KSE in component normalised_active_and_passive_force (unit_normalised_force_per_micrometre). * CONSTANTS[47] is SEon in component normalised_active_and_passive_force (dimensionless). * ALGEBRAIC[25] is FrSBXB in component calculation_of_micromolar_per_millisecondes_of_Ca_for_apparent_Ca_binding (dimensionless). * ALGEBRAIC[40] is dFrSBXB in component calculation_of_micromolar_per_millisecondes_of_Ca_for_apparent_Ca_binding (first_order_rate_constant). * ALGEBRAIC[26] is dsovr_ze in component calculation_of_micromolar_per_millisecondes_of_Ca_for_apparent_Ca_binding (micrometre_per_millisecond). * ALGEBRAIC[27] is dsovr_cle in component calculation_of_micromolar_per_millisecondes_of_Ca_for_apparent_Ca_binding (micrometre_per_millisecond). * ALGEBRAIC[28] is dlen_sovr in component calculation_of_micromolar_per_millisecondes_of_Ca_for_apparent_Ca_binding (micrometre_per_millisecond). * ALGEBRAIC[30] is dSOVFThick in component calculation_of_micromolar_per_millisecondes_of_Ca_for_apparent_Ca_binding (first_order_rate_constant). * ALGEBRAIC[29] is dSOVFThin in component calculation_of_micromolar_per_millisecondes_of_Ca_for_apparent_Ca_binding (first_order_rate_constant). * CONSTANTS[48] is kxb in component calculation_of_micromolar_per_millisecondes_of_Ca_for_apparent_Ca_binding (millinewton_per_millimetre2). * ALGEBRAIC[42] is dforce in component calculation_of_micromolar_per_millisecondes_of_Ca_for_apparent_Ca_binding (millinewton_micrometre_per_millimetre2_per_millisecond). * CONSTANTS[49] is Trop_conc in component calculation_of_micromolar_per_millisecondes_of_Ca_for_apparent_Ca_binding (micromolar). * ALGEBRAIC[31] is TropTot in component calculation_of_micromolar_per_millisecondes_of_Ca_for_apparent_Ca_binding (micromolar). * ALGEBRAIC[41] is dTropTot in component calculation_of_micromolar_per_millisecondes_of_Ca_for_apparent_Ca_binding (micromolar_per_millisecond). * CONSTANTS[60] is beta in component equation_for_simulated_calcium_transient (dimensionless). * CONSTANTS[50] is tau1 in component equation_for_simulated_calcium_transient (millisecond). * CONSTANTS[51] is tau2 in component equation_for_simulated_calcium_transient (millisecond). * CONSTANTS[52] is start_time in component equation_for_simulated_calcium_transient (millisecond). * CONSTANTS[53] is Ca_amplitude in component equation_for_simulated_calcium_transient (micromolar). * CONSTANTS[54] is Ca_diastolic in component equation_for_simulated_calcium_transient (micromolar). * RATES[1] is d/dt TRPNCaL in component Ca_binding_to_troponin_to_thin_filament_regulation (dimensionless). * RATES[2] is d/dt TRPNCaH in component Ca_binding_to_troponin_to_thin_filament_regulation (dimensionless). * RATES[7] is d/dt N_NoXB in component regulation_and_crossbridge_cycling_state_equations (dimensionless). * RATES[8] is d/dt P_NoXB in component regulation_and_crossbridge_cycling_state_equations (dimensionless). * RATES[9] is d/dt N in component regulation_and_crossbridge_cycling_state_equations (dimensionless). * RATES[6] is d/dt XBprer in component regulation_and_crossbridge_cycling_state_equations (dimensionless). * RATES[5] is d/dt XBpostr in component regulation_and_crossbridge_cycling_state_equations (dimensionless). * RATES[4] is d/dt xXBprer in component mean_strain_of_strongly_bound_states (micrometre). * RATES[3] is d/dt xXBpostr in component mean_strain_of_strongly_bound_states (micrometre). * RATES[0] is d/dt SL in component normalised_active_and_passive_force (micrometre). * RATES[10] is d/dt intf in component normalised_active_and_passive_force (unit_normalised_force_millisecond). * There are a total of 10 condition variables. */ void initConsts(double* CONSTANTS, double* RATES, double *STATES) { CONSTANTS[0] = 2.4; CONSTANTS[1] = 1.4; CONSTANTS[2] = 1.2; CONSTANTS[3] = 1.65; CONSTANTS[4] = 0.1; STATES[0] = 1.89999811516093; STATES[1] = 0.0147730085063734; STATES[2] = 0.13066096561522; CONSTANTS[5] = 1.5; CONSTANTS[6] = 1.3; CONSTANTS[7] = 1.6; CONSTANTS[8] = 1.6; CONSTANTS[9] = 0.05; CONSTANTS[10] = 0.25; CONSTANTS[11] = 0.025; CONSTANTS[12] = 0.5; CONSTANTS[13] = 15; CONSTANTS[14] = 0.5; CONSTANTS[15] = 0.05; CONSTANTS[16] = 1; CONSTANTS[17] = 24; CONSTANTS[18] = 0.5; CONSTANTS[19] = 0.07; CONSTANTS[20] = 2; CONSTANTS[21] = 0.4; CONSTANTS[22] = 0.07; CONSTANTS[23] = 6; CONSTANTS[24] = 5; CONSTANTS[25] = 0; CONSTANTS[26] = 8; CONSTANTS[27] = 1; CONSTANTS[28] = 1; CONSTANTS[29] = 6.25; CONSTANTS[30] = 2.5; CONSTANTS[31] = 6.25; CONSTANTS[32] = 6.25; CONSTANTS[33] = 6.25; CONSTANTS[34] = 0.007; STATES[3] = 0.00700005394873882; STATES[4] = 3.41212828972468e-8; STATES[5] = 1.81017564383744e-6; STATES[6] = 3.0494964880038e-7; STATES[7] = 0.999999959256274; STATES[8] = 4.07437173988636e-8; STATES[9] = 0.999997834540066; CONSTANTS[35] = 2; CONSTANTS[36] = 120; STATES[10] = -4.5113452510363e-6; CONSTANTS[37] = 2.25; CONSTANTS[38] = 1.85; CONSTANTS[39] = 1.9; CONSTANTS[40] = 0.002; CONSTANTS[41] = 10; CONSTANTS[42] = 0.02; CONSTANTS[43] = 70; CONSTANTS[44] = 50; CONSTANTS[45] = 3; CONSTANTS[46] = 1; CONSTANTS[47] = 1; CONSTANTS[48] = 120; CONSTANTS[49] = 70; CONSTANTS[50] = 20; CONSTANTS[51] = 110; CONSTANTS[52] = 5; CONSTANTS[53] = 1.45; CONSTANTS[54] = 0.09; CONSTANTS[55] = CONSTANTS[9]*pow(CONSTANTS[5], (CONSTANTS[17] - 37.0000)/10.0000); CONSTANTS[56] = CONSTANTS[10]*CONSTANTS[16]*pow(CONSTANTS[6], (CONSTANTS[17] - 37.0000)/10.0000); CONSTANTS[57] = CONSTANTS[11]*CONSTANTS[16]*pow(CONSTANTS[6], (CONSTANTS[17] - 37.0000)/10.0000); CONSTANTS[58] = CONSTANTS[18]*CONSTANTS[28]*pow(CONSTANTS[29], (CONSTANTS[17] - 37.0000)/10.0000); CONSTANTS[59] = ( CONSTANTS[21]*CONSTANTS[18]+ CONSTANTS[22]*CONSTANTS[18])/( CONSTANTS[18]*CONSTANTS[20]+ CONSTANTS[22]*CONSTANTS[20]+ CONSTANTS[22]*CONSTANTS[19]+ CONSTANTS[21]*CONSTANTS[18]+ CONSTANTS[21]*CONSTANTS[19]+ CONSTANTS[22]*CONSTANTS[18]); CONSTANTS[60] = pow(CONSTANTS[50]/CONSTANTS[51], - 1.00000/(CONSTANTS[50]/CONSTANTS[51] - 1.00000)) - pow(CONSTANTS[50]/CONSTANTS[51], - 1.00000/(1.00000 - CONSTANTS[51]/CONSTANTS[50])); CONSTANTS[61] = ( CONSTANTS[18]*CONSTANTS[20])/( CONSTANTS[18]*CONSTANTS[20]+ CONSTANTS[22]*CONSTANTS[20]+ CONSTANTS[22]*CONSTANTS[19]+ CONSTANTS[21]*CONSTANTS[18]+ CONSTANTS[21]*CONSTANTS[19]+ CONSTANTS[22]*CONSTANTS[18]); CONSTANTS[62] = CONSTANTS[36]*CONSTANTS[34]*CONSTANTS[61]; CONSTANTS[63] = (fabs(CONSTANTS[39] - CONSTANTS[38])/(CONSTANTS[39] - CONSTANTS[38]))*CONSTANTS[40]*(exp( CONSTANTS[41]*fabs(CONSTANTS[39] - CONSTANTS[38])) - 1.00000); RATES[1] = 0.1001; RATES[2] = 0.1001; RATES[7] = 0.1001; RATES[8] = 0.1001; RATES[9] = 0.1001; RATES[6] = 0.1001; RATES[5] = 0.1001; RATES[4] = 0.1001; RATES[3] = 0.1001; RATES[0] = 0.1001; RATES[10] = 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[35]; resid[1] = RATES[2] - ALGEBRAIC[36]; resid[2] = RATES[7] - ALGEBRAIC[44]*STATES[8] - ALGEBRAIC[43]*STATES[7]; resid[3] = RATES[8] - ALGEBRAIC[43]*STATES[7] - ALGEBRAIC[44]*STATES[8]; resid[4] = RATES[9] - ALGEBRAIC[44]*ALGEBRAIC[15] - ALGEBRAIC[43]*STATES[9]; resid[5] = RATES[6] - ALGEBRAIC[37]; resid[6] = RATES[5] - ALGEBRAIC[14]; resid[7] = RATES[4] - ALGEBRAIC[38]; resid[8] = RATES[3] - ALGEBRAIC[39]; resid[9] = RATES[0] - ALGEBRAIC[24]; resid[10] = RATES[10] - (CONSTANTS[63]+ALGEBRAIC[23]) - (ALGEBRAIC[22]+ALGEBRAIC[19]); } void computeVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC) { ALGEBRAIC[25] = (STATES[5]+STATES[6])/(CONSTANTS[61]+CONSTANTS[59]); ALGEBRAIC[26] = (CONDVAR[7]<0.00000 ? - 0.500000*ALGEBRAIC[24] : 0.00000); ALGEBRAIC[27] = (CONDVAR[8]>0.00000 ? - 0.500000*ALGEBRAIC[24] : 0.00000); ALGEBRAIC[28] = ALGEBRAIC[26] - ALGEBRAIC[27]; ALGEBRAIC[29] = ALGEBRAIC[28]/CONSTANTS[2]; ALGEBRAIC[30] = ( 2.00000*ALGEBRAIC[28])/(CONSTANTS[3] - CONSTANTS[4]); ALGEBRAIC[31] = CONSTANTS[49]*( (1.00000 - ALGEBRAIC[4])*STATES[1]+ ALGEBRAIC[4]*( ALGEBRAIC[25]*STATES[2]+ (1.00000 - ALGEBRAIC[25])*STATES[1])); ALGEBRAIC[40] = (ALGEBRAIC[14]+ALGEBRAIC[37])/(CONSTANTS[61]+CONSTANTS[59]); ALGEBRAIC[41] = CONSTANTS[49]*( - ALGEBRAIC[29]*STATES[1]+ (1.00000 - ALGEBRAIC[4])*ALGEBRAIC[35]+ ALGEBRAIC[29]*( ALGEBRAIC[25]*STATES[2]+ (1.00000 - ALGEBRAIC[25])*STATES[1])+ ALGEBRAIC[4]*(( ALGEBRAIC[40]*STATES[2]+ ALGEBRAIC[25]*ALGEBRAIC[36]+ (1.00000 - ALGEBRAIC[25])*ALGEBRAIC[35]) - ALGEBRAIC[40]*STATES[1])); ALGEBRAIC[42] = CONSTANTS[48]*ALGEBRAIC[30]*( STATES[3]*STATES[5]+ STATES[4]*STATES[6])+ CONSTANTS[48]*ALGEBRAIC[3]*( ALGEBRAIC[39]*STATES[5]+ STATES[3]*ALGEBRAIC[14]+ ALGEBRAIC[38]*STATES[6]+ STATES[4]*ALGEBRAIC[37]); } void computeEssentialVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC) { ALGEBRAIC[8] = exp( (- STATES[4]/fabs(STATES[4]))*CONSTANTS[24]*pow(STATES[4]/CONSTANTS[34], 2.00000)); ALGEBRAIC[10] = CONSTANTS[20]*ALGEBRAIC[8]*CONSTANTS[28]*pow(CONSTANTS[31], (CONSTANTS[17] - 37.0000)/10.0000); ALGEBRAIC[9] = exp( ((STATES[3] - CONSTANTS[34])/fabs(STATES[3] - CONSTANTS[34]))*CONSTANTS[25]*pow((STATES[3] - CONSTANTS[34])/CONSTANTS[34], 2.00000)); ALGEBRAIC[11] = CONSTANTS[21]*ALGEBRAIC[9]*CONSTANTS[28]*pow(CONSTANTS[32], (CONSTANTS[17] - 37.0000)/10.0000); ALGEBRAIC[12] = (CONDVAR[3]<0.00000 ? exp( CONSTANTS[26]*pow((CONSTANTS[34] - STATES[3])/CONSTANTS[34], 2.00000)) : exp( CONSTANTS[27]*pow((STATES[3] - CONSTANTS[34])/CONSTANTS[34], 2.00000))); ALGEBRAIC[13] = CONSTANTS[22]*ALGEBRAIC[12]*CONSTANTS[28]*pow(CONSTANTS[33], (CONSTANTS[17] - 37.0000)/10.0000); ALGEBRAIC[14] = ALGEBRAIC[10]*STATES[6] - ( ALGEBRAIC[11]*STATES[5]+ ALGEBRAIC[13]*STATES[5]); ALGEBRAIC[15] = ((1.00000 - STATES[9]) - STATES[6]) - STATES[5]; ALGEBRAIC[0] = (CONDVAR[0]<0.00000 ? CONSTANTS[3]/2.00000 : STATES[0]/2.00000); ALGEBRAIC[1] = (CONDVAR[1]>0.00000 ? STATES[0]/2.00000 - (STATES[0] - CONSTANTS[2]) : CONSTANTS[4]/2.00000); ALGEBRAIC[2] = ALGEBRAIC[0] - ALGEBRAIC[1]; ALGEBRAIC[3] = ( ALGEBRAIC[2]*2.00000)/(CONSTANTS[3] - CONSTANTS[4]); ALGEBRAIC[18] = CONSTANTS[36]*ALGEBRAIC[3]*( STATES[3]*STATES[5]+ STATES[4]*STATES[6]); ALGEBRAIC[19] = ( 1.00000*ALGEBRAIC[18])/CONSTANTS[62]; ALGEBRAIC[20] = ((STATES[0] - CONSTANTS[38])/fabs(STATES[0] - CONSTANTS[38]))*CONSTANTS[40]*(exp( CONSTANTS[41]*fabs(STATES[0] - CONSTANTS[38])) - 1.00000); ALGEBRAIC[21] = (CONDVAR[4]>0.00000 ? CONSTANTS[42]*(exp( CONSTANTS[43]*fabs(STATES[0] - CONSTANTS[37])) - 1.00000) : 0.00000); ALGEBRAIC[22] = ALGEBRAIC[20]+ALGEBRAIC[21]; ALGEBRAIC[23] = (CONSTANTS[47]==1.00000 ? CONSTANTS[46]*(CONSTANTS[39] - STATES[0]) : 0.00000); ALGEBRAIC[24] = (CONDVAR[5]<=0.00000&&CONDVAR[6]>0.00000 ? (STATES[10]+ (CONSTANTS[39] - STATES[0])*CONSTANTS[45])/CONSTANTS[44] : 0.00000); ALGEBRAIC[32] = (CONDVAR[9]>0.00000 ? ((CONSTANTS[53] - CONSTANTS[54])/CONSTANTS[60])*(exp(- (VOI - CONSTANTS[52])/CONSTANTS[50]) - exp(- (VOI - CONSTANTS[52])/CONSTANTS[51]))+CONSTANTS[54] : CONSTANTS[54]); ALGEBRAIC[35] = CONSTANTS[55]*ALGEBRAIC[32]*(1.00000 - STATES[1]) - CONSTANTS[56]*STATES[1]; ALGEBRAIC[36] = CONSTANTS[55]*ALGEBRAIC[32]*(1.00000 - STATES[2]) - CONSTANTS[57]*STATES[2]; ALGEBRAIC[6] = 1.00000+ (1.00000 - ALGEBRAIC[3])*CONSTANTS[23]; ALGEBRAIC[7] = CONSTANTS[19]*ALGEBRAIC[6]*CONSTANTS[28]*pow(CONSTANTS[30], (CONSTANTS[17] - 37.0000)/10.0000); ALGEBRAIC[37] = ( CONSTANTS[58]*ALGEBRAIC[15]+ ALGEBRAIC[11]*STATES[5]) - ( ALGEBRAIC[7]*STATES[6]+ ALGEBRAIC[10]*STATES[6]); ALGEBRAIC[16] = ( ALGEBRAIC[11]*CONSTANTS[58]+ ALGEBRAIC[13]*CONSTANTS[58])/( CONSTANTS[58]*ALGEBRAIC[10]+ ALGEBRAIC[13]*ALGEBRAIC[10]+ ALGEBRAIC[13]*ALGEBRAIC[7]+ ALGEBRAIC[11]*CONSTANTS[58]+ ALGEBRAIC[11]*ALGEBRAIC[7]+ ALGEBRAIC[13]*CONSTANTS[58]); ALGEBRAIC[38] = ALGEBRAIC[24]/2.00000+ (CONSTANTS[35]/ALGEBRAIC[16])*( CONSTANTS[58]*- STATES[4]+ ALGEBRAIC[11]*(STATES[3] - (CONSTANTS[34]+STATES[4]))); ALGEBRAIC[17] = ( CONSTANTS[58]*ALGEBRAIC[10])/( CONSTANTS[58]*ALGEBRAIC[10]+ ALGEBRAIC[13]*ALGEBRAIC[10]+ ALGEBRAIC[13]*ALGEBRAIC[7]+ ALGEBRAIC[11]*CONSTANTS[58]+ ALGEBRAIC[11]*ALGEBRAIC[7]+ ALGEBRAIC[13]*CONSTANTS[58]); ALGEBRAIC[39] = ALGEBRAIC[24]/2.00000+ (CONSTANTS[35]/ALGEBRAIC[17])*ALGEBRAIC[10]*((STATES[4]+CONSTANTS[34]) - STATES[3]); ALGEBRAIC[4] = ALGEBRAIC[2]/CONSTANTS[2]; ALGEBRAIC[5] = (1.00000 - ALGEBRAIC[4])*STATES[1]+ ALGEBRAIC[4]*STATES[2]; ALGEBRAIC[33] = pow(fabs(1.00000/(1.00000+pow(CONSTANTS[12]/ALGEBRAIC[5], CONSTANTS[13]))), 1.0 / 2); ALGEBRAIC[43] = CONSTANTS[14]*ALGEBRAIC[33]*pow(CONSTANTS[7], (CONSTANTS[17] - 37.0000)/10.0000); ALGEBRAIC[34] = (CONDVAR[2]<0.00000 ? 1.00000/ALGEBRAIC[33] : 100.000); ALGEBRAIC[44] = CONSTANTS[15]*ALGEBRAIC[34]*pow(CONSTANTS[8], (CONSTANTS[17] - 37.0000)/10.0000); } 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; SI[7] = 1.0; SI[8] = 1.0; SI[9] = 1.0; SI[10] = 1.0; } void computeRoots(double VOI, double* CONSTANTS, double* RATES, double* OLDRATES, double* STATES, double* OLDSTATES, double* ALGEBRAIC, double* CONDVARS) { CONDVAR[0] = CONSTANTS[3]/2.00000 - STATES[0]/2.00000; CONDVAR[1] = (STATES[0]/2.00000 - (STATES[0] - CONSTANTS[2])) - CONSTANTS[4]/2.00000; CONDVAR[2] = 1.00000/ALGEBRAIC[33] - 100.000; CONDVAR[3] = STATES[3] - CONSTANTS[34]; CONDVAR[4] = STATES[0] - CONSTANTS[37]; CONDVAR[5] = STATES[0] - CONSTANTS[0]; CONDVAR[6] = STATES[0] - CONSTANTS[1]; CONDVAR[7] = STATES[0] - CONSTANTS[3]; CONDVAR[8] = ( 2.00000*CONSTANTS[2] - STATES[0]) - CONSTANTS[4]; CONDVAR[9] = VOI - CONSTANTS[52]; }