Generated Code

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

The raw code is available.

# Size of variable arrays:
sizeAlgebraic = 369
sizeStates = 145
sizeConstants = 410
from math import *
from numpy import *

def createLegends():
    legend_states = [""] * sizeStates
    legend_rates = [""] * sizeStates
    legend_algebraic = [""] * sizeAlgebraic
    legend_voi = ""
    legend_constants = [""] * sizeConstants
    legend_constants[324] = "AC47_cyt in component ac (uM)"
    legend_constants[329] = "AC47_eca in component ac (uM)"
    legend_constants[320] = "AC56_cav in component ac (uM)"
    legend_constants[328] = "AC56_cyt in component ac (uM)"
    legend_constants[296] = "AC_tot in component ac (uM)"
    legend_constants[0] = "ATP in component ac (uM)"
    legend_constants[1] = "KmATP in component ac (uM)"
    legend_constants[2] = "KmGiAC56 in component ac (uM)"
    legend_constants[3] = "KmGsAC47 in component ac (dimensionless)"
    legend_constants[4] = "KmGsAC56 in component ac (dimensionless)"
    legend_constants[5] = "KmGsGiAC56 in component ac (dimensionless)"
    legend_algebraic[0] = "ac_kAC47_cyt_gsa in component ac (dimensionless)"
    legend_algebraic[1] = "ac_kAC47_eca_gsa in component ac (dimensionless)"
    legend_algebraic[2] = "ac_kAC56_cav_gsa in component ac (dimensionless)"
    legend_algebraic[30] = "ac_kAC56_cyt_gsa in component ac (dimensionless)"
    legend_constants[6] = "afAC47 in component ac (hertz)"
    legend_constants[7] = "afAC56 in component ac (hertz)"
    legend_constants[8] = "basalAC47 in component ac (dimensionless)"
    legend_constants[9] = "basalAC56 in component ac (dimensionless)"
    legend_constants[294] = "R_b1_tot in component beta (uM)"
    legend_states[0] = "Gi_bg in component beta_cav (uM)"
    legend_states[1] = "Gs_aGTP in component beta_cav (uM)"
    legend_states[2] = "Gs_aGTP in component beta_cyt (uM)"
    legend_states[3] = "Gs_aGTP in component beta_eca (uM)"
    legend_algebraic[68] = "dcAMP_AC47_cyt in component ac (mol_per_m3_per_s_times_1e_minus_3)"
    legend_algebraic[67] = "dcAMP_AC47_eca in component ac (mol_per_m3_per_s_times_1e_minus_3)"
    legend_algebraic[82] = "dcAMP_AC56_cav in component ac (mol_per_m3_per_s_times_1e_minus_3)"
    legend_algebraic[106] = "dcAMP_AC56_cyt in component ac (mol_per_m3_per_s_times_1e_minus_3)"
    legend_constants[227] = "fATP in component ac (dimensionless)"
    legend_constants[10] = "f_AC47_eca in component ac (dimensionless)"
    legend_constants[260] = "f_AC56_AC47 in component ac (dimensionless)"
    legend_constants[11] = "f_AC56_cav in component ac (dimensionless)"
    legend_algebraic[32] = "gsi in component ac (dimensionless)"
    legend_constants[12] = "hGsAC47 in component ac (dimensionless)"
    legend_constants[13] = "hGsAC56 in component ac (dimensionless)"
    legend_constants[14] = "hGsGiAC56 in component ac (dimensionless)"
    legend_algebraic[55] = "kAC47_cyt in component ac (hertz)"
    legend_algebraic[31] = "kAC47_eca in component ac (hertz)"
    legend_algebraic[56] = "kAC56_cav in component ac (hertz)"
    legend_algebraic[84] = "kAC56_cyt in component ac (hertz)"
    legend_constants[15] = "vGsGiAC56 in component ac (dimensionless)"
    legend_constants[319] = "vr_cav in component cell (dimensionless)"
    legend_constants[321] = "vr_cyt in component cell (dimensionless)"
    legend_constants[326] = "vr_eca in component cell (dimensionless)"
    legend_constants[16] = "ICaL_akap in component akap_sig (uM)"
    legend_constants[391] = "ICaL_akapf in component akap_sig (uM)"
    legend_constants[392] = "ICaL_arn in component akap_sig (uM)"
    legend_constants[393] = "ICaL_arp in component akap_sig (uM)"
    legend_constants[17] = "ICaL_tot in component akap_sig (uM)"
    legend_constants[281] = "ICaLf in component akap_sig (uM)"
    legend_states[4] = "ICaLp in component akap_sig (uM)"
    legend_constants[18] = "Ka_ical in component akap_sig (uM)"
    legend_constants[19] = "Ka_ryr in component akap_sig (uM)"
    legend_constants[20] = "Ki in component akap_sig (uM)"
    legend_constants[21] = "Kp_ical in component akap_sig (uM)"
    legend_constants[22] = "Kp_ryr in component akap_sig (uM)"
    legend_constants[23] = "Kr in component akap_sig (uM)"
    legend_constants[24] = "Li in component akap_sig (uM)"
    legend_constants[25] = "Lr in component akap_sig (uM)"
    legend_constants[26] = "Mi in component akap_sig (uM)"
    legend_constants[27] = "Mr in component akap_sig (uM)"
    legend_constants[380] = "PKA_cav in component pka (uM)"
    legend_constants[390] = "PKAf in component akap_sig (uM)"
    legend_constants[28] = "PP1_cav in component pp1 (uM)"
    legend_constants[291] = "PP1f_cav in component akap_sig (uM)"
    legend_constants[29] = "RyR_akap in component akap_sig (uM)"
    legend_constants[394] = "RyR_akapf in component akap_sig (uM)"
    legend_constants[395] = "RyR_arn in component akap_sig (uM)"
    legend_constants[396] = "RyR_arp in component akap_sig (uM)"
    legend_constants[30] = "RyR_tot in component akap_sig (uM)"
    legend_constants[293] = "RyRf in component akap_sig (uM)"
    legend_states[5] = "RyRp in component akap_sig (uM)"
    legend_constants[273] = "akap_sig_ICaLf_sum in component akap_sig (dimensionless)"
    legend_algebraic[3] = "akap_sig_ICaLp_dif in component akap_sig (uM)"
    legend_constants[387] = "akap_sig_PKAf_arg in component akap_sig (dimensionless)"
    legend_constants[381] = "akap_sig_PKAf_b in component akap_sig (uM)"
    legend_constants[382] = "akap_sig_PKAf_c in component akap_sig (mM2_times_1e_minus_6)"
    legend_constants[383] = "akap_sig_PKAf_d in component akap_sig (mM3_times_1e_minus_9)"
    legend_constants[388] = "akap_sig_PKAf_mag in component akap_sig (uM)"
    legend_constants[384] = "akap_sig_PKAf_rr in component akap_sig (mol6_per_m18_times_1e_minus_18)"
    legend_constants[389] = "akap_sig_PKAf_x in component akap_sig (dimensionless)"
    legend_constants[385] = "akap_sig_PKAf_yi in component akap_sig (mM3_times_1e_minus_9)"
    legend_constants[386] = "akap_sig_PKAf_yr in component akap_sig (mM3_times_1e_minus_9)"
    legend_constants[288] = "akap_sig_PP1f_cav_arg in component akap_sig (dimensionless)"
    legend_constants[282] = "akap_sig_PP1f_cav_b in component akap_sig (uM)"
    legend_constants[283] = "akap_sig_PP1f_cav_c in component akap_sig (mM2_times_1e_minus_6)"
    legend_constants[284] = "akap_sig_PP1f_cav_d in component akap_sig (mM3_times_1e_minus_9)"
    legend_constants[289] = "akap_sig_PP1f_cav_mag in component akap_sig (uM)"
    legend_constants[285] = "akap_sig_PP1f_cav_rr in component akap_sig (mol6_per_m18_times_1e_minus_18)"
    legend_constants[290] = "akap_sig_PP1f_cav_x in component akap_sig (dimensionless)"
    legend_constants[286] = "akap_sig_PP1f_cav_yi in component akap_sig (mM3_times_1e_minus_9)"
    legend_constants[287] = "akap_sig_PP1f_cav_yr in component akap_sig (mM3_times_1e_minus_9)"
    legend_constants[292] = "akap_sig_RyRf_sum in component akap_sig (dimensionless)"
    legend_algebraic[4] = "akap_sig_RyRp_dif in component akap_sig (uM)"
    legend_algebraic[10] = "fp_ICaL in component akap_sig (dimensionless)"
    legend_algebraic[38] = "fp_RyR in component akap_sig (dimensionless)"
    legend_constants[31] = "ka_ical in component akap_sig (hertz)"
    legend_constants[32] = "ka_ryr in component akap_sig (hertz)"
    legend_constants[33] = "kp_ical in component akap_sig (hertz)"
    legend_constants[34] = "kp_ryr in component akap_sig (hertz)"
    legend_states[6] = "C in component pka_cav (uM)"
    legend_voi = "time in component engine (ms)"
    legend_constants[35] = "Gi_tot in component beta (uM)"
    legend_constants[295] = "Gs_tot in component beta (uM)"
    legend_constants[297] = "R_b2_tot in component beta (uM)"
    legend_constants[36] = "f_Gi_cav in component beta (dimensionless)"
    legend_constants[215] = "f_Gi_eca in component beta (dimensionless)"
    legend_constants[37] = "f_Gs_cav in component beta (dimensionless)"
    legend_constants[216] = "f_Gs_cyt in component beta (dimensionless)"
    legend_constants[38] = "f_Gs_eca in component beta (dimensionless)"
    legend_constants[39] = "f_Rb1_cav in component beta (dimensionless)"
    legend_constants[298] = "f_Rb1_cyt in component beta (dimensionless)"
    legend_constants[40] = "f_Rb1_eca in component beta (dimensionless)"
    legend_constants[41] = "f_Rb2_cav in component beta (dimensionless)"
    legend_constants[299] = "f_Rb2_eca in component beta (dimensionless)"
    legend_constants[42] = "k_act1_Gi in component beta (hertz)"
    legend_constants[43] = "k_act1_Gs in component beta (hertz)"
    legend_constants[44] = "k_act2_Gi in component beta (hertz)"
    legend_constants[45] = "k_act2_Gs in component beta (hertz)"
    legend_constants[46] = "k_b1_c in component beta (uM)"
    legend_constants[47] = "k_b1_h in component beta (uM)"
    legend_constants[48] = "k_b1_l in component beta (uM)"
    legend_constants[49] = "k_b2_a in component beta (uM)"
    legend_constants[50] = "k_b2_c in component beta (uM)"
    legend_constants[51] = "k_b2_f in component beta (uM)"
    legend_constants[52] = "k_b2_h in component beta (uM)"
    legend_constants[53] = "k_b2_l in component beta (uM)"
    legend_constants[54] = "k_b2_n in component beta (uM)"
    legend_constants[217] = "k_grk_dp in component beta (hertz)"
    legend_constants[218] = "k_grk_p in component beta (hertz)"
    legend_constants[219] = "k_hydr_Gi in component beta (hertz)"
    legend_constants[55] = "k_hydr_Gs in component beta (hertz)"
    legend_constants[257] = "k_pka_dp in component beta (hertz)"
    legend_constants[220] = "k_pka_p in component beta (per_mM_per_ms)"
    legend_constants[221] = "k_reas_Gi in component beta (per_mM_per_ms)"
    legend_constants[56] = "k_reas_Gs in component beta (per_mM_per_ms)"
    legend_constants[57] = "rate_bds in component beta (per_mM_per_ms)"
    legend_constants[58] = "GRK in component beta_cav (dimensionless)"
    legend_states[7] = "Gi_aGDP in component beta_cav (uM)"
    legend_states[8] = "Gi_aGTP in component beta_cav (uM)"
    legend_algebraic[5] = "Gi_abg in component beta_cav (uM)"
    legend_algebraic[86] = "Gi_f in component beta_cav (uM)"
    legend_states[9] = "Gs_aGDP in component beta_cav (uM)"
    legend_algebraic[6] = "Gs_abg in component beta_cav (uM)"
    legend_states[10] = "Gs_bg in component beta_cav (uM)"
    legend_algebraic[156] = "Gs_f in component beta_cav (uM)"
    legend_algebraic[188] = "LRGs_tot in component beta_cav (uM)"
    legend_algebraic[164] = "LRb1 in component beta_cav (uM)"
    legend_algebraic[168] = "LRb1Gs in component beta_cav (uM)"
    legend_algebraic[180] = "LRb2 in component beta_cav (uM)"
    legend_algebraic[108] = "LRb2Gi in component beta_cav (uM)"
    legend_algebraic[184] = "LRb2Gs in component beta_cav (uM)"
    legend_algebraic[196] = "RGs_tot in component beta_cav (uM)"
    legend_constants[322] = "R_b1_tot in component beta_cav (uM)"
    legend_constants[323] = "R_b2_tot in component beta_cav (uM)"
    legend_algebraic[172] = "Rb1Gs in component beta_cav (uM)"
    legend_algebraic[160] = "Rb1_f in component beta_cav (uM)"
    legend_states[11] = "Rb1_grk_tot in component beta_cav (uM)"
    legend_algebraic[33] = "Rb1_np_tot in component beta_cav (uM)"
    legend_states[12] = "Rb1_pka_tot in component beta_cav (uM)"
    legend_algebraic[98] = "Rb2Gi in component beta_cav (uM)"
    legend_algebraic[192] = "Rb2Gs in component beta_cav (uM)"
    legend_algebraic[176] = "Rb2_f in component beta_cav (uM)"
    legend_states[13] = "Rb2_grk_tot in component beta_cav (uM)"
    legend_algebraic[57] = "Rb2_np_tot in component beta_cav (uM)"
    legend_algebraic[70] = "Rb2_pka_f in component beta_cav (uM)"
    legend_states[14] = "Rb2_pka_tot in component beta_cav (uM)"
    legend_constants[223] = "beta_cav_Gs_f_a in component beta_cav (mol4_per_m12_times_1e_minus_12)"
    legend_algebraic[131] = "beta_cav_Gs_f_arg in component beta_cav (dimensionless)"
    legend_algebraic[69] = "beta_cav_Gs_f_b in component beta_cav (uM)"
    legend_algebraic[85] = "beta_cav_Gs_f_c in component beta_cav (mM2_times_1e_minus_6)"
    legend_constants[258] = "beta_cav_Gs_f_c11 in component beta_cav (mol5_per_m15_times_1e_minus_15)"
    legend_constants[271] = "beta_cav_Gs_f_c22 in component beta_cav (mol5_per_m15_times_1e_minus_15)"
    legend_constants[279] = "beta_cav_Gs_f_c33 in component beta_cav (mol6_per_m18_times_1e_minus_18)"
    legend_algebraic[97] = "beta_cav_Gs_f_d in component beta_cav (mM3_times_1e_minus_9)"
    legend_algebraic[147] = "beta_cav_Gs_f_i in component beta_cav (uM)"
    legend_algebraic[137] = "beta_cav_Gs_f_mag in component beta_cav (uM)"
    legend_algebraic[151] = "beta_cav_Gs_f_r in component beta_cav (uM)"
    legend_algebraic[109] = "beta_cav_Gs_f_rr in component beta_cav (mol6_per_m18_times_1e_minus_18)"
    legend_algebraic[142] = "beta_cav_Gs_f_x in component beta_cav (dimensionless)"
    legend_algebraic[117] = "beta_cav_Gs_f_yi in component beta_cav (mM3_times_1e_minus_9)"
    legend_algebraic[125] = "beta_cav_Gs_f_yr in component beta_cav (mM3_times_1e_minus_9)"
    legend_constants[222] = "beta_cav_Rb2_pka_f_a in component beta_cav (uM)"
    legend_algebraic[34] = "beta_cav_Rb2_pka_f_b in component beta_cav (mM2_times_1e_minus_6)"
    legend_algebraic[58] = "beta_cav_Rb2_pka_f_c in component beta_cav (mM3_times_1e_minus_9)"
    legend_constants[59] = "L in component iso (uM)"
    legend_constants[60] = "k_GsAct_b2 in component beta_cav (dimensionless)"
    legend_constants[61] = "GRK in component beta_cyt (dimensionless)"
    legend_states[15] = "Gs_aGDP in component beta_cyt (uM)"
    legend_algebraic[7] = "Gs_abg in component beta_cyt (uM)"
    legend_states[16] = "Gs_bg in component beta_cyt (uM)"
    legend_algebraic[99] = "Gs_f in component beta_cyt (uM)"
    legend_algebraic[110] = "LRb1Gs_np in component beta_cyt (uM)"
    legend_algebraic[118] = "LRb1_np in component beta_cyt (uM)"
    legend_constants[325] = "R_b1_tot in component beta_cyt (uM)"
    legend_algebraic[119] = "Rb1Gs_np in component beta_cyt (uM)"
    legend_states[17] = "Rb1_grk_tot in component beta_cyt (uM)"
    legend_algebraic[87] = "Rb1_np_f in component beta_cyt (uM)"
    legend_algebraic[35] = "Rb1_np_tot in component beta_cyt (uM)"
    legend_states[18] = "Rb1_pka_tot in component beta_cyt (uM)"
    legend_constants[224] = "beta_cyt_Rb1_np_f_a in component beta_cyt (uM)"
    legend_algebraic[59] = "beta_cyt_Rb1_np_f_b in component beta_cyt (mM2_times_1e_minus_6)"
    legend_algebraic[71] = "beta_cyt_Rb1_np_f_c in component beta_cyt (mM3_times_1e_minus_9)"
    legend_states[19] = "C in component pka_cyt (uM)"
    legend_constants[62] = "GRK in component beta_eca (dimensionless)"
    legend_states[20] = "Gi_aGDP in component beta_eca (uM)"
    legend_states[21] = "Gi_aGTP in component beta_eca (uM)"
    legend_algebraic[8] = "Gi_abg in component beta_eca (uM)"
    legend_states[22] = "Gi_bg in component beta_eca (uM)"
    legend_algebraic[89] = "Gi_f in component beta_eca (uM)"
    legend_states[23] = "Gs_aGDP in component beta_eca (uM)"
    legend_algebraic[9] = "Gs_abg in component beta_eca (uM)"
    legend_states[24] = "Gs_bg in component beta_eca (uM)"
    legend_algebraic[157] = "Gs_f in component beta_eca (uM)"
    legend_algebraic[189] = "LRGs_tot in component beta_eca (uM)"
    legend_algebraic[165] = "LRb1 in component beta_eca (uM)"
    legend_algebraic[169] = "LRb1Gs in component beta_eca (uM)"
    legend_algebraic[181] = "LRb2 in component beta_eca (uM)"
    legend_algebraic[111] = "LRb2Gi in component beta_eca (uM)"
    legend_algebraic[185] = "LRb2Gs in component beta_eca (uM)"
    legend_algebraic[197] = "RGs_tot in component beta_eca (uM)"
    legend_constants[330] = "R_b1_tot in component beta_eca (uM)"
    legend_constants[331] = "R_b2_tot in component beta_eca (uM)"
    legend_algebraic[173] = "Rb1Gs in component beta_eca (uM)"
    legend_algebraic[161] = "Rb1_f in component beta_eca (uM)"
    legend_states[25] = "Rb1_grk_tot in component beta_eca (uM)"
    legend_algebraic[36] = "Rb1_np_tot in component beta_eca (uM)"
    legend_states[26] = "Rb1_pka_tot in component beta_eca (uM)"
    legend_algebraic[101] = "Rb2Gi in component beta_eca (uM)"
    legend_algebraic[193] = "Rb2Gs in component beta_eca (uM)"
    legend_algebraic[177] = "Rb2_f in component beta_eca (uM)"
    legend_states[27] = "Rb2_grk_tot in component beta_eca (uM)"
    legend_algebraic[60] = "Rb2_np_tot in component beta_eca (uM)"
    legend_algebraic[73] = "Rb2_pka_f in component beta_eca (uM)"
    legend_states[28] = "Rb2_pka_tot in component beta_eca (uM)"
    legend_constants[226] = "beta_eca_Gs_f_a in component beta_eca (mol4_per_m12_times_1e_minus_12)"
    legend_algebraic[132] = "beta_eca_Gs_f_arg in component beta_eca (dimensionless)"
    legend_algebraic[72] = "beta_eca_Gs_f_b in component beta_eca (uM)"
    legend_algebraic[88] = "beta_eca_Gs_f_c in component beta_eca (mM2_times_1e_minus_6)"
    legend_constants[259] = "beta_eca_Gs_f_c11 in component beta_eca (mol5_per_m15_times_1e_minus_15)"
    legend_constants[272] = "beta_eca_Gs_f_c22 in component beta_eca (mol5_per_m15_times_1e_minus_15)"
    legend_constants[280] = "beta_eca_Gs_f_c33 in component beta_eca (mol6_per_m18_times_1e_minus_18)"
    legend_algebraic[100] = "beta_eca_Gs_f_d in component beta_eca (mM3_times_1e_minus_9)"
    legend_algebraic[148] = "beta_eca_Gs_f_i in component beta_eca (uM)"
    legend_algebraic[138] = "beta_eca_Gs_f_mag in component beta_eca (uM)"
    legend_algebraic[152] = "beta_eca_Gs_f_r in component beta_eca (uM)"
    legend_algebraic[112] = "beta_eca_Gs_f_rr in component beta_eca (mol6_per_m18_times_1e_minus_18)"
    legend_algebraic[143] = "beta_eca_Gs_f_x in component beta_eca (dimensionless)"
    legend_algebraic[120] = "beta_eca_Gs_f_yi in component beta_eca (mM3_times_1e_minus_9)"
    legend_algebraic[126] = "beta_eca_Gs_f_yr in component beta_eca (mM3_times_1e_minus_9)"
    legend_constants[225] = "beta_eca_Rb2_pka_f_a in component beta_eca (uM)"
    legend_algebraic[37] = "beta_eca_Rb2_pka_f_b in component beta_eca (mM2_times_1e_minus_6)"
    legend_algebraic[61] = "beta_eca_Rb2_pka_f_c in component beta_eca (mM3_times_1e_minus_9)"
    legend_constants[63] = "k_GsAct_b2 in component beta_eca (dimensionless)"
    legend_states[29] = "C in component pka_eca (uM)"
    legend_constants[302] = "AF in component cell (m2_mol_per_s_per_A_times_1e_minus_4)"
    legend_algebraic[186] = "Ca in component calcium (mM)"
    legend_algebraic[102] = "Ca_CaL in component calcium (mM)"
    legend_algebraic[127] = "Ca_jsr in component calcium (mM)"
    legend_states[30] = "Ca_nsr in component calcium (mM)"
    legend_algebraic[149] = "Ca_sr in component calcium (mM)"
    legend_algebraic[305] = "ICa_tot in component calcium (uA_per_cm2)"
    legend_algebraic[217] = "ICab in component icab (uA_per_cm2)"
    legend_algebraic[297] = "INaCa in component inaca (uA_per_cm2)"
    legend_algebraic[291] = "INaCaSR in component inaca (uA_per_cm2)"
    legend_algebraic[201] = "Idiff_Ca in component diff (mM_per_ms)"
    legend_algebraic[209] = "Idiff_sr in component diff (mM_per_ms)"
    legend_algebraic[304] = "IpCa in component ipca (uA_per_cm2)"
    legend_algebraic[319] = "Irel in component irel (mM_per_ms)"
    legend_algebraic[211] = "Itr in component diff (mM_per_ms)"
    legend_algebraic[328] = "Iup in component iup (mM_per_ms)"
    legend_constants[64] = "Ka_tni in component calcium (uM)"
    legend_constants[65] = "Kp_tni in component calcium (uM)"
    legend_constants[66] = "PP2A in component pp1 (uM)"
    legend_constants[228] = "bar_sum in component calcium (mM)"
    legend_constants[67] = "bsl_bar in component calcium (mM)"
    legend_constants[68] = "bsl_km in component calcium (mM)"
    legend_constants[69] = "bsr_bar in component calcium (mM)"
    legend_constants[70] = "bsr_km in component calcium (mM)"
    legend_algebraic[62] = "calcium_Ca_CaL_b in component calcium (mM)"
    legend_algebraic[74] = "calcium_Ca_CaL_c in component calcium (mM2)"
    legend_algebraic[90] = "calcium_Ca_CaL_d in component calcium (mM3)"
    legend_algebraic[178] = "calcium_Ca_b in component calcium (mM)"
    legend_algebraic[182] = "calcium_Ca_c in component calcium (mM2)"
    legend_algebraic[170] = "calcium_Ca_d in component calcium (mM3)"
    legend_algebraic[113] = "calcium_Ca_jsr_b in component calcium (mM)"
    legend_algebraic[121] = "calcium_Ca_jsr_c in component calcium (mM2)"
    legend_constants[312] = "calcium_Ca_nsr_r1 in component calcium (dimensionless)"
    legend_algebraic[133] = "calcium_Ca_sr_b in component calcium (mM)"
    legend_algebraic[139] = "calcium_Ca_sr_c in component calcium (mM2)"
    legend_algebraic[144] = "calcium_Ca_sr_d in component calcium (mM3)"
    legend_algebraic[153] = "calcium_fhat_val in component calcium (dimensionless)"
    legend_constants[305] = "calcium_uCa_CaL_r1 in component calcium (mol_per_m_per_s_per_A_times_1e5)"
    legend_constants[315] = "calcium_uCa_CaL_r2 in component calcium (dimensionless)"
    legend_constants[308] = "calcium_uCa_r1 in component calcium (mol_per_m_per_s_per_A_times_1e5)"
    legend_constants[313] = "calcium_uCa_r2 in component calcium (dimensionless)"
    legend_constants[316] = "calcium_uCa_sr_r1 in component calcium (mol_per_m_per_s_per_A_times_1e5)"
    legend_constants[317] = "calcium_uCa_sr_r2 in component calcium (dimensionless)"
    legend_constants[71] = "cbar in component calcium (mM)"
    legend_constants[72] = "csqn_bar in component calcium (mM)"
    legend_constants[73] = "csqn_km in component calcium (mM)"
    legend_states[31] = "f_tni in component calcium (dimensionless)"
    legend_algebraic[158] = "fhat in component calcium (dimensionless)"
    legend_algebraic[248] = "ICaL in component ical (uA_per_cm2)"
    legend_constants[74] = "ka_tni in component calcium (hertz)"
    legend_constants[75] = "kc in component calcium (mM)"
    legend_constants[230] = "km_pro in component calcium (mM2)"
    legend_constants[261] = "km_sum in component calcium (mM)"
    legend_constants[76] = "kp_tni in component calcium (hertz)"
    legend_algebraic[166] = "kpro in component calcium (mM2)"
    legend_algebraic[174] = "ksum in component calcium (mM)"
    legend_algebraic[162] = "kt in component calcium (mM)"
    legend_constants[77] = "ktn in component calcium (mM)"
    legend_constants[229] = "ktp in component calcium (mM)"
    legend_constants[318] = "r3 in component calcium (dimensionless)"
    legend_constants[262] = "ss_pro in component calcium (mM2)"
    legend_constants[274] = "ss_sum in component calcium (mM)"
    legend_constants[78] = "tbar in component calcium (mM)"
    legend_states[32] = "uCa in component calcium (mM)"
    legend_states[33] = "uCa_CaL in component calcium (mM)"
    legend_states[34] = "uCa_jsr in component calcium (mM)"
    legend_states[35] = "uCa_sr in component calcium (mM)"
    legend_constants[304] = "v_CaL in component cell (uL)"
    legend_constants[307] = "v_cyt in component cell (uL)"
    legend_constants[310] = "v_jsr in component cell (uL)"
    legend_constants[311] = "v_nsr in component cell (uL)"
    legend_constants[314] = "v_sr in component cell (uL)"
    legend_constants[79] = "CaMK0 in component camk (dimensionless)"
    legend_constants[80] = "K in component camk (dimensionless)"
    legend_constants[81] = "Km in component camk (mM)"
    legend_constants[82] = "PP1_eca in component pp1 (uM)"
    legend_algebraic[206] = "PP1_tot in component camk (uM)"
    legend_algebraic[203] = "PP1f_cyt in component pp1 (uM)"
    legend_algebraic[194] = "active in component camk (dimensionless)"
    legend_algebraic[190] = "bound in component camk (dimensionless)"
    legend_algebraic[199] = "c in component camk (dimensionless)"
    legend_algebraic[200] = "camk_f_ryr_d in component camk (dimensionless)"
    legend_constants[83] = "camk_trap_alpha in component camk (mS_per_uF)"
    legend_constants[84] = "camk_trap_beta in component camk (mS_per_uF)"
    legend_states[36] = "f_ical in component camk (dimensionless)"
    legend_states[37] = "f_ik1 in component camk (dimensionless)"
    legend_states[38] = "f_ina in component camk (dimensionless)"
    legend_states[39] = "f_ito in component camk (dimensionless)"
    legend_states[40] = "f_plb in component camk (dimensionless)"
    legend_states[41] = "f_ryr in component camk (dimensionless)"
    legend_constants[231] = "tau_cal in component camk (ms)"
    legend_constants[232] = "tau_ik1 in component camk (ms)"
    legend_constants[233] = "tau_ina in component camk (ms)"
    legend_constants[234] = "tau_ito in component camk (ms)"
    legend_constants[85] = "tau_plb in component camk (ms)"
    legend_constants[86] = "tau_ryr in component camk (ms)"
    legend_states[42] = "trap in component camk (dimensionless)"
    legend_states[43] = "cAMP_cav in component camp (uM)"
    legend_states[44] = "cAMP_cyt in component camp (uM)"
    legend_states[45] = "cAMP_eca in component camp (uM)"
    legend_algebraic[95] = "camp_cAMP_cav_j1 in component camp (mol_per_m3_per_s_times_1e_minus_3)"
    legend_algebraic[105] = "camp_cAMP_cav_j2 in component camp (mol_per_m3_per_s_times_1e_minus_3)"
    legend_algebraic[135] = "camp_cAMP_cav_pde in component camp (mol_per_m3_per_s_times_1e_minus_3)"
    legend_algebraic[115] = "camp_cAMP_cyt_j1 in component camp (mol_per_m3_per_s_times_1e_minus_3)"
    legend_algebraic[123] = "camp_cAMP_cyt_j2 in component camp (mol_per_m3_per_s_times_1e_minus_3)"
    legend_algebraic[146] = "camp_cAMP_cyt_pde in component camp (mol_per_m3_per_s_times_1e_minus_3)"
    legend_algebraic[83] = "camp_cAMP_eca_j1 in component camp (mol_per_m3_per_s_times_1e_minus_3)"
    legend_algebraic[96] = "camp_cAMP_eca_j2 in component camp (mol_per_m3_per_s_times_1e_minus_3)"
    legend_algebraic[124] = "camp_cAMP_eca_pde in component camp (mol_per_m3_per_s_times_1e_minus_3)"
    legend_algebraic[114] = "dcAMP_PDE2_cav in component pde (mol_per_m3_per_s_times_1e_minus_3)"
    legend_algebraic[129] = "dcAMP_PDE2_cyt in component pde (mol_per_m3_per_s_times_1e_minus_3)"
    legend_algebraic[107] = "dcAMP_PDE2_eca in component pde (mol_per_m3_per_s_times_1e_minus_3)"
    legend_algebraic[122] = "dcAMP_PDE3_cav in component pde (mol_per_m3_per_s_times_1e_minus_3)"
    legend_algebraic[136] = "dcAMP_PDE3_cyt in component pde (mol_per_m3_per_s_times_1e_minus_3)"
    legend_algebraic[128] = "dcAMP_PDE4_cav in component pde (mol_per_m3_per_s_times_1e_minus_3)"
    legend_algebraic[141] = "dcAMP_PDE4_cyt in component pde (mol_per_m3_per_s_times_1e_minus_3)"
    legend_algebraic[116] = "dcAMP_PDE4_eca in component pde (mol_per_m3_per_s_times_1e_minus_3)"
    legend_constants[235] = "j_cav_cyt in component camp (m3_per_s_times_1e_minus_9)"
    legend_constants[236] = "j_cav_eca in component camp (m3_per_s_times_1e_minus_9)"
    legend_constants[237] = "j_eca_cyt in component camp (m3_per_s_times_1e_minus_9)"
    legend_algebraic[145] = "dcAMP in component pka_cav (mol_per_m3_per_s_times_1e_minus_3)"
    legend_algebraic[154] = "dcAMP in component pka_cyt (mol_per_m3_per_s_times_1e_minus_3)"
    legend_algebraic[134] = "dcAMP in component pka_eca (mol_per_m3_per_s_times_1e_minus_3)"
    legend_constants[306] = "v_cav in component cell (uL)"
    legend_constants[309] = "v_eca in component cell (uL)"
    legend_constants[87] = "F in component phys (C_per_mol)"
    legend_constants[301] = "capArea in component cell (cm2)"
    legend_constants[300] = "geoArea in component cell (cm2)"
    legend_constants[88] = "length in component cell (cm)"
    legend_constants[89] = "pi in component cell (dimensionless)"
    legend_constants[90] = "radius in component cell (cm)"
    legend_constants[303] = "volume in component cell (uL)"
    legend_algebraic[333] = "CTKCl in component ctkcl (mM_per_ms)"
    legend_algebraic[354] = "CTNaCl in component ctnacl (mM_per_ms)"
    legend_states[46] = "Cl in component chloride (mM)"
    legend_states[47] = "Cl_sr in component chloride (mM)"
    legend_algebraic[323] = "IClCa in component iclca (uA_per_cm2)"
    legend_algebraic[330] = "ICl_tot in component chloride (uA_per_cm2)"
    legend_algebraic[329] = "IClb in component iclb (uA_per_cm2)"
    legend_algebraic[204] = "Idiff_Cl in component diff (mM_per_ms)"
    legend_constants[332] = "chloride_Cl_r1 in component chloride (mol_per_m_per_s_per_A_times_1e5)"
    legend_constants[337] = "chloride_Cl_r2 in component chloride (dimensionless)"
    legend_constants[341] = "chloride_Cl_sr_r1 in component chloride (mol_per_m_per_s_per_A_times_1e5)"
    legend_algebraic[327] = "ECl in component nernst (mV)"
    legend_algebraic[331] = "EK in component nernst (mV)"
    legend_constants[91] = "KClBar in component ctkcl (mM_per_ms)"
    legend_algebraic[332] = "ctkcl_CTKCl_z1 in component ctkcl (mV)"
    legend_constants[92] = "ctkcl_CTKCl_z2 in component ctkcl (mV)"
    legend_algebraic[352] = "ENa in component nernst (mV)"
    legend_constants[93] = "NaClBar in component ctnacl (mM_per_ms)"
    legend_algebraic[353] = "ctnacl_CTNaCl_z1 in component ctnacl (g4_m8_per_s12_per_A4)"
    legend_constants[346] = "ctnacl_CTNaCl_z2 in component ctnacl (g4_m8_per_s12_per_A4)"
    legend_algebraic[207] = "Idiff_Na in component diff (mM_per_ms)"
    legend_states[48] = "Na in component sodium (mM)"
    legend_states[49] = "Na_sr in component sodium (mM)"
    legend_constants[94] = "tau in component diff (ms)"
    legend_constants[95] = "tau_sr in component diff (ms)"
    legend_constants[96] = "tau_tr in component diff (ms)"
    legend_constants[97] = "Cao in component extra (mM)"
    legend_constants[98] = "Clo in component extra (mM)"
    legend_constants[99] = "Ko in component extra (mM)"
    legend_constants[100] = "Nao in component extra (mM)"
    legend_constants[263] = "FRT in component phys (per_mV)"
    legend_states[50] = "V in component membrane (mV)"
    legend_algebraic[215] = "efrt in component icab (dimensionless)"
    legend_constants[101] = "pCab in component icab (cm_per_s)"
    legend_algebraic[213] = "vfrt in component icab (dimensionless)"
    legend_algebraic[223] = "f_hat in component ical (dimensionless)"
    legend_algebraic[235] = "ICaL in component ical_camk (uA_per_cm2)"
    legend_constants[397] = "ical_f_hat_ratio in component ical (dimensionless)"
    legend_algebraic[220] = "ical_f_hat_val in component ical (dimensionless)"
    legend_algebraic[246] = "ICaL in component ical_np (uA_per_cm2)"
    legend_states[51] = "C in component ical_camk (dimensionless)"
    legend_states[52] = "CI in component ical_camk (dimensionless)"
    legend_states[53] = "CIs in component ical_camk (dimensionless)"
    legend_states[54] = "Cs in component ical_camk (dimensionless)"
    legend_constants[275] = "FFRT in component phys (s4_A2_per_g_per_m2_per_mol)"
    legend_algebraic[232] = "IBar in component ical_camk (uA_per_cm2)"
    legend_states[55] = "O in component ical_camk (dimensionless)"
    legend_states[56] = "OI in component ical_camk (dimensionless)"
    legend_states[57] = "OIs in component ical_camk (dimensionless)"
    legend_states[58] = "Os in component ical_camk (dimensionless)"
    legend_algebraic[226] = "PCa in component ical_camk (cm_per_s)"
    legend_algebraic[155] = "ac_inf in component ical_camk (dimensionless)"
    legend_algebraic[195] = "ac_tau in component ical_np (ms)"
    legend_algebraic[202] = "alpha in component ical_camk (mS_per_uF)"
    legend_algebraic[205] = "beta in component ical_camk (mS_per_uF)"
    legend_algebraic[183] = "delta in component ical_camk (mS_per_uF)"
    legend_algebraic[242] = "delta1 in component ical_camk (mS_per_uF)"
    legend_algebraic[159] = "delta_tau in component ical_camk (dimensionless)"
    legend_algebraic[229] = "ical_camk_IBar_vv in component ical_camk (dimensionless)"
    legend_algebraic[230] = "ical_camk_delta1_xs_cor in component ical_camk (mS_per_uF)"
    legend_algebraic[236] = "ical_camk_delta1_y_cor in component ical_camk (mS_per_uF)"
    legend_algebraic[214] = "in_a in component ical_np (dimensionless)"
    legend_algebraic[216] = "in_b in component ical_np (dimensionless)"
    legend_algebraic[167] = "in_hi_inf in component ical_camk (dimensionless)"
    legend_algebraic[218] = "in_hi_tau in component ical_camk (ms)"
    legend_algebraic[163] = "in_inf in component ical_camk (dimensionless)"
    legend_algebraic[171] = "in_lo_inf in component ical_camk (dimensionless)"
    legend_algebraic[221] = "in_lo_tau in component ical_camk (ms)"
    legend_algebraic[187] = "inca in component ical_camk (dimensionless)"
    legend_algebraic[175] = "ss_cal_10 in component ical_camk (dimensionless)"
    legend_algebraic[179] = "ss_cal_4 in component ical_camk (dimensionless)"
    legend_constants[102] = "theta in component ical_camk (mS_per_uF)"
    legend_constants[103] = "theta1 in component ical_camk (mS_per_uF)"
    legend_algebraic[224] = "x in component ical_camk (mS_per_uF)"
    legend_algebraic[227] = "xs in component ical_camk (mS_per_uF)"
    legend_algebraic[233] = "y in component ical_camk (mS_per_uF)"
    legend_algebraic[239] = "ys in component ical_camk (mS_per_uF)"
    legend_states[59] = "C in component ical_np (dimensionless)"
    legend_states[60] = "CI in component ical_np (dimensionless)"
    legend_states[61] = "CIs in component ical_np (dimensionless)"
    legend_states[62] = "Cs in component ical_np (dimensionless)"
    legend_algebraic[244] = "IBar in component ical_np (uA_per_cm2)"
    legend_states[63] = "O in component ical_np (dimensionless)"
    legend_states[64] = "OI in component ical_np (dimensionless)"
    legend_states[65] = "OIs in component ical_np (dimensionless)"
    legend_states[66] = "Os in component ical_np (dimensionless)"
    legend_algebraic[238] = "PCa in component ical_np (cm_per_s)"
    legend_algebraic[191] = "ac_inf in component ical_np (dimensionless)"
    legend_algebraic[208] = "alpha in component ical_np (mS_per_uF)"
    legend_algebraic[210] = "beta in component ical_np (mS_per_uF)"
    legend_algebraic[237] = "delta in component ical_np (mS_per_uF)"
    legend_algebraic[260] = "delta1 in component ical_np (mS_per_uF)"
    legend_algebraic[212] = "delta_tau in component ical_np (dimensionless)"
    legend_algebraic[241] = "ical_np_IBar_vv in component ical_np (dimensionless)"
    legend_algebraic[249] = "ical_np_delta1_xs_cor in component ical_np (mS_per_uF)"
    legend_algebraic[254] = "ical_np_delta1_y_cor in component ical_np (mS_per_uF)"
    legend_algebraic[222] = "in_hi_inf in component ical_np (dimensionless)"
    legend_algebraic[243] = "in_hi_tau in component ical_np (ms)"
    legend_algebraic[219] = "in_inf in component ical_np (dimensionless)"
    legend_algebraic[225] = "in_lo_inf in component ical_np (dimensionless)"
    legend_algebraic[228] = "in_lo_tau in component ical_np (ms)"
    legend_algebraic[240] = "inca in component ical_np (dimensionless)"
    legend_algebraic[231] = "ss_cal_10 in component ical_np (dimensionless)"
    legend_algebraic[234] = "ss_cal_4 in component ical_np (dimensionless)"
    legend_constants[104] = "theta in component ical_np (mS_per_uF)"
    legend_constants[105] = "theta1 in component ical_np (mS_per_uF)"
    legend_algebraic[245] = "x in component ical_np (mS_per_uF)"
    legend_algebraic[247] = "xs in component ical_np (mS_per_uF)"
    legend_algebraic[251] = "y in component ical_np (mS_per_uF)"
    legend_algebraic[257] = "ys in component ical_np (mS_per_uF)"
    legend_constants[106] = "Gbar in component iclb (mS_per_cm2)"
    legend_algebraic[253] = "IClCa_bar in component iclca (uA_per_cm2)"
    legend_algebraic[317] = "Irel_pure in component irel (mM_per_ms)"
    legend_algebraic[320] = "KClCa in component iclca (dimensionless)"
    legend_constants[107] = "PCl in component iclca (cm_per_s)"
    legend_states[67] = "i2 in component iclca (dimensionless)"
    legend_algebraic[11] = "iclca_i2_alpha in component iclca (dimensionless)"
    legend_algebraic[39] = "iclca_i2_beta in component iclca (dimensionless)"
    legend_constants[108] = "kCaCl in component iclca (mM_per_ms)"
    legend_constants[109] = "tau in component iclca (ms)"
    legend_algebraic[250] = "vexp in component iclca (dimensionless)"
    legend_constants[239] = "Gbar in component ik1 (mS_per_cm2)"
    legend_algebraic[339] = "IK1 in component ik1 (uA_per_cm2)"
    legend_algebraic[338] = "IK1_camk in component ik1 (uA_per_cm2)"
    legend_algebraic[337] = "IK1_np in component ik1 (uA_per_cm2)"
    legend_algebraic[335] = "ik1_IK1_np_alpha in component ik1 (dimensionless)"
    legend_algebraic[336] = "ik1_IK1_np_beta in component ik1 (dimensionless)"
    legend_algebraic[334] = "ik1_IK1_np_vv in component ik1 (mV)"
    legend_constants[240] = "GKr in component ikr (mS_per_cm2)"
    legend_algebraic[340] = "IKr in component ikr (uA_per_cm2)"
    legend_states[68] = "ac in component ikr (dimensionless)"
    legend_algebraic[12] = "ikr_ac_tau in component ikr (ms)"
    legend_algebraic[40] = "inf in component ikr (dimensionless)"
    legend_algebraic[256] = "inx in component ikr (dimensionless)"
    legend_algebraic[348] = "EKs in component nernst (mV)"
    legend_algebraic[259] = "G in component iks (mS_per_cm2)"
    legend_algebraic[351] = "IKs in component iks (uA_per_cm2)"
    legend_constants[403] = "IKs_arn in component iks_sig (uM)"
    legend_algebraic[349] = "IKs_np in component iks (uA_per_cm2)"
    legend_algebraic[350] = "IKs_pka in component iks (uA_per_cm2)"
    legend_constants[110] = "IKs_tot in component iks_sig (uM)"
    legend_algebraic[266] = "f_hat in component iks (dimensionless)"
    legend_algebraic[262] = "fp_iks in component iks_sig (dimensionless)"
    legend_constants[404] = "iks_f_hat_ratio in component iks (dimensionless)"
    legend_algebraic[264] = "iks_f_hat_val in component iks (dimensionless)"
    legend_states[69] = "O1 in component iks_np (dimensionless)"
    legend_states[70] = "O2 in component iks_np (dimensionless)"
    legend_states[71] = "O1 in component iks_pka (dimensionless)"
    legend_states[72] = "O2 in component iks_pka (dimensionless)"
    legend_states[73] = "C1 in component iks_np (dimensionless)"
    legend_states[74] = "C10 in component iks_np (dimensionless)"
    legend_states[75] = "C11 in component iks_np (dimensionless)"
    legend_states[76] = "C12 in component iks_np (dimensionless)"
    legend_states[77] = "C13 in component iks_np (dimensionless)"
    legend_states[78] = "C14 in component iks_np (dimensionless)"
    legend_states[79] = "C15 in component iks_np (dimensionless)"
    legend_states[80] = "C2 in component iks_np (dimensionless)"
    legend_states[81] = "C3 in component iks_np (dimensionless)"
    legend_states[82] = "C4 in component iks_np (dimensionless)"
    legend_states[83] = "C5 in component iks_np (dimensionless)"
    legend_states[84] = "C6 in component iks_np (dimensionless)"
    legend_states[85] = "C7 in component iks_np (dimensionless)"
    legend_states[86] = "C8 in component iks_np (dimensionless)"
    legend_states[87] = "C9 in component iks_np (dimensionless)"
    legend_algebraic[13] = "a in component iks_np (mS_per_uF)"
    legend_algebraic[41] = "b in component iks_np (mS_per_uF)"
    legend_algebraic[63] = "d in component iks_np (mS_per_uF)"
    legend_algebraic[75] = "e in component iks_np (mS_per_uF)"
    legend_algebraic[91] = "g in component iks_np (mS_per_uF)"
    legend_algebraic[92] = "o in component iks_np (mS_per_uF)"
    legend_algebraic[103] = "p in component iks_np (mS_per_uF)"
    legend_constants[111] = "t in component iks_np (mS_per_uF)"
    legend_states[88] = "C1 in component iks_pka (dimensionless)"
    legend_states[89] = "C10 in component iks_pka (dimensionless)"
    legend_states[90] = "C11 in component iks_pka (dimensionless)"
    legend_states[91] = "C12 in component iks_pka (dimensionless)"
    legend_states[92] = "C13 in component iks_pka (dimensionless)"
    legend_states[93] = "C14 in component iks_pka (dimensionless)"
    legend_states[94] = "C15 in component iks_pka (dimensionless)"
    legend_states[95] = "C2 in component iks_pka (dimensionless)"
    legend_states[96] = "C3 in component iks_pka (dimensionless)"
    legend_states[97] = "C4 in component iks_pka (dimensionless)"
    legend_states[98] = "C5 in component iks_pka (dimensionless)"
    legend_states[99] = "C6 in component iks_pka (dimensionless)"
    legend_states[100] = "C7 in component iks_pka (dimensionless)"
    legend_states[101] = "C8 in component iks_pka (dimensionless)"
    legend_states[102] = "C9 in component iks_pka (dimensionless)"
    legend_algebraic[14] = "a in component iks_pka (mS_per_uF)"
    legend_algebraic[42] = "b in component iks_pka (mS_per_uF)"
    legend_algebraic[64] = "d in component iks_pka (mS_per_uF)"
    legend_algebraic[76] = "e in component iks_pka (mS_per_uF)"
    legend_algebraic[93] = "g in component iks_pka (mS_per_uF)"
    legend_algebraic[94] = "o in component iks_pka (mS_per_uF)"
    legend_algebraic[104] = "p in component iks_pka (mS_per_uF)"
    legend_constants[112] = "t in component iks_pka (mS_per_uF)"
    legend_constants[405] = "IKs_arp in component iks_sig (uM)"
    legend_constants[356] = "IKsf in component iks_sig (uM)"
    legend_states[103] = "IKsp in component iks_sig (uM)"
    legend_constants[113] = "K in component iks_sig (uM)"
    legend_constants[114] = "Ka_iks in component iks_sig (uM)"
    legend_constants[115] = "Kp_iks in component iks_sig (uM)"
    legend_constants[116] = "L in component iks_sig (uM)"
    legend_constants[117] = "M in component iks_sig (uM)"
    legend_constants[399] = "PKA_eca in component pka (uM)"
    legend_constants[401] = "PKAf in component iks_sig (uM)"
    legend_constants[360] = "PP1f_eca in component iks_sig (uM)"
    legend_constants[118] = "Yotiao in component iks_sig (uM)"
    legend_constants[402] = "Yotiaof in component iks_sig (uM)"
    legend_constants[353] = "iks_sig_IKsf_sum in component iks_sig (dimensionless)"
    legend_algebraic[15] = "iks_sig_IKsp_dif in component iks_sig (uM)"
    legend_constants[400] = "iks_sig_PKAf_sum in component iks_sig (dimensionless)"
    legend_constants[358] = "iks_sig_PP1f_eca_sum in component iks_sig (dimensionless)"
    legend_constants[119] = "ka_iks in component iks_sig (hertz)"
    legend_constants[120] = "kp_iks in component iks_sig (hertz)"
    legend_algebraic[343] = "IKur in component ikur (uA_per_cm2)"
    legend_algebraic[341] = "IKur_np in component ikur (uA_per_cm2)"
    legend_algebraic[342] = "IKur_p in component ikur (uA_per_cm2)"
    legend_constants[121] = "Ka_ikur in component ikur (uM)"
    legend_constants[122] = "Kp_ikur in component ikur (uM)"
    legend_states[104] = "f_ikur in component ikur (dimensionless)"
    legend_algebraic[270] = "fhat in component ikur (dimensionless)"
    legend_constants[123] = "gbar_np in component ikur (mS_per_cm2)"
    legend_algebraic[268] = "ikur_fhat_val in component ikur (dimensionless)"
    legend_constants[124] = "ka_ikur in component ikur (hertz)"
    legend_constants[125] = "kp_ikur in component ikur (hertz)"
    legend_algebraic[359] = "INa in component ina (uA_per_cm2)"
    legend_algebraic[355] = "INa_both in component ina (uA_per_cm2)"
    legend_algebraic[356] = "INa_camk in component ina (uA_per_cm2)"
    legend_algebraic[357] = "INa_np in component ina (uA_per_cm2)"
    legend_algebraic[358] = "INa_pka in component ina (uA_per_cm2)"
    legend_constants[126] = "Ka_ina in component ina (uM)"
    legend_constants[127] = "Kp_ina in component ina (uM)"
    legend_algebraic[275] = "f_both in component ina (dimensionless)"
    legend_algebraic[276] = "f_camk_only in component ina (dimensionless)"
    legend_states[105] = "f_ina in component ina (dimensionless)"
    legend_algebraic[278] = "f_np in component ina (dimensionless)"
    legend_algebraic[274] = "f_pka in component ina (dimensionless)"
    legend_algebraic[277] = "f_pka_only in component ina (dimensionless)"
    legend_constants[241] = "gNaBar in component ina (mS_per_cm2)"
    legend_states[106] = "h in component ina_camk (dimensionless)"
    legend_states[107] = "j in component ina_camk (dimensionless)"
    legend_states[108] = "m in component ina_camk (dimensionless)"
    legend_algebraic[273] = "ina_f_pka_val in component ina (dimensionless)"
    legend_states[109] = "h in component ina_np (dimensionless)"
    legend_states[110] = "j in component ina_np (dimensionless)"
    legend_states[111] = "m in component ina_np (dimensionless)"
    legend_states[112] = "h in component ina_pka (dimensionless)"
    legend_states[113] = "j in component ina_pka (dimensionless)"
    legend_states[114] = "m in component ina_pka (dimensionless)"
    legend_constants[128] = "ka_ina in component ina (hertz)"
    legend_constants[129] = "kp_ina in component ina (hertz)"
    legend_constants[130] = "dVIn in component ina_camk (mV)"
    legend_algebraic[16] = "ina_camk_h_alpha in component ina_camk (mS_per_uF)"
    legend_algebraic[43] = "ina_camk_h_beta in component ina_camk (mS_per_uF)"
    legend_algebraic[17] = "ina_camk_j_alpha in component ina_camk (mS_per_uF)"
    legend_algebraic[44] = "ina_camk_j_beta in component ina_camk (mS_per_uF)"
    legend_algebraic[18] = "ina_camk_m_alpha in component ina_camk (mS_per_uF)"
    legend_algebraic[45] = "ina_camk_m_beta in component ina_camk (mS_per_uF)"
    legend_algebraic[19] = "ina_np_h_alpha in component ina_np (mS_per_uF)"
    legend_algebraic[46] = "ina_np_h_beta in component ina_np (mS_per_uF)"
    legend_algebraic[20] = "ina_np_j_alpha in component ina_np (mS_per_uF)"
    legend_algebraic[47] = "ina_np_j_beta in component ina_np (mS_per_uF)"
    legend_algebraic[21] = "ina_np_m_alpha in component ina_np (mS_per_uF)"
    legend_algebraic[48] = "ina_np_m_beta in component ina_np (mS_per_uF)"
    legend_constants[131] = "dVAc in component ina_pka (mV)"
    legend_constants[132] = "dVIn in component ina_pka (mV)"
    legend_algebraic[22] = "ina_pka_h_alpha in component ina_pka (mS_per_uF)"
    legend_algebraic[49] = "ina_pka_h_beta in component ina_pka (mS_per_uF)"
    legend_algebraic[23] = "ina_pka_j_alpha in component ina_pka (mS_per_uF)"
    legend_algebraic[50] = "ina_pka_j_beta in component ina_pka (mS_per_uF)"
    legend_algebraic[24] = "ina_pka_m_alpha in component ina_pka (mS_per_uF)"
    legend_algebraic[51] = "ina_pka_m_beta in component ina_pka (mS_per_uF)"
    legend_algebraic[281] = "INab in component inab (uA_per_cm2)"
    legend_constants[133] = "P in component inab (cm_per_s)"
    legend_algebraic[280] = "ePhi in component inab (dimensionless)"
    legend_algebraic[279] = "inab_INab_phi in component inab (dimensionless)"
    legend_constants[362] = "KmNai3 in component inaca (mM3)"
    legend_constants[364] = "KmNao3 in component inaca (mM3)"
    legend_constants[134] = "Km_Ca in component inaca (mM)"
    legend_constants[135] = "Km_Cai in component inaca (mM)"
    legend_constants[136] = "Km_Cao in component inaca (mM)"
    legend_constants[137] = "Km_Nai in component inaca (mM)"
    legend_constants[138] = "Km_Nao in component inaca (mM)"
    legend_algebraic[282] = "Na_i3 in component inaca (mM3)"
    legend_constants[366] = "Na_o3 in component inaca (mM3)"
    legend_algebraic[283] = "Na_ss3 in component inaca (mM3)"
    legend_constants[139] = "eta in component inaca (dimensionless)"
    legend_algebraic[284] = "exp1 in component inaca (dimensionless)"
    legend_algebraic[285] = "exp2 in component inaca (dimensionless)"
    legend_algebraic[286] = "inaca_INaCaSR_denom1 in component inaca (dimensionless)"
    legend_algebraic[287] = "inaca_INaCaSR_denom2 in component inaca (dimensionless)"
    legend_algebraic[288] = "inaca_INaCaSR_denom3 in component inaca (mol4_per_m12)"
    legend_algebraic[289] = "inaca_INaCaSR_denom4 in component inaca (mol4_per_m12)"
    legend_algebraic[290] = "inaca_INaCaSR_num in component inaca (A_mol4_per_m14_times_1e_minus_2)"
    legend_algebraic[292] = "inaca_INaCa_denom1 in component inaca (dimensionless)"
    legend_algebraic[293] = "inaca_INaCa_denom2 in component inaca (dimensionless)"
    legend_algebraic[294] = "inaca_INaCa_denom3 in component inaca (mol4_per_m12)"
    legend_algebraic[295] = "inaca_INaCa_denom4 in component inaca (mol4_per_m12)"
    legend_algebraic[296] = "inaca_INaCa_num in component inaca (A_mol4_per_m14_times_1e_minus_2)"
    legend_constants[140] = "kSat in component inaca (dimensionless)"
    legend_constants[141] = "vMax in component inaca (uA_per_cm2)"
    legend_algebraic[303] = "INaK in component inak (uA_per_cm2)"
    legend_algebraic[301] = "INaK_np in component inak (uA_per_cm2)"
    legend_algebraic[302] = "INaK_p in component inak (uA_per_cm2)"
    legend_constants[142] = "Ka_inak in component inak (uM)"
    legend_constants[143] = "Kp_inak in component inak (uM)"
    legend_states[115] = "f_inak in component inak (dimensionless)"
    legend_algebraic[299] = "fhat in component inak (dimensionless)"
    legend_constants[144] = "ibar in component inak (uA_per_cm2)"
    legend_algebraic[298] = "inak_fhat_val in component inak (dimensionless)"
    legend_constants[145] = "ka_inak in component inak (hertz)"
    legend_constants[146] = "km_ko in component inak (mM)"
    legend_constants[147] = "km_np in component inak (mM)"
    legend_constants[148] = "km_p in component inak (mM)"
    legend_constants[149] = "kp_inak in component inak (hertz)"
    legend_algebraic[300] = "phi in component inak (uA_per_cm2)"
    legend_constants[242] = "pk in component inak (dimensionless)"
    legend_algebraic[363] = "INaL in component inal (uA_per_cm2)"
    legend_algebraic[361] = "INaL_camk in component inal (uA_per_cm2)"
    legend_algebraic[362] = "INaL_np in component inal (uA_per_cm2)"
    legend_algebraic[360] = "conductance in component inal (mV)"
    legend_states[116] = "h in component inal (dimensionless)"
    legend_algebraic[25] = "h_inf in component inal (dimensionless)"
    legend_algebraic[26] = "inal_m_alpha in component inal (mS_per_uF)"
    legend_algebraic[52] = "inal_m_beta in component inal (mS_per_uF)"
    legend_states[117] = "m in component inal (dimensionless)"
    legend_constants[150] = "tau_h in component inal (ms)"
    legend_constants[151] = "IpCa_bar in component ipca (uA_per_cm2)"
    legend_constants[152] = "Km_pCa in component ipca (mM)"
    legend_algebraic[315] = "Ileak_ryr in component irel (mM_per_ms)"
    legend_algebraic[307] = "Ileak_ryr_np in component irel (mM_per_ms)"
    legend_algebraic[309] = "Ileak_ryr_p in component irel (mM_per_ms)"
    legend_states[118] = "Irel_np in component irel (mM_per_ms)"
    legend_states[119] = "Irel_p in component irel (mM_per_ms)"
    legend_constants[153] = "Km_ryr_leak_np in component irel (mM)"
    legend_constants[154] = "Km_ryr_leak_p in component irel (mM)"
    legend_algebraic[255] = "alpha_np in component irel (mM_per_ms)"
    legend_algebraic[261] = "alpha_p in component irel (mM_per_ms)"
    legend_constants[243] = "beta_0 in component irel (ms)"
    legend_algebraic[252] = "beta_np in component irel (ms)"
    legend_algebraic[258] = "beta_p in component irel (ms)"
    legend_algebraic[313] = "fhat in component irel (dimensionless)"
    legend_constants[398] = "irel_fhat_ratio in component irel (dimensionless)"
    legend_algebraic[311] = "irel_fhat_val in component irel (dimensionless)"
    legend_algebraic[271] = "irel_inf_np in component irel (mM_per_ms)"
    legend_algebraic[272] = "irel_inf_p in component irel (mM_per_ms)"
    legend_algebraic[265] = "irel_tau_np in component irel (ms)"
    legend_algebraic[267] = "irel_tau_p in component irel (ms)"
    legend_constants[155] = "k_ryr_leak_np in component irel (mS_per_uF)"
    legend_constants[156] = "k_ryr_leak_p in component irel (mS_per_uF)"
    legend_algebraic[263] = "x in component irel (dimensionless)"
    legend_algebraic[269] = "y in component irel (dimensionless)"
    legend_constants[157] = "Gbar in component ito (mS_per_cm2)"
    legend_algebraic[347] = "ITo in component ito (uA_per_cm2)"
    legend_algebraic[345] = "ITo_camk in component ito (uA_per_cm2)"
    legend_algebraic[346] = "ITo_np in component ito (uA_per_cm2)"
    legend_algebraic[325] = "R in component ito (dimensionless)"
    legend_algebraic[27] = "a_inf in component ito (dimensionless)"
    legend_states[120] = "a_np in component ito (dimensionless)"
    legend_algebraic[77] = "a_tau in component ito (ms)"
    legend_algebraic[28] = "alph_if in component ito (dimensionless)"
    legend_algebraic[54] = "alph_is in component ito (dimensionless)"
    legend_algebraic[66] = "beta_i in component ito (mS_per_uF)"
    legend_states[121] = "if_camk in component ito (dimensionless)"
    legend_states[122] = "if_np in component ito (dimensionless)"
    legend_states[123] = "is_camk in component ito (dimensionless)"
    legend_states[124] = "is_np in component ito (dimensionless)"
    legend_algebraic[53] = "ito_a_np_alpha in component ito (dimensionless)"
    legend_algebraic[65] = "ito_a_np_beta in component ito (dimensionless)"
    legend_algebraic[78] = "ito_if_camk_alpha in component ito (mS_per_uF)"
    legend_algebraic[79] = "ito_if_np_alpha in component ito (mS_per_uF)"
    legend_algebraic[80] = "ito_is_camk_alpha in component ito (mS_per_uF)"
    legend_algebraic[81] = "ito_is_np_alpha in component ito (mS_per_uF)"
    legend_algebraic[344] = "x in component ito (uA_per_cm2)"
    legend_algebraic[308] = "Imax in component iup (mM_per_ms)"
    legend_constants[158] = "Ka_plb in component iup (uM)"
    legend_constants[376] = "Km_both in component iup (mM)"
    legend_constants[369] = "Km_camk in component iup (mM)"
    legend_constants[159] = "Km_np in component iup (mM)"
    legend_constants[374] = "Km_pka in component iup (mM)"
    legend_algebraic[322] = "Km_up in component iup (mM)"
    legend_constants[160] = "Kp_plb in component iup (uM)"
    legend_algebraic[306] = "f_SERCA2a in component iup (dimensionless)"
    legend_algebraic[314] = "f_both in component iup (dimensionless)"
    legend_algebraic[316] = "f_camk_only in component iup (dimensionless)"
    legend_algebraic[321] = "f_np in component iup (dimensionless)"
    legend_algebraic[312] = "f_pka in component iup (dimensionless)"
    legend_algebraic[318] = "f_pka_only in component iup (dimensionless)"
    legend_states[125] = "f_plb in component iup (dimensionless)"
    legend_algebraic[310] = "iup_f_pka_val in component iup (dimensionless)"
    legend_constants[161] = "iupmax in component iup (mM_per_ms)"
    legend_constants[379] = "iupmaxCAMK in component iup (mM_per_ms)"
    legend_constants[162] = "ka_plb in component iup (hertz)"
    legend_constants[163] = "kp_plb in component iup (hertz)"
    legend_algebraic[324] = "leak in component iup (mM_per_ms)"
    legend_constants[164] = "nsrmax in component iup (mM)"
    legend_algebraic[326] = "uptake in component iup (mM_per_ms)"
    legend_algebraic[364] = "IK_tot in component potassium (uA_per_cm2)"
    legend_algebraic[366] = "INa_tot in component sodium (uA_per_cm2)"
    legend_algebraic[367] = "i_ion in component membrane (uA_per_cm2)"
    legend_algebraic[368] = "i_stim in component stimulus (uA_per_cm2)"
    legend_constants[165] = "PNaK in component nernst (dimensionless)"
    legend_constants[238] = "RTF in component phys (mV)"
    legend_states[126] = "K in component potassium (mM)"
    legend_constants[166] = "KPDEp in component pde (uM)"
    legend_constants[167] = "KmIbmxPde2 in component pde (dimensionless)"
    legend_constants[168] = "KmIbmxPde3 in component pde (dimensionless)"
    legend_constants[169] = "KmIbmxPde4 in component pde (dimensionless)"
    legend_constants[170] = "KmPDE2 in component pde (uM)"
    legend_constants[171] = "KmPDE3 in component pde (uM)"
    legend_constants[172] = "KmPDE4 in component pde (uM)"
    legend_constants[347] = "PDE2_cav in component pde (uM)"
    legend_constants[348] = "PDE2_cyt in component pde (uM)"
    legend_constants[349] = "PDE2_eca in component pde (uM)"
    legend_constants[173] = "PDE2_tot in component pde (uM)"
    legend_states[127] = "PDE3_P_cav in component pde (uM)"
    legend_states[128] = "PDE3_P_cyt in component pde (uM)"
    legend_constants[377] = "PDE3_cav in component pde (uM)"
    legend_constants[378] = "PDE3_cyt in component pde (uM)"
    legend_constants[363] = "PDE3_tot in component pde (uM)"
    legend_states[129] = "PDE4_P_cav in component pde (uM)"
    legend_states[130] = "PDE4_P_cyt in component pde (uM)"
    legend_states[131] = "PDE4_P_eca in component pde (uM)"
    legend_constants[370] = "PDE4_cav in component pde (uM)"
    legend_constants[371] = "PDE4_cyt in component pde (uM)"
    legend_constants[372] = "PDE4_eca in component pde (uM)"
    legend_constants[365] = "PDE4_tot in component pde (uM)"
    legend_constants[174] = "delta_k_pde34 in component pde (dimensionless)"
    legend_constants[175] = "f_pde2_cav in component pde (dimensionless)"
    legend_constants[333] = "f_pde2_cyt in component pde (dimensionless)"
    legend_constants[176] = "f_pde2_eca in component pde (dimensionless)"
    legend_constants[334] = "f_pde2_part in component pde (dimensionless)"
    legend_constants[367] = "f_pde3_cav in component pde (dimensionless)"
    legend_constants[373] = "f_pde3_cyt in component pde (dimensionless)"
    legend_constants[177] = "f_pde4_cav in component pde (dimensionless)"
    legend_constants[339] = "f_pde4_cyt in component pde (dimensionless)"
    legend_constants[343] = "f_pde4_eca in component pde (dimensionless)"
    legend_constants[178] = "f_pde4_part in component pde (dimensionless)"
    legend_constants[179] = "f_pde_part in component pde (dimensionless)"
    legend_constants[180] = "ff_pde3_cyt in component pde (dimensionless)"
    legend_constants[181] = "h_ibmx_pde2 in component pde (dimensionless)"
    legend_constants[182] = "h_ibmx_pde3 in component pde (dimensionless)"
    legend_constants[183] = "h_ibmx_pde4 in component pde (dimensionless)"
    legend_constants[184] = "ibmx in component pde (uM)"
    legend_constants[342] = "ibmx2 in component pde (uM)"
    legend_constants[375] = "ibmx3 in component pde (uM)"
    legend_constants[368] = "ibmx4 in component pde (uM)"
    legend_constants[338] = "ibmx_h2 in component pde (dimensionless)"
    legend_constants[350] = "ibmx_h3 in component pde (dimensionless)"
    legend_constants[354] = "ibmx_h4 in component pde (dimensionless)"
    legend_constants[185] = "kPDE2 in component pde (hertz)"
    legend_constants[186] = "kPDE3 in component pde (hertz)"
    legend_constants[187] = "kPDE4 in component pde (hertz)"
    legend_constants[244] = "kbPDEp in component pde (hertz)"
    legend_constants[188] = "kfPDEp in component pde (per_mM_per_ms)"
    legend_constants[359] = "pde_PDE3_tot_alpha in component pde (dimensionless)"
    legend_constants[361] = "pde_PDE3_tot_beta in component pde (dimensionless)"
    legend_constants[189] = "r_pde34_frac in component pde (dimensionless)"
    legend_constants[357] = "r_pde3_cyt in component pde (dimensionless)"
    legend_constants[190] = "R in component phys (mJ_per_mol_per_K)"
    legend_constants[191] = "T in component phys (kelvin)"
    legend_constants[245] = "K_pki in component pka (uM)"
    legend_constants[335] = "PKA_cyt in component pka (uM)"
    legend_constants[192] = "PKA_tot in component pka (uM)"
    legend_constants[344] = "PKI_cav in component pka (uM)"
    legend_constants[355] = "PKI_cyt in component pka (uM)"
    legend_constants[351] = "PKI_eca in component pka (uM)"
    legend_constants[336] = "PKI_tot in component pka (uM)"
    legend_constants[264] = "b_pki in component pka (hertz)"
    legend_constants[193] = "f_cav in component pka (dimensionless)"
    legend_constants[327] = "f_cyt in component pka (dimensionless)"
    legend_constants[194] = "f_eca in component pka (dimensionless)"
    legend_constants[195] = "f_pki in component pka (per_mM_per_ms)"
    legend_constants[340] = "f_pki_cav in component pka (dimensionless)"
    legend_constants[352] = "f_pki_cyt in component pka (dimensionless)"
    legend_constants[345] = "f_pki_eca in component pka (dimensionless)"
    legend_states[132] = "A2R in component pka_cav (uM)"
    legend_states[133] = "A2RC in component pka_cav (uM)"
    legend_states[134] = "ARC in component pka_cav (uM)"
    legend_constants[196] = "K1 in component pka_cav (uM)"
    legend_constants[197] = "K2 in component pka_cav (uM)"
    legend_constants[198] = "K3 in component pka_cav (m3_per_mol_times_1e3)"
    legend_states[135] = "PKIC in component pka_cav (uM)"
    legend_algebraic[140] = "RCf in component pka_cav (uM)"
    legend_constants[246] = "b1 in component pka_cav (hertz)"
    legend_constants[247] = "b2 in component pka_cav (hertz)"
    legend_constants[248] = "b3 in component pka_cav (per_mM_per_ms)"
    legend_constants[199] = "f1 in component pka_cav (per_mM_per_ms)"
    legend_constants[200] = "f2 in component pka_cav (per_mM_per_ms)"
    legend_constants[201] = "f3 in component pka_cav (hertz)"
    legend_states[136] = "A2R in component pka_cyt (uM)"
    legend_states[137] = "A2RC in component pka_cyt (uM)"
    legend_states[138] = "ARC in component pka_cyt (uM)"
    legend_constants[202] = "K1 in component pka_cyt (uM)"
    legend_constants[203] = "K2 in component pka_cyt (uM)"
    legend_constants[204] = "K3 in component pka_cyt (m3_per_mol_times_1e3)"
    legend_states[139] = "PKIC in component pka_cyt (uM)"
    legend_algebraic[150] = "RCf in component pka_cyt (uM)"
    legend_constants[265] = "b1 in component pka_cyt (hertz)"
    legend_constants[266] = "b2 in component pka_cyt (hertz)"
    legend_constants[267] = "b3 in component pka_cyt (per_mM_per_ms)"
    legend_constants[249] = "f1 in component pka_cyt (per_mM_per_ms)"
    legend_constants[250] = "f2 in component pka_cyt (per_mM_per_ms)"
    legend_constants[251] = "f3 in component pka_cyt (hertz)"
    legend_states[140] = "A2R in component pka_eca (uM)"
    legend_states[141] = "A2RC in component pka_eca (uM)"
    legend_states[142] = "ARC in component pka_eca (uM)"
    legend_constants[252] = "K1 in component pka_eca (uM)"
    legend_constants[253] = "K2 in component pka_eca (uM)"
    legend_constants[254] = "K3 in component pka_eca (m3_per_mol_times_1e3)"
    legend_states[143] = "PKIC in component pka_eca (uM)"
    legend_algebraic[130] = "RCf in component pka_eca (uM)"
    legend_constants[276] = "b1 in component pka_eca (hertz)"
    legend_constants[277] = "b2 in component pka_eca (hertz)"
    legend_constants[278] = "b3 in component pka_eca (per_mM_per_ms)"
    legend_constants[268] = "f1 in component pka_eca (per_mM_per_ms)"
    legend_constants[269] = "f2 in component pka_eca (per_mM_per_ms)"
    legend_constants[270] = "f3 in component pka_eca (hertz)"
    legend_constants[406] = "potassium_K_r1 in component potassium (mol_per_m_per_s_per_A_times_1e5)"
    legend_constants[205] = "K in component pp1 (uM)"
    legend_constants[206] = "Kdp in component pp1 (uM)"
    legend_constants[207] = "Kp in component pp1 (uM)"
    legend_constants[208] = "PP1_cyt in component pp1 (uM)"
    legend_algebraic[29] = "di in component pp1 (uM)"
    legend_constants[209] = "f in component pp1 (dimensionless)"
    legend_states[144] = "inhib1_p in component pp1 (uM)"
    legend_constants[255] = "inhib1_tot in component pp1 (uM)"
    legend_constants[210] = "kdp in component pp1 (hertz)"
    legend_constants[211] = "kp in component pp1 (hertz)"
    legend_algebraic[198] = "pp1_PP1f_cyt_sum in component pp1 (uM)"
    legend_algebraic[365] = "INa_cyt in component sodium (uA_per_cm2)"
    legend_constants[407] = "sodium_Na_r1 in component sodium (mol_per_m_per_s_per_A_times_1e5)"
    legend_constants[408] = "sodium_Na_r2 in component sodium (dimensionless)"
    legend_constants[409] = "sodium_Na_sr_r1 in component sodium (mol_per_m_per_s_per_A_times_1e5)"
    legend_constants[256] = "amplitude in component stimulus (uA_per_cm2)"
    legend_constants[212] = "duration in component stimulus (ms)"
    legend_constants[213] = "offset in component stimulus (ms)"
    legend_constants[214] = "period in component stimulus (ms)"
    legend_rates[4] = "d/dt ICaLp in component akap_sig (uM)"
    legend_rates[5] = "d/dt RyRp in component akap_sig (uM)"
    legend_rates[7] = "d/dt Gi_aGDP in component beta_cav (uM)"
    legend_rates[8] = "d/dt Gi_aGTP in component beta_cav (uM)"
    legend_rates[0] = "d/dt Gi_bg in component beta_cav (uM)"
    legend_rates[9] = "d/dt Gs_aGDP in component beta_cav (uM)"
    legend_rates[1] = "d/dt Gs_aGTP in component beta_cav (uM)"
    legend_rates[10] = "d/dt Gs_bg in component beta_cav (uM)"
    legend_rates[11] = "d/dt Rb1_grk_tot in component beta_cav (uM)"
    legend_rates[12] = "d/dt Rb1_pka_tot in component beta_cav (uM)"
    legend_rates[13] = "d/dt Rb2_grk_tot in component beta_cav (uM)"
    legend_rates[14] = "d/dt Rb2_pka_tot in component beta_cav (uM)"
    legend_rates[15] = "d/dt Gs_aGDP in component beta_cyt (uM)"
    legend_rates[2] = "d/dt Gs_aGTP in component beta_cyt (uM)"
    legend_rates[16] = "d/dt Gs_bg in component beta_cyt (uM)"
    legend_rates[17] = "d/dt Rb1_grk_tot in component beta_cyt (uM)"
    legend_rates[18] = "d/dt Rb1_pka_tot in component beta_cyt (uM)"
    legend_rates[20] = "d/dt Gi_aGDP in component beta_eca (uM)"
    legend_rates[21] = "d/dt Gi_aGTP in component beta_eca (uM)"
    legend_rates[22] = "d/dt Gi_bg in component beta_eca (uM)"
    legend_rates[23] = "d/dt Gs_aGDP in component beta_eca (uM)"
    legend_rates[3] = "d/dt Gs_aGTP in component beta_eca (uM)"
    legend_rates[24] = "d/dt Gs_bg in component beta_eca (uM)"
    legend_rates[25] = "d/dt Rb1_grk_tot in component beta_eca (uM)"
    legend_rates[26] = "d/dt Rb1_pka_tot in component beta_eca (uM)"
    legend_rates[27] = "d/dt Rb2_grk_tot in component beta_eca (uM)"
    legend_rates[28] = "d/dt Rb2_pka_tot in component beta_eca (uM)"
    legend_rates[30] = "d/dt Ca_nsr in component calcium (mM)"
    legend_rates[31] = "d/dt f_tni in component calcium (dimensionless)"
    legend_rates[32] = "d/dt uCa in component calcium (mM)"
    legend_rates[33] = "d/dt uCa_CaL in component calcium (mM)"
    legend_rates[34] = "d/dt uCa_jsr in component calcium (mM)"
    legend_rates[35] = "d/dt uCa_sr in component calcium (mM)"
    legend_rates[36] = "d/dt f_ical in component camk (dimensionless)"
    legend_rates[37] = "d/dt f_ik1 in component camk (dimensionless)"
    legend_rates[38] = "d/dt f_ina in component camk (dimensionless)"
    legend_rates[39] = "d/dt f_ito in component camk (dimensionless)"
    legend_rates[40] = "d/dt f_plb in component camk (dimensionless)"
    legend_rates[41] = "d/dt f_ryr in component camk (dimensionless)"
    legend_rates[42] = "d/dt trap in component camk (dimensionless)"
    legend_rates[43] = "d/dt cAMP_cav in component camp (uM)"
    legend_rates[44] = "d/dt cAMP_cyt in component camp (uM)"
    legend_rates[45] = "d/dt cAMP_eca in component camp (uM)"
    legend_rates[46] = "d/dt Cl in component chloride (mM)"
    legend_rates[47] = "d/dt Cl_sr in component chloride (mM)"
    legend_rates[51] = "d/dt C in component ical_camk (dimensionless)"
    legend_rates[52] = "d/dt CI in component ical_camk (dimensionless)"
    legend_rates[53] = "d/dt CIs in component ical_camk (dimensionless)"
    legend_rates[54] = "d/dt Cs in component ical_camk (dimensionless)"
    legend_rates[55] = "d/dt O in component ical_camk (dimensionless)"
    legend_rates[56] = "d/dt OI in component ical_camk (dimensionless)"
    legend_rates[57] = "d/dt OIs in component ical_camk (dimensionless)"
    legend_rates[58] = "d/dt Os in component ical_camk (dimensionless)"
    legend_rates[59] = "d/dt C in component ical_np (dimensionless)"
    legend_rates[60] = "d/dt CI in component ical_np (dimensionless)"
    legend_rates[61] = "d/dt CIs in component ical_np (dimensionless)"
    legend_rates[62] = "d/dt Cs in component ical_np (dimensionless)"
    legend_rates[63] = "d/dt O in component ical_np (dimensionless)"
    legend_rates[64] = "d/dt OI in component ical_np (dimensionless)"
    legend_rates[65] = "d/dt OIs in component ical_np (dimensionless)"
    legend_rates[66] = "d/dt Os in component ical_np (dimensionless)"
    legend_rates[67] = "d/dt i2 in component iclca (dimensionless)"
    legend_rates[68] = "d/dt ac in component ikr (dimensionless)"
    legend_rates[73] = "d/dt C1 in component iks_np (dimensionless)"
    legend_rates[74] = "d/dt C10 in component iks_np (dimensionless)"
    legend_rates[75] = "d/dt C11 in component iks_np (dimensionless)"
    legend_rates[76] = "d/dt C12 in component iks_np (dimensionless)"
    legend_rates[77] = "d/dt C13 in component iks_np (dimensionless)"
    legend_rates[78] = "d/dt C14 in component iks_np (dimensionless)"
    legend_rates[79] = "d/dt C15 in component iks_np (dimensionless)"
    legend_rates[80] = "d/dt C2 in component iks_np (dimensionless)"
    legend_rates[81] = "d/dt C3 in component iks_np (dimensionless)"
    legend_rates[82] = "d/dt C4 in component iks_np (dimensionless)"
    legend_rates[83] = "d/dt C5 in component iks_np (dimensionless)"
    legend_rates[84] = "d/dt C6 in component iks_np (dimensionless)"
    legend_rates[85] = "d/dt C7 in component iks_np (dimensionless)"
    legend_rates[86] = "d/dt C8 in component iks_np (dimensionless)"
    legend_rates[87] = "d/dt C9 in component iks_np (dimensionless)"
    legend_rates[69] = "d/dt O1 in component iks_np (dimensionless)"
    legend_rates[70] = "d/dt O2 in component iks_np (dimensionless)"
    legend_rates[88] = "d/dt C1 in component iks_pka (dimensionless)"
    legend_rates[89] = "d/dt C10 in component iks_pka (dimensionless)"
    legend_rates[90] = "d/dt C11 in component iks_pka (dimensionless)"
    legend_rates[91] = "d/dt C12 in component iks_pka (dimensionless)"
    legend_rates[92] = "d/dt C13 in component iks_pka (dimensionless)"
    legend_rates[93] = "d/dt C14 in component iks_pka (dimensionless)"
    legend_rates[94] = "d/dt C15 in component iks_pka (dimensionless)"
    legend_rates[95] = "d/dt C2 in component iks_pka (dimensionless)"
    legend_rates[96] = "d/dt C3 in component iks_pka (dimensionless)"
    legend_rates[97] = "d/dt C4 in component iks_pka (dimensionless)"
    legend_rates[98] = "d/dt C5 in component iks_pka (dimensionless)"
    legend_rates[99] = "d/dt C6 in component iks_pka (dimensionless)"
    legend_rates[100] = "d/dt C7 in component iks_pka (dimensionless)"
    legend_rates[101] = "d/dt C8 in component iks_pka (dimensionless)"
    legend_rates[102] = "d/dt C9 in component iks_pka (dimensionless)"
    legend_rates[71] = "d/dt O1 in component iks_pka (dimensionless)"
    legend_rates[72] = "d/dt O2 in component iks_pka (dimensionless)"
    legend_rates[103] = "d/dt IKsp in component iks_sig (uM)"
    legend_rates[104] = "d/dt f_ikur in component ikur (dimensionless)"
    legend_rates[105] = "d/dt f_ina in component ina (dimensionless)"
    legend_rates[106] = "d/dt h in component ina_camk (dimensionless)"
    legend_rates[107] = "d/dt j in component ina_camk (dimensionless)"
    legend_rates[108] = "d/dt m in component ina_camk (dimensionless)"
    legend_rates[109] = "d/dt h in component ina_np (dimensionless)"
    legend_rates[110] = "d/dt j in component ina_np (dimensionless)"
    legend_rates[111] = "d/dt m in component ina_np (dimensionless)"
    legend_rates[112] = "d/dt h in component ina_pka (dimensionless)"
    legend_rates[113] = "d/dt j in component ina_pka (dimensionless)"
    legend_rates[114] = "d/dt m in component ina_pka (dimensionless)"
    legend_rates[115] = "d/dt f_inak in component inak (dimensionless)"
    legend_rates[116] = "d/dt h in component inal (dimensionless)"
    legend_rates[117] = "d/dt m in component inal (dimensionless)"
    legend_rates[118] = "d/dt Irel_np in component irel (mM_per_ms)"
    legend_rates[119] = "d/dt Irel_p in component irel (mM_per_ms)"
    legend_rates[120] = "d/dt a_np in component ito (dimensionless)"
    legend_rates[121] = "d/dt if_camk in component ito (dimensionless)"
    legend_rates[122] = "d/dt if_np in component ito (dimensionless)"
    legend_rates[123] = "d/dt is_camk in component ito (dimensionless)"
    legend_rates[124] = "d/dt is_np in component ito (dimensionless)"
    legend_rates[125] = "d/dt f_plb in component iup (dimensionless)"
    legend_rates[50] = "d/dt V in component membrane (mV)"
    legend_rates[127] = "d/dt PDE3_P_cav in component pde (uM)"
    legend_rates[128] = "d/dt PDE3_P_cyt in component pde (uM)"
    legend_rates[129] = "d/dt PDE4_P_cav in component pde (uM)"
    legend_rates[130] = "d/dt PDE4_P_cyt in component pde (uM)"
    legend_rates[131] = "d/dt PDE4_P_eca in component pde (uM)"
    legend_rates[132] = "d/dt A2R in component pka_cav (uM)"
    legend_rates[133] = "d/dt A2RC in component pka_cav (uM)"
    legend_rates[134] = "d/dt ARC in component pka_cav (uM)"
    legend_rates[6] = "d/dt C in component pka_cav (uM)"
    legend_rates[135] = "d/dt PKIC in component pka_cav (uM)"
    legend_rates[136] = "d/dt A2R in component pka_cyt (uM)"
    legend_rates[137] = "d/dt A2RC in component pka_cyt (uM)"
    legend_rates[138] = "d/dt ARC in component pka_cyt (uM)"
    legend_rates[19] = "d/dt C in component pka_cyt (uM)"
    legend_rates[139] = "d/dt PKIC in component pka_cyt (uM)"
    legend_rates[140] = "d/dt A2R in component pka_eca (uM)"
    legend_rates[141] = "d/dt A2RC in component pka_eca (uM)"
    legend_rates[142] = "d/dt ARC in component pka_eca (uM)"
    legend_rates[29] = "d/dt C in component pka_eca (uM)"
    legend_rates[143] = "d/dt PKIC in component pka_eca (uM)"
    legend_rates[126] = "d/dt K in component potassium (mM)"
    legend_rates[144] = "d/dt inhib1_p in component pp1 (uM)"
    legend_rates[48] = "d/dt Na in component sodium (mM)"
    legend_rates[49] = "d/dt Na_sr in component sodium (mM)"
    return (legend_states, legend_algebraic, legend_voi, legend_constants)

