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 44 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 72 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 len_thin in component model_parameters (micrometre).
 * CONSTANTS[1] is len_thick in component model_parameters (micrometre).
 * CONSTANTS[2] 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[7] is dTRPNCaL in component Ca_binding_to_troponin_to_thin_filament_regulation (first_order_rate_constant).
 * ALGEBRAIC[10] is dTRPNCaH in component Ca_binding_to_troponin_to_thin_filament_regulation (first_order_rate_constant).
 * ALGEBRAIC[12] is kn_pT in component Ca_binding_to_troponin_to_thin_filament_regulation (first_order_rate_constant).
 * ALGEBRAIC[18] is kp_nT in component Ca_binding_to_troponin_to_thin_filament_regulation (first_order_rate_constant).
 * CONSTANTS[58] is H in component Ca_binding_to_troponin_to_thin_filament_regulation (micromolar).
 * CONSTANTS[61] is H_cons in component Ca_binding_to_troponin_to_thin_filament_regulation (micromolar).
 * CONSTANTS[62] 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[3] is Qkon in component Ca_binding_to_troponin_to_thin_filament_regulation (dimensionless).
 * CONSTANTS[4] is Qkoff in component Ca_binding_to_troponin_to_thin_filament_regulation (dimensionless).
 * CONSTANTS[5] is Qkn_p in component Ca_binding_to_troponin_to_thin_filament_regulation (dimensionless).
 * CONSTANTS[6] is Qkp_n in component Ca_binding_to_troponin_to_thin_filament_regulation (dimensionless).
 * CONSTANTS[7] is kon in component Ca_binding_to_troponin_to_thin_filament_regulation (second_order_rate_constant).
 * CONSTANTS[8] is koffL in component Ca_binding_to_troponin_to_thin_filament_regulation (first_order_rate_constant).
 * CONSTANTS[9] is koffH in component Ca_binding_to_troponin_to_thin_filament_regulation (first_order_rate_constant).
 * CONSTANTS[10] is perm50 in component Ca_binding_to_troponin_to_thin_filament_regulation (dimensionless).
 * CONSTANTS[11] is nperm in component Ca_binding_to_troponin_to_thin_filament_regulation (dimensionless).
 * CONSTANTS[12] is kn_p in component Ca_binding_to_troponin_to_thin_filament_regulation (first_order_rate_constant).
 * CONSTANTS[13] is kp_n in component Ca_binding_to_troponin_to_thin_filament_regulation (first_order_rate_constant).
 * CONSTANTS[14] 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[9] is permtot in component Ca_binding_to_troponin_to_thin_filament_regulation (dimensionless).
 * ALGEBRAIC[15] is inprmt in component Ca_binding_to_troponin_to_thin_filament_regulation (dimensionless).
 * CONSTANTS[15] is pH in component Ca_binding_to_troponin_to_thin_filament_regulation (dimensionless).
 * CONSTANTS[16] is m in component Ca_binding_to_troponin_to_thin_filament_regulation (dimensionless).
 * CONSTANTS[17] is kdHCa in component Ca_binding_to_troponin_to_thin_filament_regulation (micromolar).
 * CONSTANTS[18] is TmpC in component model_parameters (kelvin).
 * CONSTANTS[19] is Cai in component model_parameters (micromolar).
 * CONSTANTS[63] is fappT in component thin_filament_regulation_and_crossbridge_cycling_rates (first_order_rate_constant).
 * ALGEBRAIC[16] 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).
 * CONSTANTS[65] 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[20] is fapp in component thin_filament_regulation_and_crossbridge_cycling_rates (first_order_rate_constant).
 * CONSTANTS[21] is gapp in component thin_filament_regulation_and_crossbridge_cycling_rates (first_order_rate_constant).
 * CONSTANTS[22] is hf in component thin_filament_regulation_and_crossbridge_cycling_rates (first_order_rate_constant).
 * CONSTANTS[23] is hb in component thin_filament_regulation_and_crossbridge_cycling_rates (first_order_rate_constant).
 * CONSTANTS[24] is gxb in component thin_filament_regulation_and_crossbridge_cycling_rates (first_order_rate_constant).
 * CONSTANTS[25] is gslmod in component thin_filament_regulation_and_crossbridge_cycling_rates (dimensionless).
 * ALGEBRAIC[19] is hfmd in component thin_filament_regulation_and_crossbridge_cycling_rates (dimensionless).
 * CONSTANTS[64] is hbmd in component thin_filament_regulation_and_crossbridge_cycling_rates (dimensionless).
 * CONSTANTS[26] is hfmdc in component thin_filament_regulation_and_crossbridge_cycling_rates (dimensionless).
 * CONSTANTS[27] is hbmdc in component thin_filament_regulation_and_crossbridge_cycling_rates (dimensionless).
 * CONSTANTS[28] is sigmap in component thin_filament_regulation_and_crossbridge_cycling_rates (dimensionless).
 * CONSTANTS[29] is sigman in component thin_filament_regulation_and_crossbridge_cycling_rates (dimensionless).
 * CONSTANTS[30] is xbmodsp in component thin_filament_regulation_and_crossbridge_cycling_rates (dimensionless).
 * CONSTANTS[31] is Qfapp in component thin_filament_regulation_and_crossbridge_cycling_rates (dimensionless).
 * CONSTANTS[32] is Qgapp in component thin_filament_regulation_and_crossbridge_cycling_rates (dimensionless).
 * CONSTANTS[33] is Qhf in component thin_filament_regulation_and_crossbridge_cycling_rates (dimensionless).
 * CONSTANTS[34] is Qhb in component thin_filament_regulation_and_crossbridge_cycling_rates (dimensionless).
 * CONSTANTS[35] 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[13] is gapslmd in component thin_filament_regulation_and_crossbridge_cycling_rates (dimensionless).
 * CONSTANTS[36] 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[32] is dXBpostr in component regulation_and_crossbridge_cycling_state_equations (first_order_rate_constant).
 * ALGEBRAIC[27] is dXBprer in component regulation_and_crossbridge_cycling_state_equations (first_order_rate_constant).
 * CONSTANTS[66] is alpha1_plus in component regulation_and_crossbridge_cycling_state_equations (first_order_rate_constant).
 * ALGEBRAIC[24] is alpha2_plus in component regulation_and_crossbridge_cycling_state_equations (first_order_rate_constant).
 * ALGEBRAIC[25] is alpha3_plus in component regulation_and_crossbridge_cycling_state_equations (first_order_rate_constant).
 * ALGEBRAIC[26] is alpha1_minus in component regulation_and_crossbridge_cycling_state_equations (first_order_rate_constant).
 * CONSTANTS[68] is alpha2_minus in component regulation_and_crossbridge_cycling_state_equations (first_order_rate_constant).
 * ALGEBRAIC[29] is alpha3_minus in component regulation_and_crossbridge_cycling_state_equations (first_order_rate_constant).
 * CONSTANTS[37] is kMgATP in component regulation_and_crossbridge_cycling_state_equations (micromolar2).
 * CONSTANTS[38] is kdADP in component regulation_and_crossbridge_cycling_state_equations (micromolar).
 * CONSTANTS[39] is xPi_cons in component regulation_and_crossbridge_cycling_state_equations (micromolar).
 * CONSTANTS[40] is MgATP_cons in component regulation_and_crossbridge_cycling_state_equations (micromolar).
 * ALGEBRAIC[28] is fxbT 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).
 * STATES[9] is P in component regulation_and_crossbridge_cycling_state_equations (dimensionless).
 * ALGEBRAIC[21] is N in component regulation_and_crossbridge_cycling_state_equations (dimensionless).
 * CONSTANTS[41] is MgADP_cons in component regulation_and_crossbridge_cycling_state_equations (micromolar).
 * CONSTANTS[42] is xPi in component regulation_and_crossbridge_cycling_state_equations (micromolar).
 * CONSTANTS[43] is MgATP in component regulation_and_crossbridge_cycling_state_equations (micromolar).
 * CONSTANTS[44] is MgADP in component regulation_and_crossbridge_cycling_state_equations (micromolar).
 * ALGEBRAIC[33] is dxXBpostr in component mean_strain_of_strongly_bound_states (micrometre_per_millisecond).
 * ALGEBRAIC[34] is dxXBprer in component mean_strain_of_strongly_bound_states (micrometre_per_millisecond).
 * CONSTANTS[45] is xPsi in component mean_strain_of_strongly_bound_states (dimensionless).
 * ALGEBRAIC[31] is dutyprer in component mean_strain_of_strongly_bound_states (dimensionless).
 * ALGEBRAIC[30] is dutypostr in component mean_strain_of_strongly_bound_states (dimensionless).
 * CONSTANTS[59] is dSL in component normalised_active_and_passive_force (micrometre_per_millisecond).
 * CONSTANTS[70] is SSXBpostr in component normalised_active_and_passive_force (dimensionless).
 * CONSTANTS[69] is SSXBprer in component normalised_active_and_passive_force (dimensionless).
 * ALGEBRAIC[14] is ppforce in component normalised_active_and_passive_force (unit_normalised_force).
 * ALGEBRAIC[8] 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[60] is preload in component normalised_active_and_passive_force (unit_normalised_force).
 * ALGEBRAIC[17] 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[46] is SL_c in component normalised_active_and_passive_force (micrometre).
 * CONSTANTS[47] is SLrest in component normalised_active_and_passive_force (micrometre).
 * CONSTANTS[48] is SLset in component normalised_active_and_passive_force (micrometre).
 * CONSTANTS[49] is PCon_t in component normalised_active_and_passive_force (unit_normalised_force).
 * CONSTANTS[50] is PExp_t in component normalised_active_and_passive_force (per_micrometre).
 * CONSTANTS[51] is PCon_c in component normalised_active_and_passive_force (unit_normalised_force).
 * CONSTANTS[52] is PExp_c in component normalised_active_and_passive_force (per_micrometre).
 * CONSTANTS[53] is KSE in component normalised_active_and_passive_force (unit_normalised_force_per_micrometre).
 * CONSTANTS[67] is fxb in component normalised_active_and_passive_force (first_order_rate_constant).
 * CONSTANTS[54] is SEon in component normalised_active_and_passive_force (dimensionless).
 * ALGEBRAIC[5] is F_active in component normalised_active_and_passive_force (unit_normalised_force).
 * ALGEBRAIC[35] is FrSBXB in component calculation_of_micromolar_per_millisecondes_of_Ca_for_apparent_Ca_binding (dimensionless).
 * ALGEBRAIC[36] is dFrSBXB in component calculation_of_micromolar_per_millisecondes_of_Ca_for_apparent_Ca_binding (first_order_rate_constant).
 * ALGEBRAIC[38] is dsovr_ze in component calculation_of_micromolar_per_millisecondes_of_Ca_for_apparent_Ca_binding (micrometre_per_millisecond).
 * ALGEBRAIC[39] is dsovr_cle in component calculation_of_micromolar_per_millisecondes_of_Ca_for_apparent_Ca_binding (micrometre_per_millisecond).
 * ALGEBRAIC[40] is dlen_sovr in component calculation_of_micromolar_per_millisecondes_of_Ca_for_apparent_Ca_binding (micrometre_per_millisecond).
 * ALGEBRAIC[41] is dSOVFThick in component calculation_of_micromolar_per_millisecondes_of_Ca_for_apparent_Ca_binding (first_order_rate_constant).
 * ALGEBRAIC[42] is dSOVFThin in component calculation_of_micromolar_per_millisecondes_of_Ca_for_apparent_Ca_binding (first_order_rate_constant).
 * CONSTANTS[55] is Trop_conc in component calculation_of_micromolar_per_millisecondes_of_Ca_for_apparent_Ca_binding (micromolar).
 * ALGEBRAIC[37] is TropTot in component calculation_of_micromolar_per_millisecondes_of_Ca_for_apparent_Ca_binding (micromolar).
 * ALGEBRAIC[43] is dTropTot in component calculation_of_micromolar_per_millisecondes_of_Ca_for_apparent_Ca_binding (micromolar_per_millisecond).
 * 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 P 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] = 1.2;
