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 51 entries in the algebraic variable array.
   There are a total of 22 entries in each of the rate and state variable arrays.
   There are a total of 57 entries in the constant variable array.
 */
/*
 * VOI is time in component environment (ms).
 * STATES[0] is V in component cell (mV).
 * CONSTANTS[0] is R in component cell (joule_per_mole_kelvin).
 * CONSTANTS[1] is T in component cell (kelvin).
 * CONSTANTS[2] is F in component cell (coulomb_per_millimole).
 * CONSTANTS[43] is FonRT in component cell (per_mV).
 * CONSTANTS[3] is Cm in component cell (pF).
 * CONSTANTS[4] is failing in component cell (dimensionless).
 * ALGEBRAIC[21] is i_Na in component INa (uA_per_uF).
 * ALGEBRAIC[24] is i_Ca in component ICa (uA_per_uF).
 * ALGEBRAIC[26] is i_to in component Ito (uA_per_uF).
 * ALGEBRAIC[31] is i_Kr in component IKr (uA_per_uF).
 * ALGEBRAIC[28] is i_Ks in component IKs (uA_per_uF).
 * ALGEBRAIC[36] is i_K1 in component IK1 (uA_per_uF).
 * ALGEBRAIC[41] is i_NaCa in component INaCa (uA_per_uF).
 * ALGEBRAIC[40] is i_NaK in component INaK (uA_per_uF).
 * ALGEBRAIC[38] is i_b_Na in component INab (uA_per_uF).
 * ALGEBRAIC[37] is i_b_Ca in component ICab (uA_per_uF).
 * ALGEBRAIC[44] is dVdt in component cell (mV_per_ms).
 * ALGEBRAIC[42] is I_tot in component cell (uA_per_uF).
 * ALGEBRAIC[10] is i_Stim in component cell (uA_per_uF).
 * CONSTANTS[5] is stim_offset in component cell (ms).
 * CONSTANTS[6] is stim_period in component cell (ms).
 * CONSTANTS[7] is stim_duration in component cell (ms).
 * CONSTANTS[8] is stim_amplitude in component cell (uA_per_uF).
 * ALGEBRAIC[0] is past in component cell (ms).
 * CONSTANTS[9] is V_clamp in component cell (dimensionless).
 * CONSTANTS[10] is V_hold in component cell (mV).
 * CONSTANTS[11] is V_step in component cell (mV).
 * ALGEBRAIC[20] is E_Na in component INa (mV).
 * CONSTANTS[12] is g_Na in component INa (mS_per_uF).
 * STATES[1] is Nai in component Ionic_concentrations (mM).
 * CONSTANTS[13] is Nao in component Ionic_concentrations (mM).
 * STATES[2] is m in component INa_m_gate (dimensionless).
 * STATES[3] is h in component INa_h_gate (dimensionless).
 * STATES[4] is j in component INa_j_gate (dimensionless).
 * ALGEBRAIC[1] is alpha_m in component INa_m_gate (per_ms).
 * ALGEBRAIC[11] is beta_m in component INa_m_gate (per_ms).
 * ALGEBRAIC[2] is alpha_h in component INa_h_gate (per_ms).
 * ALGEBRAIC[12] is beta_h in component INa_h_gate (per_ms).
 * ALGEBRAIC[3] is alpha_j in component INa_j_gate (per_ms).
 * ALGEBRAIC[13] is beta_j in component INa_j_gate (per_ms).
 * ALGEBRAIC[22] is E_Ca in component ICa (mV).
 * CONSTANTS[14] is g_Ca_max in component ICa (mS_per_uF).
 * STATES[5] is Cai in component Ionic_concentrations (mM).
 * CONSTANTS[15] is Cao in component Ionic_concentrations (mM).
 * STATES[6] is d in component ICa_d_gate (dimensionless).
 * STATES[7] is f in component ICa_f_gate (dimensionless).
 * ALGEBRAIC[23] is f_Ca in component ICa_f_Ca_gate (dimensionless).
 * ALGEBRAIC[4] is alpha_d in component ICa_d_gate (per_ms).
 * ALGEBRAIC[14] is beta_d in component ICa_d_gate (per_ms).
 * ALGEBRAIC[5] is alpha_f in component ICa_f_gate (per_ms).
 * ALGEBRAIC[15] is beta_f in component ICa_f_gate (per_ms).
 * CONSTANTS[16] is Km_Ca in component ICa_f_Ca_gate (mM).
 * CONSTANTS[44] is g_to_max in component Ito (mS_per_uF).
 * ALGEBRAIC[25] is E_to in component Ito (mV).
 * STATES[8] is Ki in component Ionic_concentrations (mM).
 * CONSTANTS[17] is Ko in component Ionic_concentrations (mM).
 * STATES[9] is t in component Ito_t_gate (dimensionless).
 * STATES[10] is r in component Ito_r_gate (dimensionless).
 * ALGEBRAIC[6] is alpha_r in component Ito_r_gate (per_ms).
 * ALGEBRAIC[16] is beta_r in component Ito_r_gate (per_ms).
 * ALGEBRAIC[7] is alpha_t in component Ito_t_gate (per_ms).
 * ALGEBRAIC[17] is beta_t in component Ito_t_gate (per_ms).
 * CONSTANTS[18] is g_Ks_max in component IKs (mS_per_uF).
 * ALGEBRAIC[27] is E_Ks in component IKs (mV).
 * STATES[11] is Xs in component IKs_Xs_gate (dimensionless).
 * ALGEBRAIC[8] is alpha_Xs in component IKs_Xs_gate (per_ms).
 * ALGEBRAIC[18] is beta_Xs in component IKs_Xs_gate (per_ms).
 * CONSTANTS[19] is g_Kr_max in component IKr (mS_per_uF).
 * ALGEBRAIC[30] is rik in component IKr (dimensionless).
 * ALGEBRAIC[29] is E_K in component IKr (mV).
 * STATES[12] is Xr in component IKr_Xr_gate (dimensionless).
 * ALGEBRAIC[9] is alpha_Xr in component IKr_Xr_gate (per_ms).
 * ALGEBRAIC[19] is beta_Xr in component IKr_Xr_gate (per_ms).
 * ALGEBRAIC[32] is E_K1 in component IK1 (mV).
 * CONSTANTS[45] is g_K1_max in component IK1 (mS_per_uF).
 * ALGEBRAIC[35] is K1_infinity in component IK1_K1_gate (dimensionless).
 * ALGEBRAIC[33] is alpha_K1 in component IK1_K1_gate (per_ms).
 * ALGEBRAIC[34] is beta_K1 in component IK1_K1_gate (per_ms).
 * CONSTANTS[46] is g_b_Ca_max in component ICab (mS_per_uF).
 * CONSTANTS[47] is g_b_Na_max in component INab (mS_per_uF).
 * CONSTANTS[48] is I_NaK_max in component INaK (uA_per_uF).
 * ALGEBRAIC[39] is f_NaK in component INaK (dimensionless).
 * CONSTANTS[20] is K_mNai in component INaK (mM).
 * CONSTANTS[21] is K_mKo in component INaK (mM).
 * CONSTANTS[49] is sigma in component INaK (dimensionless).
 * CONSTANTS[50] is K_NaCa in component INaCa (uA_per_uF).
 * CONSTANTS[22] is K_mNa in component INaCa (mM).
 * CONSTANTS[23] is K_mCa in component INaCa (mM).
 * CONSTANTS[24] is K_sat in component INaCa (dimensionless).
 * CONSTANTS[25] is eta in component INaCa (dimensionless).
 * ALGEBRAIC[45] is i_rel in component Irel (mM_per_ms).
 * ALGEBRAIC[43] is G_rel in component Irel (per_ms).
 * CONSTANTS[26] is G_rel_max in component Irel (per_ms).
 * CONSTANTS[27] is G_rel_overload in component Irel (per_ms).
 * CONSTANTS[28] is K_mrel in component Irel (mM).
 * CONSTANTS[29] is delta_Ca_ith in component Irel (mM).
 * CONSTANTS[30] is K_mCSQN in component calcium_buffers_in_the_JSR (mM).
 * STATES[13] is Ca_JSR in component Ionic_concentrations (mM).
 * CONSTANTS[54] is V_myo in component Ionic_concentrations (fL).
 * CONSTANTS[56] is V_JSR in component Ionic_concentrations (fL).
 * STATES[14] is APtrack in component Irel (dimensionless).
 * STATES[15] is APtrack2 in component Irel (dimensionless).
 * STATES[16] is APtrack3 in component Irel (dimensionless).
 * STATES[17] is Cainfluxtrack in component Irel (mM).
 * STATES[18] is OVRLDtrack in component Irel (dimensionless).
 * STATES[19] is OVRLDtrack2 in component Irel (dimensionless).
 * STATES[20] is OVRLDtrack3 in component Irel (dimensionless).
 * CONSTANTS[31] is CSQNthresh in component Irel (mM).
 * CONSTANTS[32] is Logicthresh in component Irel (dimensionless).
 * ALGEBRAIC[46] is i_up in component Iup (mM_per_ms).
 * CONSTANTS[51] is I_up_max in component Iup (mM_per_ms).
 * CONSTANTS[33] is K_mup in component Iup (mM).
 * ALGEBRAIC[47] is i_leak in component Ileak (mM_per_ms).
 * CONSTANTS[52] is K_leak in component Ileak (per_ms).
 * STATES[21] is Ca_NSR in component Ionic_concentrations (mM).
 * ALGEBRAIC[49] is i_tr in component Itr (mM_per_ms).
 * CONSTANTS[34] is tau_tr in component Itr (ms).
 * CONSTANTS[35] is K_mTn in component calcium_buffers_in_the_myoplasm (mM).
 * CONSTANTS[36] is K_mCMDN in component calcium_buffers_in_the_myoplasm (mM).
 * CONSTANTS[37] is Tn_max in component calcium_buffers_in_the_myoplasm (mM).
 * CONSTANTS[38] is CMDN_max in component calcium_buffers_in_the_myoplasm (mM).
 * CONSTANTS[39] is buffon in component calcium_buffers_in_the_myoplasm (dimensionless).
 * ALGEBRAIC[48] is Cai_bufc in component calcium_buffers_in_the_myoplasm (dimensionless).
 * CONSTANTS[40] is CSQN_max in component calcium_buffers_in_the_JSR (mM).
 * ALGEBRAIC[50] is Ca_JSR_bufc in component calcium_buffers_in_the_JSR (dimensionless).
 * CONSTANTS[41] is preplength in component Ionic_concentrations (um).
 * CONSTANTS[42] is radius in component Ionic_concentrations (um).
 * CONSTANTS[53] is volume in component Ionic_concentrations (fL).
 * CONSTANTS[55] is V_NSR in component Ionic_concentrations (fL).
 * RATES[0] is d/dt V in component cell (mV).
 * RATES[2] is d/dt m in component INa_m_gate (dimensionless).
 * RATES[3] is d/dt h in component INa_h_gate (dimensionless).
 * RATES[4] is d/dt j in component INa_j_gate (dimensionless).
 * RATES[6] is d/dt d in component ICa_d_gate (dimensionless).
 * RATES[7] is d/dt f in component ICa_f_gate (dimensionless).
 * RATES[10] is d/dt r in component Ito_r_gate (dimensionless).
 * RATES[9] is d/dt t in component Ito_t_gate (dimensionless).
 * RATES[11] is d/dt Xs in component IKs_Xs_gate (dimensionless).
 * RATES[12] is d/dt Xr in component IKr_Xr_gate (dimensionless).
 * RATES[14] is d/dt APtrack in component Irel (dimensionless).
 * RATES[15] is d/dt APtrack2 in component Irel (dimensionless).
 * RATES[16] is d/dt APtrack3 in component Irel (dimensionless).
 * RATES[17] is d/dt Cainfluxtrack in component Irel (mM).
 * RATES[18] is d/dt OVRLDtrack in component Irel (dimensionless).
 * RATES[19] is d/dt OVRLDtrack2 in component Irel (dimensionless).
 * RATES[20] is d/dt OVRLDtrack3 in component Irel (dimensionless).
 * RATES[1] is d/dt Nai in component Ionic_concentrations (mM).
 * RATES[8] is d/dt Ki in component Ionic_concentrations (mM).
 * RATES[5] is d/dt Cai in component Ionic_concentrations (mM).
 * RATES[13] is d/dt Ca_JSR in component Ionic_concentrations (mM).
 * RATES[21] is d/dt Ca_NSR in component Ionic_concentrations (mM).
 */