def initConsts():
    constants = [0.0] * sizeConstants; states = [0.0] * sizeStates;
    constants[0] = 5000.0
    constants[1] = 315.0
    constants[2] = 0.0465
    constants[3] = 0.031544
    constants[4] = 0.0852
    constants[5] = 0.4824
    constants[6] = 3.3757
    constants[7] = 41.32
    constants[8] = 0.03135
    constants[9] = 0.037696
    states[0] = 2.09911481235842013e-03
    states[1] = 6.85041638458664965e-03
    states[2] = 7.31420577213055985e-04
    states[3] = 1.84627603007976003e-02
    constants[10] = 0.16479
    constants[11] = 0.087459
    constants[12] = 1.0043
    constants[13] = 1.3574
    constants[14] = 0.6623
    constants[15] = 0.8569
    constants[16] = 0.025
    constants[17] = 0.025
    states[4] = 6.73713947839316954e-04
    constants[18] = 1.27019999999999993e-06
    constants[19] = 6.62979999999999944e-05
    constants[20] = 0.01
    constants[21] = 0.0063064
    constants[22] = 0.043003
    constants[23] = 0.01
    constants[24] = 0.0001
    constants[25] = 0.0001
    constants[26] = 0.01
    constants[27] = 0.01
    constants[28] = 0.25
    constants[29] = 0.125
    constants[30] = 0.125
    states[5] = 4.10693810508170991e-03
    constants[31] = 5.10090000000000044e-04
    constants[32] = 0.0025548
    constants[33] = 0.0006903
    constants[34] = 0.0038257
    states[6] = 3.26565916584702978e-02
    constants[35] = 0.5
    constants[36] = 0.85
    constants[37] = 0.0011071
    constants[38] = 0.5664
    constants[39] = 0.081161
    constants[40] = 0.48744
    constants[41] = 0.85
    constants[42] = 4.0
    constants[43] = 4.9054
    constants[44] = 0.05
    constants[45] = 0.25945
    constants[46] = 2.449
    constants[47] = 0.062
    constants[48] = 0.567
    constants[49] = 1.6655
    constants[50] = 1.8463
    constants[51] = 0.1
    constants[52] = 0.012
    constants[53] = 1.053
    constants[54] = 1.053
    constants[55] = 0.8
    constants[56] = 1210.0
    constants[57] = 0.35
    constants[58] = 1.0
    states[7] = 5.02792845976641014e-04
    states[8] = 1.59632196638178009e-03
    states[9] = 6.07316088556675987e-04
    states[10] = 7.45773247314215036e-03
    states[11] = 2.49592854373432000e-10
    states[12] = 1.49041813757830998e-02
    states[13] = 8.91799633266019011e-10
    states[14] = 2.75455839709412009e-02
    constants[59] = 0.0
    constants[60] = 1.0
    constants[61] = 1.0
    states[15] = 4.19991861054322011e-04
    states[16] = 1.15141243826746994e-03
    states[17] = 7.07824478944670999e-11
    states[18] = 9.44463350378085993e-03
    states[19] = 3.62113356111495976e-01
    constants[62] = 1.0
    states[20] = 3.41341142614041016e-04
    states[21] = 3.64315164237569004e-04
    states[22] = 7.05656306851923029e-04
    states[23] = 6.39038440072506948e-04
    states[24] = 1.91017987408719017e-02
    states[25] = 1.18055788874765002e-09
    states[26] = 2.03016833596287999e-01
    states[27] = 1.13428924662652000e-10
    states[28] = 1.10248953370551007e-02
    constants[63] = 1.0
    states[29] = 5.67249910261072965e-01
    states[30] = 1.191
    constants[64] = 2.71430000000000008e-05
    constants[65] = 0.26714
    constants[66] = 1.0
    constants[67] = 1.124
    constants[68] = 0.0087
    constants[69] = 0.047
    constants[70] = 0.00087
    constants[71] = 0.05
    constants[72] = 10.0
    constants[73] = 0.8
    states[31] = 6.73518785672381992e-01
    constants[74] = 0.10408
    constants[75] = 0.00238
    constants[76] = 0.052633
    constants[77] = 0.0005
    constants[78] = 0.07
    states[32] = 0.013394
    states[33] = 0.023413
    states[34] = 6.8659
    states[35] = 0.023413
    constants[79] = 0.05
    constants[80] = 0.25
    constants[81] = 0.0015
    constants[82] = 0.1
    constants[83] = 0.05
    constants[84] = 0.00068
    states[36] = 0.0
    states[37] = 0.0
    states[38] = 0.0
    states[39] = 0.0
    states[40] = 0.0
    states[41] = 0.0
    constants[85] = 100000.0
    constants[86] = 10000.0
    states[42] = 0.0017546
    states[43] = 3.47102959606005013e-01
    states[44] = 4.74081735738210996e-01
    states[45] = 9.62359241535767040e+00
    constants[87] = 96487.0
    constants[88] = 0.01
    constants[89] = 3.14159265358979312e+00
    constants[90] = 0.0011
    states[46] = 20.273
    states[47] = 20.273
    constants[91] = 1.77e-05
    constants[92] = 87.8251
    constants[93] = 2.46108000000000016e-05
    states[48] = 6.8909
    states[49] = 6.8909
    constants[94] = 0.2
    constants[95] = 0.02
    constants[96] = 75.0
    constants[97] = 1.8
    constants[98] = 100.0
    constants[99] = 5.4
    constants[100] = 140.0
    states[50] = -87.491
    constants[101] = 1.995e-07
    states[51] = 1.0
    states[52] = 0.0
    states[53] = 0.0
    states[54] = 0.0
    states[55] = 0.0
    states[56] = 0.0
    states[57] = 0.0
    states[58] = 0.0
    constants[102] = 1.0
    constants[103] = 1e-06
    states[59] = 1.0
    states[60] = 0.0
    states[61] = 0.0
    states[62] = 0.0
    states[63] = 0.0
    states[64] = 0.0
    states[65] = 0.0
    states[66] = 0.0
    constants[104] = 1.0
    constants[105] = 1e-06
    constants[106] = 0.000225
    constants[107] = 9e-07
    states[67] = 0.99604
    constants[108] = 0.4
    constants[109] = 8.0
    states[68] = 1.23059999999999995e-08
    constants[110] = 0.025
    states[69] = 9.37220000000000071e-16
    states[70] = 1.65950000000000014e-17
    states[71] = 1.12010000000000000e-15
    states[72] = 1.66129999999999997e-18
    states[73] = 0.91141
    states[74] = 5.36959999999999959e-07
    states[75] = 2.48610000000000001e-08
    states[76] = 2.87759999999999997e-10
    states[77] = 1.12169999999999999e-10
    states[78] = 2.59670000000000003e-12
    states[79] = 8.78740000000000076e-15
    states[80] = 0.084395
    states[81] = 0.0029306
    states[82] = 4.52285000000000024e-05
    states[83] = 2.61750000000000024e-07
    states[84] = 0.0011424
    states[85] = 7.93370000000000029e-05
    states[86] = 1.83659999999999992e-06
    states[87] = 1.41719999999999995e-08
    constants[111] = 0.0027304
    states[88] = 0.95624
    states[89] = 3.19559999999999984e-07
    states[90] = 7.039e-09
    states[91] = 3.87629999999999971e-11
    states[92] = 5.02769999999999999e-11
    states[93] = 5.53740000000000021e-13
    states[94] = 2.96639999999999984e-15
    states[95] = 0.042127
    states[96] = 6.95969999999999965e-04
    states[97] = 5.11010000000000042e-06
    states[98] = 1.407e-08
    states[99] = 9.02690000000000046e-04
    states[100] = 2.98259999999999987e-05
    states[101] = 3.285e-07
    states[102] = 1.206e-09
    constants[112] = 0.0046171
    states[103] = 7.65988420110534033e-04
    constants[113] = 0.01
    constants[114] = 9.97940000000000003e-05
    constants[115] = 1.11470000000000002e-04
    constants[116] = 0.0001
    constants[117] = 0.01
    constants[118] = 0.025
    constants[119] = 0.16305
    constants[120] = 1.0542
    constants[121] = 0.27623
    constants[122] = 0.002331
    states[104] = 5.89379755147717982e-02
    constants[123] = 0.00384
    constants[124] = 0.069537
    constants[125] = 0.317
    constants[126] = 0.10988
    constants[127] = 7.8605
    states[105] = 2.39479458960527997e-01
    states[106] = 0.83805
    states[107] = 0.99281
    states[108] = 6.81269999999999988e-04
    states[109] = 0.0068172
    states[110] = 0.99709
    states[111] = 0.90163
    states[112] = 0.001236
    states[113] = 0.99123
    states[114] = 0.79472
    constants[128] = 0.01368
    constants[129] = 0.052811
    constants[130] = 3.25
    constants[131] = 3.7
    constants[132] = 4.9
    constants[133] = 3.2e-09
    constants[134] = 0.000125
    constants[135] = 0.0036
    constants[136] = 1.3
    constants[137] = 12.3
    constants[138] = 87.5
    constants[139] = 0.27
    constants[140] = 0.32
    constants[141] = 4.5
    constants[142] = 0.0011001
    constants[143] = 5.7392
    states[115] = 1.26345311579565994e-01
    constants[144] = 1.4
    constants[145] = 0.015265
    constants[146] = 1.5
    constants[147] = 2.6
    constants[148] = 1.846
    constants[149] = 0.092455
    states[116] = 0.36003
    states[117] = 0.0007053
    constants[150] = 600.0
    constants[151] = 0.0575
    constants[152] = 0.0005
    states[118] = 3.66750000000000000e-09
    states[119] = 7.30739999999999981e-09
    constants[153] = 20.0
    constants[154] = 1.1
    constants[155] = 0.000175
    constants[156] = 0.0005
    constants[157] = 0.4975
    states[120] = 1.76869999999999985e-05
    states[121] = 1.0
    states[122] = 0.99798
    states[123] = 1.0
    states[124] = 0.98747
    constants[158] = 9.88539999999999992e-04
    constants[159] = 0.00092
    constants[160] = 0.80737
    states[125] = 5.92167467082830967e-01
    constants[161] = 0.004375
    constants[162] = 0.11348
    constants[163] = 0.48302
    constants[164] = 15.0
    constants[165] = 0.01833
    states[126] = 145.62
    constants[166] = 0.52218
    constants[167] = 21.58
    constants[168] = 2.642
    constants[169] = 11.89
    constants[170] = 50.0
    constants[171] = 0.8
    constants[172] = 1.4
    constants[173] = 0.029268
    states[127] = 2.36821659448036986e-02
    states[128] = 1.28402905095187994e-02
    states[129] = 6.37363047239019025e-03
    states[130] = 9.17039986149184062e-03
    states[131] = 4.29171113639321980e-05
    constants[174] = 3.0
    constants[175] = 0.16957
    constants[176] = 2.12570000000000006e-04
    constants[177] = 0.12481
    constants[178] = 0.125
    constants[179] = 0.2
    constants[180] = 0.35
    constants[181] = 1.167
    constants[182] = 0.7629
    constants[183] = 0.9024
    constants[184] = 0.0
    constants[185] = 20.0
    constants[186] = 2.5
    constants[187] = 4.0
    constants[188] = 0.0196
    constants[189] = 3.71
    constants[190] = 8314.0
    constants[191] = 310.0
    constants[192] = 0.5
    constants[193] = 0.0388
    constants[194] = 0.1
    constants[195] = 50.0
    states[132] = 2.25475702283052998e-01
    states[133] = 2.76490711096605019e-03
    states[134] = 9.04820284659604013e-02
    constants[196] = 2.4984
    constants[197] = 11.359
    constants[198] = 0.3755
    states[135] = 1.92819110624504991e-01
    constants[199] = 100.0
    constants[200] = 100.0
    constants[201] = 100.0
    states[136] = 4.89063888619455989e-01
    states[137] = 6.64997605558790977e-02
    states[138] = 6.46928309115710060e-02
    constants[202] = 0.1088
    constants[203] = 0.4612
    constants[204] = 0.3755
    states[139] = 1.26950532507959013e-01
    states[140] = 8.17161796756963987e-01
    states[141] = 1.74057375932567010e-01
    states[142] = 2.05444874210056000e-01
    states[143] = 2.49911886495889995e-01
    constants[205] = 0.001
    constants[206] = 1.95259999999999991e-05
    constants[207] = 0.001469
    constants[208] = 0.2
    constants[209] = 0.3
    states[144] = 2.82662056977524001e-02
    constants[210] = 0.0035731
    constants[211] = 0.010145
    constants[212] = 0.5
    constants[213] = 100.0
    constants[214] = 1000.0
    constants[215] = 1.00000-constants[36]
    constants[216] = (1.00000-constants[37])-constants[38]
    constants[217] = constants[57]*0.000983300
    constants[218] = constants[57]*0.00133000
    constants[219] = constants[55]
    constants[220] = constants[57]*0.00650000
    constants[221] = constants[56]
    constants[222] = ((constants[51]+constants[59])*(constants[54]+constants[59]))/constants[54]
    constants[223] = ((constants[48]*constants[53])*(constants[47]+constants[59]))*(constants[52]+constants[59])
    constants[224] = ((constants[47]+constants[59])*(constants[48]+constants[59]))/constants[48]
    constants[225] = ((constants[51]+constants[59])*(constants[54]+constants[59]))/constants[54]
    constants[226] = ((constants[48]*constants[53])*(constants[47]+constants[59]))*(constants[52]+constants[59])
    constants[227] = constants[0]/(constants[1]+constants[0])
    constants[228] = constants[69]+constants[67]
    constants[229] = 1.50000*constants[77]
    constants[230] = constants[70]*constants[68]
    constants[231] = constants[86]
    constants[232] = constants[85]
    constants[233] = constants[85]
    constants[234] = constants[85]
    constants[235] = 7.50000e-14*1.00000e+06
    constants[236] = 5.00000e-15*1.00000e+06
    constants[237] = 9.00000e-15*1.00000e+06
    constants[238] = (constants[190]*constants[191])/constants[87]
    constants[239] = 0.500000*(power(constants[99]/5.40000, 1.0/2))
    constants[240] = 0.0138542*(power(constants[99]/5.40000, 1.0/2))
    constants[241] = (2.15000*8.25000)*1.10000
    constants[242] = constants[99]/(constants[99]+constants[146])
    constants[243] = 0.666700*4.75000
    constants[244] = constants[166]*constants[188]
    constants[245] = 0.0100000/50.0000
    constants[246] = constants[199]*constants[196]
    constants[247] = constants[200]*constants[197]
    constants[248] = constants[201]*constants[198]
    constants[249] = constants[199]
    constants[250] = constants[200]
    constants[251] = constants[201]
    constants[252] = constants[196]
    constants[253] = constants[197]
    constants[254] = constants[198]
    constants[255] = (constants[209]/(1.00000-constants[209]))*constants[205]+constants[209]*constants[208]
    constants[256] = -80.0000
    constants[257] = 0.156290*constants[220]
    constants[258] = (((constants[46]*constants[47])*constants[53])*(constants[52]+constants[59]))*(constants[48]+constants[59])
    constants[259] = (((constants[46]*constants[47])*constants[53])*(constants[52]+constants[59]))*(constants[48]+constants[59])
    constants[260] = 1.00000/(1.00000+0.350000)
    constants[261] = constants[70]+constants[68]
    constants[262] = (constants[69]*constants[68]+constants[67]*constants[70])+constants[230]
    constants[263] = 1.00000/constants[238]
    constants[264] = constants[195]*constants[245]
    constants[265] = constants[249]*constants[202]
    constants[266] = constants[250]*constants[203]
    constants[267] = constants[251]*constants[204]
    constants[268] = constants[199]
    constants[269] = constants[200]
    constants[270] = constants[201]
    constants[271] = (((constants[50]*constants[52])*constants[48])*(constants[47]+constants[59]))*(constants[53]+constants[59])
    constants[272] = (((constants[50]*constants[52])*constants[48])*(constants[47]+constants[59]))*(constants[53]+constants[59])
    constants[273] = 1.00000+(constants[16]-constants[17])/constants[24]
    constants[274] = constants[228]+constants[261]
    constants[275] = constants[87]*constants[263]
    constants[276] = constants[268]*constants[252]
    constants[277] = constants[269]*constants[253]
    constants[278] = constants[270]*constants[254]
    constants[279] = ((((constants[46]*constants[50])*constants[47])*constants[52])*(constants[48]+constants[59]))*(constants[53]+constants[59])
    constants[280] = ((((constants[46]*constants[50])*constants[47])*constants[52])*(constants[48]+constants[59]))*(constants[53]+constants[59])
    constants[281] = (constants[24]/2.00000)*(power(power(constants[273], 2.00000)+(4.00000*constants[17])/constants[24], 1.0/2)-constants[273])
    constants[282] = (((constants[16]+constants[29])+constants[20])+constants[23])-constants[28]
    constants[283] = ((constants[16]*constants[23]+constants[29]*constants[20])+constants[20]*constants[23])-constants[28]*(constants[20]+constants[23])
    constants[284] = (constants[28]*constants[20])*constants[23]
    constants[285] = ((((-constants[284]/27.0000)*(power(constants[282], 3.00000))-(((constants[282]*constants[282])*constants[283])*constants[283])/108.000)+((constants[282]*constants[283])*constants[284])/6.00000)+(power(constants[283], 3.00000))/27.0000)+(constants[284]*constants[284])/4.00000
    constants[286] = custom_piecewise([less(constants[285] , 0.00000), power(-constants[285], 1.0/2) , True, 0.00000])
    constants[287] = (((custom_piecewise([greater(constants[285] , 0.00000), power(constants[285], 1.0/2) , True, 0.00000]))+constants[284]/2.00000)+(constants[282]*constants[283])/6.00000)-(power(constants[282], 3.00000))/27.0000
    constants[288] = arctan(constants[286]/constants[287])/3.00000
    constants[289] = power(constants[287]*constants[287]+constants[286]*constants[286], 1.00000/6.00000)
    constants[290] = (constants[283]/3.00000-(constants[282]*constants[282])/9.00000)/(constants[289]*constants[289])
    constants[291] = (constants[289]*cos(constants[288]))*(1.00000-constants[290])-constants[282]/3.00000
    constants[292] = 1.00000+(constants[29]-constants[30])/constants[25]
    constants[293] = (constants[25]/2.00000)*(power(power(constants[292], 2.00000)+(4.00000*constants[30])/constants[25], 1.0/2)-constants[292])
    constants[294] = 0.850000*0.0250000
    constants[295] = 224.000*constants[294]
    constants[296] = 3.00000*constants[294]
    constants[297] = 0.150000*0.0250000
    constants[298] = (1.00000-constants[39])-constants[40]
    constants[299] = 1.00000-constants[41]
    constants[300] = ((2.00000*constants[89])*constants[90])*(constants[90]+constants[88])
    constants[301] = 2.00000*constants[300]
    constants[302] = constants[301]/constants[87]
    constants[303] = (((1000.00*constants[89])*constants[90])*constants[90])*constants[88]
    constants[304] = constants[303]*0.00200000
    constants[305] = constants[302]/(2.00000*constants[304])
    constants[306] = 0.0200000*constants[303]
    constants[307] = constants[303]*0.678000
    constants[308] = constants[302]/(2.00000*constants[307])
    constants[309] = 0.0400000*constants[303]
    constants[310] = constants[303]*0.00480000
    constants[311] = constants[303]*0.0552000
    constants[312] = constants[310]/constants[311]
    constants[313] = constants[311]/constants[307]
    constants[314] = constants[303]*0.0200000
    constants[315] = constants[314]/constants[304]
    constants[316] = -constants[302]/constants[314]
    constants[317] = -constants[310]/constants[314]
    constants[318] = constants[314]/constants[307]
    constants[319] = constants[303]/constants[306]
    constants[320] = ((constants[11]*constants[260])*constants[296])*constants[319]
    constants[321] = constants[303]/constants[307]
    constants[322] = (constants[39]*constants[294])*constants[319]
    constants[323] = (constants[41]*constants[297])*constants[319]
    constants[324] = (((1.00000-constants[10])*(1.00000-constants[260]))*constants[296])*constants[321]
    constants[325] = (constants[298]*constants[294])*constants[321]
    constants[326] = constants[303]/constants[309]
    constants[327] = (1.00000-constants[193])-constants[194]
    constants[328] = (((1.00000-constants[11])*constants[260])*constants[296])*constants[321]
    constants[329] = ((constants[10]*(1.00000-constants[260]))*constants[296])*constants[326]
    constants[330] = (constants[40]*constants[294])*constants[326]
    constants[331] = (constants[299]*constants[297])*constants[326]
    constants[332] = constants[302]/constants[307]
    constants[333] = (1.00000-constants[175])-constants[176]
    constants[334] = constants[175]+constants[176]
    constants[335] = (constants[327]*constants[192])*constants[321]
    constants[336] = 0.200000*constants[192]
    constants[337] = constants[314]/constants[307]
    constants[338] = power(constants[184]*1.00000, constants[181])
    constants[339] = 1.00000-constants[178]
    constants[340] = constants[193]
    constants[341] = constants[302]/constants[314]
    constants[342] = (1.00000-constants[338]/(constants[167]+constants[338]))*constants[173]
    constants[343] = constants[178]-constants[177]
    constants[344] = (constants[340]*constants[336])*constants[319]
    constants[345] = constants[194]
    constants[346] = power(87.8251, 4.00000)
    constants[347] = (constants[342]*constants[175])*constants[319]
    constants[348] = (constants[342]*constants[333])*constants[321]
    constants[349] = (constants[342]*constants[176])*constants[326]
    constants[350] = power(constants[184]*1.00000, constants[182])
    constants[351] = (constants[345]*constants[336])*constants[326]
    constants[352] = (1.00000-constants[340])-constants[345]
    constants[353] = 1.00000+(constants[118]-constants[110])/constants[116]
    constants[354] = power(constants[184]*1.00000, constants[183])
    constants[355] = (constants[352]*constants[336])*constants[321]
    constants[356] = (constants[116]/2.00000)*(power(power(constants[353], 2.00000)+(4.00000*constants[110])/constants[116], 1.0/2)-constants[353])
    constants[357] = constants[180]/(1.00000-constants[180])
    constants[358] = 1.00000+(constants[118]-constants[82])/constants[113]
    constants[359] = constants[357]*(constants[178]*(((1.00000+constants[189])-constants[189]*constants[334])-constants[179])+constants[334]*(constants[179]-1.00000))+(constants[189]*constants[178])*(constants[179]-constants[334])
    constants[360] = (constants[113]/2.00000)*(power(power(constants[358], 2.00000)+(4.00000*constants[82])/constants[113], 1.0/2)-constants[358])
    constants[361] = constants[178]*((1.00000+constants[189])+constants[179]*(constants[357]-constants[189]))-constants[179]*(1.00000+constants[357])
    constants[362] = power(constants[137], 3.00000)
    constants[363] = (constants[359]/constants[361])*constants[173]
    constants[364] = power(constants[138], 3.00000)
    constants[365] = ((constants[179]-constants[334])*constants[173]+constants[179]*constants[363])/((1.00000+constants[189])*constants[178]-constants[179])
    constants[366] = power(constants[100], 3.00000)
    constants[367] = ((constants[189]*constants[178])*constants[365])/constants[363]
    constants[368] = (1.00000-constants[354]/(constants[169]+constants[354]))*constants[365]
    constants[369] = constants[159]-0.000170000
    constants[370] = (constants[368]*constants[177])*constants[319]
    constants[371] = (constants[368]*constants[339])*constants[321]
    constants[372] = (constants[368]*constants[343])*constants[326]
    constants[373] = 1.00000-constants[367]
    constants[374] = constants[159]*(1.00000-0.460000)
    constants[375] = (1.00000-constants[350]/(constants[168]+constants[350]))*constants[363]
    constants[376] = constants[374]
    constants[377] = (constants[375]*constants[367])*constants[319]
    constants[378] = (constants[375]*constants[373])*constants[321]
    constants[379] = 3.25000*constants[161]
    constants[380] = (constants[193]*constants[192])*constants[319]
    constants[381] = (((constants[16]+constants[29])+constants[26])+constants[27])-constants[380]
    constants[382] = ((constants[16]*constants[27]+constants[29]*constants[26])+constants[26]*constants[27])-constants[380]*(constants[26]+constants[27])
    constants[383] = (constants[380]*constants[26])*constants[27]
    constants[384] = ((((-constants[383]/27.0000)*(power(constants[381], 3.00000))-(((constants[381]*constants[381])*constants[382])*constants[382])/108.000)+((constants[381]*constants[382])*constants[383])/6.00000)+(power(constants[382], 3.00000))/27.0000)+(constants[383]*constants[383])/4.00000
    constants[385] = custom_piecewise([less(constants[384] , 0.00000), power(-constants[384], 1.0/2) , True, 0.00000])
    constants[386] = (((custom_piecewise([greater(constants[384] , 0.00000), power(constants[384], 1.0/2) , True, 0.00000]))+constants[383]/2.00000)+(constants[381]*constants[382])/6.00000)-(power(constants[381], 3.00000))/27.0000
    constants[387] = arctan(constants[385]/constants[386])/3.00000
    constants[388] = power(constants[386]*constants[386]+constants[385]*constants[385], 1.00000/6.00000)
    constants[389] = (constants[382]/3.00000-(constants[381]*constants[381])/9.00000)/(constants[388]*constants[388])
    constants[390] = (constants[388]*cos(constants[387]))*(1.00000-constants[389])-constants[381]/3.00000
    constants[391] = ((constants[16]-constants[17])+constants[281])/((constants[291]/constants[20]+1.00000)*(constants[390]/constants[26]+1.00000))
    constants[392] = ((constants[281]*constants[391])*constants[390])/(constants[24]*constants[26])
    constants[393] = (constants[392]*constants[291])/constants[20]
    constants[394] = ((constants[29]-constants[30])+constants[293])/((constants[291]/constants[23]+1.00000)*(constants[390]/constants[27]+1.00000))
    constants[395] = ((constants[293]*constants[394])*constants[390])/(constants[25]*constants[27])
    constants[396] = (constants[395]*constants[291])/constants[23]
    constants[397] = 0.0269000+constants[392]/constants[17]
    constants[398] = 0.0329000+constants[395]/constants[30]
    constants[399] = (constants[194]*constants[192])*constants[326]
    constants[400] = 1.00000+(constants[118]-constants[399])/constants[117]
    constants[401] = (constants[117]/2.00000)*(power(power(constants[400], 2.00000)+(4.00000*constants[399])/constants[117], 1.0/2)-constants[400])
    constants[402] = ((constants[118]-constants[110])+constants[356])/((1.00000+constants[360]/constants[113])*(1.00000+constants[401]/constants[117]))
    constants[403] = ((constants[356]*constants[402])*constants[401])/(constants[116]*constants[117])
    constants[404] = 0.0306000+constants[403]/constants[110]
    constants[405] = (constants[403]*constants[360])/constants[113]
    constants[406] = -constants[302]/constants[307]
    constants[407] = -constants[302]/constants[307]
    constants[408] = constants[314]/constants[307]
    constants[409] = (3.00000*constants[302])/constants[314]
    return (states, constants)

