Generated Code

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

The raw code is available.

/*
   There are a total of 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[42] is i_Na in component INa (uA_per_uF).
 * ALGEBRAIC[43] is i_Ca in component ICa (uA_per_uF).
 * ALGEBRAIC[44] is i_to in component Ito (uA_per_uF).
 * ALGEBRAIC[46] is i_Kr in component IKr (uA_per_uF).
 * ALGEBRAIC[45] is i_Ks in component IKs (uA_per_uF).
 * ALGEBRAIC[48] is i_K1 in component IK1 (uA_per_uF).
 * ALGEBRAIC[34] is i_NaCa in component INaCa (uA_per_uF).
 * ALGEBRAIC[33] is i_NaK in component INaK (uA_per_uF).
 * ALGEBRAIC[31] is i_b_Na in component INab (uA_per_uF).
 * ALGEBRAIC[30] is i_b_Ca in component ICab (uA_per_uF).
 * ALGEBRAIC[50] is dVdt in component cell (mV_per_ms).
 * ALGEBRAIC[49] is I_tot in component cell (uA_per_uF).
 * ALGEBRAIC[1] 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[2] 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[3] is alpha_m in component INa_m_gate (per_ms).
 * ALGEBRAIC[4] is beta_m in component INa_m_gate (per_ms).
 * ALGEBRAIC[5] is alpha_h in component INa_h_gate (per_ms).
 * ALGEBRAIC[6] is beta_h in component INa_h_gate (per_ms).
 * ALGEBRAIC[7] is alpha_j in component INa_j_gate (per_ms).
 * ALGEBRAIC[8] is beta_j in component INa_j_gate (per_ms).
 * ALGEBRAIC[9] 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[14] is f_Ca in component ICa_f_Ca_gate (dimensionless).
 * ALGEBRAIC[10] is alpha_d in component ICa_d_gate (per_ms).
 * ALGEBRAIC[11] is beta_d in component ICa_d_gate (per_ms).
 * ALGEBRAIC[12] is alpha_f in component ICa_f_gate (per_ms).
 * ALGEBRAIC[13] 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[15] 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[16] is alpha_r in component Ito_r_gate (per_ms).
 * ALGEBRAIC[17] is beta_r in component Ito_r_gate (per_ms).
 * ALGEBRAIC[18] is alpha_t in component Ito_t_gate (per_ms).
 * ALGEBRAIC[19] is beta_t in component Ito_t_gate (per_ms).
 * CONSTANTS[18] is g_Ks_max in component IKs (mS_per_uF).
 * ALGEBRAIC[20] is E_Ks in component IKs (mV).
 * STATES[11] is Xs in component IKs_Xs_gate (dimensionless).
 * ALGEBRAIC[21] is alpha_Xs in component IKs_Xs_gate (per_ms).
 * ALGEBRAIC[22] is beta_Xs in component IKs_Xs_gate (per_ms).
 * CONSTANTS[19] is g_Kr_max in component IKr (mS_per_uF).
 * ALGEBRAIC[24] is rik in component IKr (dimensionless).
 * ALGEBRAIC[23] is E_K in component IKr (mV).
 * STATES[12] is Xr in component IKr_Xr_gate (dimensionless).
 * ALGEBRAIC[25] is alpha_Xr in component IKr_Xr_gate (per_ms).
 * ALGEBRAIC[26] is beta_Xr in component IKr_Xr_gate (per_ms).
 * ALGEBRAIC[27] is E_K1 in component IK1 (mV).
 * CONSTANTS[45] is g_K1_max in component IK1 (mS_per_uF).
 * ALGEBRAIC[47] is K1_infinity in component IK1_K1_gate (dimensionless).
 * ALGEBRAIC[28] is alpha_K1 in component IK1_K1_gate (per_ms).
 * ALGEBRAIC[29] 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[32] 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[36] is i_rel in component Irel (mM_per_ms).
 * ALGEBRAIC[35] 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[37] 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[38] 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[39] 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[40] 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[41] 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).
 * There are a total of 29 condition variables.
 */
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];
RATES[0] = 0.1;
RATES[2] = 0.1;
RATES[3] = 0.1;
RATES[4] = 0.1;
RATES[6] = 0.1;
RATES[7] = 0.1;
RATES[10] = 0.1;
RATES[9] = 0.1;
RATES[11] = 0.1;
RATES[12] = 0.1;
RATES[14] = 0.1;
RATES[15] = 0.1;
RATES[16] = 0.1;
RATES[17] = 0.1;
RATES[18] = 0.1;
RATES[19] = 0.1;
RATES[20] = 0.1;
RATES[1] = 0.1;
RATES[8] = 0.1;
RATES[5] = 0.1;
RATES[13] = 0.1;
RATES[21] = 0.1;
}
void
computeResiduals(double VOI, double* CONSTANTS, double* RATES, double* OLDRATES, double* STATES,
                 double* OLDSTATES, double* ALGEBRAIC, double* CONDVARS)
{
resid[0] = RATES[0] - ALGEBRAIC[50];
resid[1] = RATES[2] -  ALGEBRAIC[3]*(1.00000 - STATES[2]) -  ALGEBRAIC[4]*STATES[2];
resid[2] = RATES[3] -  ALGEBRAIC[5]*(1.00000 - STATES[3]) -  ALGEBRAIC[6]*STATES[3];
resid[3] = RATES[4] -  ALGEBRAIC[7]*(1.00000 - STATES[4]) -  ALGEBRAIC[8]*STATES[4];
resid[4] = RATES[6] -  ALGEBRAIC[10]*(1.00000 - STATES[6]) -  ALGEBRAIC[11]*STATES[6];
resid[5] = RATES[7] -  ALGEBRAIC[12]*(1.00000 - STATES[7]) -  ALGEBRAIC[13]*STATES[7];
resid[6] = RATES[10] -  ALGEBRAIC[16]*(1.00000 - STATES[10]) -  ALGEBRAIC[17]*STATES[10];
resid[7] = RATES[9] -  ALGEBRAIC[18]*(1.00000 - STATES[9]) -  ALGEBRAIC[19]*STATES[9];
resid[8] = RATES[11] -  ALGEBRAIC[21]*(1.00000 - STATES[11]) -  ALGEBRAIC[22]*STATES[11];
resid[9] = RATES[12] -  ALGEBRAIC[25]*(1.00000 - STATES[12]) -  ALGEBRAIC[26]*STATES[12];
resid[10] = RATES[14] - (CONDVAR[11]>0.00000 ?  100.000*(1.00000 - STATES[14]) -  0.500000*STATES[14] :  - 0.500000*STATES[14]);
resid[11] = RATES[15] - (CONDVAR[12]<0.00000&&CONDVAR[13]>0.00000 ?  100.000*(1.00000 - STATES[15]) -  0.500000*STATES[15] :  - 0.500000*STATES[15]);
resid[12] = RATES[16] - (CONDVAR[14]<0.00000&&CONDVAR[15]>0.00000 ?  100.000*(1.00000 - STATES[16]) -  0.500000*STATES[16] :  - 0.0100000*STATES[16]);
resid[13] = RATES[17] - (CONDVAR[16]>0.00000 ? ( - CONSTANTS[3]*((ALGEBRAIC[43] - ALGEBRAIC[34])+ALGEBRAIC[30]))/( 2.00000*CONSTANTS[54]*CONSTANTS[2]) : CONDVAR[17]>0.00000&&CONDVAR[18]<=0.00000 ? 0.00000 :  - 0.500000*STATES[17]);
resid[14] = RATES[18] - (CONDVAR[19]>0.00000&&CONDVAR[20]<0.00000&&CONDVAR[21]<0.00000 ?  0.00000*50.0000*(1.00000 - STATES[18]) :  - 0.00000*0.500000*STATES[18]);
resid[15] = RATES[19] - (CONDVAR[22]>0.00000&&CONDVAR[23]<0.00000 ?  0.00000*50.0000*(1.00000 - STATES[19]) :  - 0.00000*0.500000*STATES[19]);
resid[16] = RATES[20] - (CONDVAR[24]>0.00000&&CONDVAR[25]<0.00000 ?  0.00000*50.0000*(1.00000 - STATES[20]) :  - 0.00000*0.0100000*STATES[20]);
resid[17] = RATES[1] - ( - 1.00000*CONSTANTS[3]*(ALGEBRAIC[42]+ALGEBRAIC[31]+ ALGEBRAIC[34]*3.00000+ ALGEBRAIC[33]*3.00000))/( CONSTANTS[54]*CONSTANTS[2]);
resid[18] = RATES[8] - ( - 1.00000*CONSTANTS[3]*((ALGEBRAIC[44]+ALGEBRAIC[46]+ALGEBRAIC[48]+ALGEBRAIC[1]+ALGEBRAIC[45]) -  2.00000*ALGEBRAIC[33]))/( CONSTANTS[54]*CONSTANTS[2]);
resid[19] = RATES[5] -  ALGEBRAIC[40]*(( - CONSTANTS[3]*((ALGEBRAIC[43] -  2.00000*ALGEBRAIC[34])+ALGEBRAIC[30]))/( 2.00000*CONSTANTS[54]*CONSTANTS[2])+( ALGEBRAIC[36]*CONSTANTS[56])/CONSTANTS[54]+( (ALGEBRAIC[38] - ALGEBRAIC[37])*CONSTANTS[55])/CONSTANTS[54]);
resid[20] = RATES[13] -  ALGEBRAIC[41]*(ALGEBRAIC[39] - ALGEBRAIC[36]);
resid[21] = RATES[21] -  - 1.00000*((ALGEBRAIC[38]+ (CONSTANTS[56]/CONSTANTS[55])*ALGEBRAIC[39]) - ALGEBRAIC[37]);
}
void
computeVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
}
void
computeEssentialVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
ALGEBRAIC[0] =  floor(VOI/CONSTANTS[6])*CONSTANTS[6];
ALGEBRAIC[1] = (CONDVAR[0]>=0.00000&&CONDVAR[1]<=0.00000 ? CONSTANTS[8] : 0.00000);
ALGEBRAIC[3] = (CONDVAR[6]>0.00000 ? ( 0.320000*(STATES[0]+47.1300))/(1.00000 - exp( - 0.100000*(STATES[0]+47.1300))) : 3.20000);
ALGEBRAIC[4] =  0.0800000*exp(- STATES[0]/11.0000);
ALGEBRAIC[5] = (CONDVAR[7]<0.00000 ?  0.135000*exp((80.0000+STATES[0])/- 6.80000) : 0.00000);
ALGEBRAIC[6] = (CONDVAR[8]<0.00000 ?  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[7] = (CONDVAR[9]<0.00000 ? ( ( - 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[8] = (CONDVAR[10]<0.00000 ? ( 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[10] =  (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[11] = 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[12] = 0.00687200/(1.00000+exp((STATES[0] - 6.15460)/6.12230));
ALGEBRAIC[13] = ( 0.0687000*exp( - 0.108100*(STATES[0]+9.82550))+0.0112000)/(1.00000+exp( - 0.277900*(STATES[0]+9.82550)))+0.000547400;
ALGEBRAIC[16] = ( 0.526600*exp( - 0.0166000*(STATES[0] - 42.2912)))/(1.00000+exp( - 0.0943000*(STATES[0] - 42.2912)));
ALGEBRAIC[17] = ( 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[18] = ( 5.61200e-05*STATES[0]+ 0.0721000*exp( - 0.173000*(STATES[0]+34.2531)))/(1.00000+exp( - 0.173200*(STATES[0]+34.2531)));
ALGEBRAIC[19] = ( 0.000121500*STATES[0]+ 0.0767000*exp( - 1.66000e-09*(STATES[0]+34.0235)))/(1.00000+exp( - 0.160400*(STATES[0]+34.0235)));
ALGEBRAIC[21] = 0.00301300/(1.00000+exp((7.44540 - (STATES[0]+10.0000))/14.3171));
ALGEBRAIC[22] = 0.00587000/(1.00000+exp((5.95000+STATES[0]+10.0000)/15.8200));
ALGEBRAIC[25] = ( 0.00500000*exp( 0.000526600*(STATES[0]+4.06700)))/(1.00000+exp( - 0.126200*(STATES[0]+4.06700)));
ALGEBRAIC[26] = ( 0.0160000*exp( 0.00160000*(STATES[0]+65.6600)))/(1.00000+exp( 0.0783000*(STATES[0]+65.6600)));
ALGEBRAIC[9] = log(CONSTANTS[15]/STATES[5])/( 2.00000*CONSTANTS[43]);
ALGEBRAIC[30] =  CONSTANTS[46]*(STATES[0] - ALGEBRAIC[9]);
ALGEBRAIC[2] = log(CONSTANTS[13]/STATES[1])/CONSTANTS[43];
ALGEBRAIC[31] =  CONSTANTS[47]*(STATES[0] - ALGEBRAIC[2]);
ALGEBRAIC[32] = 1.00000/(1.00000+ 0.124500*exp( - 0.100000*STATES[0]*CONSTANTS[43])+ 0.0365000*CONSTANTS[49]*exp( - STATES[0]*CONSTANTS[43]));
ALGEBRAIC[33] = ( (( CONSTANTS[48]*ALGEBRAIC[32]*1.00000)/(1.00000+pow(CONSTANTS[20]/STATES[1], 1.50000)))*CONSTANTS[17])/(CONSTANTS[17]+CONSTANTS[21]);
ALGEBRAIC[34] =  (( (( (( 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[35] = (CONDVAR[26]>0.00000 ?  (( 1.00000*CONSTANTS[26]*(STATES[17] - CONSTANTS[29]))/((CONSTANTS[28]+STATES[17]) - CONSTANTS[29]))*(1.00000 - STATES[15])*STATES[15] : CONDVAR[27]<=0.00000&&CONDVAR[28]>0.00000 ?  0.00000*CONSTANTS[27]*(1.00000 - STATES[19])*STATES[19] : 0.00000);
ALGEBRAIC[36] =  ALGEBRAIC[35]*(STATES[13] - STATES[5]);
ALGEBRAIC[37] = ( CONSTANTS[51]*STATES[5])/(STATES[5]+CONSTANTS[33]);
ALGEBRAIC[38] =  CONSTANTS[52]*STATES[21];
ALGEBRAIC[39] = ( 1.00000*(STATES[21] - STATES[13]))/CONSTANTS[34];
ALGEBRAIC[40] = 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[41] = 1.00000/(1.00000+( CONSTANTS[40]*CONSTANTS[30])/pow(CONSTANTS[30]+STATES[13], 2.00000));
ALGEBRAIC[42] =  CONSTANTS[12]*pow(STATES[2], 3.00000)*STATES[3]*STATES[4]*(STATES[0] - ALGEBRAIC[2]);
ALGEBRAIC[14] = CONSTANTS[16]/(CONSTANTS[16]+STATES[5]);
ALGEBRAIC[43] =  CONSTANTS[14]*STATES[6]*STATES[7]*ALGEBRAIC[14]*(STATES[0] - ALGEBRAIC[9]);
ALGEBRAIC[15] = log(( 0.0430000*CONSTANTS[13]+CONSTANTS[17])/( 0.0430000*STATES[1]+STATES[8]))/CONSTANTS[43];
ALGEBRAIC[44] =  CONSTANTS[44]*STATES[10]*STATES[9]*(STATES[0] - ALGEBRAIC[15]);
ALGEBRAIC[20] = log(( 0.0183300*CONSTANTS[13]+CONSTANTS[17])/( 0.0183300*STATES[1]+STATES[8]))/CONSTANTS[43];
ALGEBRAIC[45] =  CONSTANTS[18]*pow(STATES[11], 2.00000)*(STATES[0] - ALGEBRAIC[20]);
ALGEBRAIC[24] = 1.00000/(1.00000+exp((STATES[0]+26.0000)/23.0000));
ALGEBRAIC[23] = log(CONSTANTS[17]/STATES[8])/CONSTANTS[43];
ALGEBRAIC[46] =  CONSTANTS[19]*STATES[12]*ALGEBRAIC[24]*(STATES[0] - ALGEBRAIC[23]);
ALGEBRAIC[27] = log(CONSTANTS[17]/STATES[8])/CONSTANTS[43];
ALGEBRAIC[28] = 0.100000/(1.00000+exp( 0.0600000*(STATES[0] - (ALGEBRAIC[27]+200.000))));
ALGEBRAIC[29] = ( 3.00000*exp( 0.000200000*(STATES[0]+100.000+- ALGEBRAIC[27]))+ 1.00000*exp( 0.100000*(STATES[0] - (10.0000+ALGEBRAIC[27]))))/(1.00000+exp( - 0.500000*(STATES[0] - ALGEBRAIC[27])));
ALGEBRAIC[47] = ALGEBRAIC[28]/(ALGEBRAIC[28]+ALGEBRAIC[29]);
ALGEBRAIC[48] =  CONSTANTS[45]*ALGEBRAIC[47]*(STATES[0] - ALGEBRAIC[27]);
ALGEBRAIC[49] = ALGEBRAIC[42]+ALGEBRAIC[43]+ALGEBRAIC[44]+ALGEBRAIC[46]+ALGEBRAIC[45]+ALGEBRAIC[48]+ALGEBRAIC[34]+ALGEBRAIC[33]+ALGEBRAIC[31]+ALGEBRAIC[30]+ALGEBRAIC[1];
ALGEBRAIC[50] = (CONSTANTS[9]==1.00000&&(CONDVAR[2]<=0.00000||CONDVAR[3]>0.00000) ? (CONSTANTS[10] - STATES[0])/1.00000 : CONSTANTS[9]==1.00000&&CONDVAR[4]>0.00000&&CONDVAR[5]<=0.00000 ? (CONSTANTS[11] - STATES[0])/1.00000 :  - 1.00000*ALGEBRAIC[49]);
}
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;
SI[11] = 1.0;
SI[12] = 1.0;
SI[13] = 1.0;
SI[14] = 1.0;
SI[15] = 1.0;
SI[16] = 1.0;
SI[17] = 1.0;
SI[18] = 1.0;
SI[19] = 1.0;
SI[20] = 1.0;
SI[21] = 1.0;
}
void
computeRoots(double VOI, double* CONSTANTS, double* RATES, double* OLDRATES, double* STATES,
             double* OLDSTATES, double* ALGEBRAIC, double* CONDVARS)
{
CONDVAR[0] = (VOI - ALGEBRAIC[0]) - CONSTANTS[5];
CONDVAR[1] = (VOI - ALGEBRAIC[0]) - (CONSTANTS[5]+CONSTANTS[7]);
CONDVAR[2] = VOI - 500.000;
CONDVAR[3] = VOI - 800.000;
CONDVAR[4] = VOI - 500.000;
CONDVAR[5] = VOI - 800.000;
CONDVAR[6] = fabs(STATES[0]+47.1300) - 0.00100000;
CONDVAR[7] = STATES[0] - - 40.0000;
CONDVAR[8] = STATES[0] - - 40.0000;
CONDVAR[9] = STATES[0] - - 40.0000;
CONDVAR[10] = STATES[0] - - 40.0000;
CONDVAR[11] = ALGEBRAIC[50] - 150.000;
CONDVAR[12] = STATES[14] - 0.200000;
CONDVAR[13] = STATES[14] - 0.180000;
CONDVAR[14] = STATES[14] - 0.200000;
CONDVAR[15] = STATES[14] - 0.180000;
CONDVAR[16] = STATES[14] - 0.200000;
CONDVAR[17] = STATES[15] - 0.0100000;
CONDVAR[18] = STATES[14] - 0.200000;
CONDVAR[19] = 1.00000/(1.00000+CONSTANTS[30]/STATES[13]) - CONSTANTS[31];
CONDVAR[20] = STATES[20] - 0.370000;
CONDVAR[21] = STATES[16] - 0.370000;
CONDVAR[22] = STATES[18] - CONSTANTS[32];
CONDVAR[23] = STATES[19] - CONSTANTS[32];
CONDVAR[24] = STATES[18] - CONSTANTS[32];
CONDVAR[25] = STATES[20] - CONSTANTS[32];
CONDVAR[26] = STATES[17] - CONSTANTS[29];
CONDVAR[27] = STATES[17] - CONSTANTS[29];
CONDVAR[28] = STATES[19] - 0.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.