void
initConsts(double* CONSTANTS, double* RATES, double *STATES)
{
STATES[0] = -90.7796417483135;
CONSTANTS[0] = 8.3143;
CONSTANTS[1] = 310.15;
CONSTANTS[2] = 96.4867;
CONSTANTS[3] = 153.4;
CONSTANTS[4] = 0;
CONSTANTS[5] = 0;
CONSTANTS[6] = 1000;
CONSTANTS[7] = 3;
CONSTANTS[8] = -15;
CONSTANTS[9] = 0;
CONSTANTS[10] = -60;
CONSTANTS[11] = 0;
CONSTANTS[12] = 16;
STATES[1] = 10;
CONSTANTS[13] = 138;
STATES[2] = 0.000585525582501575;
STATES[3] = 0.995865529216237;
STATES[4] = 0.997011204496203;
CONSTANTS[14] = 0.064;
STATES[5] = 0.0002;
CONSTANTS[15] = 2;
STATES[6] = 2.50653215966786e-10;
STATES[7] = 0.92130376850548;
CONSTANTS[16] = 0.0006;
STATES[8] = 140;
CONSTANTS[17] = 4;
STATES[9] = 0.999897251531651;
STATES[10] = 1.75032478501027e-5;
CONSTANTS[18] = 0.02;
STATES[11] = 0.00885658064818147;
CONSTANTS[19] = 0.015;
STATES[12] = 0.000215523048438941;
CONSTANTS[20] = 10;
CONSTANTS[21] = 1.5;
CONSTANTS[22] = 87.5;
CONSTANTS[23] = 1.38;
CONSTANTS[24] = 0.1;
CONSTANTS[25] = 0.35;
CONSTANTS[26] = 22;
CONSTANTS[27] = 3;
CONSTANTS[28] = 0.0008;
CONSTANTS[29] = 5e-6;
CONSTANTS[30] = 0.8;
STATES[13] = 2.5;
STATES[14] = -1.372158997089e-136;
STATES[15] = -7.58517896402761e-136;
STATES[16] = 4.82035353592764e-5;
STATES[17] = -7.71120176147331e-138;
STATES[18] = 1e-6;
STATES[19] = 1e-6;
STATES[20] = 1e-6;
CONSTANTS[31] = 0.7;
CONSTANTS[32] = 0.98;
CONSTANTS[33] = 0.00092;
STATES[21] = 2.5;
CONSTANTS[34] = 180;
CONSTANTS[35] = 0.0005;
CONSTANTS[36] = 0.00238;
CONSTANTS[37] = 0.07;
CONSTANTS[38] = 0.05;
CONSTANTS[39] = 1;
CONSTANTS[40] = 10;
CONSTANTS[41] = 100;
CONSTANTS[42] = 11;
CONSTANTS[43] = CONSTANTS[2]/( CONSTANTS[0]*CONSTANTS[1]);
CONSTANTS[44] = (CONSTANTS[4]==0.00000 ? 0.300000 : 0.191000);
CONSTANTS[45] = (CONSTANTS[4]==0.00000 ? 2.50000 : 2.00000);
CONSTANTS[46] = (CONSTANTS[4]==0.00000 ? 0.000850000 : 0.00130000);
CONSTANTS[47] = (CONSTANTS[4]==0.00000 ? 0.00100000 : 0.00000);
CONSTANTS[48] = (CONSTANTS[4]==0.00000 ? 1.30000 : 0.750000);
CONSTANTS[49] =  (1.00000/7.00000)*(exp(CONSTANTS[13]/67.3000) - 1.00000);
CONSTANTS[50] = (CONSTANTS[4]==0.00000 ? 1000.00 : 1650.00);
CONSTANTS[51] = (CONSTANTS[4]==0.00000 ? 0.00450000 : 0.00150000);
CONSTANTS[52] = (CONSTANTS[4]==0.00000 ? 0.000260000 : 0.000170000);
CONSTANTS[53] =   3.14159265358979*CONSTANTS[41]*pow(CONSTANTS[42], 2.00000);
CONSTANTS[54] =  0.680000*CONSTANTS[53];
CONSTANTS[55] =  0.0552000*CONSTANTS[53];
CONSTANTS[56] =  0.00480000*CONSTANTS[53];
}
void
computeRates(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
RATES[15] = (STATES[14]<0.200000&&STATES[14]>0.180000 ?  100.000*(1.00000 - STATES[15]) -  0.500000*STATES[15] :  - 0.500000*STATES[15]);
RATES[16] = (STATES[14]<0.200000&&STATES[14]>0.180000 ?  100.000*(1.00000 - STATES[16]) -  0.500000*STATES[16] :  - 0.0100000*STATES[16]);
RATES[18] = (1.00000/(1.00000+CONSTANTS[30]/STATES[13])>CONSTANTS[31]&&STATES[20]<0.370000&&STATES[16]<0.370000 ?  0.00000*50.0000*(1.00000 - STATES[18]) :  - 0.00000*0.500000*STATES[18]);
RATES[19] = (STATES[18]>CONSTANTS[32]&&STATES[19]<CONSTANTS[32] ?  0.00000*50.0000*(1.00000 - STATES[19]) :  - 0.00000*0.500000*STATES[19]);
RATES[20] = (STATES[18]>CONSTANTS[32]&&STATES[20]<CONSTANTS[32] ?  0.00000*50.0000*(1.00000 - STATES[20]) :  - 0.00000*0.0100000*STATES[20]);
ALGEBRAIC[1] = (fabs(STATES[0]+47.1300)>0.00100000 ? ( 0.320000*(STATES[0]+47.1300))/(1.00000 - exp( - 0.100000*(STATES[0]+47.1300))) : 3.20000);
ALGEBRAIC[11] =  0.0800000*exp(- STATES[0]/11.0000);
RATES[2] =  ALGEBRAIC[1]*(1.00000 - STATES[2]) -  ALGEBRAIC[11]*STATES[2];
ALGEBRAIC[2] = (STATES[0]<- 40.0000 ?  0.135000*exp((80.0000+STATES[0])/- 6.80000) : 0.00000);
ALGEBRAIC[12] = (STATES[0]<- 40.0000 ?  3.56000*exp( 0.0790000*STATES[0])+ 310000.*exp( 0.350000*STATES[0]) : 1.00000/( 0.130000*(1.00000+exp(- (STATES[0]+10.6600)/11.1000))));
RATES[3] =  ALGEBRAIC[2]*(1.00000 - STATES[3]) -  ALGEBRAIC[12]*STATES[3];
ALGEBRAIC[3] = (STATES[0]<- 40.0000 ? ( ( - 127140.*exp( 0.244000*STATES[0]) -  3.47400e-05*exp( - 0.0439100*STATES[0]))*(STATES[0]+37.7800))/(1.00000+exp( 0.311000*(STATES[0]+79.2300))) : 0.00000);
ALGEBRAIC[13] = (STATES[0]<- 40.0000 ? ( 0.121200*exp( - 0.0105200*STATES[0]))/(1.00000+exp( - 0.137800*(STATES[0]+40.1400))) : ( 0.300000*exp( - 2.53500e-07*STATES[0]))/(1.00000+exp( - 0.100000*(STATES[0]+32.0000))));
RATES[4] =  ALGEBRAIC[3]*(1.00000 - STATES[4]) -  ALGEBRAIC[13]*STATES[4];
ALGEBRAIC[4] =  (14.9859/( 16.6813* pow(( 2.00000* 3.14159265358979), 1.0 / 2)))*exp(- pow((STATES[0] - 22.3600)/16.6813, 2.00000)/2.00000);
ALGEBRAIC[14] = 0.147100 -  (5.30000/( 14.9300* pow(( 2.00000* 3.14159265358979), 1.0 / 2)))*exp(- pow((STATES[0] - 6.27440)/14.9300, 2.00000)/2.00000);
RATES[6] =  ALGEBRAIC[4]*(1.00000 - STATES[6]) -  ALGEBRAIC[14]*STATES[6];
ALGEBRAIC[5] = 0.00687200/(1.00000+exp((STATES[0] - 6.15460)/6.12230));
ALGEBRAIC[15] = ( 0.0687000*exp( - 0.108100*(STATES[0]+9.82550))+0.0112000)/(1.00000+exp( - 0.277900*(STATES[0]+9.82550)))+0.000547400;
RATES[7] =  ALGEBRAIC[5]*(1.00000 - STATES[7]) -  ALGEBRAIC[15]*STATES[7];
ALGEBRAIC[6] = ( 0.526600*exp( - 0.0166000*(STATES[0] - 42.2912)))/(1.00000+exp( - 0.0943000*(STATES[0] - 42.2912)));
ALGEBRAIC[16] = ( 5.18600e-05*STATES[0]+ 0.514900*exp( - 0.134400*(STATES[0] - 5.00270)))/(1.00000+exp( - 0.134800*(STATES[0] - 5.18600e-05)));
RATES[10] =  ALGEBRAIC[6]*(1.00000 - STATES[10]) -  ALGEBRAIC[16]*STATES[10];
ALGEBRAIC[7] = ( 5.61200e-05*STATES[0]+ 0.0721000*exp( - 0.173000*(STATES[0]+34.2531)))/(1.00000+exp( - 0.173200*(STATES[0]+34.2531)));
ALGEBRAIC[17] = ( 0.000121500*STATES[0]+ 0.0767000*exp( - 1.66000e-09*(STATES[0]+34.0235)))/(1.00000+exp( - 0.160400*(STATES[0]+34.0235)));
RATES[9] =  ALGEBRAIC[7]*(1.00000 - STATES[9]) -  ALGEBRAIC[17]*STATES[9];
ALGEBRAIC[8] = 0.00301300/(1.00000+exp((7.44540 - (STATES[0]+10.0000))/14.3171));
ALGEBRAIC[18] = 0.00587000/(1.00000+exp((5.95000+STATES[0]+10.0000)/15.8200));
RATES[11] =  ALGEBRAIC[8]*(1.00000 - STATES[11]) -  ALGEBRAIC[18]*STATES[11];
ALGEBRAIC[9] = ( 0.00500000*exp( 0.000526600*(STATES[0]+4.06700)))/(1.00000+exp( - 0.126200*(STATES[0]+4.06700)));
ALGEBRAIC[19] = ( 0.0160000*exp( 0.00160000*(STATES[0]+65.6600)))/(1.00000+exp( 0.0783000*(STATES[0]+65.6600)));
RATES[12] =  ALGEBRAIC[9]*(1.00000 - STATES[12]) -  ALGEBRAIC[19]*STATES[12];
ALGEBRAIC[25] = log(( 0.0430000*CONSTANTS[13]+CONSTANTS[17])/( 0.0430000*STATES[1]+STATES[8]))/CONSTANTS[43];
ALGEBRAIC[26] =  CONSTANTS[44]*STATES[10]*STATES[9]*(STATES[0] - ALGEBRAIC[25]);
ALGEBRAIC[30] = 1.00000/(1.00000+exp((STATES[0]+26.0000)/23.0000));
ALGEBRAIC[29] = log(CONSTANTS[17]/STATES[8])/CONSTANTS[43];
ALGEBRAIC[31] =  CONSTANTS[19]*STATES[12]*ALGEBRAIC[30]*(STATES[0] - ALGEBRAIC[29]);
ALGEBRAIC[27] = log(( 0.0183300*CONSTANTS[13]+CONSTANTS[17])/( 0.0183300*STATES[1]+STATES[8]))/CONSTANTS[43];
ALGEBRAIC[28] =  CONSTANTS[18]*pow(STATES[11], 2.00000)*(STATES[0] - ALGEBRAIC[27]);
ALGEBRAIC[32] = log(CONSTANTS[17]/STATES[8])/CONSTANTS[43];
ALGEBRAIC[33] = 0.100000/(1.00000+exp( 0.0600000*(STATES[0] - (ALGEBRAIC[32]+200.000))));
ALGEBRAIC[34] = ( 3.00000*exp( 0.000200000*(STATES[0]+100.000+- ALGEBRAIC[32]))+ 1.00000*exp( 0.100000*(STATES[0] - (10.0000+ALGEBRAIC[32]))))/(1.00000+exp( - 0.500000*(STATES[0] - ALGEBRAIC[32])));
ALGEBRAIC[35] = ALGEBRAIC[33]/(ALGEBRAIC[33]+ALGEBRAIC[34]);
ALGEBRAIC[36] =  CONSTANTS[45]*ALGEBRAIC[35]*(STATES[0] - ALGEBRAIC[32]);
ALGEBRAIC[39] = 1.00000/(1.00000+ 0.124500*exp( - 0.100000*STATES[0]*CONSTANTS[43])+ 0.0365000*CONSTANTS[49]*exp( - STATES[0]*CONSTANTS[43]));
ALGEBRAIC[40] = ( (( CONSTANTS[48]*ALGEBRAIC[39]*1.00000)/(1.00000+pow(CONSTANTS[20]/STATES[1], 1.50000)))*CONSTANTS[17])/(CONSTANTS[17]+CONSTANTS[21]);
ALGEBRAIC[0] =  floor(VOI/CONSTANTS[6])*CONSTANTS[6];
ALGEBRAIC[10] = (VOI - ALGEBRAIC[0]>=CONSTANTS[5]&&VOI - ALGEBRAIC[0]<=CONSTANTS[5]+CONSTANTS[7] ? CONSTANTS[8] : 0.00000);
RATES[8] = ( - 1.00000*CONSTANTS[3]*((ALGEBRAIC[26]+ALGEBRAIC[31]+ALGEBRAIC[36]+ALGEBRAIC[10]+ALGEBRAIC[28]) -  2.00000*ALGEBRAIC[40]))/( CONSTANTS[54]*CONSTANTS[2]);
ALGEBRAIC[22] = log(CONSTANTS[15]/STATES[5])/( 2.00000*CONSTANTS[43]);
ALGEBRAIC[23] = CONSTANTS[16]/(CONSTANTS[16]+STATES[5]);
ALGEBRAIC[24] =  CONSTANTS[14]*STATES[6]*STATES[7]*ALGEBRAIC[23]*(STATES[0] - ALGEBRAIC[22]);
ALGEBRAIC[41] =  (( (( (( CONSTANTS[50]*1.00000)/(pow(CONSTANTS[22], 3.00000)+pow(CONSTANTS[13], 3.00000)))*1.00000)/(CONSTANTS[23]+CONSTANTS[15]))*1.00000)/(1.00000+ CONSTANTS[24]*exp( (CONSTANTS[25] - 1.00000)*STATES[0]*CONSTANTS[43])))*( exp( CONSTANTS[25]*STATES[0]*CONSTANTS[43])*pow(STATES[1], 3.00000)*CONSTANTS[15] -  exp( (CONSTANTS[25] - 1.00000)*STATES[0]*CONSTANTS[43])*pow(CONSTANTS[13], 3.00000)*STATES[5]);
ALGEBRAIC[37] =  CONSTANTS[46]*(STATES[0] - ALGEBRAIC[22]);
RATES[17] = (STATES[14]>0.200000 ? ( - CONSTANTS[3]*((ALGEBRAIC[24] - ALGEBRAIC[41])+ALGEBRAIC[37]))/( 2.00000*CONSTANTS[54]*CONSTANTS[2]) : STATES[15]>0.0100000&&STATES[14]<=0.200000 ? 0.00000 :  - 0.500000*STATES[17]);
ALGEBRAIC[20] = log(CONSTANTS[13]/STATES[1])/CONSTANTS[43];
ALGEBRAIC[21] =  CONSTANTS[12]*pow(STATES[2], 3.00000)*STATES[3]*STATES[4]*(STATES[0] - ALGEBRAIC[20]);
ALGEBRAIC[38] =  CONSTANTS[47]*(STATES[0] - ALGEBRAIC[20]);
RATES[1] = ( - 1.00000*CONSTANTS[3]*(ALGEBRAIC[21]+ALGEBRAIC[38]+ ALGEBRAIC[41]*3.00000+ ALGEBRAIC[40]*3.00000))/( CONSTANTS[54]*CONSTANTS[2]);
ALGEBRAIC[42] = ALGEBRAIC[21]+ALGEBRAIC[24]+ALGEBRAIC[26]+ALGEBRAIC[31]+ALGEBRAIC[28]+ALGEBRAIC[36]+ALGEBRAIC[41]+ALGEBRAIC[40]+ALGEBRAIC[38]+ALGEBRAIC[37]+ALGEBRAIC[10];
ALGEBRAIC[44] = (CONSTANTS[9]==1.00000&&(VOI<=500.000||VOI>800.000) ? (CONSTANTS[10] - STATES[0])/1.00000 : CONSTANTS[9]==1.00000&&VOI>500.000&&VOI<=800.000 ? (CONSTANTS[11] - STATES[0])/1.00000 :  - 1.00000*ALGEBRAIC[42]);
RATES[0] = ALGEBRAIC[44];
RATES[14] = (ALGEBRAIC[44]>150.000 ?  100.000*(1.00000 - STATES[14]) -  0.500000*STATES[14] :  - 0.500000*STATES[14]);
ALGEBRAIC[43] = (STATES[17]>CONSTANTS[29] ?  (( 1.00000*CONSTANTS[26]*(STATES[17] - CONSTANTS[29]))/((CONSTANTS[28]+STATES[17]) - CONSTANTS[29]))*(1.00000 - STATES[15])*STATES[15] : STATES[17]<=CONSTANTS[29]&&STATES[19]>0.00000 ?  0.00000*CONSTANTS[27]*(1.00000 - STATES[19])*STATES[19] : 0.00000);
ALGEBRAIC[45] =  ALGEBRAIC[43]*(STATES[13] - STATES[5]);
ALGEBRAIC[46] = ( CONSTANTS[51]*STATES[5])/(STATES[5]+CONSTANTS[33]);
ALGEBRAIC[47] =  CONSTANTS[52]*STATES[21];
ALGEBRAIC[48] = 1.00000/(1.00000+ CONSTANTS[39]*(( CONSTANTS[38]*CONSTANTS[36])/pow(CONSTANTS[36]+STATES[5], 2.00000)+( CONSTANTS[37]*CONSTANTS[35])/pow(CONSTANTS[35]+STATES[5], 2.00000)));
RATES[5] =  ALGEBRAIC[48]*(( - CONSTANTS[3]*((ALGEBRAIC[24] -  2.00000*ALGEBRAIC[41])+ALGEBRAIC[37]))/( 2.00000*CONSTANTS[54]*CONSTANTS[2])+( ALGEBRAIC[45]*CONSTANTS[56])/CONSTANTS[54]+( (ALGEBRAIC[47] - ALGEBRAIC[46])*CONSTANTS[55])/CONSTANTS[54]);
ALGEBRAIC[49] = ( 1.00000*(STATES[21] - STATES[13]))/CONSTANTS[34];
RATES[21] =  - 1.00000*((ALGEBRAIC[47]+ (CONSTANTS[56]/CONSTANTS[55])*ALGEBRAIC[49]) - ALGEBRAIC[46]);
ALGEBRAIC[50] = 1.00000/(1.00000+( CONSTANTS[40]*CONSTANTS[30])/pow(CONSTANTS[30]+STATES[13], 2.00000));
RATES[13] =  ALGEBRAIC[50]*(ALGEBRAIC[49] - ALGEBRAIC[45]);
}
void
computeVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
ALGEBRAIC[1] = (fabs(STATES[0]+47.1300)>0.00100000 ? ( 0.320000*(STATES[0]+47.1300))/(1.00000 - exp( - 0.100000*(STATES[0]+47.1300))) : 3.20000);
ALGEBRAIC[11] =  0.0800000*exp(- STATES[0]/11.0000);
ALGEBRAIC[2] = (STATES[0]<- 40.0000 ?  0.135000*exp((80.0000+STATES[0])/- 6.80000) : 0.00000);
ALGEBRAIC[12] = (STATES[0]<- 40.0000 ?  3.56000*exp( 0.0790000*STATES[0])+ 310000.*exp( 0.350000*STATES[0]) : 1.00000/( 0.130000*(1.00000+exp(- (STATES[0]+10.6600)/11.1000))));
ALGEBRAIC[3] = (STATES[0]<- 40.0000 ? ( ( - 127140.*exp( 0.244000*STATES[0]) -  3.47400e-05*exp( - 0.0439100*STATES[0]))*(STATES[0]+37.7800))/(1.00000+exp( 0.311000*(STATES[0]+79.2300))) : 0.00000);
ALGEBRAIC[13] = (STATES[0]<- 40.0000 ? ( 0.121200*exp( - 0.0105200*STATES[0]))/(1.00000+exp( - 0.137800*(STATES[0]+40.1400))) : ( 0.300000*exp( - 2.53500e-07*STATES[0]))/(1.00000+exp( - 0.100000*(STATES[0]+32.0000))));
ALGEBRAIC[4] =  (14.9859/( 16.6813* pow(( 2.00000* 3.14159265358979), 1.0 / 2)))*exp(- pow((STATES[0] - 22.3600)/16.6813, 2.00000)/2.00000);
ALGEBRAIC[14] = 0.147100 -  (5.30000/( 14.9300* pow(( 2.00000* 3.14159265358979), 1.0 / 2)))*exp(- pow((STATES[0] - 6.27440)/14.9300, 2.00000)/2.00000);
ALGEBRAIC[5] = 0.00687200/(1.00000+exp((STATES[0] - 6.15460)/6.12230));
ALGEBRAIC[15] = ( 0.0687000*exp( - 0.108100*(STATES[0]+9.82550))+0.0112000)/(1.00000+exp( - 0.277900*(STATES[0]+9.82550)))+0.000547400;
ALGEBRAIC[6] = ( 0.526600*exp( - 0.0166000*(STATES[0] - 42.2912)))/(1.00000+exp( - 0.0943000*(STATES[0] - 42.2912)));
ALGEBRAIC[16] = ( 5.18600e-05*STATES[0]+ 0.514900*exp( - 0.134400*(STATES[0] - 5.00270)))/(1.00000+exp( - 0.134800*(STATES[0] - 5.18600e-05)));
ALGEBRAIC[7] = ( 5.61200e-05*STATES[0]+ 0.0721000*exp( - 0.173000*(STATES[0]+34.2531)))/(1.00000+exp( - 0.173200*(STATES[0]+34.2531)));
ALGEBRAIC[17] = ( 0.000121500*STATES[0]+ 0.0767000*exp( - 1.66000e-09*(STATES[0]+34.0235)))/(1.00000+exp( - 0.160400*(STATES[0]+34.0235)));
ALGEBRAIC[8] = 0.00301300/(1.00000+exp((7.44540 - (STATES[0]+10.0000))/14.3171));
ALGEBRAIC[18] = 0.00587000/(1.00000+exp((5.95000+STATES[0]+10.0000)/15.8200));
ALGEBRAIC[9] = ( 0.00500000*exp( 0.000526600*(STATES[0]+4.06700)))/(1.00000+exp( - 0.126200*(STATES[0]+4.06700)));
ALGEBRAIC[19] = ( 0.0160000*exp( 0.00160000*(STATES[0]+65.6600)))/(1.00000+exp( 0.0783000*(STATES[0]+65.6600)));
ALGEBRAIC[25] = log(( 0.0430000*CONSTANTS[13]+CONSTANTS[17])/( 0.0430000*STATES[1]+STATES[8]))/CONSTANTS[43];
ALGEBRAIC[26] =  CONSTANTS[44]*STATES[10]*STATES[9]*(STATES[0] - ALGEBRAIC[25]);
ALGEBRAIC[30] = 1.00000/(1.00000+exp((STATES[0]+26.0000)/23.0000));
ALGEBRAIC[29] = log(CONSTANTS[17]/STATES[8])/CONSTANTS[43];
ALGEBRAIC[31] =  CONSTANTS[19]*STATES[12]*ALGEBRAIC[30]*(STATES[0] - ALGEBRAIC[29]);
ALGEBRAIC[27] = log(( 0.0183300*CONSTANTS[13]+CONSTANTS[17])/( 0.0183300*STATES[1]+STATES[8]))/CONSTANTS[43];
ALGEBRAIC[28] =  CONSTANTS[18]*pow(STATES[11], 2.00000)*(STATES[0] - ALGEBRAIC[27]);
ALGEBRAIC[32] = log(CONSTANTS[17]/STATES[8])/CONSTANTS[43];
ALGEBRAIC[33] = 0.100000/(1.00000+exp( 0.0600000*(STATES[0] - (ALGEBRAIC[32]+200.000))));
ALGEBRAIC[34] = ( 3.00000*exp( 0.000200000*(STATES[0]+100.000+- ALGEBRAIC[32]))+ 1.00000*exp( 0.100000*(STATES[0] - (10.0000+ALGEBRAIC[32]))))/(1.00000+exp( - 0.500000*(STATES[0] - ALGEBRAIC[32])));
ALGEBRAIC[35] = ALGEBRAIC[33]/(ALGEBRAIC[33]+ALGEBRAIC[34]);
ALGEBRAIC[36] =  CONSTANTS[45]*ALGEBRAIC[35]*(STATES[0] - ALGEBRAIC[32]);
ALGEBRAIC[39] = 1.00000/(1.00000+ 0.124500*exp( - 0.100000*STATES[0]*CONSTANTS[43])+ 0.0365000*CONSTANTS[49]*exp( - STATES[0]*CONSTANTS[43]));
ALGEBRAIC[40] = ( (( CONSTANTS[48]*ALGEBRAIC[39]*1.00000)/(1.00000+pow(CONSTANTS[20]/STATES[1], 1.50000)))*CONSTANTS[17])/(CONSTANTS[17]+CONSTANTS[21]);
ALGEBRAIC[0] =  floor(VOI/CONSTANTS[6])*CONSTANTS[6];
ALGEBRAIC[10] = (VOI - ALGEBRAIC[0]>=CONSTANTS[5]&&VOI - ALGEBRAIC[0]<=CONSTANTS[5]+CONSTANTS[7] ? CONSTANTS[8] : 0.00000);
ALGEBRAIC[22] = log(CONSTANTS[15]/STATES[5])/( 2.00000*CONSTANTS[43]);
ALGEBRAIC[23] = CONSTANTS[16]/(CONSTANTS[16]+STATES[5]);
ALGEBRAIC[24] =  CONSTANTS[14]*STATES[6]*STATES[7]*ALGEBRAIC[23]*(STATES[0] - ALGEBRAIC[22]);
ALGEBRAIC[41] =  (( (( (( CONSTANTS[50]*1.00000)/(pow(CONSTANTS[22], 3.00000)+pow(CONSTANTS[13], 3.00000)))*1.00000)/(CONSTANTS[23]+CONSTANTS[15]))*1.00000)/(1.00000+ CONSTANTS[24]*exp( (CONSTANTS[25] - 1.00000)*STATES[0]*CONSTANTS[43])))*( exp( CONSTANTS[25]*STATES[0]*CONSTANTS[43])*pow(STATES[1], 3.00000)*CONSTANTS[15] -  exp( (CONSTANTS[25] - 1.00000)*STATES[0]*CONSTANTS[43])*pow(CONSTANTS[13], 3.00000)*STATES[5]);
ALGEBRAIC[37] =  CONSTANTS[46]*(STATES[0] - ALGEBRAIC[22]);
ALGEBRAIC[20] = log(CONSTANTS[13]/STATES[1])/CONSTANTS[43];
ALGEBRAIC[21] =  CONSTANTS[12]*pow(STATES[2], 3.00000)*STATES[3]*STATES[4]*(STATES[0] - ALGEBRAIC[20]);
ALGEBRAIC[38] =  CONSTANTS[47]*(STATES[0] - ALGEBRAIC[20]);
ALGEBRAIC[42] = ALGEBRAIC[21]+ALGEBRAIC[24]+ALGEBRAIC[26]+ALGEBRAIC[31]+ALGEBRAIC[28]+ALGEBRAIC[36]+ALGEBRAIC[41]+ALGEBRAIC[40]+ALGEBRAIC[38]+ALGEBRAIC[37]+ALGEBRAIC[10];
ALGEBRAIC[44] = (CONSTANTS[9]==1.00000&&(VOI<=500.000||VOI>800.000) ? (CONSTANTS[10] - STATES[0])/1.00000 : CONSTANTS[9]==1.00000&&VOI>500.000&&VOI<=800.000 ? (CONSTANTS[11] - STATES[0])/1.00000 :  - 1.00000*ALGEBRAIC[42]);
ALGEBRAIC[43] = (STATES[17]>CONSTANTS[29] ?  (( 1.00000*CONSTANTS[26]*(STATES[17] - CONSTANTS[29]))/((CONSTANTS[28]+STATES[17]) - CONSTANTS[29]))*(1.00000 - STATES[15])*STATES[15] : STATES[17]<=CONSTANTS[29]&&STATES[19]>0.00000 ?  0.00000*CONSTANTS[27]*(1.00000 - STATES[19])*STATES[19] : 0.00000);
ALGEBRAIC[45] =  ALGEBRAIC[43]*(STATES[13] - STATES[5]);
ALGEBRAIC[46] = ( CONSTANTS[51]*STATES[5])/(STATES[5]+CONSTANTS[33]);
ALGEBRAIC[47] =  CONSTANTS[52]*STATES[21];
ALGEBRAIC[48] = 1.00000/(1.00000+ CONSTANTS[39]*(( CONSTANTS[38]*CONSTANTS[36])/pow(CONSTANTS[36]+STATES[5], 2.00000)+( CONSTANTS[37]*CONSTANTS[35])/pow(CONSTANTS[35]+STATES[5], 2.00000)));
ALGEBRAIC[49] = ( 1.00000*(STATES[21] - STATES[13]))/CONSTANTS[34];
ALGEBRAIC[50] = 1.00000/(1.00000+( CONSTANTS[40]*CONSTANTS[30])/pow(CONSTANTS[30]+STATES[13], 2.00000));
}
Source
Derived from workspace Priebe, Beuckelmann, 1998 at changeset 02ebb36177b7.
Collaboration
To begin collaborating on this work, please use your git client and issue this command:
License

This work is licensed under a Creative Commons Attribution 3.0 Unported License.