def computeRates(voi, states, constants):
    rates = [0.0] * sizeStates; algebraic = [0.0] * sizeAlgebraic
    rates[7] = 0.00100000*(constants[219]*states[8]-(constants[221]*states[0])*states[7])
    rates[9] = 0.00100000*(constants[55]*states[1]-(constants[56]*states[10])*states[9])
    rates[15] = 0.00100000*(constants[55]*states[2]-(constants[56]*states[16])*states[15])
    rates[20] = 0.00100000*(constants[219]*states[21]-(constants[221]*states[22])*states[20])
    rates[23] = 0.00100000*(constants[55]*states[3]-(constants[56]*states[24])*states[23])
    rates[31] = 0.00100000*(((constants[74]*states[19])*(1.00000-states[31]))/(constants[64]+(1.00000-states[31])*1.00000)-((constants[76]*constants[66])*states[31])/(constants[65]+states[31]*1.00000))
    rates[104] = 0.00100000*(((constants[124]*states[29])*(1.00000-states[104]))/(constants[121]+(1.00000-states[104])*1.00000)-((constants[125]*constants[82])*states[104])/(constants[122]+states[104]*1.00000))
    rates[105] = 0.00100000*(((constants[128]*states[6])*(1.00000-states[105]))/(constants[126]+(1.00000-states[105])*1.00000)-((constants[129]*constants[28])*states[105])/(constants[127]+states[105]*1.00000))
    rates[115] = 0.00100000*(((constants[145]*states[6])*(1.00000-states[115]))/(constants[142]+(1.00000-states[115])*1.00000)-((constants[149]*constants[28])*states[115])/(constants[143]+states[115]*1.00000))
    rates[127] = 0.00100000*((constants[188]*states[6])*(constants[377]-states[127])-constants[244]*states[127])
    rates[128] = 0.00100000*((constants[188]*states[19])*(constants[378]-states[128])-constants[244]*states[128])
    rates[129] = 0.00100000*((constants[188]*states[6])*(constants[370]-states[129])-constants[244]*states[129])
    rates[130] = 0.00100000*((constants[188]*states[19])*(constants[371]-states[130])-constants[244]*states[130])
    rates[131] = 0.00100000*((constants[188]*states[29])*(constants[372]-states[131])-constants[244]*states[131])
    rates[132] = 0.00100000*(constants[201]*states[133]-(constants[248]*states[132])*states[6])
    rates[133] = 0.00100000*(((constants[200]*states[134])*states[43]-(constants[247]+constants[201])*states[133])+(constants[248]*states[132])*states[6])
    rates[6] = 0.00100000*(((constants[201]*states[133]-(constants[248]*states[132])*states[6])+constants[264]*states[135])-(constants[195]*(constants[344]-states[135]))*states[6])
    rates[135] = 0.00100000*((constants[195]*(constants[344]-states[135]))*states[6]-constants[264]*states[135])
    rates[136] = 0.00100000*(constants[251]*states[137]-(constants[267]*states[136])*states[19])
    rates[137] = 0.00100000*(((constants[250]*states[138])*states[44]-(constants[266]+constants[251])*states[137])+(constants[267]*states[136])*states[19])
    rates[19] = 0.00100000*(((constants[251]*states[137]-(constants[267]*states[136])*states[19])+constants[264]*states[139])-(constants[195]*(constants[355]-states[139]))*states[19])
    rates[139] = 0.00100000*((constants[195]*(constants[355]-states[139]))*states[19]-constants[264]*states[139])
    rates[140] = 0.00100000*(constants[270]*states[141]-(constants[278]*states[140])*states[29])
    rates[141] = 0.00100000*(((constants[269]*states[142])*states[45]-(constants[277]+constants[270])*states[141])+(constants[278]*states[140])*states[29])
    rates[29] = 0.00100000*(((constants[270]*states[141]-(constants[278]*states[140])*states[29])+constants[264]*states[143])-(constants[195]*(constants[351]-states[143]))*states[29])
    rates[143] = 0.00100000*((constants[195]*(constants[351]-states[143]))*states[29]-constants[264]*states[143])
    algebraic[3] = constants[393]-states[4]
    rates[4] = 0.00100000*(((constants[31]*states[6])*algebraic[3])/(constants[18]+algebraic[3])-((constants[33]*constants[28])*states[4])/(constants[21]+states[4]))
    algebraic[4] = constants[396]-states[5]
    rates[5] = 0.00100000*(((constants[32]*states[6])*algebraic[4])/(constants[19]+algebraic[4])-((constants[34]*constants[28])*states[5])/(constants[22]+states[5]))
    algebraic[15] = constants[405]-states[103]
    rates[103] = 0.00100000*(((constants[119]*states[29])*algebraic[15])/(constants[114]+algebraic[15])-((constants[120]*constants[82])*states[103])/(constants[115]+states[103]))
    algebraic[25] = 1.00000/(1.00000+exp((states[50]+91.0000)/6.10000))
    rates[116] = (algebraic[25]-states[116])/constants[150]
    algebraic[29] = constants[255]-states[144]
    rates[144] = 0.00100000*(((constants[211]*states[19])*algebraic[29])/(constants[207]+algebraic[29])-((constants[210]*constants[66])*states[144])/(constants[206]+states[144]))
    algebraic[33] = (constants[322]-states[12])-states[11]
    rates[12] = 0.00100000*((constants[220]*states[6])*algebraic[33]-constants[257]*states[12])
    algebraic[35] = (constants[325]-states[18])-states[17]
    rates[18] = 0.00100000*((constants[220]*states[19])*algebraic[35]-constants[257]*states[18])
    algebraic[36] = (constants[330]-states[26])-states[25]
    rates[26] = 0.00100000*((constants[220]*states[29])*algebraic[36]-constants[257]*states[26])
    algebraic[11] = 0.0250000/(1.00000+exp((states[50]+58.0000)/5.00000))
    algebraic[39] = 0.200000/(1.00000+exp((states[50]+19.0000)/-9.00000))
    rates[67] = (algebraic[11]/(algebraic[11]+algebraic[39])-states[67])/constants[109]
    algebraic[12] = 1.00000/((0.000600000*(states[50]-1.73840))/(1.00000-exp(-0.136000*(states[50]-1.73840)))-(0.000300000*(states[50]+38.3608))/(1.00000-exp(0.152200*(states[50]+38.3608))))
    algebraic[40] = 1.00000/(1.00000+exp((states[50]+10.0850)/-4.25000))
    rates[68] = (algebraic[40]-states[68])/algebraic[12]
    algebraic[13] = 0.00739900/(1.00000+exp((constants[263]*(states[50]-0.0311960))/-0.800190))
    algebraic[41] = 0.00569920/(1.00000+exp((constants[263]*(states[50]-0.0415200))/1.34890))
    rates[73] = algebraic[41]*states[80]-states[73]*(4.00000*algebraic[13])
    algebraic[14] = 0.00994150/(1.00000+exp((constants[263]*(states[50]-0.0448090))/-0.581720))
    algebraic[42] = 0.00332010/(1.00000+exp((constants[263]*(states[50]-0.0942170))/0.953640))
    rates[88] = algebraic[42]*states[95]-states[88]*(4.00000*algebraic[14])
    algebraic[16] = custom_piecewise([greater_equal(states[50]+constants[130] , -40.0000), 0.00000 , True, 0.135000*exp(((87.0000+states[50])+constants[130])/-6.80000)])
    algebraic[43] = custom_piecewise([greater_equal(states[50]+constants[130] , -40.0000), 1.00000/(0.130000*(1.00000+exp(((states[50]+constants[130])+27.4034)/-11.1000))) , True, 3.56000*exp(0.0790000*((states[50]+constants[130])+7.00000))+310000.*exp(0.350000*((states[50]+constants[130])+7.00000))])
    rates[106] = algebraic[16]*(1.00000-states[106])-algebraic[43]*states[106]
    algebraic[17] = custom_piecewise([greater_equal(states[50]+constants[130] , -40.0000), 0.00000 , True, ((-127140.*exp(0.244400*(states[50]+constants[130]))+-6.94800e-05*exp(-0.0439100*(states[50]+constants[130])))*((states[50]+constants[130])+37.7800))/(1.00000+exp(0.311000*((states[50]+constants[130])+79.2300)))])
    algebraic[44] = custom_piecewise([greater_equal(states[50]+constants[130] , -40.0000), (0.300000*exp(-2.53500e-07*(states[50]+constants[130])))/(1.00000+exp(-0.100000*((states[50]+constants[130])+32.0000))) , True, (0.121200*exp(-0.0105200*(states[50]+constants[130])))/(1.00000+exp(-0.137800*((states[50]+constants[130])+40.1400)))])
    rates[107] = algebraic[17]*(1.00000-states[107])-algebraic[44]*states[107]
    algebraic[18] = (0.320000*(states[50]+58.4729))/(1.00000-exp(-0.100000*(states[50]+58.4729)))
    algebraic[45] = 0.0800000*exp((13.7299-states[50])/11.0000)
    rates[108] = algebraic[18]*(1.00000-states[108])-algebraic[45]*states[108]
    algebraic[19] = custom_piecewise([greater_equal(states[50] , -40.0000), 0.00000 , True, 0.135000*exp((87.0000+states[50])/-6.80000)])
    algebraic[46] = custom_piecewise([greater_equal(states[50] , -40.0000), 1.00000/(0.130000*(1.00000+exp((states[50]+27.4034)/-11.1000))) , True, 3.56000*exp(0.0790000*(states[50]+7.00000))+310000.*exp(0.350000*(states[50]+7.00000))])
    rates[109] = algebraic[19]*(1.00000-states[109])-algebraic[46]*states[109]
    algebraic[20] = custom_piecewise([greater_equal(states[50] , -40.0000), 0.00000 , True, ((-127140.*exp(0.244400*states[50])-6.94800e-05*exp(-0.0439100*states[50]))*(states[50]+37.7800))/(1.00000+exp(0.311000*(states[50]+79.2300)))])
    algebraic[47] = custom_piecewise([greater_equal(states[50] , -40.0000), (0.300000*exp(-2.53500e-07*states[50]))/(1.00000+exp(-0.100000*(states[50]+32.0000))) , True, (0.121200*exp(-0.0105200*states[50]))/(1.00000+exp(-0.137800*(states[50]+40.1400)))])
    rates[110] = algebraic[20]*(1.00000-states[110])-algebraic[47]*states[110]
    algebraic[21] = (0.320000*(states[50]+58.4729))/(1.00000-exp(-0.100000*(states[50]+58.4729)))
    algebraic[48] = 0.0800000*exp((13.7299-states[50])/11.0000)
    rates[111] = algebraic[21]*(1.00000-states[111])-algebraic[48]*states[111]
    algebraic[22] = custom_piecewise([greater_equal(states[50] , -40.0000), 0.00000 , True, 0.135000*exp(((87.0000+states[50])+constants[132])/-6.80000)])
    algebraic[49] = custom_piecewise([greater_equal(states[50] , -40.0000), (1.00000/0.130000)/(1.00000+exp(((states[50]+constants[132])+27.4034)/-11.1000)) , True, 3.56000*exp(0.0790000*((states[50]+constants[132])+7.00000))+310000.*exp(0.350000*((states[50]+constants[132])+7.00000))])
    rates[112] = algebraic[22]*(1.00000-states[112])-algebraic[49]*states[112]
    algebraic[23] = custom_piecewise([greater_equal(states[50] , -40.0000), 0.00000 , True, ((-127140.*exp(0.244400*(states[50]+constants[132]))-6.94800e-05*exp(-0.0439100*(states[50]+constants[132])))*((states[50]+constants[132])+37.7800))/(1.00000+exp(0.311000*((states[50]+constants[132])+79.2300)))])
    algebraic[50] = custom_piecewise([greater_equal(states[50] , -40.0000), (0.300000*exp(-2.53500e-07*(states[50]+constants[132])))/(1.00000+exp(-0.100000*((states[50]+constants[132])+32.0000))) , True, (0.121200*exp(-0.0105200*(states[50]+constants[132])))/(1.00000+exp(-0.137800*((states[50]+constants[132])+40.1400)))])
    rates[113] = algebraic[23]*(1.00000-states[113])-algebraic[50]*states[113]
    algebraic[24] = (0.320000*((states[50]+constants[131])+58.4729))/(1.00000-exp(-0.100000*((states[50]+constants[131])+58.4729)))
    algebraic[51] = 0.0800000*exp(((states[50]+constants[131])-13.7299)/-11.0000)
    rates[114] = algebraic[24]*(1.00000-states[114])-algebraic[51]*states[114]
    algebraic[26] = (0.320000*(states[50]+47.1300))/(1.00000-exp(-0.100000*(states[50]+47.1300)))
    algebraic[52] = 0.0800000*exp(states[50]/-11.0000)
    rates[117] = algebraic[26]*(1.00000-states[117])-algebraic[52]*states[117]
    algebraic[57] = (constants[323]-states[14])-states[13]
    rates[14] = 0.00100000*((constants[220]*states[6])*algebraic[57]-constants[257]*states[14])
    algebraic[60] = (constants[331]-states[28])-states[27]
    rates[28] = 0.00100000*((constants[220]*states[29])*algebraic[60]-constants[257]*states[28])
    algebraic[27] = 1.00000/(1.00000+exp((states[50]+9.43700)/-7.13300))
    algebraic[53] = 1.00000/(1.00000+exp((states[50]-18.4099)/-29.3814))
    algebraic[65] = 1.00000/(1.00000+exp((states[50]+100.000)/29.3814))
    algebraic[77] = 1.00000/(algebraic[53]/1.20890+3.50000*algebraic[65])
    rates[120] = (algebraic[27]-states[120])/algebraic[77]
    algebraic[66] = ((1.00000/(1.00000+exp((states[50]+19.0000)/-9.00000)))/0.500000)/9.79530
    algebraic[28] = 1.00000/(1.00000+exp((states[50]+58.0000)/5.00000))
    algebraic[78] = 0.0479600*algebraic[28]
    rates[121] = algebraic[78]*(1.00000-states[121])-algebraic[66]*states[121]
    algebraic[79] = 0.0214400*algebraic[28]
    rates[122] = algebraic[79]*(1.00000-states[122])-algebraic[66]*states[122]
    algebraic[54] = (1.00000/(1.00000+exp((states[50]+60.0000)/5.00000)))/250.000
    algebraic[80] = 2.46000*algebraic[54]
    rates[123] = algebraic[80]*(1.00000-states[123])-algebraic[66]*states[123]
    algebraic[81] = 0.560340*algebraic[54]
    rates[124] = algebraic[81]*(1.00000-states[124])-algebraic[66]*states[124]
    algebraic[63] = 0.0906540*exp((-0.111570*states[50])*constants[263])
    algebraic[91] = 0.388390/(1.00000+exp((constants[263]*(states[50]+0.150190))/-0.606930))
    rates[74] = (algebraic[41]*states[75]+algebraic[91]*states[85])-states[74]*(2.00000*algebraic[13]+2.00000*algebraic[63])
    rates[75] = ((((2.00000*algebraic[13])*states[74]+(2.00000*algebraic[41])*states[76])+(2.00000*algebraic[91])*states[86])+(3.00000*algebraic[63])*states[77])-states[75]*(((algebraic[13]+algebraic[41])+algebraic[91])+2.00000*algebraic[63])
    rates[76] = ((algebraic[13]*states[75]+(3.00000*algebraic[91])*states[87])+(3.00000*algebraic[63])*states[78])-states[76]*((2.00000*algebraic[41]+2.00000*algebraic[91])+2.00000*algebraic[63])
    rates[77] = (algebraic[41]*states[78]+algebraic[91]*states[75])-states[77]*(algebraic[13]+3.00000*algebraic[63])
    rates[78] = ((algebraic[13]*states[77]+(2.00000*algebraic[91])*states[76])+(4.00000*algebraic[63])*states[79])-states[78]*((algebraic[41]+algebraic[91])+3.00000*algebraic[63])
    algebraic[75] = 0.00311240+(0.0283300-0.00311240)/(1.00000+exp((constants[263]*(states[50]+0.0516600))/1.55220))
    rates[79] = (algebraic[91]*states[78]-states[79]*(4.00000*algebraic[63]+constants[111]))+algebraic[75]*states[69]
    rates[80] = (((4.00000*algebraic[13])*states[73]+(2.00000*algebraic[41])*states[81])+algebraic[63]*states[84])-states[80]*((3.00000*algebraic[13]+algebraic[41])+algebraic[91])
    rates[81] = (((3.00000*algebraic[13])*states[80]+(3.00000*algebraic[41])*states[82])+algebraic[63]*states[85])-states[81]*((2.00000*algebraic[13]+2.00000*algebraic[41])+2.00000*algebraic[91])
    rates[82] = (((2.00000*algebraic[13])*states[81]+(4.00000*algebraic[41])*states[83])+algebraic[63]*states[86])-states[82]*((algebraic[13]+3.00000*algebraic[41])+3.00000*algebraic[91])
    rates[83] = (algebraic[13]*states[82]+algebraic[63]*states[87])-states[83]*(4.00000*algebraic[41]+4.00000*algebraic[91])
    rates[84] = (algebraic[41]*states[85]+algebraic[91]*states[80])-states[84]*(3.00000*algebraic[13]+algebraic[63])
    rates[85] = ((((3.00000*algebraic[13])*states[84]+(2.00000*algebraic[41])*states[86])+(2.00000*algebraic[91])*states[81])+(2.00000*algebraic[63])*states[74])-states[85]*(((2.00000*algebraic[13]+algebraic[41])+algebraic[91])+algebraic[63])
    rates[86] = ((((2.00000*algebraic[13])*states[85]+(3.00000*algebraic[41])*states[87])+(3.00000*algebraic[91])*states[82])+(2.00000*algebraic[63])*states[75])-states[86]*(((algebraic[13]+2.00000*algebraic[41])+2.00000*algebraic[91])+algebraic[63])
    rates[87] = ((algebraic[13]*states[86]+(4.00000*algebraic[91])*states[83])+(2.00000*algebraic[63])*states[76])-states[87]*((3.00000*algebraic[41]+3.00000*algebraic[91])+algebraic[63])
    algebraic[64] = 0.0657000*exp((-0.118990*states[50])*constants[263])
    algebraic[93] = 0.563560/(1.00000+exp((constants[263]*(states[50]+0.179860))/-0.583810))
    rates[89] = (algebraic[42]*states[90]+algebraic[93]*states[100])-states[89]*(2.00000*algebraic[14]+2.00000*algebraic[64])
    rates[90] = ((((2.00000*algebraic[14])*states[89]+(2.00000*algebraic[42])*states[91])+(2.00000*algebraic[93])*states[101])+(3.00000*algebraic[64])*states[92])-states[90]*(((algebraic[14]+algebraic[42])+algebraic[93])+2.00000*algebraic[64])
    rates[91] = ((algebraic[14]*states[90]+(3.00000*algebraic[93])*states[102])+(3.00000*algebraic[64])*states[93])-states[91]*((2.00000*algebraic[42]+2.00000*algebraic[93])+2.00000*algebraic[64])
    rates[92] = (algebraic[42]*states[93]+algebraic[93]*states[90])-states[92]*(algebraic[14]+3.00000*algebraic[64])
    rates[93] = ((algebraic[14]*states[92]+(2.00000*algebraic[93])*states[91])+(4.00000*algebraic[64])*states[94])-states[93]*((algebraic[42]+algebraic[93])+3.00000*algebraic[64])
    algebraic[76] = 0.000385250+(0.0124060-0.000385250)/(1.00000+exp((constants[263]*(states[50]+0.0641180))/0.779920))
    rates[94] = (algebraic[93]*states[93]-states[94]*(4.00000*algebraic[64]+constants[112]))+algebraic[76]*states[71]
    rates[95] = (((4.00000*algebraic[14])*states[88]+(2.00000*algebraic[42])*states[96])+algebraic[64]*states[99])-states[95]*((3.00000*algebraic[14]+algebraic[42])+algebraic[93])
    rates[96] = (((3.00000*algebraic[14])*states[95]+(3.00000*algebraic[42])*states[97])+algebraic[64]*states[100])-states[96]*((2.00000*algebraic[14]+2.00000*algebraic[42])+2.00000*algebraic[93])
    rates[97] = (((2.00000*algebraic[14])*states[96]+(4.00000*algebraic[42])*states[98])+algebraic[64]*states[101])-states[97]*((algebraic[14]+3.00000*algebraic[42])+3.00000*algebraic[93])
    rates[98] = (algebraic[14]*states[97]+algebraic[64]*states[102])-states[98]*(4.00000*algebraic[42]+4.00000*algebraic[93])
    rates[99] = (algebraic[42]*states[100]+algebraic[93]*states[95])-states[99]*(3.00000*algebraic[14]+algebraic[64])
    rates[100] = ((((3.00000*algebraic[14])*states[99]+(2.00000*algebraic[42])*states[101])+(2.00000*algebraic[93])*states[96])+(2.00000*algebraic[64])*states[89])-states[100]*(((2.00000*algebraic[14]+algebraic[42])+algebraic[93])+algebraic[64])
    rates[101] = ((((2.00000*algebraic[14])*states[100]+(3.00000*algebraic[42])*states[102])+(3.00000*algebraic[93])*states[97])+(2.00000*algebraic[64])*states[90])-states[101]*(((algebraic[14]+2.00000*algebraic[42])+2.00000*algebraic[93])+algebraic[64])
    rates[102] = ((algebraic[14]*states[101]+(4.00000*algebraic[93])*states[98])+(2.00000*algebraic[64])*states[91])-states[102]*((3.00000*algebraic[42]+3.00000*algebraic[93])+algebraic[64])
    algebraic[92] = 0.000441980*exp((-1.20220*states[50])*constants[263])
    algebraic[103] = 0.000401730*exp((0.000208730*states[50])*constants[263])
    rates[69] = (-(algebraic[75]+algebraic[103])*states[69]+algebraic[92]*states[70])+constants[111]*states[79]
    rates[70] = algebraic[103]*states[69]-algebraic[92]*states[70]
    algebraic[94] = 0.000237300*exp((-1.97420*states[50])*constants[263])
    algebraic[104] = 0.000226520*exp((0.000246890*states[50])*constants[263])
    rates[71] = (-(algebraic[76]+algebraic[104])*states[71]+algebraic[94]*states[72])+constants[112]*states[94]
    rates[72] = algebraic[104]*states[71]-algebraic[94]*states[72]
    algebraic[5] = ((constants[36]*constants[35])*constants[319]-states[8])-states[7]
    algebraic[34] = (algebraic[5]*(constants[59]+constants[51])-states[14]*(constants[51]+constants[59]))+(constants[49]*constants[51])*(1.00000+constants[59]/constants[54])
    algebraic[58] = (-states[14]*constants[49])*constants[51]
    algebraic[70] = (-algebraic[34]+power(algebraic[34]*algebraic[34]-(4.00000*constants[222])*algebraic[58], 1.0/2))/(2.00000*constants[222])
    algebraic[86] = algebraic[5]/(1.00000+(algebraic[70]/constants[49])*(1.00000+constants[59]/constants[51]))
    algebraic[98] = (algebraic[70]*algebraic[86])/constants[49]
    algebraic[108] = (algebraic[98]*constants[59])/constants[51]
    rates[8] = 0.00100000*((constants[44]*algebraic[98]+constants[42]*algebraic[108])-constants[219]*states[8])
    rates[0] = 0.00100000*((constants[44]*algebraic[98]+constants[42]*algebraic[108])-(constants[221]*states[0])*states[7])
    algebraic[8] = ((constants[215]*constants[35])*constants[326]-states[21])-states[20]
    algebraic[37] = (algebraic[8]*(constants[59]+constants[51])-states[28]*(constants[51]+constants[59]))+(constants[49]*constants[51])*(1.00000+constants[59]/constants[54])
    algebraic[61] = (-states[28]*constants[49])*constants[51]
    algebraic[73] = (-algebraic[37]+power(algebraic[37]*algebraic[37]-(4.00000*constants[225])*algebraic[61], 1.0/2))/(2.00000*constants[225])
    algebraic[89] = algebraic[8]/(1.00000+(algebraic[73]/constants[49])*(1.00000+constants[59]/constants[51]))
    algebraic[101] = (algebraic[73]*algebraic[89])/constants[49]
    algebraic[111] = (constants[59]/constants[51])*algebraic[101]
    rates[21] = 0.00100000*((constants[44]*algebraic[101]+constants[42]*algebraic[111])-constants[219]*states[21])
    rates[22] = 0.00100000*((constants[44]*algebraic[101]+constants[42]*algebraic[111])-(constants[221]*states[22])*states[20])
    algebraic[7] = ((constants[216]*constants[295])*constants[321]-states[2])-states[15]
    algebraic[59] = (algebraic[7]*(constants[47]+constants[59])-algebraic[35]*(constants[47]+constants[59]))+(constants[46]*constants[47])*(1.00000+constants[59]/constants[48])
    algebraic[71] = (-algebraic[35]*constants[47])*constants[46]
    algebraic[87] = (-algebraic[59]+power(algebraic[59]*algebraic[59]-(4.00000*constants[224])*algebraic[71], 1.0/2))/(2.00000*constants[224])
    algebraic[99] = algebraic[7]/(1.00000+(algebraic[87]/constants[46])*(1.00000+constants[59]/constants[47]))
    algebraic[110] = ((constants[59]*algebraic[87])*algebraic[99])/(constants[46]*constants[47])
    algebraic[119] = (algebraic[99]*algebraic[87])/constants[46]
    rates[2] = 0.00100000*((constants[45]*algebraic[119]+constants[43]*algebraic[110])-constants[55]*states[2])
    rates[16] = 0.00100000*((constants[45]*algebraic[119]+constants[43]*algebraic[110])-(constants[56]*states[16])*states[15])
    algebraic[118] = (constants[59]*algebraic[87])/constants[48]
    rates[17] = 0.00100000*((constants[218]*constants[61])*(algebraic[118]+algebraic[110])-constants[217]*states[17])
    algebraic[130] = ((constants[399]-states[142])-states[141])-states[140]
    rates[142] = 0.00100000*((((constants[268]*algebraic[130])*states[45]-constants[276]*states[142])-(constants[269]*states[142])*states[45])+constants[277]*states[141])
    algebraic[1] = power(states[3]*1.00000, constants[12])
    algebraic[31] = constants[6]*(constants[8]+algebraic[1]/(constants[3]+algebraic[1]))
    algebraic[67] = (algebraic[31]*constants[329])*constants[227]
    algebraic[83] = (constants[236]*(states[43]-states[45]))/constants[309]
    algebraic[96] = (constants[237]*(states[45]-states[44]))/constants[309]
    algebraic[107] = (constants[349]*constants[185])/(1.00000+constants[170]/states[45])
    algebraic[116] = ((constants[372]+(constants[174]-1.00000)*states[131])*constants[187])/(1.00000+constants[172]/states[45])
    algebraic[124] = algebraic[107]+algebraic[116]
    algebraic[134] = (((-constants[268]*algebraic[130])*states[45]+constants[276]*states[142])-(constants[269]*states[142])*states[45])+constants[277]*states[141]
    rates[45] = 0.00100000*((((algebraic[134]+algebraic[67])-algebraic[124])+algebraic[83])-algebraic[96])
    algebraic[140] = ((constants[380]-states[134])-states[133])-states[132]
    rates[134] = 0.00100000*((((constants[199]*algebraic[140])*states[43]-constants[246]*states[134])-(constants[200]*states[134])*states[43])+constants[247]*states[133])
    algebraic[2] = power(states[1]*1.00000, constants[13])
    algebraic[32] = power(states[1]*1.00000, constants[14])
    algebraic[56] = (constants[7]*(constants[9]+algebraic[2]/(constants[4]+algebraic[2])))*(1.00000-((1.00000-(constants[15]*algebraic[32])/(constants[5]+algebraic[32]))*states[0])/(constants[2]+states[0]))
    algebraic[82] = (algebraic[56]*constants[320])*constants[227]
    algebraic[95] = (constants[236]*(states[43]-states[45]))/constants[306]
    algebraic[105] = (constants[235]*(states[43]-states[44]))/constants[306]
    algebraic[114] = (constants[347]*constants[185])/(1.00000+constants[170]/states[43])
    algebraic[122] = ((constants[377]+(constants[174]-1.00000)*states[127])*constants[186])/(1.00000+constants[171]/states[43])
    algebraic[128] = ((constants[370]+(constants[174]-1.00000)*states[129])*constants[187])/(1.00000+constants[172]/states[43])
    algebraic[135] = (algebraic[114]+algebraic[122])+algebraic[128]
    algebraic[145] = (((-constants[199]*algebraic[140])*states[43]+constants[246]*states[134])-(constants[200]*states[134])*states[43])+constants[247]*states[133]
    rates[43] = 0.00100000*((((algebraic[145]+algebraic[82])-algebraic[135])-algebraic[95])-algebraic[105])
    algebraic[150] = ((constants[335]-states[138])-states[137])-states[136]
    rates[138] = 0.00100000*((((constants[249]*algebraic[150])*states[44]-constants[265]*states[138])-(constants[250]*states[138])*states[44])+constants[266]*states[137])
    algebraic[0] = power(states[2]*1.00000, constants[12])
    algebraic[55] = constants[6]*(constants[8]+algebraic[0]/(constants[3]+algebraic[0]))
    algebraic[68] = (algebraic[55]*constants[324])*constants[227]
    algebraic[30] = power(states[2]*1.00000, constants[13])
    algebraic[84] = constants[7]*(constants[9]+algebraic[30]/(constants[4]+algebraic[30]))
    algebraic[106] = (algebraic[84]*constants[328])*constants[227]
    algebraic[115] = (constants[235]*(states[43]-states[44]))/constants[307]
    algebraic[123] = (constants[237]*(states[45]-states[44]))/constants[307]
    algebraic[129] = (constants[348]*constants[185])/(1.00000+constants[170]/states[44])
    algebraic[136] = ((constants[378]+(constants[174]-1.00000)*states[128])*constants[186])/(1.00000+constants[171]/states[44])
    algebraic[141] = ((constants[371]+(constants[174]-1.00000)*states[130])*constants[187])/(1.00000+constants[172]/states[44])
    algebraic[146] = (algebraic[129]+algebraic[136])+algebraic[141]
    algebraic[154] = (((-constants[249]*algebraic[150])*states[44]+constants[265]*states[138])-(constants[250]*states[138])*states[44])+constants[266]*states[137]
    rates[44] = 0.00100000*(((((algebraic[154]+algebraic[68])+algebraic[106])-algebraic[146])+algebraic[115])+algebraic[123])
    algebraic[6] = ((constants[37]*constants[295])*constants[319]-states[1])-states[9]
    algebraic[69] = (((constants[258]+constants[271])/constants[223]+algebraic[33])+algebraic[57])-algebraic[6]
    algebraic[85] = ((constants[271]*(algebraic[33]-algebraic[6])+constants[258]*(algebraic[57]-algebraic[6]))+constants[279])/constants[223]
    algebraic[97] = (algebraic[6]*constants[279])/constants[223]
    algebraic[109] = ((((-algebraic[97]/27.0000)*(power(algebraic[69], 3.00000))-(((algebraic[69]*algebraic[69])*algebraic[85])*algebraic[85])/108.000)+((algebraic[69]*algebraic[85])*algebraic[97])/6.00000)+(power(algebraic[85], 3.00000))/27.0000)+(algebraic[97]*algebraic[97])/4.00000
    algebraic[117] = custom_piecewise([less(algebraic[109] , 0.00000), power(-algebraic[109], 1.0/2) , True, 0.00000])
    algebraic[125] = (((custom_piecewise([greater(algebraic[109] , 0.00000), power(algebraic[109], 1.0/2) , True, 0.00000]))+algebraic[97]/2.00000)+(algebraic[69]*algebraic[85])/6.00000)-(power(algebraic[69], 3.00000))/27.0000
    algebraic[131] = arctan(algebraic[117]/algebraic[125])/3.00000
    algebraic[137] = power(algebraic[125]*algebraic[125]+algebraic[117]*algebraic[117], 1.00000/6.00000)
    algebraic[142] = (algebraic[85]/3.00000-(algebraic[69]*algebraic[69])/9.00000)/(algebraic[137]*algebraic[137])
    algebraic[147] = (algebraic[137]*sin(algebraic[131]))*(1.00000+algebraic[142])
    algebraic[151] = (algebraic[137]*cos(algebraic[131]))*(1.00000-algebraic[142])-algebraic[69]/3.00000
    algebraic[156] = power(algebraic[151]*algebraic[151]+algebraic[147]*algebraic[147], 1.0/2)
    algebraic[160] = algebraic[33]/((1.00000+constants[59]/constants[48])+(algebraic[156]*(constants[47]+constants[59]))/(constants[46]*constants[47]))
    algebraic[164] = (constants[59]*algebraic[160])/constants[48]
    algebraic[168] = ((constants[59]*algebraic[160])*algebraic[156])/(constants[46]*constants[47])
    rates[11] = 0.00100000*((constants[218]*constants[58])*(algebraic[164]+algebraic[168])-constants[217]*states[11])
    algebraic[9] = ((constants[38]*constants[295])*constants[326]-states[3])-states[23]
    algebraic[72] = (((constants[259]+constants[272])/constants[226]+algebraic[36])+algebraic[60])-algebraic[9]
    algebraic[88] = ((constants[272]*(algebraic[36]-algebraic[9])+constants[259]*(algebraic[60]-algebraic[9]))+constants[280])/constants[226]
    algebraic[100] = (algebraic[9]*constants[280])/constants[226]
    algebraic[112] = ((((-algebraic[100]/27.0000)*(power(algebraic[72], 3.00000))-(((algebraic[72]*algebraic[72])*algebraic[88])*algebraic[88])/108.000)+((algebraic[72]*algebraic[88])*algebraic[100])/6.00000)+(power(algebraic[88], 3.00000))/27.0000)+(algebraic[100]*algebraic[100])/4.00000
    algebraic[120] = custom_piecewise([less(algebraic[112] , 0.00000), power(-algebraic[112], 1.0/2) , True, 0.00000])
    algebraic[126] = (((custom_piecewise([greater(algebraic[112] , 0.00000), power(algebraic[112], 1.0/2) , True, 0.00000]))+algebraic[100]/2.00000)+(algebraic[72]*algebraic[88])/6.00000)-(power(algebraic[72], 3.00000))/27.0000
    algebraic[132] = arctan(algebraic[120]/algebraic[126])/3.00000
    algebraic[138] = power(algebraic[126]*algebraic[126]+algebraic[120]*algebraic[120], 1.00000/6.00000)
    algebraic[143] = (algebraic[88]/3.00000-(algebraic[72]*algebraic[72])/9.00000)/(algebraic[138]*algebraic[138])
    algebraic[148] = (algebraic[138]*sin(algebraic[132]))*(1.00000+algebraic[143])
    algebraic[152] = (algebraic[138]*cos(algebraic[132]))*(1.00000-algebraic[143])-algebraic[72]/3.00000
    algebraic[157] = power(algebraic[152]*algebraic[152]+algebraic[148]*algebraic[148], 1.0/2)
    algebraic[161] = algebraic[36]/((1.00000+constants[59]/constants[48])+(algebraic[157]*(constants[47]+constants[59]))/(constants[46]*constants[47]))
    algebraic[165] = (constants[59]*algebraic[161])/constants[48]
    algebraic[169] = ((constants[59]*algebraic[161])*algebraic[157])/(constants[46]*constants[47])
    rates[25] = 0.00100000*((constants[218]*constants[62])*(algebraic[165]+algebraic[169])-constants[217]*states[25])
    algebraic[176] = algebraic[57]/((1.00000+constants[59]/constants[53])+(algebraic[156]*(constants[52]+constants[59]))/(constants[50]*constants[52]))
    algebraic[180] = (constants[59]*algebraic[176])/constants[53]
    algebraic[184] = ((constants[59]*algebraic[176])*algebraic[156])/(constants[50]*constants[52])
    rates[13] = 0.00100000*((constants[218]*constants[58])*(algebraic[180]+algebraic[184])-constants[217]*states[13])
    algebraic[177] = algebraic[60]/((1.00000+constants[59]/constants[53])+(algebraic[157]*(constants[52]+constants[59]))/(constants[50]*constants[52]))
    algebraic[181] = (constants[59]*algebraic[177])/constants[53]
    algebraic[185] = ((constants[59]*algebraic[177])*algebraic[157])/(constants[50]*constants[52])
    rates[27] = 0.00100000*((constants[218]*constants[62])*(algebraic[181]+algebraic[185])-constants[217]*states[27])
    algebraic[188] = algebraic[168]+constants[60]*algebraic[184]
    algebraic[172] = (algebraic[160]*algebraic[156])/constants[46]
    algebraic[192] = (algebraic[176]*algebraic[156])/constants[50]
    algebraic[196] = algebraic[172]+constants[60]*algebraic[192]
    rates[1] = 0.00100000*((constants[45]*algebraic[196]+constants[43]*algebraic[188])-constants[55]*states[1])
    rates[10] = 0.00100000*((constants[45]*algebraic[196]+constants[43]*algebraic[188])-(constants[56]*states[10])*states[9])
    algebraic[189] = algebraic[169]+constants[63]*algebraic[185]
    algebraic[173] = (algebraic[161]*algebraic[157])/constants[46]
    algebraic[193] = (algebraic[177]*algebraic[157])/constants[50]
    algebraic[197] = algebraic[173]+constants[63]*algebraic[193]
    rates[3] = 0.00100000*((constants[45]*algebraic[197]+constants[43]*algebraic[189])-constants[55]*states[3])
    rates[24] = 0.00100000*((constants[45]*algebraic[197]+constants[43]*algebraic[189])-(constants[56]*states[24])*states[23])
    algebraic[133] = constants[274]-states[35]
    algebraic[139] = constants[262]-states[35]*constants[261]
    algebraic[144] = -constants[230]*states[35]
    algebraic[149] = -algebraic[133]/3.00000+((2.00000/3.00000)*(power(algebraic[133]*algebraic[133]-3.00000*algebraic[139], 1.0/2)))*cos(arccos((((9.00000*algebraic[133])*algebraic[139]-((2.00000*algebraic[133])*algebraic[133])*algebraic[133])-27.0000*algebraic[144])/(2.00000*(power(algebraic[133]*algebraic[133]-3.00000*algebraic[139], 1.50000))))/3.00000)
    algebraic[190] = (constants[79]*(1.00000-states[42]))/(1.00000+constants[81]/algebraic[149])
    algebraic[194] = algebraic[190]+states[42]
    algebraic[199] = algebraic[194]/(algebraic[194]+constants[80])
    rates[36] = (algebraic[199]-states[36])/constants[231]
    rates[37] = (algebraic[199]-states[37])/constants[232]
    rates[38] = (algebraic[199]-states[38])/constants[233]
    rates[39] = (algebraic[199]-states[39])/constants[234]
    rates[40] = (algebraic[199]-states[40])/constants[85]
    algebraic[200] = 1.00000/(1.00000+power(constants[80]/algebraic[194], 2.00000))
    rates[41] = (algebraic[200]-states[41])/constants[86]
    algebraic[198] = (constants[205]-constants[208])+states[144]
    algebraic[203] = 0.500000*(power(power(algebraic[198], 2.00000)+(4.00000*constants[205])*constants[208], 1.0/2)-algebraic[198])
    rates[125] = 0.00100000*(((constants[162]*states[19])*(1.00000-states[125]))/(constants[158]+(1.00000-states[125])*1.00000)-((constants[163]*algebraic[203])*states[125])/(constants[160]+states[125]*1.00000))
    algebraic[206] = (constants[28]/constants[319]+constants[82]/constants[326])+algebraic[203]/constants[321]
    rates[42] = (constants[83]*algebraic[190])*algebraic[194]-(constants[84]*states[42])*(0.100000+(0.900000*algebraic[206])/0.137100)
    algebraic[155] = 1.00000/((1.00000+exp((4.79800+states[50])/-7.56990))*(1.00000+exp((25.0000+states[50])/-5.00000)))
    algebraic[195] = 0.590000+(0.800000*exp(0.0520000*(states[50]+13.0000)))/(1.00000+exp(0.132000*(states[50]+13.0000)))
    algebraic[202] = algebraic[155]/algebraic[195]
    algebraic[205] = (1.00000-algebraic[155])/algebraic[195]
    algebraic[179] = 1.00000+power(0.00200000/algebraic[149], 4.00000)
    algebraic[183] = 6.00000/algebraic[179]
    algebraic[163] = 1.00000/(1.00000+exp((29.9790+states[50])/3.17750))
    algebraic[171] = (0.100000+algebraic[163])/1.10000
    algebraic[214] = 1.00000/((70.0000*(1.00000-0.500000*states[36]))*(1.00000+exp((states[50]+49.1000)/10.3490)))
    algebraic[216] = 1.00000/(1.00000+exp((states[50]+0.213000)/-10.8070))
    algebraic[221] = 1.00000/(algebraic[214]+algebraic[216]/38.4940)
    algebraic[224] = algebraic[171]/algebraic[221]
    algebraic[233] = (1.00000-algebraic[171])/algebraic[221]
    rates[51] = ((-((algebraic[202]+algebraic[183])+algebraic[233])*states[51]+algebraic[205]*states[55])+constants[102]*states[54])+algebraic[224]*states[52]
    rates[55] = ((-((algebraic[205]+algebraic[183])+algebraic[233])*states[55]+algebraic[202]*states[51])+constants[102]*states[58])+algebraic[224]*states[56]
    algebraic[167] = (0.000100000+algebraic[163])/1.00010
    algebraic[159] = 0.100000*states[36]
    algebraic[175] = 1.00000+power(0.0100000/algebraic[149], 10.0000)
    algebraic[187] = (32.5000-(18.0000-algebraic[159])/algebraic[179])-10.0000/algebraic[175]
    algebraic[218] = 1.00000/(algebraic[214]+algebraic[216]/algebraic[187])
    algebraic[227] = algebraic[167]/algebraic[218]
    algebraic[239] = (1.00000-algebraic[167])/algebraic[218]
    rates[54] = ((-((algebraic[202]+constants[102])+algebraic[239])*states[54]+algebraic[183]*states[51])+algebraic[205]*states[58])+algebraic[227]*states[53]
    rates[58] = ((-((algebraic[205]+constants[102])+algebraic[239])*states[58]+algebraic[183]*states[55])+algebraic[202]*states[54])+algebraic[227]*states[57]
    algebraic[230] = custom_piecewise([less(fabs(algebraic[227]) , 1.00000e-12), 1.00000e-12 , True, algebraic[227]])
    algebraic[236] = custom_piecewise([less(fabs(algebraic[233]) , 1.00000e-12), 1.00000e-12 , True, algebraic[233]])
    algebraic[242] = (constants[103]*((algebraic[224]*algebraic[239])*algebraic[183]))/((algebraic[236]*algebraic[230])*constants[102])
    rates[52] = ((-((algebraic[202]+algebraic[242])+algebraic[224])*states[52]+algebraic[233]*states[51])+constants[103]*states[53])+algebraic[205]*states[56]
    rates[53] = ((-((algebraic[202]+constants[103])+algebraic[227])*states[53]+algebraic[239]*states[54])+algebraic[242]*states[52])+algebraic[205]*states[57]
    rates[56] = ((-((algebraic[205]+algebraic[242])+algebraic[224])*states[56]+algebraic[233]*states[55])+constants[103]*states[57])+algebraic[202]*states[52]
    rates[57] = ((-((algebraic[205]+constants[103])+algebraic[227])*states[57]+algebraic[239]*states[58])+algebraic[242]*states[56])+algebraic[202]*states[53]
    algebraic[62] = constants[274]-states[33]
    algebraic[74] = constants[262]-states[33]*constants[261]
    algebraic[90] = -constants[230]*states[33]
    algebraic[102] = -algebraic[62]/3.00000+((2.00000/3.00000)*(power(algebraic[62]*algebraic[62]-3.00000*algebraic[74], 1.0/2)))*cos(arccos((((9.00000*algebraic[62])*algebraic[74]-((2.00000*algebraic[62])*algebraic[62])*algebraic[62])-27.0000*algebraic[90])/(2.00000*(power(algebraic[62]*algebraic[62]-3.00000*algebraic[74], 1.50000))))/3.00000)
    algebraic[209] = (algebraic[149]-algebraic[102])/constants[95]
    algebraic[10] = (states[4]+constants[392])/constants[17]
    algebraic[220] = (algebraic[10]-constants[397])/(0.927300-constants[397])
    algebraic[223] = custom_piecewise([less(algebraic[220] , 0.00000), 0.00000 , True, algebraic[220]])
    algebraic[226] = 0.000257900*(1.00000+0.100000*states[36])
    algebraic[229] = exp((2.00000*states[50])*constants[263])
    algebraic[232] = ((((algebraic[226]*4.00000)*states[50])*constants[275])*(algebraic[149]*algebraic[229]-0.341000*constants[97]))/(algebraic[229]-1.00000)
    algebraic[235] = algebraic[232]*(states[55]+states[58])
    algebraic[238] = 0.000155200*(1.00000+0.400000*states[36])
    algebraic[241] = exp((2.00000*states[50])*constants[263])
    algebraic[244] = ((((algebraic[238]*4.00000)*states[50])*constants[275])*(algebraic[149]*algebraic[241]-0.341000*constants[97]))/(algebraic[241]-1.00000)
    algebraic[246] = algebraic[244]*(states[63]+states[66])
    algebraic[248] = (1.00000-algebraic[223])*algebraic[246]+algebraic[223]*algebraic[235]
    rates[33] = -constants[305]*algebraic[248]+constants[315]*algebraic[209]
    algebraic[191] = 1.00000/((1.00000+exp((13.5600-states[50])/9.45000))*(1.00000+exp((25.0000+states[50])/-5.00000)))
    algebraic[208] = algebraic[191]/algebraic[195]
    algebraic[210] = (1.00000-algebraic[191])/algebraic[195]
    algebraic[234] = 1.00000+power(0.00110000/algebraic[149], 4.00000)
    algebraic[237] = 14.9186/algebraic[234]
    algebraic[219] = 1.00000/(1.00000+exp((17.5000+states[50])/3.00000))
    algebraic[225] = (0.247400+algebraic[219])/1.24740
    algebraic[228] = 1.00000/(algebraic[214]+algebraic[216]/26.5530)
    algebraic[245] = algebraic[225]/algebraic[228]
    algebraic[251] = (1.00000-algebraic[225])/algebraic[228]
    rates[59] = ((-((algebraic[208]+algebraic[237])+algebraic[251])*states[59]+algebraic[210]*states[63])+constants[104]*states[62])+algebraic[245]*states[60]
    rates[63] = ((-((algebraic[210]+algebraic[237])+algebraic[251])*states[63]+algebraic[208]*states[59])+constants[104]*states[66])+algebraic[245]*states[64]
    algebraic[222] = (0.00100000+algebraic[219])/1.00100
    algebraic[212] = 5.00000*states[36]
    algebraic[231] = 1.00000+power(0.0120000/algebraic[149], 10.0000)
    algebraic[240] = (13.8250-(6.38360-algebraic[212])/algebraic[234])-3.36960/algebraic[231]
    algebraic[243] = 1.00000/(algebraic[214]+algebraic[216]/algebraic[240])
    algebraic[247] = algebraic[222]/algebraic[243]
    algebraic[257] = (1.00000-algebraic[222])/algebraic[243]
    rates[62] = ((-((algebraic[208]+constants[104])+algebraic[257])*states[62]+algebraic[237]*states[59])+algebraic[210]*states[66])+algebraic[247]*states[61]
    rates[66] = ((-((algebraic[210]+constants[104])+algebraic[257])*states[66]+algebraic[237]*states[63])+algebraic[208]*states[62])+algebraic[247]*states[65]
    algebraic[249] = custom_piecewise([less(fabs(algebraic[247]) , 1.00000e-12), 1.00000e-12 , True, algebraic[247]])
    algebraic[254] = custom_piecewise([less(fabs(algebraic[251]) , 1.00000e-12), 1.00000e-12 , True, algebraic[251]])
    algebraic[260] = (constants[105]*((algebraic[245]*algebraic[257])*algebraic[237]))/((algebraic[254]*algebraic[249])*constants[104])
    rates[60] = ((-((algebraic[208]+algebraic[260])+algebraic[245])*states[60]+algebraic[251]*states[59])+constants[105]*states[61])+algebraic[210]*states[64]
    rates[61] = ((-((algebraic[208]+constants[105])+algebraic[247])*states[61]+algebraic[257]*states[62])+algebraic[260]*states[60])+algebraic[210]*states[65]
    rates[64] = ((-((algebraic[210]+algebraic[260])+algebraic[245])*states[64]+algebraic[251]*states[63])+constants[105]*states[65])+algebraic[208]*states[60]
    rates[65] = ((-((algebraic[210]+constants[105])+algebraic[247])*states[65]+algebraic[257]*states[66])+algebraic[260]*states[64])+algebraic[208]*states[61]
    algebraic[252] = constants[243]*(1.00000+2.00000*states[41])
    algebraic[255] = 0.112500*algebraic[252]
    algebraic[113] = (constants[72]+constants[73])-states[34]
    algebraic[121] = states[34]*constants[73]
    algebraic[127] = (power(algebraic[113]*algebraic[113]+4.00000*algebraic[121], 1.0/2)-algebraic[113])/2.00000
    algebraic[269] = (algebraic[248]*1.00000)/(1.00000+power(1.00000/algebraic[127], 8.00000))
    algebraic[271] = algebraic[255]*algebraic[269]
    algebraic[263] = 1.00000+0.0123000/algebraic[127]
    algebraic[265] = algebraic[252]/algebraic[263]
    rates[118] = -(algebraic[271]+states[118])/algebraic[265]
    algebraic[258] = constants[243]*(1.00000+0.00000*states[41])
    algebraic[261] = 0.112500*algebraic[258]
    algebraic[272] = (1.99250*algebraic[261])*algebraic[269]
    algebraic[267] = (0.535700*algebraic[258])/algebraic[263]
    rates[119] = -(algebraic[272]+states[119])/algebraic[267]
    algebraic[286] = 1.00000+power(constants[134]/algebraic[149], 2.00000)
    algebraic[285] = exp(((constants[139]-1.00000)*states[50])*constants[263])
    algebraic[287] = 1.00000+constants[140]*algebraic[285]
    algebraic[283] = power(states[49], 3.00000)
    algebraic[288] = (constants[136]*algebraic[283]+constants[364]*algebraic[149])+(constants[362]*constants[97])*(1.00000+algebraic[149]/constants[135])
    algebraic[289] = ((constants[135]*constants[366])*(1.00000+algebraic[283]/constants[362])+algebraic[283]*constants[97])+constants[366]*algebraic[149]
    algebraic[284] = exp((constants[139]*states[50])*constants[263])
    algebraic[290] = (0.200000*constants[141])*((algebraic[283]*constants[97])*algebraic[284]-(constants[366]*algebraic[149])*algebraic[285])
    algebraic[291] = algebraic[290]/((algebraic[286]*algebraic[287])*(algebraic[288]+algebraic[289]))
    algebraic[207] = (states[49]-states[48])/constants[94]
    rates[49] = -(constants[409]*algebraic[291]+algebraic[207])
    algebraic[38] = (states[5]+constants[395])/constants[30]
    algebraic[311] = (algebraic[38]-constants[398])/(0.958600-constants[398])
    algebraic[313] = custom_piecewise([less(algebraic[311] , 0.00000), 0.00000 , True, algebraic[311]])
    algebraic[317] = (1.00000-algebraic[313])*states[118]+algebraic[313]*states[119]
    algebraic[307] = (constants[155]*exp(algebraic[127]/constants[153]))*(algebraic[127]-algebraic[149])
    algebraic[309] = (constants[156]*exp(algebraic[127]/constants[154]))*(algebraic[127]-algebraic[149])
    algebraic[315] = (1.00000-algebraic[313])*algebraic[307]+algebraic[313]*algebraic[309]
    algebraic[319] = algebraic[315]+algebraic[317]
    algebraic[211] = (states[30]-algebraic[127])/constants[96]
    rates[34] = algebraic[211]-algebraic[319]
    algebraic[153] = (states[31]-0.673519)/(0.999180-0.673519)
    algebraic[158] = custom_piecewise([less(algebraic[153] , 0.00000), 0.00000 , True, algebraic[153]])
    algebraic[162] = (1.00000-algebraic[158])*constants[77]+algebraic[158]*constants[229]
    algebraic[174] = algebraic[162]+constants[75]
    algebraic[178] = ((algebraic[174]-states[32])+constants[71])+constants[78]
    algebraic[166] = algebraic[162]*constants[75]
    algebraic[182] = ((algebraic[166]-states[32]*algebraic[174])+constants[78]*constants[75])+constants[71]*algebraic[162]
    algebraic[170] = -algebraic[166]*states[32]
    algebraic[186] = -algebraic[178]/3.00000+((2.00000/3.00000)*(power(algebraic[178]*algebraic[178]-3.00000*algebraic[182], 1.0/2)))*cos(arccos((((9.00000*algebraic[178])*algebraic[182]-((2.00000*algebraic[178])*algebraic[178])*algebraic[178])-27.0000*algebraic[170])/(2.00000*(power(algebraic[178]*algebraic[178]-3.00000*algebraic[182], 1.50000))))/3.00000)
    algebraic[201] = (algebraic[149]-algebraic[186])/constants[94]
    rates[35] = -(((constants[316]*algebraic[291]+constants[317]*algebraic[319])+algebraic[201])+algebraic[209])
    algebraic[250] = exp(states[50]*constants[263])
    algebraic[253] = (((constants[107]*states[50])*constants[275])*(states[46]-constants[98]*algebraic[250]))/(1.00000-algebraic[250])
    algebraic[320] = 1.00000-1.00000/(1.00000+power(algebraic[317]/constants[108], 2.00000))
    algebraic[323] = (algebraic[253]*algebraic[320])*states[67]
    algebraic[204] = (states[47]-states[46])/constants[94]
    rates[47] = constants[341]*algebraic[323]-algebraic[204]
    algebraic[306] = 1.00000/(1.00000+power(0.0300000/algebraic[194], 2.00000))
    algebraic[308] = (1.00000-algebraic[306])*constants[161]+algebraic[306]*constants[379]
    algebraic[324] = (algebraic[308]*states[30])/constants[164]
    algebraic[310] = (states[125]-0.659100)/(0.994500-0.659100)
    algebraic[312] = custom_piecewise([less(algebraic[310] , 0.00000), 0.00000 , True, algebraic[310]])
    algebraic[314] = algebraic[312]*states[40]
    algebraic[316] = states[40]-algebraic[314]
    algebraic[318] = algebraic[312]-algebraic[314]
    algebraic[321] = ((1.00000-algebraic[318])-algebraic[316])-algebraic[314]
    algebraic[322] = ((algebraic[321]*constants[159]+algebraic[318]*constants[374])+algebraic[316]*constants[369])+algebraic[314]*constants[376]
    algebraic[326] = (algebraic[308]*algebraic[186])/(algebraic[186]+algebraic[322])
    algebraic[328] = algebraic[326]-algebraic[324]
    rates[30] = algebraic[328]-constants[312]*algebraic[211]
    algebraic[213] = (2.00000*states[50])*constants[263]
    algebraic[215] = exp(algebraic[213])
    algebraic[217] = ((((constants[101]*2.00000)*constants[87])*algebraic[213])*(algebraic[186]*algebraic[215]-0.341000*constants[97]))/(algebraic[215]-1.00000)
    algebraic[292] = 1.00000+power(constants[134]/algebraic[186], 2.00000)
    algebraic[293] = 1.00000+constants[140]*algebraic[285]
    algebraic[282] = power(states[48], 3.00000)
    algebraic[294] = (constants[136]*algebraic[282]+constants[364]*algebraic[186])+(constants[362]*constants[97])*(1.00000+algebraic[186]/constants[135])
    algebraic[295] = ((constants[135]*constants[366])*(1.00000+algebraic[282]/constants[362])+algebraic[282]*constants[97])+constants[366]*algebraic[186]
    algebraic[296] = (0.800000*constants[141])*((algebraic[282]*constants[97])*algebraic[284]-(constants[366]*algebraic[186])*algebraic[285])
    algebraic[297] = algebraic[296]/((algebraic[292]*algebraic[293])*(algebraic[294]+algebraic[295]))
    algebraic[304] = (constants[151]*algebraic[186])/(constants[152]+algebraic[186])
    rates[32] = (-constants[308]*((algebraic[217]+algebraic[304])-2.00000*algebraic[297])-constants[313]*algebraic[328])+constants[318]*algebraic[201]
    algebraic[327] = -constants[238]*log(constants[98]/states[46])
    algebraic[331] = constants[238]*log(constants[99]/states[126])
    algebraic[332] = algebraic[331]-algebraic[327]
    algebraic[333] = (constants[91]*algebraic[332])/(algebraic[332]+constants[92])
    algebraic[352] = constants[238]*log(constants[100]/states[48])
    algebraic[353] = power(algebraic[352]-algebraic[327], 4.00000)
    algebraic[354] = (constants[93]*algebraic[353])/(algebraic[353]+constants[346])
    algebraic[329] = constants[106]*(states[50]-algebraic[327])
    rates[46] = ((constants[332]*algebraic[329]+algebraic[354])+algebraic[333])+constants[337]*algebraic[204]
    algebraic[355] = (((constants[241]*(power(states[114], 3.00000)))*states[106])*states[107])*(states[50]-algebraic[352])
    algebraic[356] = (((constants[241]*(power(states[108], 3.00000)))*states[106])*states[107])*(states[50]-algebraic[352])
    algebraic[357] = (((constants[241]*(power(states[111], 3.00000)))*states[109])*states[110])*(states[50]-algebraic[352])
    algebraic[358] = ((((constants[241]*(power(states[114], 3.00000)))*states[112])*states[113])*(states[50]-algebraic[352]))*1.25000
    algebraic[273] = (states[105]-0.239480)/(0.950143-0.239480)
    algebraic[274] = custom_piecewise([less(algebraic[273] , 0.00000), 0.00000 , True, algebraic[273]])
    algebraic[275] = algebraic[274]*states[38]
    algebraic[276] = states[38]-algebraic[275]
    algebraic[277] = algebraic[274]-algebraic[275]
    algebraic[278] = ((1.00000-algebraic[277])-algebraic[276])-algebraic[275]
    algebraic[359] = ((algebraic[278]*algebraic[357]+algebraic[277]*algebraic[358])+algebraic[276]*algebraic[356])+algebraic[275]*algebraic[355]
    algebraic[279] = states[50]*constants[263]
    algebraic[280] = exp(algebraic[279])
    algebraic[281] = (((constants[133]*constants[87])*algebraic[279])*(states[48]*algebraic[280]-constants[100]))/(algebraic[280]-1.00000)
    algebraic[300] = (constants[144]*constants[242])/(1.00000+exp(-(states[50]+92.0000)*constants[263]))
    algebraic[301] = algebraic[300]*(power(states[48]/(states[48]+constants[147]), 3.00000))
    algebraic[302] = algebraic[300]*(power(states[48]/(states[48]+constants[148]), 3.00000))
    algebraic[298] = (states[115]-0.126345)/(0.998014-0.126345)
    algebraic[299] = custom_piecewise([less(algebraic[298] , 0.00000), 0.00000 , True, algebraic[298]])
    algebraic[303] = (1.00000-algebraic[299])*algebraic[301]+algebraic[299]*algebraic[302]
    algebraic[360] = ((power(states[117], 3.00000))*states[116])*(states[50]-algebraic[352])
    algebraic[361] = 0.0160000*algebraic[360]
    algebraic[362] = 0.00650000*algebraic[360]
    algebraic[363] = (1.00000-states[38])*algebraic[362]+states[38]*algebraic[361]
    algebraic[365] = (((algebraic[359]+algebraic[281])+algebraic[363])+algebraic[303]*3.00000)+algebraic[297]*3.00000
    rates[48] = (constants[407]*algebraic[365]+constants[408]*algebraic[207])+algebraic[354]
    algebraic[305] = (((algebraic[248]+algebraic[217])+algebraic[304])-algebraic[297]*2.00000)-algebraic[291]*2.00000
    algebraic[330] = algebraic[329]+algebraic[323]
    algebraic[334] = states[50]-algebraic[331]
    algebraic[335] = 1.02000/(1.00000+exp(0.238500*(algebraic[334]-59.2150)))
    algebraic[336] = (0.491240*exp(0.0803200*(algebraic[334]+5.47600))+exp(0.0617500*(algebraic[334]-594.310)))/(1.00000+exp(-0.514300*(algebraic[334]+4.75300)))
    algebraic[337] = (constants[239]*(algebraic[335]/(algebraic[335]+algebraic[336])))*algebraic[334]
    algebraic[338] = algebraic[337]*1.20000
    algebraic[339] = (1.00000-states[37])*algebraic[337]+states[37]*algebraic[338]
    algebraic[256] = 1.00000/(1.00000+exp((states[50]+10.0000)/15.4000))
    algebraic[340] = ((constants[240]*states[68])*algebraic[256])*(states[50]-algebraic[331])
    algebraic[348] = constants[238]*log((constants[99]+constants[165]*constants[100])/(states[126]+constants[165]*states[48]))
    algebraic[259] = 0.195610*(1.00000+0.600000/(1.00000+power(3.80000e-05/algebraic[186], 1.40000)))
    algebraic[349] = (algebraic[259]*(states[69]+states[70]))*(states[50]-algebraic[348])
    algebraic[350] = (algebraic[259]*(states[71]+states[72]))*(states[50]-algebraic[348])
    algebraic[262] = (states[103]+constants[403])/constants[110]
    algebraic[264] = (algebraic[262]-constants[404])/(0.785000-constants[404])
    algebraic[266] = custom_piecewise([less(algebraic[264] , 0.00000), 0.00000 , True, algebraic[264]])
    algebraic[351] = algebraic[266]*algebraic[350]+(1.00000-algebraic[266])*algebraic[349]
    algebraic[341] = (constants[123]*(states[50]-algebraic[331]))/(1.00000+exp((15.0000-states[50])/17.0000))
    algebraic[342] = ((constants[123]*(states[50]-algebraic[331]))/(1.00000+exp((36.0000-states[50])/17.0000)))*3.62000
    algebraic[268] = (states[104]-0.0589380)/(0.393747-0.0589380)
    algebraic[270] = custom_piecewise([less(algebraic[268] , 0.00000), 0.00000 , True, algebraic[268]])
    algebraic[343] = (1.00000-algebraic[270])*algebraic[341]+algebraic[270]*algebraic[342]
    algebraic[325] = exp(states[50]/550.000)
    algebraic[344] = ((constants[157]*(power(states[120], 3.00000)))*algebraic[325])*(states[50]-algebraic[331])
    algebraic[345] = algebraic[344]*(0.735600*states[121]+0.264400*states[123])
    algebraic[346] = algebraic[344]*(0.735600*states[122]+0.264400*states[124])
    algebraic[347] = (1.00000-states[39])*algebraic[346]+states[39]*algebraic[345]
    algebraic[364] = ((((algebraic[339]+algebraic[340])+algebraic[351])+algebraic[343])+algebraic[347])-2.00000*algebraic[303]
    algebraic[366] = algebraic[365]+algebraic[291]*3.00000
    algebraic[367] = ((algebraic[366]+algebraic[364])+algebraic[305])+algebraic[330]
    algebraic[368] = (custom_piecewise([less((voi-constants[213])-constants[214]*floor((voi-constants[213])/constants[214]) , constants[212]), 1.00000 , True, 0.00000]))*constants[256]
    rates[50] = -(algebraic[367]+algebraic[368])/1.00000
    rates[126] = constants[406]*(algebraic[364]+algebraic[368])+algebraic[333]
    return(rates)