CONSTANTS[1] = 1.65;
CONSTANTS[2] = 0.1;
STATES[0] = 2.2;
STATES[1] = 0.0147730085063734;
STATES[2] = 0.13066096561522;
CONSTANTS[3] = 1.5;
CONSTANTS[4] = 1.3;
CONSTANTS[5] = 1.6;
CONSTANTS[6] = 1.6;
CONSTANTS[7] = 0.05;
CONSTANTS[8] = 0.25;
CONSTANTS[9] = 0.025;
CONSTANTS[10] = 0.5;
CONSTANTS[11] = 15;
CONSTANTS[12] = 0.5;
CONSTANTS[13] = 0.05;
CONSTANTS[14] = 1;
CONSTANTS[15] = 7.15;
CONSTANTS[16] = 1;
CONSTANTS[17] = 2e-2;
CONSTANTS[18] = 299;
CONSTANTS[19] = 200.0;
CONSTANTS[20] = 0.5;
CONSTANTS[21] = 0.07;
CONSTANTS[22] = 2;
CONSTANTS[23] = 0.4;
CONSTANTS[24] = 0.07;
CONSTANTS[25] = 6;
CONSTANTS[26] = 5;
CONSTANTS[27] = 0;
CONSTANTS[28] = 8;
CONSTANTS[29] = 1;
CONSTANTS[30] = 0.2;
CONSTANTS[31] = 6.25;
CONSTANTS[32] = 2.5;
CONSTANTS[33] = 6.25;
CONSTANTS[34] = 6.25;
CONSTANTS[35] = 6.25;
CONSTANTS[36] = 0.007;
STATES[3] = 0.00700005394873882;
STATES[4] = 3.41212828972468e-8;
STATES[5] = 1.81017564383744e-6;
STATES[6] = 3.0494964880038e-7;
CONSTANTS[37] = 15400e6;
CONSTANTS[38] = 4;
CONSTANTS[39] = 2e3;
CONSTANTS[40] = 5e3;
STATES[7] = 0.999999959256274;
STATES[8] = 4.07437173988636e-8;
STATES[9] = 0.999997834540066;
CONSTANTS[41] = 36;
CONSTANTS[42] = 2e3;
CONSTANTS[43] = 5e3;
CONSTANTS[44] = 36.3;
CONSTANTS[45] = 2;
STATES[10] = -4.5113452510363e-6;
CONSTANTS[46] = 2.25;
CONSTANTS[47] = 1.85;
CONSTANTS[48] = 1.9;
CONSTANTS[49] = 0.002;
CONSTANTS[50] = 10;
CONSTANTS[51] = 0.02;
CONSTANTS[52] = 70;
CONSTANTS[53] = 1;
CONSTANTS[54] = 1;
CONSTANTS[55] = 70;
CONSTANTS[56] =  CONSTANTS[8]*CONSTANTS[14]*pow(CONSTANTS[4], (CONSTANTS[18] - 310.000)/10.0000);
CONSTANTS[57] =  CONSTANTS[9]*CONSTANTS[14]*pow(CONSTANTS[4], (CONSTANTS[18] - 310.000)/10.0000);
CONSTANTS[58] =  1.00000e+07*pow(10.0000, - CONSTANTS[15]);
CONSTANTS[59] = 0.00000;
CONSTANTS[60] =  (fabs(CONSTANTS[48] - CONSTANTS[47])/(CONSTANTS[48] - CONSTANTS[47]))*CONSTANTS[49]*(exp( CONSTANTS[50]*fabs(CONSTANTS[48] - CONSTANTS[47])) - 1.00000);
CONSTANTS[61] =  1.00000e+07*pow(10.0000, - 7.15000);
CONSTANTS[71] = CONSTANTS[59];
CONSTANTS[62] =  ((pow(CONSTANTS[17], CONSTANTS[16])+pow(CONSTANTS[61], CONSTANTS[16]))/(pow(CONSTANTS[17], CONSTANTS[16])+pow(CONSTANTS[58], CONSTANTS[16])))*CONSTANTS[7]*pow(CONSTANTS[3], (CONSTANTS[18] - 310.000)/10.0000);
CONSTANTS[63] =  CONSTANTS[20]*CONSTANTS[30]*pow(CONSTANTS[31], (CONSTANTS[18] - 310.000)/10.0000);
CONSTANTS[64] = 1.00000;
CONSTANTS[65] =  CONSTANTS[23]*CONSTANTS[64]*CONSTANTS[30]*pow(CONSTANTS[34], (CONSTANTS[18] - 310.000)/10.0000);
CONSTANTS[66] = CONSTANTS[63];
CONSTANTS[67] = (( CONSTANTS[38]*CONSTANTS[20]*CONSTANTS[22]*CONSTANTS[24])/CONSTANTS[40])/( (( (CONSTANTS[21]/CONSTANTS[39])*CONSTANTS[23])/CONSTANTS[61])*CONSTANTS[37]);
CONSTANTS[68] = ( (( (( CONSTANTS[58]*CONSTANTS[65])/CONSTANTS[61])*(CONSTANTS[38]+CONSTANTS[41]))/CONSTANTS[41])*CONSTANTS[44])/(CONSTANTS[38]+CONSTANTS[44]);
CONSTANTS[69] = ( CONSTANTS[67]*CONSTANTS[23]+ CONSTANTS[24]*CONSTANTS[20]+ CONSTANTS[65]*CONSTANTS[20])/( CONSTANTS[22]*CONSTANTS[24]+ CONSTANTS[23]*CONSTANTS[21]+ CONSTANTS[24]*CONSTANTS[21]+ CONSTANTS[67]*CONSTANTS[23]+ CONSTANTS[24]*CONSTANTS[20]+ CONSTANTS[23]*CONSTANTS[20]+ CONSTANTS[67]*CONSTANTS[21]+ CONSTANTS[20]*CONSTANTS[22]+ CONSTANTS[67]*CONSTANTS[23]);
CONSTANTS[70] = ( CONSTANTS[20]*CONSTANTS[22]+ CONSTANTS[67]*CONSTANTS[21]+ CONSTANTS[67]*CONSTANTS[23])/( CONSTANTS[22]*CONSTANTS[24]+ CONSTANTS[23]*CONSTANTS[21]+ CONSTANTS[24]*CONSTANTS[21]+ CONSTANTS[67]*CONSTANTS[23]+ CONSTANTS[24]*CONSTANTS[20]+ CONSTANTS[23]*CONSTANTS[20]+ CONSTANTS[67]*CONSTANTS[21]+ CONSTANTS[20]*CONSTANTS[22]+ CONSTANTS[67]*CONSTANTS[23]);
}
void
computeRates(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
RATES[0] = CONSTANTS[71];
ALGEBRAIC[7] =  CONSTANTS[62]*CONSTANTS[19]*(1.00000 - STATES[1]) -  CONSTANTS[56]*STATES[1];
RATES[1] = ALGEBRAIC[7];
ALGEBRAIC[10] =  CONSTANTS[62]*CONSTANTS[19]*(1.00000 - STATES[2]) -  CONSTANTS[57]*STATES[2];
RATES[2] = ALGEBRAIC[10];
ALGEBRAIC[8] =  ((STATES[0] - CONSTANTS[47])/fabs(STATES[0] - CONSTANTS[47]))*CONSTANTS[49]*(exp( CONSTANTS[50]*fabs(STATES[0] - CONSTANTS[47])) - 1.00000);
ALGEBRAIC[11] = (STATES[0]>CONSTANTS[46] ?  CONSTANTS[51]*(exp( CONSTANTS[52]*fabs(STATES[0] - CONSTANTS[46])) - 1.00000) : 0.00000);
ALGEBRAIC[14] = ALGEBRAIC[8]+ALGEBRAIC[11];
ALGEBRAIC[17] = (CONSTANTS[54]==1.00000 ?  CONSTANTS[53]*(CONSTANTS[48] - STATES[0]) : 0.00000);
ALGEBRAIC[0] = (CONSTANTS[1]/2.00000<STATES[0]/2.00000 ? CONSTANTS[1]/2.00000 : STATES[0]/2.00000);
ALGEBRAIC[1] = (STATES[0]/2.00000 - (STATES[0] - CONSTANTS[0])>CONSTANTS[2]/2.00000 ? STATES[0]/2.00000 - (STATES[0] - CONSTANTS[0]) : CONSTANTS[2]/2.00000);
ALGEBRAIC[2] = ALGEBRAIC[0] - ALGEBRAIC[1];
ALGEBRAIC[3] = ( ALGEBRAIC[2]*2.00000)/(CONSTANTS[1] - CONSTANTS[2]);
ALGEBRAIC[5] = ( ALGEBRAIC[3]*( STATES[3]*STATES[5]+ STATES[4]*STATES[6]))/( CONSTANTS[36]*CONSTANTS[70]);
RATES[10] = (CONSTANTS[60]+ALGEBRAIC[17]) - (ALGEBRAIC[14]+ALGEBRAIC[5]);
ALGEBRAIC[4] = ALGEBRAIC[2]/CONSTANTS[0];
ALGEBRAIC[6] =  (1.00000 - ALGEBRAIC[4])*STATES[1]+ ALGEBRAIC[4]*STATES[2];
ALGEBRAIC[9] =  pow(fabs(1.00000/(1.00000+pow(CONSTANTS[10]/ALGEBRAIC[6], CONSTANTS[11]))), 1.0 / 2);
ALGEBRAIC[12] =  CONSTANTS[12]*ALGEBRAIC[9]*pow(CONSTANTS[5], (CONSTANTS[18] - 310.000)/10.0000);
ALGEBRAIC[15] = (1.00000/ALGEBRAIC[9]<100.000 ? 1.00000/ALGEBRAIC[9] : 100.000);
ALGEBRAIC[18] =  CONSTANTS[13]*ALGEBRAIC[15]*pow(CONSTANTS[6], (CONSTANTS[18] - 310.000)/10.0000);
RATES[7] =  ALGEBRAIC[18]*STATES[8] -  ALGEBRAIC[12]*STATES[7];
RATES[8] =  ALGEBRAIC[12]*STATES[7] -  ALGEBRAIC[18]*STATES[8];
ALGEBRAIC[21] = 1.00000 - (STATES[9]+STATES[6]+STATES[5]);
RATES[9] =  ALGEBRAIC[12]*ALGEBRAIC[21] -  (ALGEBRAIC[18]+CONSTANTS[66])*STATES[9];
ALGEBRAIC[19] = exp( (- STATES[4]/fabs(STATES[4]))*CONSTANTS[26]*pow(STATES[4]/CONSTANTS[36], 2.00000));
ALGEBRAIC[20] =  CONSTANTS[22]*ALGEBRAIC[19]*CONSTANTS[30]*pow(CONSTANTS[33], (CONSTANTS[18] - 310.000)/10.0000);
ALGEBRAIC[24] = ALGEBRAIC[20];
ALGEBRAIC[13] = 1.00000+ (1.00000 - ALGEBRAIC[3])*CONSTANTS[25];
ALGEBRAIC[16] =  CONSTANTS[21]*ALGEBRAIC[13]*CONSTANTS[30]*pow(CONSTANTS[32], (CONSTANTS[18] - 310.000)/10.0000);
ALGEBRAIC[26] = ( CONSTANTS[42]*ALGEBRAIC[16])/CONSTANTS[39];
ALGEBRAIC[27] = ( CONSTANTS[66]*STATES[9]+ CONSTANTS[68]*STATES[5]) -  (ALGEBRAIC[26]+ALGEBRAIC[24])*STATES[6];
RATES[6] = ALGEBRAIC[27];
ALGEBRAIC[22] = (STATES[3]<CONSTANTS[36] ? exp( CONSTANTS[28]*pow((CONSTANTS[36] - STATES[3])/CONSTANTS[36], 2.00000)) : exp( CONSTANTS[29]*pow((STATES[3] - CONSTANTS[36])/CONSTANTS[36], 2.00000)));
ALGEBRAIC[23] =  CONSTANTS[24]*ALGEBRAIC[22]*CONSTANTS[30]*pow(CONSTANTS[35], (CONSTANTS[18] - 310.000)/10.0000);
ALGEBRAIC[25] = ( (( CONSTANTS[43]*ALGEBRAIC[23])/CONSTANTS[40])*(CONSTANTS[38]+CONSTANTS[41]))/(CONSTANTS[38]+CONSTANTS[44]);
ALGEBRAIC[28] = (( CONSTANTS[38]*CONSTANTS[63]*ALGEBRAIC[20]*ALGEBRAIC[23])/CONSTANTS[40])/( (( (ALGEBRAIC[16]/CONSTANTS[39])*CONSTANTS[65])/CONSTANTS[61])*CONSTANTS[37]);
ALGEBRAIC[29] = ALGEBRAIC[28];
ALGEBRAIC[32] = ( ALGEBRAIC[29]*STATES[9]+ ALGEBRAIC[24]*STATES[6]) -  (CONSTANTS[68]+ALGEBRAIC[25])*STATES[5];
RATES[5] = ALGEBRAIC[32];
ALGEBRAIC[31] = ( ALGEBRAIC[29]*CONSTANTS[68]+ ALGEBRAIC[25]*CONSTANTS[66]+ CONSTANTS[68]*CONSTANTS[66])/( CONSTANTS[66]*ALGEBRAIC[24]+ ALGEBRAIC[29]*ALGEBRAIC[26]+ ALGEBRAIC[29]*ALGEBRAIC[24]+ ALGEBRAIC[29]*CONSTANTS[68]+ ALGEBRAIC[25]*CONSTANTS[66]+ CONSTANTS[68]*CONSTANTS[66]+ ALGEBRAIC[24]*ALGEBRAIC[25]+ ALGEBRAIC[29]*ALGEBRAIC[26]+ ALGEBRAIC[25]*ALGEBRAIC[26]);
ALGEBRAIC[34] = CONSTANTS[59]/2.00000+ (CONSTANTS[45]/ALGEBRAIC[31])*( - CONSTANTS[66]*STATES[4]+ CONSTANTS[68]*(STATES[3] - (CONSTANTS[36]+STATES[4])));
RATES[4] = ALGEBRAIC[34];
ALGEBRAIC[30] = ( CONSTANTS[66]*ALGEBRAIC[24]+ ALGEBRAIC[29]*ALGEBRAIC[26]+ ALGEBRAIC[29]*ALGEBRAIC[24])/( CONSTANTS[66]*ALGEBRAIC[24]+ ALGEBRAIC[29]*ALGEBRAIC[26]+ ALGEBRAIC[29]*ALGEBRAIC[24]+ ALGEBRAIC[29]*CONSTANTS[68]+ ALGEBRAIC[25]*CONSTANTS[66]+ CONSTANTS[68]*CONSTANTS[66]+ ALGEBRAIC[24]*ALGEBRAIC[25]+ ALGEBRAIC[29]*ALGEBRAIC[26]+ ALGEBRAIC[25]*ALGEBRAIC[26]);
ALGEBRAIC[33] = CONSTANTS[59]/2.00000+ (CONSTANTS[45]/ALGEBRAIC[30])*ALGEBRAIC[24]*((STATES[4]+CONSTANTS[36]) - STATES[3]);
RATES[3] = ALGEBRAIC[33];
}
void
computeVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
ALGEBRAIC[7] =  CONSTANTS[62]*CONSTANTS[19]*(1.00000 - STATES[1]) -  CONSTANTS[56]*STATES[1];
ALGEBRAIC[10] =  CONSTANTS[62]*CONSTANTS[19]*(1.00000 - STATES[2]) -  CONSTANTS[57]*STATES[2];
ALGEBRAIC[8] =  ((STATES[0] - CONSTANTS[47])/fabs(STATES[0] - CONSTANTS[47]))*CONSTANTS[49]*(exp( CONSTANTS[50]*fabs(STATES[0] - CONSTANTS[47])) - 1.00000);
ALGEBRAIC[11] = (STATES[0]>CONSTANTS[46] ?  CONSTANTS[51]*(exp( CONSTANTS[52]*fabs(STATES[0] - CONSTANTS[46])) - 1.00000) : 0.00000);
ALGEBRAIC[14] = ALGEBRAIC[8]+ALGEBRAIC[11];
ALGEBRAIC[17] = (CONSTANTS[54]==1.00000 ?  CONSTANTS[53]*(CONSTANTS[48] - STATES[0]) : 0.00000);
ALGEBRAIC[0] = (CONSTANTS[1]/2.00000<STATES[0]/2.00000 ? CONSTANTS[1]/2.00000 : STATES[0]/2.00000);
ALGEBRAIC[1] = (STATES[0]/2.00000 - (STATES[0] - CONSTANTS[0])>CONSTANTS[2]/2.00000 ? STATES[0]/2.00000 - (STATES[0] - CONSTANTS[0]) : CONSTANTS[2]/2.00000);
ALGEBRAIC[2] = ALGEBRAIC[0] - ALGEBRAIC[1];
ALGEBRAIC[3] = ( ALGEBRAIC[2]*2.00000)/(CONSTANTS[1] - CONSTANTS[2]);
ALGEBRAIC[5] = ( ALGEBRAIC[3]*( STATES[3]*STATES[5]+ STATES[4]*STATES[6]))/( CONSTANTS[36]*CONSTANTS[70]);
ALGEBRAIC[4] = ALGEBRAIC[2]/CONSTANTS[0];
ALGEBRAIC[6] =  (1.00000 - ALGEBRAIC[4])*STATES[1]+ ALGEBRAIC[4]*STATES[2];
ALGEBRAIC[9] =  pow(fabs(1.00000/(1.00000+pow(CONSTANTS[10]/ALGEBRAIC[6], CONSTANTS[11]))), 1.0 / 2);
ALGEBRAIC[12] =  CONSTANTS[12]*ALGEBRAIC[9]*pow(CONSTANTS[5], (CONSTANTS[18] - 310.000)/10.0000);
ALGEBRAIC[15] = (1.00000/ALGEBRAIC[9]<100.000 ? 1.00000/ALGEBRAIC[9] : 100.000);
ALGEBRAIC[18] =  CONSTANTS[13]*ALGEBRAIC[15]*pow(CONSTANTS[6], (CONSTANTS[18] - 310.000)/10.0000);
ALGEBRAIC[21] = 1.00000 - (STATES[9]+STATES[6]+STATES[5]);
ALGEBRAIC[19] = exp( (- STATES[4]/fabs(STATES[4]))*CONSTANTS[26]*pow(STATES[4]/CONSTANTS[36], 2.00000));
ALGEBRAIC[20] =  CONSTANTS[22]*ALGEBRAIC[19]*CONSTANTS[30]*pow(CONSTANTS[33], (CONSTANTS[18] - 310.000)/10.0000);
ALGEBRAIC[24] = ALGEBRAIC[20];
ALGEBRAIC[13] = 1.00000+ (1.00000 - ALGEBRAIC[3])*CONSTANTS[25];
ALGEBRAIC[16] =  CONSTANTS[21]*ALGEBRAIC[13]*CONSTANTS[30]*pow(CONSTANTS[32], (CONSTANTS[18] - 310.000)/10.0000);
ALGEBRAIC[26] = ( CONSTANTS[42]*ALGEBRAIC[16])/CONSTANTS[39];
ALGEBRAIC[27] = ( CONSTANTS[66]*STATES[9]+ CONSTANTS[68]*STATES[5]) -  (ALGEBRAIC[26]+ALGEBRAIC[24])*STATES[6];
ALGEBRAIC[22] = (STATES[3]<CONSTANTS[36] ? exp( CONSTANTS[28]*pow((CONSTANTS[36] - STATES[3])/CONSTANTS[36], 2.00000)) : exp( CONSTANTS[29]*pow((STATES[3] - CONSTANTS[36])/CONSTANTS[36], 2.00000)));
ALGEBRAIC[23] =  CONSTANTS[24]*ALGEBRAIC[22]*CONSTANTS[30]*pow(CONSTANTS[35], (CONSTANTS[18] - 310.000)/10.0000);
ALGEBRAIC[25] = ( (( CONSTANTS[43]*ALGEBRAIC[23])/CONSTANTS[40])*(CONSTANTS[38]+CONSTANTS[41]))/(CONSTANTS[38]+CONSTANTS[44]);
ALGEBRAIC[28] = (( CONSTANTS[38]*CONSTANTS[63]*ALGEBRAIC[20]*ALGEBRAIC[23])/CONSTANTS[40])/( (( (ALGEBRAIC[16]/CONSTANTS[39])*CONSTANTS[65])/CONSTANTS[61])*CONSTANTS[37]);
ALGEBRAIC[29] = ALGEBRAIC[28];
ALGEBRAIC[32] = ( ALGEBRAIC[29]*STATES[9]+ ALGEBRAIC[24]*STATES[6]) -  (CONSTANTS[68]+ALGEBRAIC[25])*STATES[5];
ALGEBRAIC[31] = ( ALGEBRAIC[29]*CONSTANTS[68]+ ALGEBRAIC[25]*CONSTANTS[66]+ CONSTANTS[68]*CONSTANTS[66])/( CONSTANTS[66]*ALGEBRAIC[24]+ ALGEBRAIC[29]*ALGEBRAIC[26]+ ALGEBRAIC[29]*ALGEBRAIC[24]+ ALGEBRAIC[29]*CONSTANTS[68]+ ALGEBRAIC[25]*CONSTANTS[66]+ CONSTANTS[68]*CONSTANTS[66]+ ALGEBRAIC[24]*ALGEBRAIC[25]+ ALGEBRAIC[29]*ALGEBRAIC[26]+ ALGEBRAIC[25]*ALGEBRAIC[26]);
ALGEBRAIC[34] = CONSTANTS[59]/2.00000+ (CONSTANTS[45]/ALGEBRAIC[31])*( - CONSTANTS[66]*STATES[4]+ CONSTANTS[68]*(STATES[3] - (CONSTANTS[36]+STATES[4])));
ALGEBRAIC[30] = ( CONSTANTS[66]*ALGEBRAIC[24]+ ALGEBRAIC[29]*ALGEBRAIC[26]+ ALGEBRAIC[29]*ALGEBRAIC[24])/( CONSTANTS[66]*ALGEBRAIC[24]+ ALGEBRAIC[29]*ALGEBRAIC[26]+ ALGEBRAIC[29]*ALGEBRAIC[24]+ ALGEBRAIC[29]*CONSTANTS[68]+ ALGEBRAIC[25]*CONSTANTS[66]+ CONSTANTS[68]*CONSTANTS[66]+ ALGEBRAIC[24]*ALGEBRAIC[25]+ ALGEBRAIC[29]*ALGEBRAIC[26]+ ALGEBRAIC[25]*ALGEBRAIC[26]);
ALGEBRAIC[33] = CONSTANTS[59]/2.00000+ (CONSTANTS[45]/ALGEBRAIC[30])*ALGEBRAIC[24]*((STATES[4]+CONSTANTS[36]) - STATES[3]);
ALGEBRAIC[35] = (STATES[5]+STATES[6])/(CONSTANTS[70]+CONSTANTS[69]);
ALGEBRAIC[36] = (ALGEBRAIC[32]+ALGEBRAIC[27])/(CONSTANTS[70]+CONSTANTS[69]);
ALGEBRAIC[37] =  CONSTANTS[55]*( (1.00000 - ALGEBRAIC[4])*STATES[1]+ ALGEBRAIC[4]*( ALGEBRAIC[35]*STATES[2]+ (1.00000 - ALGEBRAIC[35])*STATES[1]));
ALGEBRAIC[38] = (STATES[0]<CONSTANTS[1] ?  - 0.500000*CONSTANTS[59] : 0.00000);
ALGEBRAIC[39] = ( 2.00000*CONSTANTS[0] - STATES[0]>CONSTANTS[2] ?  - 0.500000*CONSTANTS[59] : 0.00000);
ALGEBRAIC[40] = ALGEBRAIC[38] - ALGEBRAIC[39];
ALGEBRAIC[41] = ( 2.00000*ALGEBRAIC[40])/(CONSTANTS[1] - CONSTANTS[2]);
ALGEBRAIC[42] = ALGEBRAIC[40]/CONSTANTS[0];
ALGEBRAIC[43] =  CONSTANTS[55]*( - ALGEBRAIC[42]*STATES[1]+ (1.00000 - ALGEBRAIC[4])*ALGEBRAIC[7]+ ALGEBRAIC[42]*( ALGEBRAIC[35]*STATES[2]+ (1.00000 - ALGEBRAIC[35])*STATES[1])+ ALGEBRAIC[4]*(( ALGEBRAIC[36]*STATES[2]+ ALGEBRAIC[35]*ALGEBRAIC[10]+ (1.00000 - ALGEBRAIC[35])*ALGEBRAIC[7]) -  ALGEBRAIC[36]*STATES[1]));
}