Generated Code

The following is c code generated by the CellML API from this CellML file. (Back to language selection)

The raw code is available.

/*
   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[42] is dTRPNCaL in component Ca_binding_to_troponin_to_thin_filament_regulation (first_order_rate_constant).
 * ALGEBRAIC[43] is dTRPNCaH in component Ca_binding_to_troponin_to_thin_filament_regulation (first_order_rate_constant).
 * ALGEBRAIC[10] is kn_pT in component Ca_binding_to_troponin_to_thin_filament_regulation (first_order_rate_constant).
 * ALGEBRAIC[14] 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[6] is Tropreg in component Ca_binding_to_troponin_to_thin_filament_regulation (dimensionless).
 * ALGEBRAIC[8] is permtot in component Ca_binding_to_troponin_to_thin_filament_regulation (dimensionless).
 * ALGEBRAIC[12] is inprmt in component Ca_binding_to_troponin_to_thin_filament_regulation (dimensionless).
 * CONSTANTS[17] is TmpC in component model_parameters (celsius).
 * ALGEBRAIC[40] 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[17] is gappT in component thin_filament_regulation_and_crossbridge_cycling_rates (first_order_rate_constant).
 * ALGEBRAIC[20] is hfT in component thin_filament_regulation_and_crossbridge_cycling_rates (first_order_rate_constant).
 * ALGEBRAIC[21] is hbT in component thin_filament_regulation_and_crossbridge_cycling_rates (first_order_rate_constant).
 * ALGEBRAIC[23] 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[18] is hfmd in component thin_filament_regulation_and_crossbridge_cycling_rates (dimensionless).
 * ALGEBRAIC[19] 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[22] is gxbmd in component thin_filament_regulation_and_crossbridge_cycling_rates (dimensionless).
 * ALGEBRAIC[16] 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[24] is dXBpostr in component regulation_and_crossbridge_cycling_state_equations (first_order_rate_constant).
 * ALGEBRAIC[26] 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[25] 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[31] is dxXBpostr in component mean_strain_of_strongly_bound_states (micrometre_per_millisecond).
 * ALGEBRAIC[30] 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[27] is dutyprer in component mean_strain_of_strongly_bound_states (dimensionless).
 * ALGEBRAIC[28] is dutypostr in component mean_strain_of_strongly_bound_states (dimensionless).
 * ALGEBRAIC[29] 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[5] is force in component normalised_active_and_passive_force (millinewton_micrometre_per_millimetre2).
 * ALGEBRAIC[7] is active in component normalised_active_and_passive_force (unit_normalised_force).
 * ALGEBRAIC[13] is ppforce in component normalised_active_and_passive_force (unit_normalised_force).
 * ALGEBRAIC[9] is ppforce_t in component normalised_active_and_passive_force (unit_normalised_force).
 * ALGEBRAIC[11] 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[15] 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[32] is FrSBXB in component calculation_of_micromolar_per_millisecondes_of_Ca_for_apparent_Ca_binding (dimensionless).
 * ALGEBRAIC[33] is dFrSBXB in component calculation_of_micromolar_per_millisecondes_of_Ca_for_apparent_Ca_binding (first_order_rate_constant).
 * ALGEBRAIC[35] is dsovr_ze in component calculation_of_micromolar_per_millisecondes_of_Ca_for_apparent_Ca_binding (micrometre_per_millisecond).
 * ALGEBRAIC[36] is dsovr_cle in component calculation_of_micromolar_per_millisecondes_of_Ca_for_apparent_Ca_binding (micrometre_per_millisecond).
 * ALGEBRAIC[37] is dlen_sovr in component calculation_of_micromolar_per_millisecondes_of_Ca_for_apparent_Ca_binding (micrometre_per_millisecond).
 * ALGEBRAIC[39] is dSOVFThick in component calculation_of_micromolar_per_millisecondes_of_Ca_for_apparent_Ca_binding (first_order_rate_constant).
 * ALGEBRAIC[38] 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[41] 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[34] is TropTot in component calculation_of_micromolar_per_millisecondes_of_Ca_for_apparent_Ca_binding (micromolar).
 * ALGEBRAIC[44] 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).
 */
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);
}
void
computeRates(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
ALGEBRAIC[0] = (CONSTANTS[3]/2.00000<STATES[0]/2.00000 ? CONSTANTS[3]/2.00000 : STATES[0]/2.00000);
ALGEBRAIC[1] = (STATES[0]/2.00000 - (STATES[0] - CONSTANTS[2])>CONSTANTS[4]/2.00000 ? STATES[0]/2.00000 - (STATES[0] - CONSTANTS[2]) : CONSTANTS[4]/2.00000);
ALGEBRAIC[2] = ALGEBRAIC[0] - ALGEBRAIC[1];
ALGEBRAIC[4] = ALGEBRAIC[2]/CONSTANTS[2];
ALGEBRAIC[6] =  (1.00000 - ALGEBRAIC[4])*STATES[1]+ ALGEBRAIC[4]*STATES[2];
ALGEBRAIC[8] =  pow(fabs(1.00000/(1.00000+pow(CONSTANTS[12]/ALGEBRAIC[6], CONSTANTS[13]))), 1.0 / 2);
ALGEBRAIC[10] =  CONSTANTS[14]*ALGEBRAIC[8]*pow(CONSTANTS[7], (CONSTANTS[17] - 37.0000)/10.0000);
ALGEBRAIC[12] = (1.00000/ALGEBRAIC[8]<100.000 ? 1.00000/ALGEBRAIC[8] : 100.000);
ALGEBRAIC[14] =  CONSTANTS[15]*ALGEBRAIC[12]*pow(CONSTANTS[8], (CONSTANTS[17] - 37.0000)/10.0000);
RATES[7] =  ALGEBRAIC[14]*STATES[8] -  ALGEBRAIC[10]*STATES[7];
RATES[8] =  ALGEBRAIC[10]*STATES[7] -  ALGEBRAIC[14]*STATES[8];
ALGEBRAIC[3] = ( ALGEBRAIC[2]*2.00000)/(CONSTANTS[3] - CONSTANTS[4]);
ALGEBRAIC[5] =  CONSTANTS[36]*ALGEBRAIC[3]*( STATES[3]*STATES[5]+ STATES[4]*STATES[6]);
ALGEBRAIC[7] = ( 1.00000*ALGEBRAIC[5])/CONSTANTS[62];
ALGEBRAIC[9] =  ((STATES[0] - CONSTANTS[38])/fabs(STATES[0] - CONSTANTS[38]))*CONSTANTS[40]*(exp( CONSTANTS[41]*fabs(STATES[0] - CONSTANTS[38])) - 1.00000);
ALGEBRAIC[11] = (STATES[0]>CONSTANTS[37] ?  CONSTANTS[42]*(exp( CONSTANTS[43]*fabs(STATES[0] - CONSTANTS[37])) - 1.00000) : 0.00000);
ALGEBRAIC[13] = ALGEBRAIC[9]+ALGEBRAIC[11];
ALGEBRAIC[15] = (CONSTANTS[47]==1.00000 ?  CONSTANTS[46]*(CONSTANTS[39] - STATES[0]) : 0.00000);
RATES[10] = (CONSTANTS[63]+ALGEBRAIC[15]) - (ALGEBRAIC[13]+ALGEBRAIC[7]);
ALGEBRAIC[18] = exp( (- STATES[4]/fabs(STATES[4]))*CONSTANTS[24]*pow(STATES[4]/CONSTANTS[34], 2.00000));
ALGEBRAIC[20] =  CONSTANTS[20]*ALGEBRAIC[18]*CONSTANTS[28]*pow(CONSTANTS[31], (CONSTANTS[17] - 37.0000)/10.0000);
ALGEBRAIC[19] = exp( ((STATES[3] - CONSTANTS[34])/fabs(STATES[3] - CONSTANTS[34]))*CONSTANTS[25]*pow((STATES[3] - CONSTANTS[34])/CONSTANTS[34], 2.00000));
ALGEBRAIC[21] =  CONSTANTS[21]*ALGEBRAIC[19]*CONSTANTS[28]*pow(CONSTANTS[32], (CONSTANTS[17] - 37.0000)/10.0000);
ALGEBRAIC[22] = (STATES[3]<CONSTANTS[34] ? 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[23] =  CONSTANTS[22]*ALGEBRAIC[22]*CONSTANTS[28]*pow(CONSTANTS[33], (CONSTANTS[17] - 37.0000)/10.0000);
ALGEBRAIC[24] =  ALGEBRAIC[20]*STATES[6] - ( ALGEBRAIC[21]*STATES[5]+ ALGEBRAIC[23]*STATES[5]);
RATES[5] = ALGEBRAIC[24];
ALGEBRAIC[25] = ((1.00000 - STATES[9]) - STATES[6]) - STATES[5];
RATES[9] =  ALGEBRAIC[14]*ALGEBRAIC[25] -  ALGEBRAIC[10]*STATES[9];
ALGEBRAIC[16] = 1.00000+ (1.00000 - ALGEBRAIC[3])*CONSTANTS[23];
ALGEBRAIC[17] =  CONSTANTS[19]*ALGEBRAIC[16]*CONSTANTS[28]*pow(CONSTANTS[30], (CONSTANTS[17] - 37.0000)/10.0000);
ALGEBRAIC[26] = ( CONSTANTS[58]*ALGEBRAIC[25]+ ALGEBRAIC[21]*STATES[5]) - ( ALGEBRAIC[17]*STATES[6]+ ALGEBRAIC[20]*STATES[6]);
RATES[6] = ALGEBRAIC[26];
ALGEBRAIC[29] = (STATES[0]<=CONSTANTS[0]&&STATES[0]>CONSTANTS[1] ? (STATES[10]+ (CONSTANTS[39] - STATES[0])*CONSTANTS[45])/CONSTANTS[44] : 0.00000);
RATES[0] = ALGEBRAIC[29];
ALGEBRAIC[27] = ( ALGEBRAIC[21]*CONSTANTS[58]+ ALGEBRAIC[23]*CONSTANTS[58])/( CONSTANTS[58]*ALGEBRAIC[20]+ ALGEBRAIC[23]*ALGEBRAIC[20]+ ALGEBRAIC[23]*ALGEBRAIC[17]+ ALGEBRAIC[21]*CONSTANTS[58]+ ALGEBRAIC[21]*ALGEBRAIC[17]+ ALGEBRAIC[23]*CONSTANTS[58]);
ALGEBRAIC[30] = ALGEBRAIC[29]/2.00000+ (CONSTANTS[35]/ALGEBRAIC[27])*( CONSTANTS[58]*- STATES[4]+ ALGEBRAIC[21]*(STATES[3] - (CONSTANTS[34]+STATES[4])));
RATES[4] = ALGEBRAIC[30];
ALGEBRAIC[28] = ( CONSTANTS[58]*ALGEBRAIC[20])/( CONSTANTS[58]*ALGEBRAIC[20]+ ALGEBRAIC[23]*ALGEBRAIC[20]+ ALGEBRAIC[23]*ALGEBRAIC[17]+ ALGEBRAIC[21]*CONSTANTS[58]+ ALGEBRAIC[21]*ALGEBRAIC[17]+ ALGEBRAIC[23]*CONSTANTS[58]);
ALGEBRAIC[31] = ALGEBRAIC[29]/2.00000+ (CONSTANTS[35]/ALGEBRAIC[28])*ALGEBRAIC[20]*((STATES[4]+CONSTANTS[34]) - STATES[3]);
RATES[3] = ALGEBRAIC[31];
ALGEBRAIC[40] = (VOI>CONSTANTS[52] ?  ((CONSTANTS[53] - CONSTANTS[54])/CONSTANTS[60])*(exp(- (VOI - CONSTANTS[52])/CONSTANTS[50]) - exp(- (VOI - CONSTANTS[52])/CONSTANTS[51]))+CONSTANTS[54] : CONSTANTS[54]);
ALGEBRAIC[42] =  CONSTANTS[55]*ALGEBRAIC[40]*(1.00000 - STATES[1]) -  CONSTANTS[56]*STATES[1];
RATES[1] = ALGEBRAIC[42];
ALGEBRAIC[43] =  CONSTANTS[55]*ALGEBRAIC[40]*(1.00000 - STATES[2]) -  CONSTANTS[57]*STATES[2];
RATES[2] = ALGEBRAIC[43];
}
void
computeVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
ALGEBRAIC[0] = (CONSTANTS[3]/2.00000<STATES[0]/2.00000 ? CONSTANTS[3]/2.00000 : STATES[0]/2.00000);
ALGEBRAIC[1] = (STATES[0]/2.00000 - (STATES[0] - CONSTANTS[2])>CONSTANTS[4]/2.00000 ? STATES[0]/2.00000 - (STATES[0] - CONSTANTS[2]) : CONSTANTS[4]/2.00000);
ALGEBRAIC[2] = ALGEBRAIC[0] - ALGEBRAIC[1];
ALGEBRAIC[4] = ALGEBRAIC[2]/CONSTANTS[2];
ALGEBRAIC[6] =  (1.00000 - ALGEBRAIC[4])*STATES[1]+ ALGEBRAIC[4]*STATES[2];
ALGEBRAIC[8] =  pow(fabs(1.00000/(1.00000+pow(CONSTANTS[12]/ALGEBRAIC[6], CONSTANTS[13]))), 1.0 / 2);
ALGEBRAIC[10] =  CONSTANTS[14]*ALGEBRAIC[8]*pow(CONSTANTS[7], (CONSTANTS[17] - 37.0000)/10.0000);
ALGEBRAIC[12] = (1.00000/ALGEBRAIC[8]<100.000 ? 1.00000/ALGEBRAIC[8] : 100.000);
ALGEBRAIC[14] =  CONSTANTS[15]*ALGEBRAIC[12]*pow(CONSTANTS[8], (CONSTANTS[17] - 37.0000)/10.0000);
ALGEBRAIC[3] = ( ALGEBRAIC[2]*2.00000)/(CONSTANTS[3] - CONSTANTS[4]);
ALGEBRAIC[5] =  CONSTANTS[36]*ALGEBRAIC[3]*( STATES[3]*STATES[5]+ STATES[4]*STATES[6]);
ALGEBRAIC[7] = ( 1.00000*ALGEBRAIC[5])/CONSTANTS[62];
ALGEBRAIC[9] =  ((STATES[0] - CONSTANTS[38])/fabs(STATES[0] - CONSTANTS[38]))*CONSTANTS[40]*(exp( CONSTANTS[41]*fabs(STATES[0] - CONSTANTS[38])) - 1.00000);
ALGEBRAIC[11] = (STATES[0]>CONSTANTS[37] ?  CONSTANTS[42]*(exp( CONSTANTS[43]*fabs(STATES[0] - CONSTANTS[37])) - 1.00000) : 0.00000);
ALGEBRAIC[13] = ALGEBRAIC[9]+ALGEBRAIC[11];
ALGEBRAIC[15] = (CONSTANTS[47]==1.00000 ?  CONSTANTS[46]*(CONSTANTS[39] - STATES[0]) : 0.00000);
ALGEBRAIC[18] = exp( (- STATES[4]/fabs(STATES[4]))*CONSTANTS[24]*pow(STATES[4]/CONSTANTS[34], 2.00000));
ALGEBRAIC[20] =  CONSTANTS[20]*ALGEBRAIC[18]*CONSTANTS[28]*pow(CONSTANTS[31], (CONSTANTS[17] - 37.0000)/10.0000);
ALGEBRAIC[19] = exp( ((STATES[3] - CONSTANTS[34])/fabs(STATES[3] - CONSTANTS[34]))*CONSTANTS[25]*pow((STATES[3] - CONSTANTS[34])/CONSTANTS[34], 2.00000));
ALGEBRAIC[21] =  CONSTANTS[21]*ALGEBRAIC[19]*CONSTANTS[28]*pow(CONSTANTS[32], (CONSTANTS[17] - 37.0000)/10.0000);
ALGEBRAIC[22] = (STATES[3]<CONSTANTS[34] ? 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[23] =  CONSTANTS[22]*ALGEBRAIC[22]*CONSTANTS[28]*pow(CONSTANTS[33], (CONSTANTS[17] - 37.0000)/10.0000);
ALGEBRAIC[24] =  ALGEBRAIC[20]*STATES[6] - ( ALGEBRAIC[21]*STATES[5]+ ALGEBRAIC[23]*STATES[5]);
ALGEBRAIC[25] = ((1.00000 - STATES[9]) - STATES[6]) - STATES[5];
ALGEBRAIC[16] = 1.00000+ (1.00000 - ALGEBRAIC[3])*CONSTANTS[23];
ALGEBRAIC[17] =  CONSTANTS[19]*ALGEBRAIC[16]*CONSTANTS[28]*pow(CONSTANTS[30], (CONSTANTS[17] - 37.0000)/10.0000);
ALGEBRAIC[26] = ( CONSTANTS[58]*ALGEBRAIC[25]+ ALGEBRAIC[21]*STATES[5]) - ( ALGEBRAIC[17]*STATES[6]+ ALGEBRAIC[20]*STATES[6]);
ALGEBRAIC[29] = (STATES[0]<=CONSTANTS[0]&&STATES[0]>CONSTANTS[1] ? (STATES[10]+ (CONSTANTS[39] - STATES[0])*CONSTANTS[45])/CONSTANTS[44] : 0.00000);
ALGEBRAIC[27] = ( ALGEBRAIC[21]*CONSTANTS[58]+ ALGEBRAIC[23]*CONSTANTS[58])/( CONSTANTS[58]*ALGEBRAIC[20]+ ALGEBRAIC[23]*ALGEBRAIC[20]+ ALGEBRAIC[23]*ALGEBRAIC[17]+ ALGEBRAIC[21]*CONSTANTS[58]+ ALGEBRAIC[21]*ALGEBRAIC[17]+ ALGEBRAIC[23]*CONSTANTS[58]);
ALGEBRAIC[30] = ALGEBRAIC[29]/2.00000+ (CONSTANTS[35]/ALGEBRAIC[27])*( CONSTANTS[58]*- STATES[4]+ ALGEBRAIC[21]*(STATES[3] - (CONSTANTS[34]+STATES[4])));
ALGEBRAIC[28] = ( CONSTANTS[58]*ALGEBRAIC[20])/( CONSTANTS[58]*ALGEBRAIC[20]+ ALGEBRAIC[23]*ALGEBRAIC[20]+ ALGEBRAIC[23]*ALGEBRAIC[17]+ ALGEBRAIC[21]*CONSTANTS[58]+ ALGEBRAIC[21]*ALGEBRAIC[17]+ ALGEBRAIC[23]*CONSTANTS[58]);
ALGEBRAIC[31] = ALGEBRAIC[29]/2.00000+ (CONSTANTS[35]/ALGEBRAIC[28])*ALGEBRAIC[20]*((STATES[4]+CONSTANTS[34]) - STATES[3]);
ALGEBRAIC[40] = (VOI>CONSTANTS[52] ?  ((CONSTANTS[53] - CONSTANTS[54])/CONSTANTS[60])*(exp(- (VOI - CONSTANTS[52])/CONSTANTS[50]) - exp(- (VOI - CONSTANTS[52])/CONSTANTS[51]))+CONSTANTS[54] : CONSTANTS[54]);
ALGEBRAIC[42] =  CONSTANTS[55]*ALGEBRAIC[40]*(1.00000 - STATES[1]) -  CONSTANTS[56]*STATES[1];
ALGEBRAIC[43] =  CONSTANTS[55]*ALGEBRAIC[40]*(1.00000 - STATES[2]) -  CONSTANTS[57]*STATES[2];
ALGEBRAIC[32] = (STATES[5]+STATES[6])/(CONSTANTS[61]+CONSTANTS[59]);
ALGEBRAIC[33] = (ALGEBRAIC[24]+ALGEBRAIC[26])/(CONSTANTS[61]+CONSTANTS[59]);
ALGEBRAIC[34] =  CONSTANTS[49]*( (1.00000 - ALGEBRAIC[4])*STATES[1]+ ALGEBRAIC[4]*( ALGEBRAIC[32]*STATES[2]+ (1.00000 - ALGEBRAIC[32])*STATES[1]));
ALGEBRAIC[35] = (STATES[0]<CONSTANTS[3] ?  - 0.500000*ALGEBRAIC[29] : 0.00000);
ALGEBRAIC[36] = ( 2.00000*CONSTANTS[2] - STATES[0]>CONSTANTS[4] ?  - 0.500000*ALGEBRAIC[29] : 0.00000);
ALGEBRAIC[37] = ALGEBRAIC[35] - ALGEBRAIC[36];
ALGEBRAIC[38] = ALGEBRAIC[37]/CONSTANTS[2];
ALGEBRAIC[39] = ( 2.00000*ALGEBRAIC[37])/(CONSTANTS[3] - CONSTANTS[4]);
ALGEBRAIC[41] =  CONSTANTS[48]*ALGEBRAIC[39]*( STATES[3]*STATES[5]+ STATES[4]*STATES[6])+ CONSTANTS[48]*ALGEBRAIC[3]*( ALGEBRAIC[31]*STATES[5]+ STATES[3]*ALGEBRAIC[24]+ ALGEBRAIC[30]*STATES[6]+ STATES[4]*ALGEBRAIC[26]);
ALGEBRAIC[44] =  CONSTANTS[49]*( - ALGEBRAIC[38]*STATES[1]+ (1.00000 - ALGEBRAIC[4])*ALGEBRAIC[42]+ ALGEBRAIC[38]*( ALGEBRAIC[32]*STATES[2]+ (1.00000 - ALGEBRAIC[32])*STATES[1])+ ALGEBRAIC[4]*(( ALGEBRAIC[33]*STATES[2]+ ALGEBRAIC[32]*ALGEBRAIC[43]+ (1.00000 - ALGEBRAIC[32])*ALGEBRAIC[42]) -  ALGEBRAIC[33]*STATES[1]));
}