def computeAlgebraic(constants, states, voi):
    algebraic = array([[0.0] * len(voi)] * sizeAlgebraic)
    states = array(states)
    voi = array(voi)
    algebraic[3] = constants[393]-states[4]
    algebraic[4] = constants[396]-states[5]
    algebraic[15] = constants[405]-states[103]
    algebraic[25] = 1.00000/(1.00000+exp((states[50]+91.0000)/6.10000))
    algebraic[29] = constants[255]-states[144]
    algebraic[33] = (constants[322]-states[12])-states[11]
    algebraic[35] = (constants[325]-states[18])-states[17]
    algebraic[36] = (constants[330]-states[26])-states[25]
    algebraic[11] = 0.0250000/(1.00000+exp((states[50]+58.0000)/5.00000))
    algebraic[39] = 0.200000/(1.00000+exp((states[50]+19.0000)/-9.00000))
    algebraic[12] = 1.00000/((0.000600000*(states[50]-1.73840))/(1.00000-exp(-0.136000*(states[50]-1.73840)))-(0.000300000*(states[50]+38.3608))/(1.00000-exp(0.152200*(states[50]+38.3608))))
    algebraic[40] = 1.00000/(1.00000+exp((states[50]+10.0850)/-4.25000))
    algebraic[13] = 0.00739900/(1.00000+exp((constants[263]*(states[50]-0.0311960))/-0.800190))
    algebraic[41] = 0.00569920/(1.00000+exp((constants[263]*(states[50]-0.0415200))/1.34890))
    algebraic[14] = 0.00994150/(1.00000+exp((constants[263]*(states[50]-0.0448090))/-0.581720))
    algebraic[42] = 0.00332010/(1.00000+exp((constants[263]*(states[50]-0.0942170))/0.953640))
    algebraic[16] = custom_piecewise([greater_equal(states[50]+constants[130] , -40.0000), 0.00000 , True, 0.135000*exp(((87.0000+states[50])+constants[130])/-6.80000)])
    algebraic[43] = custom_piecewise([greater_equal(states[50]+constants[130] , -40.0000), 1.00000/(0.130000*(1.00000+exp(((states[50]+constants[130])+27.4034)/-11.1000))) , True, 3.56000*exp(0.0790000*((states[50]+constants[130])+7.00000))+310000.*exp(0.350000*((states[50]+constants[130])+7.00000))])
    algebraic[17] = custom_piecewise([greater_equal(states[50]+constants[130] , -40.0000), 0.00000 , True, ((-127140.*exp(0.244400*(states[50]+constants[130]))+-6.94800e-05*exp(-0.0439100*(states[50]+constants[130])))*((states[50]+constants[130])+37.7800))/(1.00000+exp(0.311000*((states[50]+constants[130])+79.2300)))])
    algebraic[44] = custom_piecewise([greater_equal(states[50]+constants[130] , -40.0000), (0.300000*exp(-2.53500e-07*(states[50]+constants[130])))/(1.00000+exp(-0.100000*((states[50]+constants[130])+32.0000))) , True, (0.121200*exp(-0.0105200*(states[50]+constants[130])))/(1.00000+exp(-0.137800*((states[50]+constants[130])+40.1400)))])
    algebraic[18] = (0.320000*(states[50]+58.4729))/(1.00000-exp(-0.100000*(states[50]+58.4729)))
    algebraic[45] = 0.0800000*exp((13.7299-states[50])/11.0000)
    algebraic[19] = custom_piecewise([greater_equal(states[50] , -40.0000), 0.00000 , True, 0.135000*exp((87.0000+states[50])/-6.80000)])
    algebraic[46] = custom_piecewise([greater_equal(states[50] , -40.0000), 1.00000/(0.130000*(1.00000+exp((states[50]+27.4034)/-11.1000))) , True, 3.56000*exp(0.0790000*(states[50]+7.00000))+310000.*exp(0.350000*(states[50]+7.00000))])
    algebraic[20] = custom_piecewise([greater_equal(states[50] , -40.0000), 0.00000 , True, ((-127140.*exp(0.244400*states[50])-6.94800e-05*exp(-0.0439100*states[50]))*(states[50]+37.7800))/(1.00000+exp(0.311000*(states[50]+79.2300)))])
    algebraic[47] = custom_piecewise([greater_equal(states[50] , -40.0000), (0.300000*exp(-2.53500e-07*states[50]))/(1.00000+exp(-0.100000*(states[50]+32.0000))) , True, (0.121200*exp(-0.0105200*states[50]))/(1.00000+exp(-0.137800*(states[50]+40.1400)))])
    algebraic[21] = (0.320000*(states[50]+58.4729))/(1.00000-exp(-0.100000*(states[50]+58.4729)))
    algebraic[48] = 0.0800000*exp((13.7299-states[50])/11.0000)
    algebraic[22] = custom_piecewise([greater_equal(states[50] , -40.0000), 0.00000 , True, 0.135000*exp(((87.0000+states[50])+constants[132])/-6.80000)])
    algebraic[49] = custom_piecewise([greater_equal(states[50] , -40.0000), (1.00000/0.130000)/(1.00000+exp(((states[50]+constants[132])+27.4034)/-11.1000)) , True, 3.56000*exp(0.0790000*((states[50]+constants[132])+7.00000))+310000.*exp(0.350000*((states[50]+constants[132])+7.00000))])
    algebraic[23] = custom_piecewise([greater_equal(states[50] , -40.0000), 0.00000 , True, ((-127140.*exp(0.244400*(states[50]+constants[132]))-6.94800e-05*exp(-0.0439100*(states[50]+constants[132])))*((states[50]+constants[132])+37.7800))/(1.00000+exp(0.311000*((states[50]+constants[132])+79.2300)))])
    algebraic[50] = custom_piecewise([greater_equal(states[50] , -40.0000), (0.300000*exp(-2.53500e-07*(states[50]+constants[132])))/(1.00000+exp(-0.100000*((states[50]+constants[132])+32.0000))) , True, (0.121200*exp(-0.0105200*(states[50]+constants[132])))/(1.00000+exp(-0.137800*((states[50]+constants[132])+40.1400)))])
    algebraic[24] = (0.320000*((states[50]+constants[131])+58.4729))/(1.00000-exp(-0.100000*((states[50]+constants[131])+58.4729)))
    algebraic[51] = 0.0800000*exp(((states[50]+constants[131])-13.7299)/-11.0000)
    algebraic[26] = (0.320000*(states[50]+47.1300))/(1.00000-exp(-0.100000*(states[50]+47.1300)))
    algebraic[52] = 0.0800000*exp(states[50]/-11.0000)
    algebraic[57] = (constants[323]-states[14])-states[13]
    algebraic[60] = (constants[331]-states[28])-states[27]
    algebraic[27] = 1.00000/(1.00000+exp((states[50]+9.43700)/-7.13300))
    algebraic[53] = 1.00000/(1.00000+exp((states[50]-18.4099)/-29.3814))
    algebraic[65] = 1.00000/(1.00000+exp((states[50]+100.000)/29.3814))
    algebraic[77] = 1.00000/(algebraic[53]/1.20890+3.50000*algebraic[65])
    algebraic[66] = ((1.00000/(1.00000+exp((states[50]+19.0000)/-9.00000)))/0.500000)/9.79530
    algebraic[28] = 1.00000/(1.00000+exp((states[50]+58.0000)/5.00000))
    algebraic[78] = 0.0479600*algebraic[28]
    algebraic[79] = 0.0214400*algebraic[28]
    algebraic[54] = (1.00000/(1.00000+exp((states[50]+60.0000)/5.00000)))/250.000
    algebraic[80] = 2.46000*algebraic[54]
    algebraic[81] = 0.560340*algebraic[54]
    algebraic[63] = 0.0906540*exp((-0.111570*states[50])*constants[263])
    algebraic[91] = 0.388390/(1.00000+exp((constants[263]*(states[50]+0.150190))/-0.606930))
    algebraic[75] = 0.00311240+(0.0283300-0.00311240)/(1.00000+exp((constants[263]*(states[50]+0.0516600))/1.55220))
    algebraic[64] = 0.0657000*exp((-0.118990*states[50])*constants[263])
    algebraic[93] = 0.563560/(1.00000+exp((constants[263]*(states[50]+0.179860))/-0.583810))
    algebraic[76] = 0.000385250+(0.0124060-0.000385250)/(1.00000+exp((constants[263]*(states[50]+0.0641180))/0.779920))
    algebraic[92] = 0.000441980*exp((-1.20220*states[50])*constants[263])
    algebraic[103] = 0.000401730*exp((0.000208730*states[50])*constants[263])
    algebraic[94] = 0.000237300*exp((-1.97420*states[50])*constants[263])
    algebraic[104] = 0.000226520*exp((0.000246890*states[50])*constants[263])
    algebraic[5] = ((constants[36]*constants[35])*constants[319]-states[8])-states[7]
    algebraic[34] = (algebraic[5]*(constants[59]+constants[51])-states[14]*(constants[51]+constants[59]))+(constants[49]*constants[51])*(1.00000+constants[59]/constants[54])
    algebraic[58] = (-states[14]*constants[49])*constants[51]
    algebraic[70] = (-algebraic[34]+power(algebraic[34]*algebraic[34]-(4.00000*constants[222])*algebraic[58], 1.0/2))/(2.00000*constants[222])
    algebraic[86] = algebraic[5]/(1.00000+(algebraic[70]/constants[49])*(1.00000+constants[59]/constants[51]))
    algebraic[98] = (algebraic[70]*algebraic[86])/constants[49]
    algebraic[108] = (algebraic[98]*constants[59])/constants[51]
    algebraic[8] = ((constants[215]*constants[35])*constants[326]-states[21])-states[20]
    algebraic[37] = (algebraic[8]*(constants[59]+constants[51])-states[28]*(constants[51]+constants[59]))+(constants[49]*constants[51])*(1.00000+constants[59]/constants[54])
    algebraic[61] = (-states[28]*constants[49])*constants[51]
    algebraic[73] = (-algebraic[37]+power(algebraic[37]*algebraic[37]-(4.00000*constants[225])*algebraic[61], 1.0/2))/(2.00000*constants[225])
    algebraic[89] = algebraic[8]/(1.00000+(algebraic[73]/constants[49])*(1.00000+constants[59]/constants[51]))
    algebraic[101] = (algebraic[73]*algebraic[89])/constants[49]
    algebraic[111] = (constants[59]/constants[51])*algebraic[101]
    algebraic[7] = ((constants[216]*constants[295])*constants[321]-states[2])-states[15]
    algebraic[59] = (algebraic[7]*(constants[47]+constants[59])-algebraic[35]*(constants[47]+constants[59]))+(constants[46]*constants[47])*(1.00000+constants[59]/constants[48])
    algebraic[71] = (-algebraic[35]*constants[47])*constants[46]
    algebraic[87] = (-algebraic[59]+power(algebraic[59]*algebraic[59]-(4.00000*constants[224])*algebraic[71], 1.0/2))/(2.00000*constants[224])
    algebraic[99] = algebraic[7]/(1.00000+(algebraic[87]/constants[46])*(1.00000+constants[59]/constants[47]))
    algebraic[110] = ((constants[59]*algebraic[87])*algebraic[99])/(constants[46]*constants[47])
    algebraic[119] = (algebraic[99]*algebraic[87])/constants[46]
    algebraic[118] = (constants[59]*algebraic[87])/constants[48]
    algebraic[130] = ((constants[399]-states[142])-states[141])-states[140]
    algebraic[1] = power(states[3]*1.00000, constants[12])
    algebraic[31] = constants[6]*(constants[8]+algebraic[1]/(constants[3]+algebraic[1]))
    algebraic[67] = (algebraic[31]*constants[329])*constants[227]
    algebraic[83] = (constants[236]*(states[43]-states[45]))/constants[309]
    algebraic[96] = (constants[237]*(states[45]-states[44]))/constants[309]
    algebraic[107] = (constants[349]*constants[185])/(1.00000+constants[170]/states[45])
    algebraic[116] = ((constants[372]+(constants[174]-1.00000)*states[131])*constants[187])/(1.00000+constants[172]/states[45])
    algebraic[124] = algebraic[107]+algebraic[116]
    algebraic[134] = (((-constants[268]*algebraic[130])*states[45]+constants[276]*states[142])-(constants[269]*states[142])*states[45])+constants[277]*states[141]
    algebraic[140] = ((constants[380]-states[134])-states[133])-states[132]
    algebraic[2] = power(states[1]*1.00000, constants[13])
    algebraic[32] = power(states[1]*1.00000, constants[14])
    algebraic[56] = (constants[7]*(constants[9]+algebraic[2]/(constants[4]+algebraic[2])))*(1.00000-((1.00000-(constants[15]*algebraic[32])/(constants[5]+algebraic[32]))*states[0])/(constants[2]+states[0]))
    algebraic[82] = (algebraic[56]*constants[320])*constants[227]
    algebraic[95] = (constants[236]*(states[43]-states[45]))/constants[306]
    algebraic[105] = (constants[235]*(states[43]-states[44]))/constants[306]
    algebraic[114] = (constants[347]*constants[185])/(1.00000+constants[170]/states[43])
    algebraic[122] = ((constants[377]+(constants[174]-1.00000)*states[127])*constants[186])/(1.00000+constants[171]/states[43])
    algebraic[128] = ((constants[370]+(constants[174]-1.00000)*states[129])*constants[187])/(1.00000+constants[172]/states[43])
    algebraic[135] = (algebraic[114]+algebraic[122])+algebraic[128]
    algebraic[145] = (((-constants[199]*algebraic[140])*states[43]+constants[246]*states[134])-(constants[200]*states[134])*states[43])+constants[247]*states[133]
    algebraic[150] = ((constants[335]-states[138])-states[137])-states[136]
    algebraic[0] = power(states[2]*1.00000, constants[12])
    algebraic[55] = constants[6]*(constants[8]+algebraic[0]/(constants[3]+algebraic[0]))
    algebraic[68] = (algebraic[55]*constants[324])*constants[227]
    algebraic[30] = power(states[2]*1.00000, constants[13])
    algebraic[84] = constants[7]*(constants[9]+algebraic[30]/(constants[4]+algebraic[30]))
    algebraic[106] = (algebraic[84]*constants[328])*constants[227]
    algebraic[115] = (constants[235]*(states[43]-states[44]))/constants[307]
    algebraic[123] = (constants[237]*(states[45]-states[44]))/constants[307]
    algebraic[129] = (constants[348]*constants[185])/(1.00000+constants[170]/states[44])
    algebraic[136] = ((constants[378]+(constants[174]-1.00000)*states[128])*constants[186])/(1.00000+constants[171]/states[44])
    algebraic[141] = ((constants[371]+(constants[174]-1.00000)*states[130])*constants[187])/(1.00000+constants[172]/states[44])
    algebraic[146] = (algebraic[129]+algebraic[136])+algebraic[141]
    algebraic[154] = (((-constants[249]*algebraic[150])*states[44]+constants[265]*states[138])-(constants[250]*states[138])*states[44])+constants[266]*states[137]
    algebraic[6] = ((constants[37]*constants[295])*constants[319]-states[1])-states[9]
    algebraic[69] = (((constants[258]+constants[271])/constants[223]+algebraic[33])+algebraic[57])-algebraic[6]
    algebraic[85] = ((constants[271]*(algebraic[33]-algebraic[6])+constants[258]*(algebraic[57]-algebraic[6]))+constants[279])/constants[223]
    algebraic[97] = (algebraic[6]*constants[279])/constants[223]
    algebraic[109] = ((((-algebraic[97]/27.0000)*(power(algebraic[69], 3.00000))-(((algebraic[69]*algebraic[69])*algebraic[85])*algebraic[85])/108.000)+((algebraic[69]*algebraic[85])*algebraic[97])/6.00000)+(power(algebraic[85], 3.00000))/27.0000)+(algebraic[97]*algebraic[97])/4.00000
    algebraic[117] = custom_piecewise([less(algebraic[109] , 0.00000), power(-algebraic[109], 1.0/2) , True, 0.00000])
    algebraic[125] = (((custom_piecewise([greater(algebraic[109] , 0.00000), power(algebraic[109], 1.0/2) , True, 0.00000]))+algebraic[97]/2.00000)+(algebraic[69]*algebraic[85])/6.00000)-(power(algebraic[69], 3.00000))/27.0000
    algebraic[131] = arctan(algebraic[117]/algebraic[125])/3.00000
    algebraic[137] = power(algebraic[125]*algebraic[125]+algebraic[117]*algebraic[117], 1.00000/6.00000)
    algebraic[142] = (algebraic[85]/3.00000-(algebraic[69]*algebraic[69])/9.00000)/(algebraic[137]*algebraic[137])
    algebraic[147] = (algebraic[137]*sin(algebraic[131]))*(1.00000+algebraic[142])
    algebraic[151] = (algebraic[137]*cos(algebraic[131]))*(1.00000-algebraic[142])-algebraic[69]/3.00000
    algebraic[156] = power(algebraic[151]*algebraic[151]+algebraic[147]*algebraic[147], 1.0/2)
    algebraic[160] = algebraic[33]/((1.00000+constants[59]/constants[48])+(algebraic[156]*(constants[47]+constants[59]))/(constants[46]*constants[47]))
    algebraic[164] = (constants[59]*algebraic[160])/constants[48]
    algebraic[168] = ((constants[59]*algebraic[160])*algebraic[156])/(constants[46]*constants[47])
    algebraic[9] = ((constants[38]*constants[295])*constants[326]-states[3])-states[23]
    algebraic[72] = (((constants[259]+constants[272])/constants[226]+algebraic[36])+algebraic[60])-algebraic[9]
    algebraic[88] = ((constants[272]*(algebraic[36]-algebraic[9])+constants[259]*(algebraic[60]-algebraic[9]))+constants[280])/constants[226]
    algebraic[100] = (algebraic[9]*constants[280])/constants[226]
    algebraic[112] = ((((-algebraic[100]/27.0000)*(power(algebraic[72], 3.00000))-(((algebraic[72]*algebraic[72])*algebraic[88])*algebraic[88])/108.000)+((algebraic[72]*algebraic[88])*algebraic[100])/6.00000)+(power(algebraic[88], 3.00000))/27.0000)+(algebraic[100]*algebraic[100])/4.00000
    algebraic[120] = custom_piecewise([less(algebraic[112] , 0.00000), power(-algebraic[112], 1.0/2) , True, 0.00000])
    algebraic[126] = (((custom_piecewise([greater(algebraic[112] , 0.00000), power(algebraic[112], 1.0/2) , True, 0.00000]))+algebraic[100]/2.00000)+(algebraic[72]*algebraic[88])/6.00000)-(power(algebraic[72], 3.00000))/27.0000
    algebraic[132] = arctan(algebraic[120]/algebraic[126])/3.00000
    algebraic[138] = power(algebraic[126]*algebraic[126]+algebraic[120]*algebraic[120], 1.00000/6.00000)
    algebraic[143] = (algebraic[88]/3.00000-(algebraic[72]*algebraic[72])/9.00000)/(algebraic[138]*algebraic[138])
    algebraic[148] = (algebraic[138]*sin(algebraic[132]))*(1.00000+algebraic[143])
    algebraic[152] = (algebraic[138]*cos(algebraic[132]))*(1.00000-algebraic[143])-algebraic[72]/3.00000
    algebraic[157] = power(algebraic[152]*algebraic[152]+algebraic[148]*algebraic[148], 1.0/2)
    algebraic[161] = algebraic[36]/((1.00000+constants[59]/constants[48])+(algebraic[157]*(constants[47]+constants[59]))/(constants[46]*constants[47]))
    algebraic[165] = (constants[59]*algebraic[161])/constants[48]
    algebraic[169] = ((constants[59]*algebraic[161])*algebraic[157])/(constants[46]*constants[47])
    algebraic[176] = algebraic[57]/((1.00000+constants[59]/constants[53])+(algebraic[156]*(constants[52]+constants[59]))/(constants[50]*constants[52]))
    algebraic[180] = (constants[59]*algebraic[176])/constants[53]
    algebraic[184] = ((constants[59]*algebraic[176])*algebraic[156])/(constants[50]*constants[52])
    algebraic[177] = algebraic[60]/((1.00000+constants[59]/constants[53])+(algebraic[157]*(constants[52]+constants[59]))/(constants[50]*constants[52]))
    algebraic[181] = (constants[59]*algebraic[177])/constants[53]
    algebraic[185] = ((constants[59]*algebraic[177])*algebraic[157])/(constants[50]*constants[52])
    algebraic[188] = algebraic[168]+constants[60]*algebraic[184]
    algebraic[172] = (algebraic[160]*algebraic[156])/constants[46]
    algebraic[192] = (algebraic[176]*algebraic[156])/constants[50]
    algebraic[196] = algebraic[172]+constants[60]*algebraic[192]
    algebraic[189] = algebraic[169]+constants[63]*algebraic[185]
    algebraic[173] = (algebraic[161]*algebraic[157])/constants[46]
    algebraic[193] = (algebraic[177]*algebraic[157])/constants[50]
    algebraic[197] = algebraic[173]+constants[63]*algebraic[193]
    algebraic[133] = constants[274]-states[35]
    algebraic[139] = constants[262]-states[35]*constants[261]
    algebraic[144] = -constants[230]*states[35]
    algebraic[149] = -algebraic[133]/3.00000+((2.00000/3.00000)*(power(algebraic[133]*algebraic[133]-3.00000*algebraic[139], 1.0/2)))*cos(arccos((((9.00000*algebraic[133])*algebraic[139]-((2.00000*algebraic[133])*algebraic[133])*algebraic[133])-27.0000*algebraic[144])/(2.00000*(power(algebraic[133]*algebraic[133]-3.00000*algebraic[139], 1.50000))))/3.00000)
    algebraic[190] = (constants[79]*(1.00000-states[42]))/(1.00000+constants[81]/algebraic[149])
    algebraic[194] = algebraic[190]+states[42]
    algebraic[199] = algebraic[194]/(algebraic[194]+constants[80])
    algebraic[200] = 1.00000/(1.00000+power(constants[80]/algebraic[194], 2.00000))
    algebraic[198] = (constants[205]-constants[208])+states[144]
    algebraic[203] = 0.500000*(power(power(algebraic[198], 2.00000)+(4.00000*constants[205])*constants[208], 1.0/2)-algebraic[198])
    algebraic[206] = (constants[28]/constants[319]+constants[82]/constants[326])+algebraic[203]/constants[321]
    algebraic[155] = 1.00000/((1.00000+exp((4.79800+states[50])/-7.56990))*(1.00000+exp((25.0000+states[50])/-5.00000)))
    algebraic[195] = 0.590000+(0.800000*exp(0.0520000*(states[50]+13.0000)))/(1.00000+exp(0.132000*(states[50]+13.0000)))
    algebraic[202] = algebraic[155]/algebraic[195]
    algebraic[205] = (1.00000-algebraic[155])/algebraic[195]
    algebraic[179] = 1.00000+power(0.00200000/algebraic[149], 4.00000)
    algebraic[183] = 6.00000/algebraic[179]
    algebraic[163] = 1.00000/(1.00000+exp((29.9790+states[50])/3.17750))
    algebraic[171] = (0.100000+algebraic[163])/1.10000
    algebraic[214] = 1.00000/((70.0000*(1.00000-0.500000*states[36]))*(1.00000+exp((states[50]+49.1000)/10.3490)))
    algebraic[216] = 1.00000/(1.00000+exp((states[50]+0.213000)/-10.8070))
    algebraic[221] = 1.00000/(algebraic[214]+algebraic[216]/38.4940)
    algebraic[224] = algebraic[171]/algebraic[221]
    algebraic[233] = (1.00000-algebraic[171])/algebraic[221]
    algebraic[167] = (0.000100000+algebraic[163])/1.00010
    algebraic[159] = 0.100000*states[36]
    algebraic[175] = 1.00000+power(0.0100000/algebraic[149], 10.0000)
    algebraic[187] = (32.5000-(18.0000-algebraic[159])/algebraic[179])-10.0000/algebraic[175]
    algebraic[218] = 1.00000/(algebraic[214]+algebraic[216]/algebraic[187])
    algebraic[227] = algebraic[167]/algebraic[218]
    algebraic[239] = (1.00000-algebraic[167])/algebraic[218]
    algebraic[230] = custom_piecewise([less(fabs(algebraic[227]) , 1.00000e-12), 1.00000e-12 , True, algebraic[227]])
    algebraic[236] = custom_piecewise([less(fabs(algebraic[233]) , 1.00000e-12), 1.00000e-12 , True, algebraic[233]])
    algebraic[242] = (constants[103]*((algebraic[224]*algebraic[239])*algebraic[183]))/((algebraic[236]*algebraic[230])*constants[102])
    algebraic[62] = constants[274]-states[33]
    algebraic[74] = constants[262]-states[33]*constants[261]
    algebraic[90] = -constants[230]*states[33]
    algebraic[102] = -algebraic[62]/3.00000+((2.00000/3.00000)*(power(algebraic[62]*algebraic[62]-3.00000*algebraic[74], 1.0/2)))*cos(arccos((((9.00000*algebraic[62])*algebraic[74]-((2.00000*algebraic[62])*algebraic[62])*algebraic[62])-27.0000*algebraic[90])/(2.00000*(power(algebraic[62]*algebraic[62]-3.00000*algebraic[74], 1.50000))))/3.00000)
    algebraic[209] = (algebraic[149]-algebraic[102])/constants[95]
    algebraic[10] = (states[4]+constants[392])/constants[17]
    algebraic[220] = (algebraic[10]-constants[397])/(0.927300-constants[397])
    algebraic[223] = custom_piecewise([less(algebraic[220] , 0.00000), 0.00000 , True, algebraic[220]])
    algebraic[226] = 0.000257900*(1.00000+0.100000*states[36])
    algebraic[229] = exp((2.00000*states[50])*constants[263])
    algebraic[232] = ((((algebraic[226]*4.00000)*states[50])*constants[275])*(algebraic[149]*algebraic[229]-0.341000*constants[97]))/(algebraic[229]-1.00000)
    algebraic[235] = algebraic[232]*(states[55]+states[58])
    algebraic[238] = 0.000155200*(1.00000+0.400000*states[36])
    algebraic[241] = exp((2.00000*states[50])*constants[263])
    algebraic[244] = ((((algebraic[238]*4.00000)*states[50])*constants[275])*(algebraic[149]*algebraic[241]-0.341000*constants[97]))/(algebraic[241]-1.00000)
    algebraic[246] = algebraic[244]*(states[63]+states[66])
    algebraic[248] = (1.00000-algebraic[223])*algebraic[246]+algebraic[223]*algebraic[235]
    algebraic[191] = 1.00000/((1.00000+exp((13.5600-states[50])/9.45000))*(1.00000+exp((25.0000+states[50])/-5.00000)))
    algebraic[208] = algebraic[191]/algebraic[195]
    algebraic[210] = (1.00000-algebraic[191])/algebraic[195]
    algebraic[234] = 1.00000+power(0.00110000/algebraic[149], 4.00000)
    algebraic[237] = 14.9186/algebraic[234]
    algebraic[219] = 1.00000/(1.00000+exp((17.5000+states[50])/3.00000))
    algebraic[225] = (0.247400+algebraic[219])/1.24740
    algebraic[228] = 1.00000/(algebraic[214]+algebraic[216]/26.5530)
    algebraic[245] = algebraic[225]/algebraic[228]
    algebraic[251] = (1.00000-algebraic[225])/algebraic[228]
    algebraic[222] = (0.00100000+algebraic[219])/1.00100
    algebraic[212] = 5.00000*states[36]
    algebraic[231] = 1.00000+power(0.0120000/algebraic[149], 10.0000)
    algebraic[240] = (13.8250-(6.38360-algebraic[212])/algebraic[234])-3.36960/algebraic[231]
    algebraic[243] = 1.00000/(algebraic[214]+algebraic[216]/algebraic[240])
    algebraic[247] = algebraic[222]/algebraic[243]
    algebraic[257] = (1.00000-algebraic[222])/algebraic[243]
    algebraic[249] = custom_piecewise([less(fabs(algebraic[247]) , 1.00000e-12), 1.00000e-12 , True, algebraic[247]])
    algebraic[254] = custom_piecewise([less(fabs(algebraic[251]) , 1.00000e-12), 1.00000e-12 , True, algebraic[251]])
    algebraic[260] = (constants[105]*((algebraic[245]*algebraic[257])*algebraic[237]))/((algebraic[254]*algebraic[249])*constants[104])
    algebraic[252] = constants[243]*(1.00000+2.00000*states[41])
    algebraic[255] = 0.112500*algebraic[252]
    algebraic[113] = (constants[72]+constants[73])-states[34]
    algebraic[121] = states[34]*constants[73]
    algebraic[127] = (power(algebraic[113]*algebraic[113]+4.00000*algebraic[121], 1.0/2)-algebraic[113])/2.00000
    algebraic[269] = (algebraic[248]*1.00000)/(1.00000+power(1.00000/algebraic[127], 8.00000))
    algebraic[271] = algebraic[255]*algebraic[269]
    algebraic[263] = 1.00000+0.0123000/algebraic[127]
    algebraic[265] = algebraic[252]/algebraic[263]
    algebraic[258] = constants[243]*(1.00000+0.00000*states[41])
    algebraic[261] = 0.112500*algebraic[258]
    algebraic[272] = (1.99250*algebraic[261])*algebraic[269]
    algebraic[267] = (0.535700*algebraic[258])/algebraic[263]
    algebraic[286] = 1.00000+power(constants[134]/algebraic[149], 2.00000)
    algebraic[285] = exp(((constants[139]-1.00000)*states[50])*constants[263])
    algebraic[287] = 1.00000+constants[140]*algebraic[285]
    algebraic[283] = power(states[49], 3.00000)
    algebraic[288] = (constants[136]*algebraic[283]+constants[364]*algebraic[149])+(constants[362]*constants[97])*(1.00000+algebraic[149]/constants[135])
    algebraic[289] = ((constants[135]*constants[366])*(1.00000+algebraic[283]/constants[362])+algebraic[283]*constants[97])+constants[366]*algebraic[149]
    algebraic[284] = exp((constants[139]*states[50])*constants[263])
    algebraic[290] = (0.200000*constants[141])*((algebraic[283]*constants[97])*algebraic[284]-(constants[366]*algebraic[149])*algebraic[285])
    algebraic[291] = algebraic[290]/((algebraic[286]*algebraic[287])*(algebraic[288]+algebraic[289]))
    algebraic[207] = (states[49]-states[48])/constants[94]
    algebraic[38] = (states[5]+constants[395])/constants[30]
    algebraic[311] = (algebraic[38]-constants[398])/(0.958600-constants[398])
    algebraic[313] = custom_piecewise([less(algebraic[311] , 0.00000), 0.00000 , True, algebraic[311]])
    algebraic[317] = (1.00000-algebraic[313])*states[118]+algebraic[313]*states[119]
    algebraic[307] = (constants[155]*exp(algebraic[127]/constants[153]))*(algebraic[127]-algebraic[149])
    algebraic[309] = (constants[156]*exp(algebraic[127]/constants[154]))*(algebraic[127]-algebraic[149])
    algebraic[315] = (1.00000-algebraic[313])*algebraic[307]+algebraic[313]*algebraic[309]
    algebraic[319] = algebraic[315]+algebraic[317]
    algebraic[211] = (states[30]-algebraic[127])/constants[96]
    algebraic[153] = (states[31]-0.673519)/(0.999180-0.673519)
    algebraic[158] = custom_piecewise([less(algebraic[153] , 0.00000), 0.00000 , True, algebraic[153]])
    algebraic[162] = (1.00000-algebraic[158])*constants[77]+algebraic[158]*constants[229]
    algebraic[174] = algebraic[162]+constants[75]
    algebraic[178] = ((algebraic[174]-states[32])+constants[71])+constants[78]
    algebraic[166] = algebraic[162]*constants[75]
    algebraic[182] = ((algebraic[166]-states[32]*algebraic[174])+constants[78]*constants[75])+constants[71]*algebraic[162]
    algebraic[170] = -algebraic[166]*states[32]
    algebraic[186] = -algebraic[178]/3.00000+((2.00000/3.00000)*(power(algebraic[178]*algebraic[178]-3.00000*algebraic[182], 1.0/2)))*cos(arccos((((9.00000*algebraic[178])*algebraic[182]-((2.00000*algebraic[178])*algebraic[178])*algebraic[178])-27.0000*algebraic[170])/(2.00000*(power(algebraic[178]*algebraic[178]-3.00000*algebraic[182], 1.50000))))/3.00000)
    algebraic[201] = (algebraic[149]-algebraic[186])/constants[94]
    algebraic[250] = exp(states[50]*constants[263])
    algebraic[253] = (((constants[107]*states[50])*constants[275])*(states[46]-constants[98]*algebraic[250]))/(1.00000-algebraic[250])
    algebraic[320] = 1.00000-1.00000/(1.00000+power(algebraic[317]/constants[108], 2.00000))
    algebraic[323] = (algebraic[253]*algebraic[320])*states[67]
    algebraic[204] = (states[47]-states[46])/constants[94]
    algebraic[306] = 1.00000/(1.00000+power(0.0300000/algebraic[194], 2.00000))
    algebraic[308] = (1.00000-algebraic[306])*constants[161]+algebraic[306]*constants[379]
    algebraic[324] = (algebraic[308]*states[30])/constants[164]
    algebraic[310] = (states[125]-0.659100)/(0.994500-0.659100)
    algebraic[312] = custom_piecewise([less(algebraic[310] , 0.00000), 0.00000 , True, algebraic[310]])
    algebraic[314] = algebraic[312]*states[40]
    algebraic[316] = states[40]-algebraic[314]
    algebraic[318] = algebraic[312]-algebraic[314]
    algebraic[321] = ((1.00000-algebraic[318])-algebraic[316])-algebraic[314]
    algebraic[322] = ((algebraic[321]*constants[159]+algebraic[318]*constants[374])+algebraic[316]*constants[369])+algebraic[314]*constants[376]
    algebraic[326] = (algebraic[308]*algebraic[186])/(algebraic[186]+algebraic[322])
    algebraic[328] = algebraic[326]-algebraic[324]
    algebraic[213] = (2.00000*states[50])*constants[263]
    algebraic[215] = exp(algebraic[213])
    algebraic[217] = ((((constants[101]*2.00000)*constants[87])*algebraic[213])*(algebraic[186]*algebraic[215]-0.341000*constants[97]))/(algebraic[215]-1.00000)
    algebraic[292] = 1.00000+power(constants[134]/algebraic[186], 2.00000)
    algebraic[293] = 1.00000+constants[140]*algebraic[285]
    algebraic[282] = power(states[48], 3.00000)
    algebraic[294] = (constants[136]*algebraic[282]+constants[364]*algebraic[186])+(constants[362]*constants[97])*(1.00000+algebraic[186]/constants[135])
    algebraic[295] = ((constants[135]*constants[366])*(1.00000+algebraic[282]/constants[362])+algebraic[282]*constants[97])+constants[366]*algebraic[186]
    algebraic[296] = (0.800000*constants[141])*((algebraic[282]*constants[97])*algebraic[284]-(constants[366]*algebraic[186])*algebraic[285])
    algebraic[297] = algebraic[296]/((algebraic[292]*algebraic[293])*(algebraic[294]+algebraic[295]))
    algebraic[304] = (constants[151]*algebraic[186])/(constants[152]+algebraic[186])
    algebraic[327] = -constants[238]*log(constants[98]/states[46])
    algebraic[331] = constants[238]*log(constants[99]/states[126])
    algebraic[332] = algebraic[331]-algebraic[327]
    algebraic[333] = (constants[91]*algebraic[332])/(algebraic[332]+constants[92])
    algebraic[352] = constants[238]*log(constants[100]/states[48])
    algebraic[353] = power(algebraic[352]-algebraic[327], 4.00000)
    algebraic[354] = (constants[93]*algebraic[353])/(algebraic[353]+constants[346])
    algebraic[329] = constants[106]*(states[50]-algebraic[327])
    algebraic[355] = (((constants[241]*(power(states[114], 3.00000)))*states[106])*states[107])*(states[50]-algebraic[352])
    algebraic[356] = (((constants[241]*(power(states[108], 3.00000)))*states[106])*states[107])*(states[50]-algebraic[352])
    algebraic[357] = (((constants[241]*(power(states[111], 3.00000)))*states[109])*states[110])*(states[50]-algebraic[352])
    algebraic[358] = ((((constants[241]*(power(states[114], 3.00000)))*states[112])*states[113])*(states[50]-algebraic[352]))*1.25000
    algebraic[273] = (states[105]-0.239480)/(0.950143-0.239480)
    algebraic[274] = custom_piecewise([less(algebraic[273] , 0.00000), 0.00000 , True, algebraic[273]])
    algebraic[275] = algebraic[274]*states[38]
    algebraic[276] = states[38]-algebraic[275]
    algebraic[277] = algebraic[274]-algebraic[275]
    algebraic[278] = ((1.00000-algebraic[277])-algebraic[276])-algebraic[275]
    algebraic[359] = ((algebraic[278]*algebraic[357]+algebraic[277]*algebraic[358])+algebraic[276]*algebraic[356])+algebraic[275]*algebraic[355]
    algebraic[279] = states[50]*constants[263]
    algebraic[280] = exp(algebraic[279])
    algebraic[281] = (((constants[133]*constants[87])*algebraic[279])*(states[48]*algebraic[280]-constants[100]))/(algebraic[280]-1.00000)
    algebraic[300] = (constants[144]*constants[242])/(1.00000+exp(-(states[50]+92.0000)*constants[263]))
    algebraic[301] = algebraic[300]*(power(states[48]/(states[48]+constants[147]), 3.00000))
    algebraic[302] = algebraic[300]*(power(states[48]/(states[48]+constants[148]), 3.00000))
    algebraic[298] = (states[115]-0.126345)/(0.998014-0.126345)
    algebraic[299] = custom_piecewise([less(algebraic[298] , 0.00000), 0.00000 , True, algebraic[298]])
    algebraic[303] = (1.00000-algebraic[299])*algebraic[301]+algebraic[299]*algebraic[302]
    algebraic[360] = ((power(states[117], 3.00000))*states[116])*(states[50]-algebraic[352])
    algebraic[361] = 0.0160000*algebraic[360]
    algebraic[362] = 0.00650000*algebraic[360]
    algebraic[363] = (1.00000-states[38])*algebraic[362]+states[38]*algebraic[361]
    algebraic[365] = (((algebraic[359]+algebraic[281])+algebraic[363])+algebraic[303]*3.00000)+algebraic[297]*3.00000
    algebraic[305] = (((algebraic[248]+algebraic[217])+algebraic[304])-algebraic[297]*2.00000)-algebraic[291]*2.00000
    algebraic[330] = algebraic[329]+algebraic[323]
    algebraic[334] = states[50]-algebraic[331]
    algebraic[335] = 1.02000/(1.00000+exp(0.238500*(algebraic[334]-59.2150)))
    algebraic[336] = (0.491240*exp(0.0803200*(algebraic[334]+5.47600))+exp(0.0617500*(algebraic[334]-594.310)))/(1.00000+exp(-0.514300*(algebraic[334]+4.75300)))
    algebraic[337] = (constants[239]*(algebraic[335]/(algebraic[335]+algebraic[336])))*algebraic[334]
    algebraic[338] = algebraic[337]*1.20000
    algebraic[339] = (1.00000-states[37])*algebraic[337]+states[37]*algebraic[338]
    algebraic[256] = 1.00000/(1.00000+exp((states[50]+10.0000)/15.4000))
    algebraic[340] = ((constants[240]*states[68])*algebraic[256])*(states[50]-algebraic[331])
    algebraic[348] = constants[238]*log((constants[99]+constants[165]*constants[100])/(states[126]+constants[165]*states[48]))
    algebraic[259] = 0.195610*(1.00000+0.600000/(1.00000+power(3.80000e-05/algebraic[186], 1.40000)))
    algebraic[349] = (algebraic[259]*(states[69]+states[70]))*(states[50]-algebraic[348])
    algebraic[350] = (algebraic[259]*(states[71]+states[72]))*(states[50]-algebraic[348])
    algebraic[262] = (states[103]+constants[403])/constants[110]
    algebraic[264] = (algebraic[262]-constants[404])/(0.785000-constants[404])
    algebraic[266] = custom_piecewise([less(algebraic[264] , 0.00000), 0.00000 , True, algebraic[264]])
    algebraic[351] = algebraic[266]*algebraic[350]+(1.00000-algebraic[266])*algebraic[349]
    algebraic[341] = (constants[123]*(states[50]-algebraic[331]))/(1.00000+exp((15.0000-states[50])/17.0000))
    algebraic[342] = ((constants[123]*(states[50]-algebraic[331]))/(1.00000+exp((36.0000-states[50])/17.0000)))*3.62000
    algebraic[268] = (states[104]-0.0589380)/(0.393747-0.0589380)
    algebraic[270] = custom_piecewise([less(algebraic[268] , 0.00000), 0.00000 , True, algebraic[268]])
    algebraic[343] = (1.00000-algebraic[270])*algebraic[341]+algebraic[270]*algebraic[342]
    algebraic[325] = exp(states[50]/550.000)
    algebraic[344] = ((constants[157]*(power(states[120], 3.00000)))*algebraic[325])*(states[50]-algebraic[331])
    algebraic[345] = algebraic[344]*(0.735600*states[121]+0.264400*states[123])
    algebraic[346] = algebraic[344]*(0.735600*states[122]+0.264400*states[124])
    algebraic[347] = (1.00000-states[39])*algebraic[346]+states[39]*algebraic[345]
    algebraic[364] = ((((algebraic[339]+algebraic[340])+algebraic[351])+algebraic[343])+algebraic[347])-2.00000*algebraic[303]
    algebraic[366] = algebraic[365]+algebraic[291]*3.00000
    algebraic[367] = ((algebraic[366]+algebraic[364])+algebraic[305])+algebraic[330]
    algebraic[368] = (custom_piecewise([less((voi-constants[213])-constants[214]*floor((voi-constants[213])/constants[214]) , constants[212]), 1.00000 , True, 0.00000]))*constants[256]
    return algebraic

