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 76 entries in the algebraic variable array. There are a total of 29 entries in each of the rate and state variable arrays. There are a total of 86 entries in the constant variable array. */ /* * VOI is time in component environment (millisecond). * STATES[0] is Vm in component Vm (millivolt). * CONSTANTS[0] is Cm in component model_parameters (picoF). * ALGEBRAIC[8] is i_CaT in component i_CaT (picoA). * ALGEBRAIC[0] is i_CaL in component i_CaL (picoA). * ALGEBRAIC[30] is i_f in component i_f (picoA). * ALGEBRAIC[33] is i_st in component i_st (picoA). * ALGEBRAIC[13] is i_Kr in component i_Kr (picoA). * ALGEBRAIC[19] is i_Ks in component i_Ks (picoA). * ALGEBRAIC[22] is i_to in component AP_sensitive_currents (picoA). * ALGEBRAIC[23] is i_sus in component AP_sensitive_currents (picoA). * ALGEBRAIC[40] is i_NaK in component i_NaK (picoA). * ALGEBRAIC[75] is i_NaCa in component i_NaCa (picoA). * ALGEBRAIC[41] is i_b_Ca in component i_b_Ca (picoA). * ALGEBRAIC[39] is i_b_Na in component i_b_Na (picoA). * CONSTANTS[75] is E_Na in component electric_potentials (millivolt). * CONSTANTS[76] is E_K in component electric_potentials (millivolt). * CONSTANTS[77] is E_Ks in component electric_potentials (millivolt). * CONSTANTS[1] is R in component model_parameters (joule_per_kilomole_kelvin). * CONSTANTS[2] is T in component model_parameters (kelvin). * CONSTANTS[3] is F in component model_parameters (coulomb_per_mole). * CONSTANTS[4] is Nai in component model_parameters (millimolar). * CONSTANTS[5] is Nao in component model_parameters (millimolar). * CONSTANTS[6] is Ki in component model_parameters (millimolar). * CONSTANTS[7] is Ko in component model_parameters (millimolar). * CONSTANTS[8] is E_CaL in component i_CaL (millivolt). * CONSTANTS[9] is g_CaL in component i_CaL (nanoS_per_picoF). * STATES[1] is Ca_sub in component calcium_dynamics (millimolar). * STATES[2] is dL in component i_CaL_dL_gate (dimensionless). * STATES[3] is fL in component i_CaL_fL_gate (dimensionless). * STATES[4] is fCa in component i_CaL_fCa_gate (dimensionless). * ALGEBRAIC[1] is dL_infinity in component i_CaL_dL_gate (dimensionless). * ALGEBRAIC[70] is tau_dL in component i_CaL_dL_gate (millisecond). * ALGEBRAIC[59] is alpha_dL in component i_CaL_dL_gate (per_millisecond). * ALGEBRAIC[60] is beta_dL in component i_CaL_dL_gate (per_millisecond). * ALGEBRAIC[2] is adVm in component i_CaL_dL_gate (millivolt). * ALGEBRAIC[3] is bdVm in component i_CaL_dL_gate (millivolt). * ALGEBRAIC[4] is fL_infinity in component i_CaL_fL_gate (dimensionless). * ALGEBRAIC[5] is tau_fL in component i_CaL_fL_gate (millisecond). * CONSTANTS[10] is alpha_fCa in component i_CaL_fCa_gate (per_millisecond). * ALGEBRAIC[6] is fCa_infinity in component i_CaL_fCa_gate (dimensionless). * ALGEBRAIC[7] is tau_fCa in component i_CaL_fCa_gate (millisecond). * CONSTANTS[11] is Km_fCa in component i_CaL_fCa_gate (millimolar). * CONSTANTS[12] is g_CaT in component i_CaT (nanoS_per_picoF). * CONSTANTS[13] is E_CaT in component i_CaT (millivolt). * STATES[5] is dT in component i_CaT_dT_gate (dimensionless). * STATES[6] is fT in component i_CaT_fT_gate (dimensionless). * ALGEBRAIC[9] is dT_infinity in component i_CaT_dT_gate (dimensionless). * ALGEBRAIC[10] is tau_dT in component i_CaT_dT_gate (millisecond). * ALGEBRAIC[11] is fT_infinity in component i_CaT_fT_gate (dimensionless). * ALGEBRAIC[12] is tau_fT in component i_CaT_fT_gate (millisecond). * CONSTANTS[14] is g_Kr in component i_Kr (nanoS_per_picoF). * STATES[7] is paS in component i_Kr_pa_gate (dimensionless). * STATES[8] is paF in component i_Kr_pa_gate (dimensionless). * STATES[9] is pi_ in component i_Kr_pi_gate (dimensionless). * ALGEBRAIC[14] is pa_infinity in component i_Kr_pa_gate (dimensionless). * ALGEBRAIC[15] is tau_paS in component i_Kr_pa_gate (millisecond). * ALGEBRAIC[16] is tau_paF in component i_Kr_pa_gate (millisecond). * ALGEBRAIC[17] is pi_infinity in component i_Kr_pi_gate (dimensionless). * ALGEBRAIC[18] is tau_pi in component i_Kr_pi_gate (millisecond). * CONSTANTS[15] is g_Ks in component i_Ks (nanoS_per_picoF). * STATES[10] is n in component i_Ks_n_gate (dimensionless). * ALGEBRAIC[61] is n_infinity in component i_Ks_n_gate (dimensionless). * ALGEBRAIC[62] is tau_n in component i_Ks_n_gate (millisecond). * ALGEBRAIC[20] is alpha_n in component i_Ks_n_gate (per_millisecond). * ALGEBRAIC[21] is beta_n in component i_Ks_n_gate (per_millisecond). * CONSTANTS[16] is g_to in component AP_sensitive_currents (nanoS_per_picoF). * CONSTANTS[17] is g_sus in component AP_sensitive_currents (nanoS_per_picoF). * STATES[11] is q in component AP_sensitive_currents_q_gate (dimensionless). * STATES[12] is r in component AP_sensitive_currents_r_gate (dimensionless). * ALGEBRAIC[24] is q_infinity in component AP_sensitive_currents_q_gate (dimensionless). * ALGEBRAIC[25] is tau_q in component AP_sensitive_currents_q_gate (millisecond). * ALGEBRAIC[26] is r_infinity in component AP_sensitive_currents_r_gate (dimensionless). * ALGEBRAIC[27] is tau_r in component AP_sensitive_currents_r_gate (millisecond). * ALGEBRAIC[28] is i_f_Na in component i_f (picoA). * ALGEBRAIC[29] is i_f_K in component i_f (picoA). * CONSTANTS[18] is g_if in component i_f (nanoS_per_picoF). * STATES[13] is y in component i_f_y_gate (dimensionless). * ALGEBRAIC[31] is y_infinity in component i_f_y_gate (dimensionless). * ALGEBRAIC[32] is tau_y in component i_f_y_gate (millisecond). * CONSTANTS[19] is VIf_half in component i_f_y_gate (millivolt). * CONSTANTS[20] is g_st in component i_st (nanoS_per_picoF). * CONSTANTS[21] is E_st in component i_st (millivolt). * STATES[14] is qa in component i_st_qa_gate (dimensionless). * STATES[15] is qi in component i_st_qi_gate (dimensionless). * ALGEBRAIC[34] is qa_infinity in component i_st_qa_gate (dimensionless). * ALGEBRAIC[63] is tau_qa in component i_st_qa_gate (millisecond). * ALGEBRAIC[35] is alpha_qa in component i_st_qa_gate (per_millisecond). * ALGEBRAIC[36] is beta_qa in component i_st_qa_gate (per_millisecond). * ALGEBRAIC[64] is qi_infinity in component i_st_qi_gate (dimensionless). * ALGEBRAIC[65] is tau_qi in component i_st_qi_gate (millisecond). * ALGEBRAIC[37] is alpha_qi in component i_st_qi_gate (per_millisecond). * ALGEBRAIC[38] is beta_qi in component i_st_qi_gate (per_millisecond). * CONSTANTS[22] is g_b_Na in component i_b_Na (nanoS_per_picoF). * CONSTANTS[23] is Km_Kp in component i_NaK (millimolar). * CONSTANTS[24] is Km_Nap in component i_NaK (millimolar). * CONSTANTS[25] is i_NaK_max in component i_NaK (picoA_per_picoF). * CONSTANTS[26] is g_b_Ca in component i_b_Ca (nanoS_per_picoF). * CONSTANTS[27] is kNaCa in component i_NaCa (picoA_per_picoF). * ALGEBRAIC[71] is x1 in component i_NaCa (dimensionless). * ALGEBRAIC[72] is x2 in component i_NaCa (dimensionless). * ALGEBRAIC[73] is x3 in component i_NaCa (dimensionless). * ALGEBRAIC[74] is x4 in component i_NaCa (dimensionless). * ALGEBRAIC[42] is k41 in component i_NaCa (dimensionless). * CONSTANTS[80] is k34 in component i_NaCa (dimensionless). * ALGEBRAIC[69] is k23 in component i_NaCa (dimensionless). * ALGEBRAIC[68] is k21 in component i_NaCa (dimensionless). * ALGEBRAIC[44] is k32 in component i_NaCa (dimensionless). * CONSTANTS[79] is k43 in component i_NaCa (dimensionless). * ALGEBRAIC[66] is k12 in component i_NaCa (dimensionless). * ALGEBRAIC[67] is k14 in component i_NaCa (dimensionless). * CONSTANTS[28] is Qci in component i_NaCa (dimensionless). * CONSTANTS[29] is Qn in component i_NaCa (dimensionless). * CONSTANTS[30] is Qco in component i_NaCa (dimensionless). * CONSTANTS[31] is K3ni in component i_NaCa (millimolar). * CONSTANTS[32] is Kci in component i_NaCa (millimolar). * CONSTANTS[33] is K1ni in component i_NaCa (millimolar). * CONSTANTS[34] is K2ni in component i_NaCa (millimolar). * CONSTANTS[35] is Kcni in component i_NaCa (millimolar). * CONSTANTS[36] is K3no in component i_NaCa (millimolar). * CONSTANTS[37] is K1no in component i_NaCa (millimolar). * CONSTANTS[38] is K2no in component i_NaCa (millimolar). * CONSTANTS[39] is Kco in component i_NaCa (millimolar). * CONSTANTS[78] is RTOnF in component i_NaCa (millivolt). * ALGEBRAIC[45] is do in component i_NaCa (dimensionless). * ALGEBRAIC[43] is di in component i_NaCa (dimensionless). * CONSTANTS[40] is Cao in component model_parameters (millimolar). * ALGEBRAIC[46] is j_SRCarel in component j_SRCarel (millimolar_per_millisecond). * STATES[16] is R in component j_SRCarel (dimensionless). * STATES[17] is O in component j_SRCarel (dimensionless). * STATES[18] is I in component j_SRCarel (dimensionless). * STATES[19] is RI in component j_SRCarel (dimensionless). * CONSTANTS[41] is ks in component j_SRCarel (per_millisecond). * CONSTANTS[42] is MaxSR in component j_SRCarel (dimensionless). * CONSTANTS[43] is MinSR in component j_SRCarel (dimensionless). * CONSTANTS[44] is EC50_SR in component j_SRCarel (millimolar). * CONSTANTS[45] is HSR in component j_SRCarel (dimensionless). * ALGEBRAIC[48] is koSRCa in component j_SRCarel (per_millimolar2_millisecond). * ALGEBRAIC[49] is kiSRCa in component j_SRCarel (per_millimolar_millisecond). * CONSTANTS[46] is koCa in component j_SRCarel (per_millimolar2_millisecond). * CONSTANTS[47] is kiCa in component j_SRCarel (per_millimolar_millisecond). * ALGEBRAIC[47] is kCaSR in component j_SRCarel (dimensionless). * CONSTANTS[48] is kim in component j_SRCarel (per_millisecond). * CONSTANTS[49] is kom in component j_SRCarel (per_millisecond). * STATES[20] is Ca_jsr in component calcium_dynamics (millimolar). * ALGEBRAIC[50] is j_Ca_dif in component intracellular_calcium_fluxes (millimolar_per_millisecond). * ALGEBRAIC[51] is j_up in component intracellular_calcium_fluxes (millimolar_per_millisecond). * ALGEBRAIC[52] is j_tr in component intracellular_calcium_fluxes (millimolar_per_millisecond). * CONSTANTS[50] is tau_dif_Ca in component intracellular_calcium_fluxes (millisecond). * CONSTANTS[51] is tau_tr in component intracellular_calcium_fluxes (millisecond). * CONSTANTS[52] is P_up in component intracellular_calcium_fluxes (millimolar_per_millisecond). * CONSTANTS[53] is K_up in component intracellular_calcium_fluxes (millimolar). * STATES[21] is Ca_nsr in component calcium_dynamics (millimolar). * STATES[22] is Cai in component calcium_dynamics (millimolar). * CONSTANTS[54] is TC_tot in component calcium_buffering (millimolar). * CONSTANTS[55] is TMC_tot in component calcium_buffering (millimolar). * CONSTANTS[56] is CM_tot in component calcium_buffering (millimolar). * CONSTANTS[57] is CQ_tot in component calcium_buffering (millimolar). * ALGEBRAIC[53] is delta_fTC in component calcium_buffering (per_millisecond). * ALGEBRAIC[54] is delta_fTMC in component calcium_buffering (per_millisecond). * ALGEBRAIC[57] is delta_fCMs in component calcium_buffering (per_millisecond). * ALGEBRAIC[56] is delta_fCMi in component calcium_buffering (per_millisecond). * ALGEBRAIC[58] is delta_fCQ in component calcium_buffering (per_millisecond). * ALGEBRAIC[55] is delta_fTMM in component calcium_buffering (per_millisecond). * STATES[23] is fTMM in component calcium_buffering (dimensionless). * STATES[24] is fCMi in component calcium_buffering (dimensionless). * STATES[25] is fCMs in component calcium_buffering (dimensionless). * STATES[26] is fTC in component calcium_buffering (dimensionless). * STATES[27] is fTMC in component calcium_buffering (dimensionless). * STATES[28] is fCQ in component calcium_buffering (dimensionless). * CONSTANTS[58] is kf_TC in component calcium_buffering (per_millimolar_millisecond). * CONSTANTS[59] is kf_TMM in component calcium_buffering (per_millimolar_millisecond). * CONSTANTS[60] is kf_TMC in component calcium_buffering (per_millimolar_millisecond). * CONSTANTS[61] is kf_CM in component calcium_buffering (per_millimolar_millisecond). * CONSTANTS[62] is kf_CQ in component calcium_buffering (per_millimolar_millisecond). * CONSTANTS[63] is kb_TC in component calcium_buffering (per_millisecond). * CONSTANTS[64] is kb_TMC in component calcium_buffering (per_millisecond). * CONSTANTS[65] is kb_TMM in component calcium_buffering (per_millisecond). * CONSTANTS[66] is kb_CM in component calcium_buffering (per_millisecond). * CONSTANTS[67] is kb_CQ in component calcium_buffering (per_millisecond). * CONSTANTS[68] is Mgi in component model_parameters (millimolar). * CONSTANTS[84] is V_i in component model_parameters (picolitre). * CONSTANTS[83] is V_jsr in component model_parameters (picolitre). * CONSTANTS[85] is V_nsr in component model_parameters (picolitre). * CONSTANTS[82] is V_sub in component model_parameters (picolitre). * CONSTANTS[81] is V_cell in component model_parameters (picolitre). * CONSTANTS[69] is V_jsr_part in component model_parameters (dimensionless). * CONSTANTS[70] is V_i_part in component model_parameters (dimensionless). * CONSTANTS[71] is V_nsr_part in component model_parameters (dimensionless). * CONSTANTS[72] is R_cell in component model_parameters (micrometre). * CONSTANTS[73] is L_cell in component model_parameters (micrometre). * CONSTANTS[74] is L_sub in component model_parameters (micrometre). * RATES[0] is d/dt Vm in component Vm (millivolt). * RATES[2] is d/dt dL in component i_CaL_dL_gate (dimensionless). * RATES[3] is d/dt fL in component i_CaL_fL_gate (dimensionless). * RATES[4] is d/dt fCa in component i_CaL_fCa_gate (dimensionless). * RATES[5] is d/dt dT in component i_CaT_dT_gate (dimensionless). * RATES[6] is d/dt fT in component i_CaT_fT_gate (dimensionless). * RATES[7] is d/dt paS in component i_Kr_pa_gate (dimensionless). * RATES[8] is d/dt paF in component i_Kr_pa_gate (dimensionless). * RATES[9] is d/dt pi_ in component i_Kr_pi_gate (dimensionless). * RATES[10] is d/dt n in component i_Ks_n_gate (dimensionless). * RATES[11] is d/dt q in component AP_sensitive_currents_q_gate (dimensionless). * RATES[12] is d/dt r in component AP_sensitive_currents_r_gate (dimensionless). * RATES[13] is d/dt y in component i_f_y_gate (dimensionless). * RATES[14] is d/dt qa in component i_st_qa_gate (dimensionless). * RATES[15] is d/dt qi in component i_st_qi_gate (dimensionless). * RATES[16] is d/dt R in component j_SRCarel (dimensionless). * RATES[17] is d/dt O in component j_SRCarel (dimensionless). * RATES[18] is d/dt I in component j_SRCarel (dimensionless). * RATES[19] is d/dt RI in component j_SRCarel (dimensionless). * RATES[26] is d/dt fTC in component calcium_buffering (dimensionless). * RATES[27] is d/dt fTMC in component calcium_buffering (dimensionless). * RATES[23] is d/dt fTMM in component calcium_buffering (dimensionless). * RATES[24] is d/dt fCMi in component calcium_buffering (dimensionless). * RATES[25] is d/dt fCMs in component calcium_buffering (dimensionless). * RATES[28] is d/dt fCQ in component calcium_buffering (dimensionless). * RATES[22] is d/dt Cai in component calcium_dynamics (millimolar). * RATES[1] is d/dt Ca_sub in component calcium_dynamics (millimolar). * RATES[21] is d/dt Ca_nsr in component calcium_dynamics (millimolar). * RATES[20] is d/dt Ca_jsr in component calcium_dynamics (millimolar). * There are a total of 0 condition variables. */ void initConsts(double* CONSTANTS, double* RATES, double *STATES) { STATES[0] = -57.9639346865; CONSTANTS[0] = 32; CONSTANTS[1] = 8314.4; CONSTANTS[2] = 310.15; CONSTANTS[3] = 96485; CONSTANTS[4] = 10; CONSTANTS[5] = 140; CONSTANTS[6] = 140; CONSTANTS[7] = 5.4; CONSTANTS[8] = 45; CONSTANTS[9] = 0.464; STATES[1] = 0.000138112560112; STATES[2] = 0.000584545564405; STATES[3] = 0.862381249774; STATES[4] = 0.711395919653; CONSTANTS[10] = 0.021; CONSTANTS[11] = 0.00035; CONSTANTS[12] = 0.1832; CONSTANTS[13] = 45; STATES[5] = 0.00504393374639; STATES[6] = 0.420757825415; CONSTANTS[14] = 0.08113973; STATES[7] = 0.453100576739; STATES[8] = 0.144755091176; STATES[9] = 0.849409822329; CONSTANTS[15] = 0.0259; STATES[10] = 0.0264600410928; CONSTANTS[16] = 0.252; CONSTANTS[17] = 0.02; STATES[11] = 0.694241313965; STATES[12] = 0.00558131733359; CONSTANTS[18] = 0.15; STATES[13] = 0.113643187247; CONSTANTS[19] = -64; CONSTANTS[20] = 0.003; CONSTANTS[21] = 37.4; STATES[14] = 0.42380243163; STATES[15] = 0.447294008304; CONSTANTS[22] = 0.00486; CONSTANTS[23] = 1.4; CONSTANTS[24] = 14; CONSTANTS[25] = 2.88; CONSTANTS[26] = 0.0006; CONSTANTS[27] = 187.5; CONSTANTS[28] = 0.1369; CONSTANTS[29] = 0.4315; CONSTANTS[30] = 0; CONSTANTS[31] = 26.44; CONSTANTS[32] = 0.0207; CONSTANTS[33] = 395.3; CONSTANTS[34] = 2.289; CONSTANTS[35] = 26.44; CONSTANTS[36] = 4.663; CONSTANTS[37] = 1628; CONSTANTS[38] = 561.4; CONSTANTS[39] = 3.663; CONSTANTS[40] = 2; STATES[16] = 0.688047760973; STATES[17] = 1.7340201253e-7; STATES[18] = 7.86181717518e-8; STATES[19] = 0.311951987007; CONSTANTS[41] = 250000; CONSTANTS[42] = 15; CONSTANTS[43] = 1; CONSTANTS[44] = 0.45; CONSTANTS[45] = 2.5; CONSTANTS[46] = 10; CONSTANTS[47] = 0.5; CONSTANTS[48] = 0.005; CONSTANTS[49] = 0.06; STATES[20] = 0.316762674605; CONSTANTS[50] = 0.04; CONSTANTS[51] = 40; CONSTANTS[52] = 0.012; CONSTANTS[53] = 0.0006; STATES[21] = 1.49348117734; STATES[22] = 0.000150018670943; CONSTANTS[54] = 0.031; CONSTANTS[55] = 0.062; CONSTANTS[56] = 0.045; CONSTANTS[57] = 10; STATES[23] = 0.501049376634; STATES[24] = 0.0594880901438; STATES[25] = 0.054381370046; STATES[26] = 0.0291316176172; STATES[27] = 0.432694959597; STATES[28] = 0.273207128393; CONSTANTS[58] = 88.8; CONSTANTS[59] = 2.277; CONSTANTS[60] = 227.7; CONSTANTS[61] = 227.7; CONSTANTS[62] = 0.534; CONSTANTS[63] = 0.446; CONSTANTS[64] = 0.00751; CONSTANTS[65] = 0.751; CONSTANTS[66] = 0.542; CONSTANTS[67] = 0.445; CONSTANTS[68] = 2.5; CONSTANTS[69] = 0.0012; CONSTANTS[70] = 0.46; CONSTANTS[71] = 0.0116; CONSTANTS[72] = 4; CONSTANTS[73] = 70; CONSTANTS[74] = 0.02; CONSTANTS[75] = (( CONSTANTS[1]*CONSTANTS[2])/CONSTANTS[3])*log(CONSTANTS[5]/CONSTANTS[4]); CONSTANTS[76] = (( CONSTANTS[1]*CONSTANTS[2])/CONSTANTS[3])*log(CONSTANTS[7]/CONSTANTS[6]); CONSTANTS[77] = (( CONSTANTS[1]*CONSTANTS[2])/CONSTANTS[3])*log((CONSTANTS[7]+ 0.120000*CONSTANTS[5])/(CONSTANTS[6]+ 0.120000*CONSTANTS[4])); CONSTANTS[78] = ( CONSTANTS[1]*CONSTANTS[2])/CONSTANTS[3]; CONSTANTS[79] = CONSTANTS[4]/(CONSTANTS[31]+CONSTANTS[4]); CONSTANTS[80] = CONSTANTS[5]/(CONSTANTS[36]+CONSTANTS[5]); CONSTANTS[81] = 0.00100000* 3.14159265358979*pow(CONSTANTS[72], 2.00000)*CONSTANTS[73]; CONSTANTS[82] = 0.00100000*2.00000* 3.14159265358979*CONSTANTS[74]*(CONSTANTS[72] - CONSTANTS[74]/2.00000)*CONSTANTS[73]; CONSTANTS[83] = CONSTANTS[69]*CONSTANTS[81]; CONSTANTS[84] = CONSTANTS[70]*CONSTANTS[81] - CONSTANTS[82]; CONSTANTS[85] = CONSTANTS[71]*CONSTANTS[81]; RATES[0] = 0.1001; RATES[2] = 0.1001; RATES[3] = 0.1001; RATES[4] = 0.1001; RATES[5] = 0.1001; RATES[6] = 0.1001; RATES[7] = 0.1001; RATES[8] = 0.1001; RATES[9] = 0.1001; RATES[10] = 0.1001; RATES[11] = 0.1001; RATES[12] = 0.1001; RATES[13] = 0.1001; RATES[14] = 0.1001; RATES[15] = 0.1001; RATES[16] = 0.1001; RATES[17] = 0.1001; RATES[18] = 0.1001; RATES[19] = 0.1001; RATES[26] = 0.1001; RATES[27] = 0.1001; RATES[23] = 0.1001; RATES[24] = 0.1001; RATES[25] = 0.1001; RATES[28] = 0.1001; RATES[22] = 0.1001; RATES[1] = 0.1001; RATES[21] = 0.1001; RATES[20] = 0.1001; } void computeResiduals(double VOI, double* CONSTANTS, double* RATES, double* OLDRATES, double* STATES, double* OLDSTATES, double* ALGEBRAIC, double* CONDVARS) { resid[0] = RATES[0] - - (ALGEBRAIC[0]+ALGEBRAIC[8]+ALGEBRAIC[30]+ALGEBRAIC[33]+ALGEBRAIC[13]+ALGEBRAIC[19]+ALGEBRAIC[22]+ALGEBRAIC[23]+ALGEBRAIC[40]+ALGEBRAIC[75]+ALGEBRAIC[41]+ALGEBRAIC[39])/CONSTANTS[0]; resid[1] = RATES[2] - (ALGEBRAIC[1] - STATES[2])/ALGEBRAIC[70]; resid[2] = RATES[3] - (ALGEBRAIC[4] - STATES[3])/ALGEBRAIC[5]; resid[3] = RATES[4] - (ALGEBRAIC[6] - STATES[4])/ALGEBRAIC[7]; resid[4] = RATES[5] - (ALGEBRAIC[9] - STATES[5])/ALGEBRAIC[10]; resid[5] = RATES[6] - (ALGEBRAIC[11] - STATES[6])/ALGEBRAIC[12]; resid[6] = RATES[7] - (ALGEBRAIC[14] - STATES[7])/ALGEBRAIC[15]; resid[7] = RATES[8] - (ALGEBRAIC[14] - STATES[8])/ALGEBRAIC[16]; resid[8] = RATES[9] - (ALGEBRAIC[17] - STATES[9])/ALGEBRAIC[18]; resid[9] = RATES[10] - (ALGEBRAIC[61] - STATES[10])/ALGEBRAIC[62]; resid[10] = RATES[11] - (ALGEBRAIC[24] - STATES[11])/ALGEBRAIC[25]; resid[11] = RATES[12] - (ALGEBRAIC[26] - STATES[12])/ALGEBRAIC[27]; resid[12] = RATES[13] - (ALGEBRAIC[31] - STATES[13])/ALGEBRAIC[32]; resid[13] = RATES[14] - (ALGEBRAIC[34] - STATES[14])/ALGEBRAIC[63]; resid[14] = RATES[15] - (ALGEBRAIC[64] - STATES[15])/ALGEBRAIC[65]; resid[15] = RATES[16] - ( CONSTANTS[48]*STATES[19] - ALGEBRAIC[49]*STATES[1]*STATES[16]) - ( ALGEBRAIC[48]*pow(STATES[1], 2.00000)*STATES[16] - CONSTANTS[49]*STATES[17]); resid[16] = RATES[17] - ( ALGEBRAIC[48]*pow(STATES[1], 2.00000)*STATES[16] - CONSTANTS[49]*STATES[17]) - ( ALGEBRAIC[49]*STATES[1]*STATES[17] - CONSTANTS[48]*STATES[18]); resid[17] = RATES[18] - ( ALGEBRAIC[49]*STATES[1]*STATES[17] - CONSTANTS[48]*STATES[18]) - ( CONSTANTS[49]*STATES[18] - ALGEBRAIC[48]*pow(STATES[1], 2.00000)*STATES[19]); resid[18] = RATES[19] - ( CONSTANTS[49]*STATES[18] - ALGEBRAIC[48]*pow(STATES[1], 2.00000)*STATES[19]) - ( CONSTANTS[48]*STATES[19] - ALGEBRAIC[49]*STATES[1]*STATES[16]); resid[19] = RATES[26] - ALGEBRAIC[53]; resid[20] = RATES[27] - ALGEBRAIC[54]; resid[21] = RATES[23] - ALGEBRAIC[55]; resid[22] = RATES[24] - ALGEBRAIC[56]; resid[23] = RATES[25] - ALGEBRAIC[57]; resid[24] = RATES[28] - ALGEBRAIC[58]; resid[25] = RATES[22] - ( ALGEBRAIC[50]*CONSTANTS[82] - ALGEBRAIC[51]*CONSTANTS[85])/CONSTANTS[84] - ( CONSTANTS[56]*ALGEBRAIC[56]+ CONSTANTS[54]*ALGEBRAIC[53]+ CONSTANTS[55]*ALGEBRAIC[54]); resid[26] = RATES[1] - ( ALGEBRAIC[46]*CONSTANTS[83])/CONSTANTS[82] - (((ALGEBRAIC[0]+ALGEBRAIC[8]+ALGEBRAIC[41]) - 2.00000*ALGEBRAIC[75])/( 2.00000*CONSTANTS[3]*CONSTANTS[82])+ALGEBRAIC[50]+ CONSTANTS[56]*ALGEBRAIC[57]); resid[27] = RATES[21] - ALGEBRAIC[51] - ( ALGEBRAIC[52]*CONSTANTS[83])/CONSTANTS[85]; resid[28] = RATES[20] - ALGEBRAIC[52] - (ALGEBRAIC[46]+ CONSTANTS[57]*ALGEBRAIC[58]); } 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] = CONSTANTS[0]*CONSTANTS[9]*(STATES[0] - CONSTANTS[8])*STATES[2]*STATES[3]*STATES[4]; ALGEBRAIC[1] = 1.00000/(1.00000+exp(- (STATES[0]+13.5000)/6.00000)); ALGEBRAIC[4] = 1.00000/(1.00000+exp((STATES[0]+35.0000)/7.30000)); ALGEBRAIC[5] = 44.3000+ 257.100*exp(- pow((STATES[0]+32.5000)/13.9000, 2.00000)); ALGEBRAIC[6] = CONSTANTS[11]/(CONSTANTS[11]+STATES[1]); ALGEBRAIC[7] = ALGEBRAIC[6]/CONSTANTS[10]; ALGEBRAIC[8] = CONSTANTS[0]*CONSTANTS[12]*(STATES[0] - CONSTANTS[13])*STATES[5]*STATES[6]; ALGEBRAIC[9] = 1.00000/(1.00000+exp(- (STATES[0]+26.3000)/6.00000)); ALGEBRAIC[10] = 1.00000/( 1.06800*exp((STATES[0]+26.3000)/30.0000)+ 1.06800*exp(- (STATES[0]+26.3000)/30.0000)); ALGEBRAIC[11] = 1.00000/(1.00000+exp((STATES[0]+61.7000)/5.60000)); ALGEBRAIC[12] = 1.00000/( 0.0153000*exp(- (STATES[0]+61.7000)/83.3000)+ 0.0150000*exp((STATES[0]+61.7000)/15.3800)); ALGEBRAIC[13] = CONSTANTS[0]*CONSTANTS[14]*(STATES[0] - CONSTANTS[76])*( 0.600000*STATES[8]+ 0.400000*STATES[7])*STATES[9]; ALGEBRAIC[14] = 1.00000/(1.00000+exp(- (STATES[0]+23.2000)/10.6000)); ALGEBRAIC[15] = 0.846554/( 0.00420000*exp(STATES[0]/17.0000)+ 0.000150000*exp(- STATES[0]/21.6000)); ALGEBRAIC[16] = 0.846554/( 0.0372000*exp(STATES[0]/15.9000)+ 0.000960000*exp(- STATES[0]/22.5000)); ALGEBRAIC[17] = 1.00000/(1.00000+exp((STATES[0]+28.6000)/17.1000)); ALGEBRAIC[18] = 1.00000/( 0.100000*exp(- STATES[0]/54.6450)+ 0.656000*exp(STATES[0]/106.157)); ALGEBRAIC[19] = CONSTANTS[0]*CONSTANTS[15]*(STATES[0] - CONSTANTS[77])*pow(STATES[10], 2.00000); ALGEBRAIC[22] = CONSTANTS[0]*CONSTANTS[16]*(STATES[0] - CONSTANTS[76])*STATES[11]*STATES[12]; ALGEBRAIC[23] = CONSTANTS[0]*CONSTANTS[17]*(STATES[0] - CONSTANTS[76])*STATES[12]; ALGEBRAIC[24] = 1.00000/(1.00000+exp((STATES[0]+49.0000)/13.0000)); ALGEBRAIC[25] = 6.06000+39.1020/( 0.570000*exp( - 0.0800000*(STATES[0]+44.0000))+ 0.0650000*exp( 0.100000*(STATES[0]+45.9300))); ALGEBRAIC[26] = 1.00000/(1.00000+exp(- (STATES[0] - 19.3000)/15.0000)); ALGEBRAIC[27] = 2.75352+14.4052/( 1.03700*exp( 0.0900000*(STATES[0]+30.6100))+ 0.369000*exp( - 0.120000*(STATES[0]+23.8400))); ALGEBRAIC[28] = CONSTANTS[0]*0.383300*CONSTANTS[18]*(STATES[0] - CONSTANTS[75])*pow(STATES[13], 2.00000); ALGEBRAIC[29] = CONSTANTS[0]*0.616700*CONSTANTS[18]*(STATES[0] - CONSTANTS[76])*pow(STATES[13], 2.00000); ALGEBRAIC[30] = ALGEBRAIC[28]+ALGEBRAIC[29]; ALGEBRAIC[31] = 1.00000/(1.00000+exp((STATES[0] - CONSTANTS[19])/13.5000)); ALGEBRAIC[32] = 0.716653/(exp(- (STATES[0]+386.900)/45.3020)+exp((STATES[0] - 73.0800)/19.2310)); ALGEBRAIC[33] = CONSTANTS[0]*CONSTANTS[20]*(STATES[0] - CONSTANTS[21])*STATES[14]*STATES[15]; ALGEBRAIC[34] = 1.00000/(1.00000+exp(- (STATES[0]+57.0000)/5.00000)); ALGEBRAIC[39] = CONSTANTS[0]*CONSTANTS[22]*(STATES[0] - CONSTANTS[75]); ALGEBRAIC[40] = ( CONSTANTS[0]*CONSTANTS[25])/( (1.00000+pow(CONSTANTS[23]/CONSTANTS[7], 1.20000))*(1.00000+pow(CONSTANTS[24]/CONSTANTS[4], 1.30000))*(1.00000+exp(- ((STATES[0] - CONSTANTS[75])+120.000)/30.0000))); ALGEBRAIC[41] = CONSTANTS[0]*CONSTANTS[26]*(STATES[0] - CONSTANTS[8]); ALGEBRAIC[46] = CONSTANTS[41]*STATES[17]*(STATES[20] - STATES[1]); ALGEBRAIC[47] = CONSTANTS[42] - (CONSTANTS[42] - CONSTANTS[43])/(1.00000+pow(CONSTANTS[44]/STATES[20], CONSTANTS[45])); ALGEBRAIC[48] = CONSTANTS[46]/ALGEBRAIC[47]; ALGEBRAIC[49] = CONSTANTS[47]*ALGEBRAIC[47]; ALGEBRAIC[50] = (STATES[1] - STATES[22])/CONSTANTS[50]; ALGEBRAIC[51] = CONSTANTS[52]/(1.00000+CONSTANTS[53]/STATES[22]); ALGEBRAIC[52] = (STATES[21] - STATES[20])/CONSTANTS[51]; ALGEBRAIC[53] = CONSTANTS[58]*STATES[22]*(1.00000 - STATES[26]) - CONSTANTS[63]*STATES[26]; ALGEBRAIC[54] = CONSTANTS[60]*STATES[22]*(1.00000 - (STATES[27]+STATES[23])) - CONSTANTS[64]*STATES[27]; ALGEBRAIC[55] = CONSTANTS[59]*CONSTANTS[68]*(1.00000 - (STATES[27]+STATES[23])) - CONSTANTS[65]*STATES[23]; ALGEBRAIC[56] = CONSTANTS[61]*STATES[22]*(1.00000 - STATES[24]) - CONSTANTS[66]*STATES[24]; ALGEBRAIC[57] = CONSTANTS[61]*STATES[1]*(1.00000 - STATES[25]) - CONSTANTS[66]*STATES[25]; ALGEBRAIC[58] = CONSTANTS[62]*STATES[20]*(1.00000 - STATES[28]) - CONSTANTS[67]*STATES[28]; ALGEBRAIC[20] = 0.0140000/(1.00000+exp(- (STATES[0] - 40.0000)/9.00000)); ALGEBRAIC[21] = 0.00100000*exp(- STATES[0]/45.0000); ALGEBRAIC[61] = ALGEBRAIC[20]/(ALGEBRAIC[20]+ALGEBRAIC[21]); ALGEBRAIC[62] = 1.00000/(ALGEBRAIC[20]+ALGEBRAIC[21]); ALGEBRAIC[35] = 1.00000/( 0.150000*exp(- STATES[0]/11.0000)+ 0.200000*exp(- STATES[0]/700.000)); ALGEBRAIC[36] = 1.00000/( 16.0000*exp(STATES[0]/8.00000)+ 15.0000*exp(STATES[0]/50.0000)); ALGEBRAIC[63] = 1.00000/(ALGEBRAIC[35]+ALGEBRAIC[36]); ALGEBRAIC[37] = 1.00000/( 3100.00*exp(STATES[0]/13.0000)+ 700.000*exp(STATES[0]/70.0000)); ALGEBRAIC[38] = 1.00000/( 95.0000*exp(- STATES[0]/10.0000)+ 50.0000*exp(- STATES[0]/700.000))+0.000229000/(1.00000+exp(- STATES[0]/5.00000)); ALGEBRAIC[64] = ALGEBRAIC[37]/(ALGEBRAIC[37]+ALGEBRAIC[38]); ALGEBRAIC[65] = 6.65000/(ALGEBRAIC[37]+ALGEBRAIC[38]); ALGEBRAIC[2] = (STATES[0]==- 35.0000 ? - 35.0000 : STATES[0]==0.00000 ? 1.00000e-05 : STATES[0]); ALGEBRAIC[59] = ( - 0.0283900*(ALGEBRAIC[2]+35.0000))/(exp(- (ALGEBRAIC[2]+35.0000)/2.50000) - 1.00000) - ( 0.0849000*ALGEBRAIC[2])/(exp(- ALGEBRAIC[2]/4.80000) - 1.00000); ALGEBRAIC[3] = (STATES[0]==5.00000 ? 5.00001 : STATES[0]); ALGEBRAIC[60] = ( 0.0114300*(ALGEBRAIC[3] - 5.00000))/(exp((ALGEBRAIC[3] - 5.00000)/2.50000) - 1.00000); ALGEBRAIC[70] = 1.00000/(ALGEBRAIC[59]+ALGEBRAIC[60]); ALGEBRAIC[42] = exp(( - CONSTANTS[29]*STATES[0])/( 2.00000*CONSTANTS[78])); ALGEBRAIC[45] = 1.00000+ (CONSTANTS[40]/CONSTANTS[39])*(1.00000+exp(( CONSTANTS[30]*STATES[0])/CONSTANTS[78]))+ (CONSTANTS[5]/CONSTANTS[37])*(1.00000+ (CONSTANTS[5]/CONSTANTS[38])*(1.00000+CONSTANTS[5]/CONSTANTS[36])); ALGEBRAIC[69] = ( (( (CONSTANTS[5]/CONSTANTS[37])*CONSTANTS[5])/CONSTANTS[38])*(1.00000+CONSTANTS[5]/CONSTANTS[36])*exp(( - CONSTANTS[29]*STATES[0])/( 2.00000*CONSTANTS[78])))/ALGEBRAIC[45]; ALGEBRAIC[68] = ( (CONSTANTS[40]/CONSTANTS[39])*exp(( CONSTANTS[30]*STATES[0])/CONSTANTS[78]))/ALGEBRAIC[45]; ALGEBRAIC[44] = exp(( CONSTANTS[29]*STATES[0])/( 2.00000*CONSTANTS[78])); ALGEBRAIC[71] = ALGEBRAIC[42]*CONSTANTS[80]*(ALGEBRAIC[69]+ALGEBRAIC[68])+ ALGEBRAIC[68]*ALGEBRAIC[44]*(CONSTANTS[79]+ALGEBRAIC[42]); ALGEBRAIC[43] = 1.00000+ (STATES[1]/CONSTANTS[32])*(1.00000+exp(( - CONSTANTS[28]*STATES[0])/CONSTANTS[78])+CONSTANTS[4]/CONSTANTS[35])+ (CONSTANTS[4]/CONSTANTS[33])*(1.00000+ (CONSTANTS[4]/CONSTANTS[34])*(1.00000+CONSTANTS[4]/CONSTANTS[31])); ALGEBRAIC[66] = ( (STATES[1]/CONSTANTS[32])*exp(( - CONSTANTS[28]*STATES[0])/CONSTANTS[78]))/ALGEBRAIC[43]; ALGEBRAIC[67] = ( (( (CONSTANTS[4]/CONSTANTS[33])*CONSTANTS[4])/CONSTANTS[34])*(1.00000+CONSTANTS[4]/CONSTANTS[31])*exp(( CONSTANTS[29]*STATES[0])/( 2.00000*CONSTANTS[78])))/ALGEBRAIC[43]; ALGEBRAIC[72] = ALGEBRAIC[44]*CONSTANTS[79]*(ALGEBRAIC[67]+ALGEBRAIC[66])+ ALGEBRAIC[42]*ALGEBRAIC[66]*(CONSTANTS[80]+ALGEBRAIC[44]); ALGEBRAIC[73] = ALGEBRAIC[67]*CONSTANTS[79]*(ALGEBRAIC[69]+ALGEBRAIC[68])+ ALGEBRAIC[66]*ALGEBRAIC[69]*(CONSTANTS[79]+ALGEBRAIC[42]); ALGEBRAIC[74] = ALGEBRAIC[69]*CONSTANTS[80]*(ALGEBRAIC[67]+ALGEBRAIC[66])+ ALGEBRAIC[67]*ALGEBRAIC[68]*(CONSTANTS[80]+ALGEBRAIC[44]); ALGEBRAIC[75] = ( CONSTANTS[0]*CONSTANTS[27]*( ALGEBRAIC[72]*ALGEBRAIC[68] - ALGEBRAIC[71]*ALGEBRAIC[66]))/(ALGEBRAIC[71]+ALGEBRAIC[72]+ALGEBRAIC[73]+ALGEBRAIC[74]); } 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; SI[22] = 1.0; SI[23] = 1.0; SI[24] = 1.0; SI[25] = 1.0; SI[26] = 1.0; SI[27] = 1.0; SI[28] = 1.0; } void computeRoots(double VOI, double* CONSTANTS, double* RATES, double* OLDRATES, double* STATES, double* OLDSTATES, double* ALGEBRAIC, double* CONDVARS) { }