def custom_piecewise(cases):
    """Compute result of a piecewise function"""
    return select(cases[0::2],cases[1::2])

def solve_model():
    """Solve model with ODE solver"""
    from scipy.integrate import ode
    # Initialise constants and state variables
    (init_states, constants) = initConsts()

    # Set timespan to solve over
    voi = linspace(0, 10, 500)

    # Construct ODE object to solve
    r = ode(computeRates)
    r.set_integrator('vode', method='bdf', atol=1e-06, rtol=1e-06, max_step=1)
    r.set_initial_value(init_states, voi[0])
    r.set_f_params(constants)

    # Solve model
    states = array([[0.0] * len(voi)] * sizeStates)
    states[:,0] = init_states
    for (i,t) in enumerate(voi[1:]):
        if r.successful():
            r.integrate(t)
            states[:,i+1] = r.y
        else:
            break

    # Compute algebraic variables
    algebraic = computeAlgebraic(constants, states, voi)
    return (voi, states, algebraic)

def plot_model(voi, states, algebraic):
    """Plot variables against variable of integration"""
    import pylab
    (legend_states, legend_algebraic, legend_voi, legend_constants) = createLegends()
    pylab.figure(1)
    pylab.plot(voi,vstack((states,algebraic)).T)
    pylab.xlabel(legend_voi)
    pylab.legend(legend_states + legend_algebraic, loc='best')
    pylab.show()

if __name__ == "__main__":
    (voi, states, algebraic) = solve_model()
    plot_model(voi, states, algebraic)
Source
Derived from workspace Heijman et al. 2011 at changeset c240497a46fb.
Collaboration
To begin collaborating on this work, please use your git client and issue this command:
License
The terms of use/license for this work is unspecified.