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 = 160
sizeStates = 50
sizeConstants = 370
from math import *
from numpy import *

def createLegends():
    legend_states = [""] * sizeStates
    legend_rates = [""] * sizeStates
    legend_algebraic = [""] * sizeAlgebraic
    legend_voi = ""
    legend_constants = [""] * sizeConstants
    legend_algebraic[0] = "sum_g_syn_e_s_1 in component synaptic_coupling (nanoS)"
    legend_algebraic[5] = "sum_g_syn_e_s_2 in component synaptic_coupling (nanoS)"
    legend_algebraic[10] = "sum_g_syn_e_s_3 in component synaptic_coupling (nanoS)"
    legend_algebraic[15] = "sum_g_syn_e_s_4 in component synaptic_coupling (nanoS)"
    legend_algebraic[20] = "sum_g_syn_e_s_5 in component synaptic_coupling (nanoS)"
    legend_algebraic[25] = "sum_g_syn_e_s_6 in component synaptic_coupling (nanoS)"
    legend_algebraic[30] = "sum_g_syn_e_s_7 in component synaptic_coupling (nanoS)"
    legend_algebraic[35] = "sum_g_syn_e_s_8 in component synaptic_coupling (nanoS)"
    legend_algebraic[40] = "sum_g_syn_e_s_9 in component synaptic_coupling (nanoS)"
    legend_algebraic[45] = "sum_g_syn_e_s_10 in component synaptic_coupling (nanoS)"
    legend_constants[0] = "g_syn_e_1_2 in component synaptic_coupling (nanoS)"
    legend_constants[1] = "g_syn_e_1_3 in component synaptic_coupling (nanoS)"
    legend_constants[2] = "g_syn_e_1_4 in component synaptic_coupling (nanoS)"
    legend_constants[3] = "g_syn_e_1_5 in component synaptic_coupling (nanoS)"
    legend_constants[4] = "g_syn_e_1_6 in component synaptic_coupling (nanoS)"
    legend_constants[5] = "g_syn_e_1_7 in component synaptic_coupling (nanoS)"
    legend_constants[6] = "g_syn_e_1_8 in component synaptic_coupling (nanoS)"
    legend_constants[7] = "g_syn_e_1_9 in component synaptic_coupling (nanoS)"
    legend_constants[8] = "g_syn_e_1_10 in component synaptic_coupling (nanoS)"
    legend_constants[9] = "g_syn_e_2_1 in component synaptic_coupling (nanoS)"
    legend_constants[10] = "g_syn_e_2_3 in component synaptic_coupling (nanoS)"
    legend_constants[11] = "g_syn_e_2_4 in component synaptic_coupling (nanoS)"
    legend_constants[12] = "g_syn_e_2_5 in component synaptic_coupling (nanoS)"
    legend_constants[13] = "g_syn_e_2_6 in component synaptic_coupling (nanoS)"
    legend_constants[14] = "g_syn_e_2_7 in component synaptic_coupling (nanoS)"
    legend_constants[15] = "g_syn_e_2_8 in component synaptic_coupling (nanoS)"
    legend_constants[16] = "g_syn_e_2_9 in component synaptic_coupling (nanoS)"
    legend_constants[17] = "g_syn_e_2_10 in component synaptic_coupling (nanoS)"
    legend_constants[18] = "g_syn_e_3_1 in component synaptic_coupling (nanoS)"
    legend_constants[19] = "g_syn_e_3_2 in component synaptic_coupling (nanoS)"
    legend_constants[20] = "g_syn_e_3_4 in component synaptic_coupling (nanoS)"
    legend_constants[21] = "g_syn_e_3_5 in component synaptic_coupling (nanoS)"
    legend_constants[22] = "g_syn_e_3_6 in component synaptic_coupling (nanoS)"
    legend_constants[23] = "g_syn_e_3_7 in component synaptic_coupling (nanoS)"
    legend_constants[24] = "g_syn_e_3_8 in component synaptic_coupling (nanoS)"
    legend_constants[25] = "g_syn_e_3_9 in component synaptic_coupling (nanoS)"
    legend_constants[26] = "g_syn_e_3_10 in component synaptic_coupling (nanoS)"
    legend_constants[27] = "g_syn_e_4_1 in component synaptic_coupling (nanoS)"
    legend_constants[28] = "g_syn_e_4_2 in component synaptic_coupling (nanoS)"
    legend_constants[29] = "g_syn_e_4_3 in component synaptic_coupling (nanoS)"
    legend_constants[30] = "g_syn_e_4_5 in component synaptic_coupling (nanoS)"
    legend_constants[31] = "g_syn_e_4_6 in component synaptic_coupling (nanoS)"
    legend_constants[32] = "g_syn_e_4_7 in component synaptic_coupling (nanoS)"
    legend_constants[33] = "g_syn_e_4_8 in component synaptic_coupling (nanoS)"
    legend_constants[34] = "g_syn_e_4_9 in component synaptic_coupling (nanoS)"
    legend_constants[35] = "g_syn_e_4_10 in component synaptic_coupling (nanoS)"
    legend_constants[36] = "g_syn_e_5_1 in component synaptic_coupling (nanoS)"
    legend_constants[37] = "g_syn_e_5_2 in component synaptic_coupling (nanoS)"
    legend_constants[38] = "g_syn_e_5_3 in component synaptic_coupling (nanoS)"
    legend_constants[39] = "g_syn_e_5_4 in component synaptic_coupling (nanoS)"
    legend_constants[40] = "g_syn_e_5_6 in component synaptic_coupling (nanoS)"
    legend_constants[41] = "g_syn_e_5_7 in component synaptic_coupling (nanoS)"
    legend_constants[42] = "g_syn_e_5_8 in component synaptic_coupling (nanoS)"
    legend_constants[43] = "g_syn_e_5_9 in component synaptic_coupling (nanoS)"
    legend_constants[44] = "g_syn_e_5_10 in component synaptic_coupling (nanoS)"
    legend_constants[45] = "g_syn_e_6_1 in component synaptic_coupling (nanoS)"
    legend_constants[46] = "g_syn_e_6_2 in component synaptic_coupling (nanoS)"
    legend_constants[47] = "g_syn_e_6_3 in component synaptic_coupling (nanoS)"
    legend_constants[48] = "g_syn_e_6_4 in component synaptic_coupling (nanoS)"
    legend_constants[49] = "g_syn_e_6_5 in component synaptic_coupling (nanoS)"
    legend_constants[50] = "g_syn_e_6_7 in component synaptic_coupling (nanoS)"
    legend_constants[51] = "g_syn_e_6_8 in component synaptic_coupling (nanoS)"
    legend_constants[52] = "g_syn_e_6_9 in component synaptic_coupling (nanoS)"
    legend_constants[53] = "g_syn_e_6_10 in component synaptic_coupling (nanoS)"
    legend_constants[54] = "g_syn_e_7_1 in component synaptic_coupling (nanoS)"
    legend_constants[55] = "g_syn_e_7_2 in component synaptic_coupling (nanoS)"
    legend_constants[56] = "g_syn_e_7_3 in component synaptic_coupling (nanoS)"
    legend_constants[57] = "g_syn_e_7_4 in component synaptic_coupling (nanoS)"
    legend_constants[58] = "g_syn_e_7_5 in component synaptic_coupling (nanoS)"
    legend_constants[59] = "g_syn_e_7_6 in component synaptic_coupling (nanoS)"
    legend_constants[60] = "g_syn_e_7_8 in component synaptic_coupling (nanoS)"
    legend_constants[61] = "g_syn_e_7_9 in component synaptic_coupling (nanoS)"
    legend_constants[62] = "g_syn_e_7_10 in component synaptic_coupling (nanoS)"
    legend_constants[63] = "g_syn_e_8_1 in component synaptic_coupling (nanoS)"
    legend_constants[64] = "g_syn_e_8_2 in component synaptic_coupling (nanoS)"
    legend_constants[65] = "g_syn_e_8_3 in component synaptic_coupling (nanoS)"
    legend_constants[66] = "g_syn_e_8_4 in component synaptic_coupling (nanoS)"
    legend_constants[67] = "g_syn_e_8_5 in component synaptic_coupling (nanoS)"
    legend_constants[68] = "g_syn_e_8_6 in component synaptic_coupling (nanoS)"
    legend_constants[69] = "g_syn_e_8_7 in component synaptic_coupling (nanoS)"
    legend_constants[70] = "g_syn_e_8_9 in component synaptic_coupling (nanoS)"
    legend_constants[71] = "g_syn_e_8_10 in component synaptic_coupling (nanoS)"
    legend_constants[72] = "g_syn_e_9_1 in component synaptic_coupling (nanoS)"
    legend_constants[73] = "g_syn_e_9_2 in component synaptic_coupling (nanoS)"
    legend_constants[74] = "g_syn_e_9_3 in component synaptic_coupling (nanoS)"
    legend_constants[75] = "g_syn_e_9_4 in component synaptic_coupling (nanoS)"
    legend_constants[76] = "g_syn_e_9_5 in component synaptic_coupling (nanoS)"
    legend_constants[77] = "g_syn_e_9_6 in component synaptic_coupling (nanoS)"
    legend_constants[78] = "g_syn_e_9_7 in component synaptic_coupling (nanoS)"
    legend_constants[79] = "g_syn_e_9_8 in component synaptic_coupling (nanoS)"
    legend_constants[80] = "g_syn_e_9_10 in component synaptic_coupling (nanoS)"
    legend_constants[81] = "g_syn_e_10_1 in component synaptic_coupling (nanoS)"
    legend_constants[82] = "g_syn_e_10_2 in component synaptic_coupling (nanoS)"
    legend_constants[83] = "g_syn_e_10_3 in component synaptic_coupling (nanoS)"
    legend_constants[84] = "g_syn_e_10_4 in component synaptic_coupling (nanoS)"
    legend_constants[85] = "g_syn_e_10_5 in component synaptic_coupling (nanoS)"
    legend_constants[86] = "g_syn_e_10_6 in component synaptic_coupling (nanoS)"
    legend_constants[87] = "g_syn_e_10_7 in component synaptic_coupling (nanoS)"
    legend_constants[88] = "g_syn_e_10_8 in component synaptic_coupling (nanoS)"
    legend_constants[89] = "g_syn_e_10_9 in component synaptic_coupling (nanoS)"
    legend_states[0] = "s in component synaptic_input (dimensionless)"
    legend_states[1] = "s in component synaptic_input (dimensionless)"
    legend_states[2] = "s in component synaptic_input (dimensionless)"
    legend_states[3] = "s in component synaptic_input (dimensionless)"
    legend_states[4] = "s in component synaptic_input (dimensionless)"
    legend_states[5] = "s in component synaptic_input (dimensionless)"
    legend_states[6] = "s in component synaptic_input (dimensionless)"
    legend_states[7] = "s in component synaptic_input (dimensionless)"
    legend_states[8] = "s in component synaptic_input (dimensionless)"
    legend_states[9] = "s in component synaptic_input (dimensionless)"
    legend_voi = "time in component environment (millisecond)"
    legend_states[10] = "V in component membrane (millivolt)"
    legend_constants[90] = "C in component membrane (picoF)"
    legend_constants[91] = "i_app in component membrane (picoA)"
    legend_algebraic[120] = "i_NaP in component persistent_sodium_current (picoA)"
    legend_algebraic[90] = "i_Na in component fast_sodium_current (picoA)"
    legend_algebraic[100] = "i_K in component potassium_current (picoA)"
    legend_algebraic[130] = "i_L in component leakage_current (picoA)"
    legend_algebraic[140] = "i_tonic_e in component tonic_current (picoA)"
    legend_algebraic[150] = "i_syn_e in component synaptic_input (picoA)"
    legend_constants[92] = "E_Na in component fast_sodium_current (millivolt)"
    legend_constants[93] = "g_Na in component fast_sodium_current (nanoS)"
    legend_algebraic[50] = "m_infinity in component fast_sodium_current_m_gate (dimensionless)"
    legend_states[11] = "n in component fast_sodium_current_n_gate (dimensionless)"
    legend_constants[94] = "theta_m in component fast_sodium_current_m_gate (millivolt)"
    legend_constants[95] = "sigma_m in component fast_sodium_current_m_gate (millivolt)"
    legend_algebraic[1] = "n_infinity in component fast_sodium_current_n_gate (dimensionless)"
    legend_algebraic[51] = "tau_n in component fast_sodium_current_n_gate (millisecond)"
    legend_constants[96] = "tau_n_max in component fast_sodium_current_n_gate (millisecond)"
    legend_constants[97] = "theta_n in component fast_sodium_current_n_gate (millivolt)"
    legend_constants[98] = "sigma_n in component fast_sodium_current_n_gate (millivolt)"
    legend_constants[99] = "g_K in component potassium_current (nanoS)"
    legend_constants[100] = "E_K in component potassium_current (millivolt)"
    legend_states[12] = "n in component potassium_current_n_gate (dimensionless)"
    legend_algebraic[2] = "n_infinity in component potassium_current_n_gate (dimensionless)"
    legend_algebraic[52] = "tau_n in component potassium_current_n_gate (millisecond)"
    legend_constants[101] = "tau_n_max in component potassium_current_n_gate (millisecond)"
    legend_constants[102] = "theta_n in component potassium_current_n_gate (millivolt)"
    legend_constants[103] = "sigma_n in component potassium_current_n_gate (millivolt)"
    legend_constants[104] = "g_NaP in component persistent_sodium_current (nanoS)"
    legend_algebraic[110] = "m_infinity in component persistent_sodium_current_m_gate (dimensionless)"
    legend_states[13] = "h in component persistent_sodium_current_h_gate (dimensionless)"
    legend_constants[105] = "theta_m in component persistent_sodium_current_m_gate (millivolt)"
    legend_constants[106] = "sigma_m in component persistent_sodium_current_m_gate (millivolt)"
    legend_algebraic[3] = "h_infinity in component persistent_sodium_current_h_gate (dimensionless)"
    legend_algebraic[53] = "tau_h in component persistent_sodium_current_h_gate (millisecond)"
    legend_constants[107] = "tau_h_max in component persistent_sodium_current_h_gate (millisecond)"
    legend_constants[108] = "theta_h in component persistent_sodium_current_h_gate (millivolt)"
    legend_constants[109] = "sigma_h in component persistent_sodium_current_h_gate (millivolt)"
    legend_constants[110] = "g_L in component leakage_current (nanoS)"
    legend_constants[111] = "E_L in component leakage_current (millivolt)"
    legend_constants[112] = "E_syn_e in component tonic_current (millivolt)"
    legend_constants[113] = "g_tonic_e in component tonic_current (nanoS)"
    legend_algebraic[4] = "s_infinity in component synaptic_input (dimensionless)"
    legend_constants[114] = "kr in component synaptic_input (dimensionless)"
    legend_constants[115] = "tau_s in component synaptic_input (millisecond)"
    legend_constants[116] = "sigma_s in component synaptic_input (millivolt)"
    legend_constants[117] = "theta_s in component synaptic_input (millivolt)"
    legend_voi = "time in component environment (millisecond)"
    legend_states[14] = "V in component membrane (millivolt)"
    legend_constants[118] = "C in component membrane (picoF)"
    legend_constants[119] = "i_app in component membrane (picoA)"
    legend_algebraic[121] = "i_NaP in component persistent_sodium_current (picoA)"
    legend_algebraic[91] = "i_Na in component fast_sodium_current (picoA)"
    legend_algebraic[101] = "i_K in component potassium_current (picoA)"
    legend_algebraic[131] = "i_L in component leakage_current (picoA)"
    legend_algebraic[141] = "i_tonic_e in component tonic_current (picoA)"
    legend_algebraic[151] = "i_syn_e in component synaptic_input (picoA)"
    legend_constants[120] = "E_Na in component fast_sodium_current (millivolt)"
    legend_constants[121] = "g_Na in component fast_sodium_current (nanoS)"
    legend_algebraic[54] = "m_infinity in component fast_sodium_current_m_gate (dimensionless)"
    legend_states[15] = "n in component fast_sodium_current_n_gate (dimensionless)"
    legend_constants[122] = "theta_m in component fast_sodium_current_m_gate (millivolt)"
    legend_constants[123] = "sigma_m in component fast_sodium_current_m_gate (millivolt)"
    legend_algebraic[6] = "n_infinity in component fast_sodium_current_n_gate (dimensionless)"
    legend_algebraic[55] = "tau_n in component fast_sodium_current_n_gate (millisecond)"
    legend_constants[124] = "tau_n_max in component fast_sodium_current_n_gate (millisecond)"
    legend_constants[125] = "theta_n in component fast_sodium_current_n_gate (millivolt)"
    legend_constants[126] = "sigma_n in component fast_sodium_current_n_gate (millivolt)"
    legend_constants[127] = "g_K in component potassium_current (nanoS)"
    legend_constants[128] = "E_K in component potassium_current (millivolt)"
    legend_states[16] = "n in component potassium_current_n_gate (dimensionless)"
    legend_algebraic[7] = "n_infinity in component potassium_current_n_gate (dimensionless)"
    legend_algebraic[56] = "tau_n in component potassium_current_n_gate (millisecond)"
    legend_constants[129] = "tau_n_max in component potassium_current_n_gate (millisecond)"
    legend_constants[130] = "theta_n in component potassium_current_n_gate (millivolt)"
    legend_constants[131] = "sigma_n in component potassium_current_n_gate (millivolt)"
    legend_constants[132] = "g_NaP in component persistent_sodium_current (nanoS)"
    legend_algebraic[111] = "m_infinity in component persistent_sodium_current_m_gate (dimensionless)"
    legend_states[17] = "h in component persistent_sodium_current_h_gate (dimensionless)"
    legend_constants[133] = "theta_m in component persistent_sodium_current_m_gate (millivolt)"
    legend_constants[134] = "sigma_m in component persistent_sodium_current_m_gate (millivolt)"
    legend_algebraic[8] = "h_infinity in component persistent_sodium_current_h_gate (dimensionless)"
    legend_algebraic[57] = "tau_h in component persistent_sodium_current_h_gate (millisecond)"
    legend_constants[135] = "tau_h_max in component persistent_sodium_current_h_gate (millisecond)"
    legend_constants[136] = "theta_h in component persistent_sodium_current_h_gate (millivolt)"
    legend_constants[137] = "sigma_h in component persistent_sodium_current_h_gate (millivolt)"
    legend_constants[138] = "g_L in component leakage_current (nanoS)"
    legend_constants[139] = "E_L in component leakage_current (millivolt)"
    legend_constants[140] = "E_syn_e in component tonic_current (millivolt)"
    legend_constants[141] = "g_tonic_e in component tonic_current (nanoS)"
    legend_algebraic[9] = "s_infinity in component synaptic_input (dimensionless)"
    legend_constants[142] = "kr in component synaptic_input (dimensionless)"
    legend_constants[143] = "tau_s in component synaptic_input (millisecond)"
    legend_constants[144] = "sigma_s in component synaptic_input (millivolt)"
    legend_constants[145] = "theta_s in component synaptic_input (millivolt)"
    legend_voi = "time in component environment (millisecond)"
    legend_states[18] = "V in component membrane (millivolt)"
    legend_constants[146] = "C in component membrane (picoF)"
    legend_constants[147] = "i_app in component membrane (picoA)"
    legend_algebraic[122] = "i_NaP in component persistent_sodium_current (picoA)"
    legend_algebraic[92] = "i_Na in component fast_sodium_current (picoA)"
    legend_algebraic[102] = "i_K in component potassium_current (picoA)"
    legend_algebraic[132] = "i_L in component leakage_current (picoA)"
    legend_algebraic[142] = "i_tonic_e in component tonic_current (picoA)"
    legend_algebraic[152] = "i_syn_e in component synaptic_input (picoA)"
    legend_constants[148] = "E_Na in component fast_sodium_current (millivolt)"
    legend_constants[149] = "g_Na in component fast_sodium_current (nanoS)"
    legend_algebraic[58] = "m_infinity in component fast_sodium_current_m_gate (dimensionless)"
    legend_states[19] = "n in component fast_sodium_current_n_gate (dimensionless)"
    legend_constants[150] = "theta_m in component fast_sodium_current_m_gate (millivolt)"
    legend_constants[151] = "sigma_m in component fast_sodium_current_m_gate (millivolt)"
    legend_algebraic[11] = "n_infinity in component fast_sodium_current_n_gate (dimensionless)"
    legend_algebraic[59] = "tau_n in component fast_sodium_current_n_gate (millisecond)"
    legend_constants[152] = "tau_n_max in component fast_sodium_current_n_gate (millisecond)"
    legend_constants[153] = "theta_n in component fast_sodium_current_n_gate (millivolt)"
    legend_constants[154] = "sigma_n in component fast_sodium_current_n_gate (millivolt)"
    legend_constants[155] = "g_K in component potassium_current (nanoS)"
    legend_constants[156] = "E_K in component potassium_current (millivolt)"
    legend_states[20] = "n in component potassium_current_n_gate (dimensionless)"
    legend_algebraic[12] = "n_infinity in component potassium_current_n_gate (dimensionless)"
    legend_algebraic[60] = "tau_n in component potassium_current_n_gate (millisecond)"
    legend_constants[157] = "tau_n_max in component potassium_current_n_gate (millisecond)"
    legend_constants[158] = "theta_n in component potassium_current_n_gate (millivolt)"
    legend_constants[159] = "sigma_n in component potassium_current_n_gate (millivolt)"
    legend_constants[160] = "g_NaP in component persistent_sodium_current (nanoS)"
    legend_algebraic[112] = "m_infinity in component persistent_sodium_current_m_gate (dimensionless)"
    legend_states[21] = "h in component persistent_sodium_current_h_gate (dimensionless)"
    legend_constants[161] = "theta_m in component persistent_sodium_current_m_gate (millivolt)"
    legend_constants[162] = "sigma_m in component persistent_sodium_current_m_gate (millivolt)"
    legend_algebraic[13] = "h_infinity in component persistent_sodium_current_h_gate (dimensionless)"
    legend_algebraic[61] = "tau_h in component persistent_sodium_current_h_gate (millisecond)"
    legend_constants[163] = "tau_h_max in component persistent_sodium_current_h_gate (millisecond)"
    legend_constants[164] = "theta_h in component persistent_sodium_current_h_gate (millivolt)"
    legend_constants[165] = "sigma_h in component persistent_sodium_current_h_gate (millivolt)"
    legend_constants[166] = "g_L in component leakage_current (nanoS)"
    legend_constants[167] = "E_L in component leakage_current (millivolt)"
    legend_constants[168] = "E_syn_e in component tonic_current (millivolt)"
    legend_constants[169] = "g_tonic_e in component tonic_current (nanoS)"
    legend_algebraic[14] = "s_infinity in component synaptic_input (dimensionless)"
    legend_constants[170] = "kr in component synaptic_input (dimensionless)"
    legend_constants[171] = "tau_s in component synaptic_input (millisecond)"
    legend_constants[172] = "sigma_s in component synaptic_input (millivolt)"
    legend_constants[173] = "theta_s in component synaptic_input (millivolt)"
    legend_voi = "time in component environment (millisecond)"
    legend_states[22] = "V in component membrane (millivolt)"
    legend_constants[174] = "C in component membrane (picoF)"
    legend_constants[175] = "i_app in component membrane (picoA)"
    legend_algebraic[123] = "i_NaP in component persistent_sodium_current (picoA)"
    legend_algebraic[93] = "i_Na in component fast_sodium_current (picoA)"
    legend_algebraic[103] = "i_K in component potassium_current (picoA)"
    legend_algebraic[133] = "i_L in component leakage_current (picoA)"
    legend_algebraic[143] = "i_tonic_e in component tonic_current (picoA)"
    legend_algebraic[153] = "i_syn_e in component synaptic_input (picoA)"
    legend_constants[176] = "E_Na in component fast_sodium_current (millivolt)"
    legend_constants[177] = "g_Na in component fast_sodium_current (nanoS)"
    legend_algebraic[62] = "m_infinity in component fast_sodium_current_m_gate (dimensionless)"
    legend_states[23] = "n in component fast_sodium_current_n_gate (dimensionless)"
    legend_constants[178] = "theta_m in component fast_sodium_current_m_gate (millivolt)"
    legend_constants[179] = "sigma_m in component fast_sodium_current_m_gate (millivolt)"
    legend_algebraic[16] = "n_infinity in component fast_sodium_current_n_gate (dimensionless)"
    legend_algebraic[63] = "tau_n in component fast_sodium_current_n_gate (millisecond)"
    legend_constants[180] = "tau_n_max in component fast_sodium_current_n_gate (millisecond)"
    legend_constants[181] = "theta_n in component fast_sodium_current_n_gate (millivolt)"
    legend_constants[182] = "sigma_n in component fast_sodium_current_n_gate (millivolt)"
    legend_constants[183] = "g_K in component potassium_current (nanoS)"
    legend_constants[184] = "E_K in component potassium_current (millivolt)"
    legend_states[24] = "n in component potassium_current_n_gate (dimensionless)"
    legend_algebraic[17] = "n_infinity in component potassium_current_n_gate (dimensionless)"
    legend_algebraic[64] = "tau_n in component potassium_current_n_gate (millisecond)"
    legend_constants[185] = "tau_n_max in component potassium_current_n_gate (millisecond)"
    legend_constants[186] = "theta_n in component potassium_current_n_gate (millivolt)"
    legend_constants[187] = "sigma_n in component potassium_current_n_gate (millivolt)"
    legend_constants[188] = "g_NaP in component persistent_sodium_current (nanoS)"
    legend_algebraic[113] = "m_infinity in component persistent_sodium_current_m_gate (dimensionless)"
    legend_states[25] = "h in component persistent_sodium_current_h_gate (dimensionless)"
    legend_constants[189] = "theta_m in component persistent_sodium_current_m_gate (millivolt)"
    legend_constants[190] = "sigma_m in component persistent_sodium_current_m_gate (millivolt)"
    legend_algebraic[18] = "h_infinity in component persistent_sodium_current_h_gate (dimensionless)"
    legend_algebraic[65] = "tau_h in component persistent_sodium_current_h_gate (millisecond)"
    legend_constants[191] = "tau_h_max in component persistent_sodium_current_h_gate (millisecond)"
    legend_constants[192] = "theta_h in component persistent_sodium_current_h_gate (millivolt)"
    legend_constants[193] = "sigma_h in component persistent_sodium_current_h_gate (millivolt)"
    legend_constants[194] = "g_L in component leakage_current (nanoS)"
    legend_constants[195] = "E_L in component leakage_current (millivolt)"
    legend_constants[196] = "E_syn_e in component tonic_current (millivolt)"
    legend_constants[197] = "g_tonic_e in component tonic_current (nanoS)"
    legend_algebraic[19] = "s_infinity in component synaptic_input (dimensionless)"
    legend_constants[198] = "kr in component synaptic_input (dimensionless)"
    legend_constants[199] = "tau_s in component synaptic_input (millisecond)"
    legend_constants[200] = "sigma_s in component synaptic_input (millivolt)"
    legend_constants[201] = "theta_s in component synaptic_input (millivolt)"
    legend_voi = "time in component environment (millisecond)"
    legend_states[26] = "V in component membrane (millivolt)"
    legend_constants[202] = "C in component membrane (picoF)"
    legend_constants[203] = "i_app in component membrane (picoA)"
    legend_algebraic[124] = "i_NaP in component persistent_sodium_current (picoA)"
    legend_algebraic[94] = "i_Na in component fast_sodium_current (picoA)"
    legend_algebraic[104] = "i_K in component potassium_current (picoA)"
    legend_algebraic[134] = "i_L in component leakage_current (picoA)"
    legend_algebraic[144] = "i_tonic_e in component tonic_current (picoA)"
    legend_algebraic[154] = "i_syn_e in component synaptic_input (picoA)"
    legend_constants[204] = "E_Na in component fast_sodium_current (millivolt)"
    legend_constants[205] = "g_Na in component fast_sodium_current (nanoS)"
    legend_algebraic[66] = "m_infinity in component fast_sodium_current_m_gate (dimensionless)"
    legend_states[27] = "n in component fast_sodium_current_n_gate (dimensionless)"
    legend_constants[206] = "theta_m in component fast_sodium_current_m_gate (millivolt)"
    legend_constants[207] = "sigma_m in component fast_sodium_current_m_gate (millivolt)"
    legend_algebraic[21] = "n_infinity in component fast_sodium_current_n_gate (dimensionless)"
    legend_algebraic[67] = "tau_n in component fast_sodium_current_n_gate (millisecond)"
    legend_constants[208] = "tau_n_max in component fast_sodium_current_n_gate (millisecond)"
    legend_constants[209] = "theta_n in component fast_sodium_current_n_gate (millivolt)"
    legend_constants[210] = "sigma_n in component fast_sodium_current_n_gate (millivolt)"
    legend_constants[211] = "g_K in component potassium_current (nanoS)"
    legend_constants[212] = "E_K in component potassium_current (millivolt)"
    legend_states[28] = "n in component potassium_current_n_gate (dimensionless)"
    legend_algebraic[22] = "n_infinity in component potassium_current_n_gate (dimensionless)"
    legend_algebraic[68] = "tau_n in component potassium_current_n_gate (millisecond)"
    legend_constants[213] = "tau_n_max in component potassium_current_n_gate (millisecond)"
    legend_constants[214] = "theta_n in component potassium_current_n_gate (millivolt)"
    legend_constants[215] = "sigma_n in component potassium_current_n_gate (millivolt)"
    legend_constants[216] = "g_NaP in component persistent_sodium_current (nanoS)"
    legend_algebraic[114] = "m_infinity in component persistent_sodium_current_m_gate (dimensionless)"
    legend_states[29] = "h in component persistent_sodium_current_h_gate (dimensionless)"
    legend_constants[217] = "theta_m in component persistent_sodium_current_m_gate (millivolt)"
    legend_constants[218] = "sigma_m in component persistent_sodium_current_m_gate (millivolt)"
    legend_algebraic[23] = "h_infinity in component persistent_sodium_current_h_gate (dimensionless)"
    legend_algebraic[69] = "tau_h in component persistent_sodium_current_h_gate (millisecond)"
    legend_constants[219] = "tau_h_max in component persistent_sodium_current_h_gate (millisecond)"
    legend_constants[220] = "theta_h in component persistent_sodium_current_h_gate (millivolt)"
    legend_constants[221] = "sigma_h in component persistent_sodium_current_h_gate (millivolt)"
    legend_constants[222] = "g_L in component leakage_current (nanoS)"
    legend_constants[223] = "E_L in component leakage_current (millivolt)"
    legend_constants[224] = "E_syn_e in component tonic_current (millivolt)"
    legend_constants[225] = "g_tonic_e in component tonic_current (nanoS)"
    legend_algebraic[24] = "s_infinity in component synaptic_input (dimensionless)"
    legend_constants[226] = "kr in component synaptic_input (dimensionless)"
    legend_constants[227] = "tau_s in component synaptic_input (millisecond)"
    legend_constants[228] = "sigma_s in component synaptic_input (millivolt)"
    legend_constants[229] = "theta_s in component synaptic_input (millivolt)"
    legend_voi = "time in component environment (millisecond)"
    legend_states[30] = "V in component membrane (millivolt)"
    legend_constants[230] = "C in component membrane (picoF)"
    legend_constants[231] = "i_app in component membrane (picoA)"
    legend_algebraic[125] = "i_NaP in component persistent_sodium_current (picoA)"
    legend_algebraic[95] = "i_Na in component fast_sodium_current (picoA)"
    legend_algebraic[105] = "i_K in component potassium_current (picoA)"
    legend_algebraic[135] = "i_L in component leakage_current (picoA)"
    legend_algebraic[145] = "i_tonic_e in component tonic_current (picoA)"
    legend_algebraic[155] = "i_syn_e in component synaptic_input (picoA)"
    legend_constants[232] = "E_Na in component fast_sodium_current (millivolt)"
    legend_constants[233] = "g_Na in component fast_sodium_current (nanoS)"
    legend_algebraic[70] = "m_infinity in component fast_sodium_current_m_gate (dimensionless)"
    legend_states[31] = "n in component fast_sodium_current_n_gate (dimensionless)"
    legend_constants[234] = "theta_m in component fast_sodium_current_m_gate (millivolt)"
    legend_constants[235] = "sigma_m in component fast_sodium_current_m_gate (millivolt)"
    legend_algebraic[26] = "n_infinity in component fast_sodium_current_n_gate (dimensionless)"
    legend_algebraic[71] = "tau_n in component fast_sodium_current_n_gate (millisecond)"
    legend_constants[236] = "tau_n_max in component fast_sodium_current_n_gate (millisecond)"
    legend_constants[237] = "theta_n in component fast_sodium_current_n_gate (millivolt)"
    legend_constants[238] = "sigma_n in component fast_sodium_current_n_gate (millivolt)"
    legend_constants[239] = "g_K in component potassium_current (nanoS)"
    legend_constants[240] = "E_K in component potassium_current (millivolt)"
    legend_states[32] = "n in component potassium_current_n_gate (dimensionless)"
    legend_algebraic[27] = "n_infinity in component potassium_current_n_gate (dimensionless)"
    legend_algebraic[72] = "tau_n in component potassium_current_n_gate (millisecond)"
    legend_constants[241] = "tau_n_max in component potassium_current_n_gate (millisecond)"
    legend_constants[242] = "theta_n in component potassium_current_n_gate (millivolt)"
    legend_constants[243] = "sigma_n in component potassium_current_n_gate (millivolt)"
    legend_constants[244] = "g_NaP in component persistent_sodium_current (nanoS)"
    legend_algebraic[115] = "m_infinity in component persistent_sodium_current_m_gate (dimensionless)"
    legend_states[33] = "h in component persistent_sodium_current_h_gate (dimensionless)"
    legend_constants[245] = "theta_m in component persistent_sodium_current_m_gate (millivolt)"
    legend_constants[246] = "sigma_m in component persistent_sodium_current_m_gate (millivolt)"
    legend_algebraic[28] = "h_infinity in component persistent_sodium_current_h_gate (dimensionless)"
    legend_algebraic[73] = "tau_h in component persistent_sodium_current_h_gate (millisecond)"
    legend_constants[247] = "tau_h_max in component persistent_sodium_current_h_gate (millisecond)"
    legend_constants[248] = "theta_h in component persistent_sodium_current_h_gate (millivolt)"
    legend_constants[249] = "sigma_h in component persistent_sodium_current_h_gate (millivolt)"
    legend_constants[250] = "g_L in component leakage_current (nanoS)"
    legend_constants[251] = "E_L in component leakage_current (millivolt)"
    legend_constants[252] = "E_syn_e in component tonic_current (millivolt)"
    legend_constants[253] = "g_tonic_e in component tonic_current (nanoS)"
    legend_algebraic[29] = "s_infinity in component synaptic_input (dimensionless)"
    legend_constants[254] = "kr in component synaptic_input (dimensionless)"
    legend_constants[255] = "tau_s in component synaptic_input (millisecond)"
    legend_constants[256] = "sigma_s in component synaptic_input (millivolt)"
    legend_constants[257] = "theta_s in component synaptic_input (millivolt)"
    legend_voi = "time in component environment (millisecond)"
    legend_states[34] = "V in component membrane (millivolt)"
    legend_constants[258] = "C in component membrane (picoF)"
    legend_constants[259] = "i_app in component membrane (picoA)"
    legend_algebraic[126] = "i_NaP in component persistent_sodium_current (picoA)"
    legend_algebraic[96] = "i_Na in component fast_sodium_current (picoA)"
    legend_algebraic[106] = "i_K in component potassium_current (picoA)"
    legend_algebraic[136] = "i_L in component leakage_current (picoA)"
    legend_algebraic[146] = "i_tonic_e in component tonic_current (picoA)"
    legend_algebraic[156] = "i_syn_e in component synaptic_input (picoA)"
    legend_constants[260] = "E_Na in component fast_sodium_current (millivolt)"
    legend_constants[261] = "g_Na in component fast_sodium_current (nanoS)"
    legend_algebraic[74] = "m_infinity in component fast_sodium_current_m_gate (dimensionless)"
    legend_states[35] = "n in component fast_sodium_current_n_gate (dimensionless)"
    legend_constants[262] = "theta_m in component fast_sodium_current_m_gate (millivolt)"
    legend_constants[263] = "sigma_m in component fast_sodium_current_m_gate (millivolt)"
    legend_algebraic[31] = "n_infinity in component fast_sodium_current_n_gate (dimensionless)"
    legend_algebraic[75] = "tau_n in component fast_sodium_current_n_gate (millisecond)"
    legend_constants[264] = "tau_n_max in component fast_sodium_current_n_gate (millisecond)"
    legend_constants[265] = "theta_n in component fast_sodium_current_n_gate (millivolt)"
    legend_constants[266] = "sigma_n in component fast_sodium_current_n_gate (millivolt)"
    legend_constants[267] = "g_K in component potassium_current (nanoS)"
    legend_constants[268] = "E_K in component potassium_current (millivolt)"
    legend_states[36] = "n in component potassium_current_n_gate (dimensionless)"
    legend_algebraic[32] = "n_infinity in component potassium_current_n_gate (dimensionless)"
    legend_algebraic[76] = "tau_n in component potassium_current_n_gate (millisecond)"
    legend_constants[269] = "tau_n_max in component potassium_current_n_gate (millisecond)"
    legend_constants[270] = "theta_n in component potassium_current_n_gate (millivolt)"
    legend_constants[271] = "sigma_n in component potassium_current_n_gate (millivolt)"
    legend_constants[272] = "g_NaP in component persistent_sodium_current (nanoS)"
    legend_algebraic[116] = "m_infinity in component persistent_sodium_current_m_gate (dimensionless)"
    legend_states[37] = "h in component persistent_sodium_current_h_gate (dimensionless)"
    legend_constants[273] = "theta_m in component persistent_sodium_current_m_gate (millivolt)"
    legend_constants[274] = "sigma_m in component persistent_sodium_current_m_gate (millivolt)"
    legend_algebraic[33] = "h_infinity in component persistent_sodium_current_h_gate (dimensionless)"
    legend_algebraic[77] = "tau_h in component persistent_sodium_current_h_gate (millisecond)"
    legend_constants[275] = "tau_h_max in component persistent_sodium_current_h_gate (millisecond)"
    legend_constants[276] = "theta_h in component persistent_sodium_current_h_gate (millivolt)"
    legend_constants[277] = "sigma_h in component persistent_sodium_current_h_gate (millivolt)"
    legend_constants[278] = "g_L in component leakage_current (nanoS)"
    legend_constants[279] = "E_L in component leakage_current (millivolt)"
    legend_constants[280] = "E_syn_e in component tonic_current (millivolt)"
    legend_constants[281] = "g_tonic_e in component tonic_current (nanoS)"
    legend_algebraic[34] = "s_infinity in component synaptic_input (dimensionless)"
    legend_constants[282] = "kr in component synaptic_input (dimensionless)"
    legend_constants[283] = "tau_s in component synaptic_input (millisecond)"
    legend_constants[284] = "sigma_s in component synaptic_input (millivolt)"
    legend_constants[285] = "theta_s in component synaptic_input (millivolt)"
    legend_voi = "time in component environment (millisecond)"
    legend_states[38] = "V in component membrane (millivolt)"
    legend_constants[286] = "C in component membrane (picoF)"
    legend_constants[287] = "i_app in component membrane (picoA)"
    legend_algebraic[127] = "i_NaP in component persistent_sodium_current (picoA)"
    legend_algebraic[97] = "i_Na in component fast_sodium_current (picoA)"
    legend_algebraic[107] = "i_K in component potassium_current (picoA)"
    legend_algebraic[137] = "i_L in component leakage_current (picoA)"
    legend_algebraic[147] = "i_tonic_e in component tonic_current (picoA)"
    legend_algebraic[157] = "i_syn_e in component synaptic_input (picoA)"
    legend_constants[288] = "E_Na in component fast_sodium_current (millivolt)"
    legend_constants[289] = "g_Na in component fast_sodium_current (nanoS)"
    legend_algebraic[78] = "m_infinity in component fast_sodium_current_m_gate (dimensionless)"
    legend_states[39] = "n in component fast_sodium_current_n_gate (dimensionless)"
    legend_constants[290] = "theta_m in component fast_sodium_current_m_gate (millivolt)"
    legend_constants[291] = "sigma_m in component fast_sodium_current_m_gate (millivolt)"
    legend_algebraic[36] = "n_infinity in component fast_sodium_current_n_gate (dimensionless)"
    legend_algebraic[79] = "tau_n in component fast_sodium_current_n_gate (millisecond)"
    legend_constants[292] = "tau_n_max in component fast_sodium_current_n_gate (millisecond)"
    legend_constants[293] = "theta_n in component fast_sodium_current_n_gate (millivolt)"
    legend_constants[294] = "sigma_n in component fast_sodium_current_n_gate (millivolt)"
    legend_constants[295] = "g_K in component potassium_current (nanoS)"
    legend_constants[296] = "E_K in component potassium_current (millivolt)"
    legend_states[40] = "n in component potassium_current_n_gate (dimensionless)"
    legend_algebraic[37] = "n_infinity in component potassium_current_n_gate (dimensionless)"
    legend_algebraic[80] = "tau_n in component potassium_current_n_gate (millisecond)"
    legend_constants[297] = "tau_n_max in component potassium_current_n_gate (millisecond)"
    legend_constants[298] = "theta_n in component potassium_current_n_gate (millivolt)"
    legend_constants[299] = "sigma_n in component potassium_current_n_gate (millivolt)"
    legend_constants[300] = "g_NaP in component persistent_sodium_current (nanoS)"
    legend_algebraic[117] = "m_infinity in component persistent_sodium_current_m_gate (dimensionless)"
    legend_states[41] = "h in component persistent_sodium_current_h_gate (dimensionless)"
    legend_constants[301] = "theta_m in component persistent_sodium_current_m_gate (millivolt)"
    legend_constants[302] = "sigma_m in component persistent_sodium_current_m_gate (millivolt)"
    legend_algebraic[38] = "h_infinity in component persistent_sodium_current_h_gate (dimensionless)"
    legend_algebraic[81] = "tau_h in component persistent_sodium_current_h_gate (millisecond)"
    legend_constants[303] = "tau_h_max in component persistent_sodium_current_h_gate (millisecond)"
    legend_constants[304] = "theta_h in component persistent_sodium_current_h_gate (millivolt)"
    legend_constants[305] = "sigma_h in component persistent_sodium_current_h_gate (millivolt)"
    legend_constants[306] = "g_L in component leakage_current (nanoS)"
    legend_constants[307] = "E_L in component leakage_current (millivolt)"
    legend_constants[308] = "E_syn_e in component tonic_current (millivolt)"
    legend_constants[309] = "g_tonic_e in component tonic_current (nanoS)"
    legend_algebraic[39] = "s_infinity in component synaptic_input (dimensionless)"
    legend_constants[310] = "kr in component synaptic_input (dimensionless)"
    legend_constants[311] = "tau_s in component synaptic_input (millisecond)"
    legend_constants[312] = "sigma_s in component synaptic_input (millivolt)"
    legend_constants[313] = "theta_s in component synaptic_input (millivolt)"
    legend_voi = "time in component environment (millisecond)"
    legend_states[42] = "V in component membrane (millivolt)"
    legend_constants[314] = "C in component membrane (picoF)"
    legend_constants[315] = "i_app in component membrane (picoA)"
    legend_algebraic[128] = "i_NaP in component persistent_sodium_current (picoA)"
    legend_algebraic[98] = "i_Na in component fast_sodium_current (picoA)"
    legend_algebraic[108] = "i_K in component potassium_current (picoA)"
    legend_algebraic[138] = "i_L in component leakage_current (picoA)"
    legend_algebraic[148] = "i_tonic_e in component tonic_current (picoA)"
    legend_algebraic[158] = "i_syn_e in component synaptic_input (picoA)"
    legend_constants[316] = "E_Na in component fast_sodium_current (millivolt)"
    legend_constants[317] = "g_Na in component fast_sodium_current (nanoS)"
    legend_algebraic[82] = "m_infinity in component fast_sodium_current_m_gate (dimensionless)"
    legend_states[43] = "n in component fast_sodium_current_n_gate (dimensionless)"
    legend_constants[318] = "theta_m in component fast_sodium_current_m_gate (millivolt)"
    legend_constants[319] = "sigma_m in component fast_sodium_current_m_gate (millivolt)"
    legend_algebraic[41] = "n_infinity in component fast_sodium_current_n_gate (dimensionless)"
    legend_algebraic[83] = "tau_n in component fast_sodium_current_n_gate (millisecond)"
    legend_constants[320] = "tau_n_max in component fast_sodium_current_n_gate (millisecond)"
    legend_constants[321] = "theta_n in component fast_sodium_current_n_gate (millivolt)"
    legend_constants[322] = "sigma_n in component fast_sodium_current_n_gate (millivolt)"
    legend_constants[323] = "g_K in component potassium_current (nanoS)"
    legend_constants[324] = "E_K in component potassium_current (millivolt)"
    legend_states[44] = "n in component potassium_current_n_gate (dimensionless)"
    legend_algebraic[42] = "n_infinity in component potassium_current_n_gate (dimensionless)"
    legend_algebraic[84] = "tau_n in component potassium_current_n_gate (millisecond)"
    legend_constants[325] = "tau_n_max in component potassium_current_n_gate (millisecond)"
    legend_constants[326] = "theta_n in component potassium_current_n_gate (millivolt)"
    legend_constants[327] = "sigma_n in component potassium_current_n_gate (millivolt)"
    legend_constants[328] = "g_NaP in component persistent_sodium_current (nanoS)"
    legend_algebraic[118] = "m_infinity in component persistent_sodium_current_m_gate (dimensionless)"
    legend_states[45] = "h in component persistent_sodium_current_h_gate (dimensionless)"
    legend_constants[329] = "theta_m in component persistent_sodium_current_m_gate (millivolt)"
    legend_constants[330] = "sigma_m in component persistent_sodium_current_m_gate (millivolt)"
    legend_algebraic[43] = "h_infinity in component persistent_sodium_current_h_gate (dimensionless)"
    legend_algebraic[85] = "tau_h in component persistent_sodium_current_h_gate (millisecond)"
    legend_constants[331] = "tau_h_max in component persistent_sodium_current_h_gate (millisecond)"
    legend_constants[332] = "theta_h in component persistent_sodium_current_h_gate (millivolt)"
    legend_constants[333] = "sigma_h in component persistent_sodium_current_h_gate (millivolt)"
    legend_constants[334] = "g_L in component leakage_current (nanoS)"
    legend_constants[335] = "E_L in component leakage_current (millivolt)"
    legend_constants[336] = "E_syn_e in component tonic_current (millivolt)"
    legend_constants[337] = "g_tonic_e in component tonic_current (nanoS)"
    legend_algebraic[44] = "s_infinity in component synaptic_input (dimensionless)"
    legend_constants[338] = "kr in component synaptic_input (dimensionless)"
    legend_constants[339] = "tau_s in component synaptic_input (millisecond)"
    legend_constants[340] = "sigma_s in component synaptic_input (millivolt)"
    legend_constants[341] = "theta_s in component synaptic_input (millivolt)"
    legend_voi = "time in component environment (millisecond)"
    legend_states[46] = "V in component membrane (millivolt)"
    legend_constants[342] = "C in component membrane (picoF)"
    legend_constants[343] = "i_app in component membrane (picoA)"
    legend_algebraic[129] = "i_NaP in component persistent_sodium_current (picoA)"
    legend_algebraic[99] = "i_Na in component fast_sodium_current (picoA)"
    legend_algebraic[109] = "i_K in component potassium_current (picoA)"
    legend_algebraic[139] = "i_L in component leakage_current (picoA)"
    legend_algebraic[149] = "i_tonic_e in component tonic_current (picoA)"
    legend_algebraic[159] = "i_syn_e in component synaptic_input (picoA)"
    legend_constants[344] = "E_Na in component fast_sodium_current (millivolt)"
    legend_constants[345] = "g_Na in component fast_sodium_current (nanoS)"
    legend_algebraic[86] = "m_infinity in component fast_sodium_current_m_gate (dimensionless)"
    legend_states[47] = "n in component fast_sodium_current_n_gate (dimensionless)"
    legend_constants[346] = "theta_m in component fast_sodium_current_m_gate (millivolt)"
    legend_constants[347] = "sigma_m in component fast_sodium_current_m_gate (millivolt)"
    legend_algebraic[46] = "n_infinity in component fast_sodium_current_n_gate (dimensionless)"
    legend_algebraic[87] = "tau_n in component fast_sodium_current_n_gate (millisecond)"
    legend_constants[348] = "tau_n_max in component fast_sodium_current_n_gate (millisecond)"
    legend_constants[349] = "theta_n in component fast_sodium_current_n_gate (millivolt)"
    legend_constants[350] = "sigma_n in component fast_sodium_current_n_gate (millivolt)"
    legend_constants[351] = "g_K in component potassium_current (nanoS)"
    legend_constants[352] = "E_K in component potassium_current (millivolt)"
    legend_states[48] = "n in component potassium_current_n_gate (dimensionless)"
    legend_algebraic[47] = "n_infinity in component potassium_current_n_gate (dimensionless)"
    legend_algebraic[88] = "tau_n in component potassium_current_n_gate (millisecond)"
    legend_constants[353] = "tau_n_max in component potassium_current_n_gate (millisecond)"
    legend_constants[354] = "theta_n in component potassium_current_n_gate (millivolt)"
    legend_constants[355] = "sigma_n in component potassium_current_n_gate (millivolt)"
    legend_constants[356] = "g_NaP in component persistent_sodium_current (nanoS)"
    legend_algebraic[119] = "m_infinity in component persistent_sodium_current_m_gate (dimensionless)"
    legend_states[49] = "h in component persistent_sodium_current_h_gate (dimensionless)"
    legend_constants[357] = "theta_m in component persistent_sodium_current_m_gate (millivolt)"
    legend_constants[358] = "sigma_m in component persistent_sodium_current_m_gate (millivolt)"
    legend_algebraic[48] = "h_infinity in component persistent_sodium_current_h_gate (dimensionless)"
    legend_algebraic[89] = "tau_h in component persistent_sodium_current_h_gate (millisecond)"
    legend_constants[359] = "tau_h_max in component persistent_sodium_current_h_gate (millisecond)"
    legend_constants[360] = "theta_h in component persistent_sodium_current_h_gate (millivolt)"
    legend_constants[361] = "sigma_h in component persistent_sodium_current_h_gate (millivolt)"
    legend_constants[362] = "g_L in component leakage_current (nanoS)"
    legend_constants[363] = "E_L in component leakage_current (millivolt)"
    legend_constants[364] = "E_syn_e in component tonic_current (millivolt)"
    legend_constants[365] = "g_tonic_e in component tonic_current (nanoS)"
    legend_algebraic[49] = "s_infinity in component synaptic_input (dimensionless)"
    legend_constants[366] = "kr in component synaptic_input (dimensionless)"
    legend_constants[367] = "tau_s in component synaptic_input (millisecond)"
    legend_constants[368] = "sigma_s in component synaptic_input (millivolt)"
    legend_constants[369] = "theta_s in component synaptic_input (millivolt)"
    legend_rates[10] = "d/dt V in component membrane (millivolt)"
    legend_rates[11] = "d/dt n in component fast_sodium_current_n_gate (dimensionless)"
    legend_rates[12] = "d/dt n in component potassium_current_n_gate (dimensionless)"
    legend_rates[13] = "d/dt h in component persistent_sodium_current_h_gate (dimensionless)"
    legend_rates[0] = "d/dt s in component synaptic_input (dimensionless)"
    legend_rates[14] = "d/dt V in component membrane (millivolt)"
    legend_rates[15] = "d/dt n in component fast_sodium_current_n_gate (dimensionless)"
    legend_rates[16] = "d/dt n in component potassium_current_n_gate (dimensionless)"
    legend_rates[17] = "d/dt h in component persistent_sodium_current_h_gate (dimensionless)"
    legend_rates[1] = "d/dt s in component synaptic_input (dimensionless)"
    legend_rates[18] = "d/dt V in component membrane (millivolt)"
    legend_rates[19] = "d/dt n in component fast_sodium_current_n_gate (dimensionless)"
    legend_rates[20] = "d/dt n in component potassium_current_n_gate (dimensionless)"
    legend_rates[21] = "d/dt h in component persistent_sodium_current_h_gate (dimensionless)"
    legend_rates[2] = "d/dt s in component synaptic_input (dimensionless)"
    legend_rates[22] = "d/dt V in component membrane (millivolt)"
    legend_rates[23] = "d/dt n in component fast_sodium_current_n_gate (dimensionless)"
    legend_rates[24] = "d/dt n in component potassium_current_n_gate (dimensionless)"
    legend_rates[25] = "d/dt h in component persistent_sodium_current_h_gate (dimensionless)"
    legend_rates[3] = "d/dt s in component synaptic_input (dimensionless)"
    legend_rates[26] = "d/dt V in component membrane (millivolt)"
    legend_rates[27] = "d/dt n in component fast_sodium_current_n_gate (dimensionless)"
    legend_rates[28] = "d/dt n in component potassium_current_n_gate (dimensionless)"
    legend_rates[29] = "d/dt h in component persistent_sodium_current_h_gate (dimensionless)"
    legend_rates[4] = "d/dt s in component synaptic_input (dimensionless)"
    legend_rates[30] = "d/dt V in component membrane (millivolt)"
    legend_rates[31] = "d/dt n in component fast_sodium_current_n_gate (dimensionless)"
    legend_rates[32] = "d/dt n in component potassium_current_n_gate (dimensionless)"
    legend_rates[33] = "d/dt h in component persistent_sodium_current_h_gate (dimensionless)"
    legend_rates[5] = "d/dt s in component synaptic_input (dimensionless)"
    legend_rates[34] = "d/dt V in component membrane (millivolt)"
    legend_rates[35] = "d/dt n in component fast_sodium_current_n_gate (dimensionless)"
    legend_rates[36] = "d/dt n in component potassium_current_n_gate (dimensionless)"
    legend_rates[37] = "d/dt h in component persistent_sodium_current_h_gate (dimensionless)"
    legend_rates[6] = "d/dt s in component synaptic_input (dimensionless)"
    legend_rates[38] = "d/dt V in component membrane (millivolt)"
    legend_rates[39] = "d/dt n in component fast_sodium_current_n_gate (dimensionless)"
    legend_rates[40] = "d/dt n in component potassium_current_n_gate (dimensionless)"
    legend_rates[41] = "d/dt h in component persistent_sodium_current_h_gate (dimensionless)"
    legend_rates[7] = "d/dt s in component synaptic_input (dimensionless)"
    legend_rates[42] = "d/dt V in component membrane (millivolt)"
    legend_rates[43] = "d/dt n in component fast_sodium_current_n_gate (dimensionless)"
    legend_rates[44] = "d/dt n in component potassium_current_n_gate (dimensionless)"
    legend_rates[45] = "d/dt h in component persistent_sodium_current_h_gate (dimensionless)"
    legend_rates[8] = "d/dt s in component synaptic_input (dimensionless)"
    legend_rates[46] = "d/dt V in component membrane (millivolt)"
    legend_rates[47] = "d/dt n in component fast_sodium_current_n_gate (dimensionless)"
    legend_rates[48] = "d/dt n in component potassium_current_n_gate (dimensionless)"
    legend_rates[49] = "d/dt h in component persistent_sodium_current_h_gate (dimensionless)"
    legend_rates[9] = "d/dt s in component synaptic_input (dimensionless)"
    return (legend_states, legend_algebraic, legend_voi, legend_constants)

def initConsts():
    constants = [0.0] * sizeConstants; states = [0.0] * sizeStates;
    constants[0] = 0.10
    constants[1] = 0.10
    constants[2] = 0.10
    constants[3] = 0.10
    constants[4] = 0.10
    constants[5] = 0.10
    constants[6] = 0.10
    constants[7] = 0.10
    constants[8] = 0.10
    constants[9] = 0.10
    constants[10] = 0.10
    constants[11] = 0.10
    constants[12] = 0.10
    constants[13] = 0.10
    constants[14] = 0.10
    constants[15] = 0.10
    constants[16] = 0.10
    constants[17] = 0.10
    constants[18] = 0.10
    constants[19] = 0.10
    constants[20] = 0.10
    constants[21] = 0.10
    constants[22] = 0.10
    constants[23] = 0.10
    constants[24] = 0.10
    constants[25] = 0.10
    constants[26] = 0.10
    constants[27] = 0.10
    constants[28] = 0.10
    constants[29] = 0.10
    constants[30] = 0.10
    constants[31] = 0.10
    constants[32] = 0.10
    constants[33] = 0.10
    constants[34] = 0.10
    constants[35] = 0.10
    constants[36] = 0.10
    constants[37] = 0.10
    constants[38] = 0.10
    constants[39] = 0.10
    constants[40] = 0.10
    constants[41] = 0.10
    constants[42] = 0.10
    constants[43] = 0.10
    constants[44] = 0.10
    constants[45] = 0.10
    constants[46] = 0.10
    constants[47] = 0.10
    constants[48] = 0.10
    constants[49] = 0.10
    constants[50] = 0.10
    constants[51] = 0.10
    constants[52] = 0.10
    constants[53] = 0.10
    constants[54] = 0.10
    constants[55] = 0.10
    constants[56] = 0.10
    constants[57] = 0.10
    constants[58] = 0.10
    constants[59] = 0.10
    constants[60] = 0.10
    constants[61] = 0.10
    constants[62] = 0.10
    constants[63] = 0.10
    constants[64] = 0.10
    constants[65] = 0.10
    constants[66] = 0.10
    constants[67] = 0.10
    constants[68] = 0.10
    constants[69] = 0.10
    constants[70] = 0.10
    constants[71] = 0.10
    constants[72] = 0.10
    constants[73] = 0.10
    constants[74] = 0.10
    constants[75] = 0.10
    constants[76] = 0.10
    constants[77] = 0.10
    constants[78] = 0.10
    constants[79] = 0.10
    constants[80] = 0.10
    constants[81] = 0.10
    constants[82] = 0.10
    constants[83] = 0.10
    constants[84] = 0.10
    constants[85] = 0.10
    constants[86] = 0.10
    constants[87] = 0.10
    constants[88] = 0.10
    constants[89] = 0.10
    states[0] = 1
    states[1] = 1
    states[2] = 1
    states[3] = 1
    states[4] = 1
    states[5] = 1
    states[6] = 1
    states[7] = 1
    states[8] = 1
    states[9] = 1
    states[10] = -50.0
    constants[90] = 21.0
    constants[91] = 0.0
    constants[92] = 50.0
    constants[93] = 28.0
    states[11] = 0.01
    constants[94] = -34.0
    constants[95] = -5.0
    constants[96] = 10.0
    constants[97] = -29.0
    constants[98] = -4.0
    constants[99] = 11.2
    constants[100] = -85.0
    states[12] = 0.01
    constants[101] = 10.0
    constants[102] = -29.0
    constants[103] = -4.0
    constants[104] = 2.8
    states[13] = 0.46
    constants[105] = -40.0
    constants[106] = -6.0
    constants[107] = 10000.0
    constants[108] = -48.0
    constants[109] = 6.0
    constants[110] = 2.8
    constants[111] = -57.5
    constants[112] = 0.0
    constants[113] = 0.0
    constants[114] = 1.0
    constants[115] = 5.0
    constants[116] = -5.0
    constants[117] = -10.0
    states[14] = -50.0
    constants[118] = 21.0
    constants[119] = 0.0
    constants[120] = 50.0
    constants[121] = 28.0
    states[15] = 0.01
    constants[122] = -34.0
    constants[123] = -5.0
    constants[124] = 10.0
    constants[125] = -29.0
    constants[126] = -4.0
    constants[127] = 11.2
    constants[128] = -85.0
    states[16] = 0.01
    constants[129] = 10.0
    constants[130] = -29.0
    constants[131] = -4.0
    constants[132] = 2.8
    states[17] = 0.46
    constants[133] = -40.0
    constants[134] = -6.0
    constants[135] = 10000.0
    constants[136] = -48.0
    constants[137] = 6.0
    constants[138] = 2.8
    constants[139] = -57.5
    constants[140] = 0.0
    constants[141] = 0.0
    constants[142] = 1.0
    constants[143] = 5.0
    constants[144] = -5.0
    constants[145] = -10.0
    states[18] = -50.0
    constants[146] = 21.0
    constants[147] = 0.0
    constants[148] = 50.0
    constants[149] = 28.0
    states[19] = 0.01
    constants[150] = -34.0
    constants[151] = -5.0
    constants[152] = 10.0
    constants[153] = -29.0
    constants[154] = -4.0
    constants[155] = 11.2
    constants[156] = -85.0
    states[20] = 0.01
    constants[157] = 10.0
    constants[158] = -29.0
    constants[159] = -4.0
    constants[160] = 2.8
    states[21] = 0.46
    constants[161] = -40.0
    constants[162] = -6.0
    constants[163] = 10000.0
    constants[164] = -48.0
    constants[165] = 6.0
    constants[166] = 2.8
    constants[167] = -57.5
    constants[168] = 0.0
    constants[169] = 0.0
    constants[170] = 1.0
    constants[171] = 5.0
    constants[172] = -5.0
    constants[173] = -10.0
    states[22] = -50.0
    constants[174] = 21.0
    constants[175] = 0.0
    constants[176] = 50.0
    constants[177] = 28.0
    states[23] = 0.01
    constants[178] = -34.0
    constants[179] = -5.0
    constants[180] = 10.0
    constants[181] = -29.0
    constants[182] = -4.0
    constants[183] = 11.2
    constants[184] = -85.0
    states[24] = 0.01
    constants[185] = 10.0
    constants[186] = -29.0
    constants[187] = -4.0
    constants[188] = 2.8
    states[25] = 0.46
    constants[189] = -40.0
    constants[190] = -6.0
    constants[191] = 10000.0
    constants[192] = -48.0
    constants[193] = 6.0
    constants[194] = 2.8
    constants[195] = -57.5
    constants[196] = 0.0
    constants[197] = 0.0
    constants[198] = 1.0
    constants[199] = 5.0
    constants[200] = -5.0
    constants[201] = -10.0
    states[26] = -50.0
    constants[202] = 21.0
    constants[203] = 0.0
    constants[204] = 50.0
    constants[205] = 28.0
    states[27] = 0.01
    constants[206] = -34.0
    constants[207] = -5.0
    constants[208] = 10.0
    constants[209] = -29.0
    constants[210] = -4.0
    constants[211] = 11.2
    constants[212] = -85.0
    states[28] = 0.01
    constants[213] = 10.0
    constants[214] = -29.0
    constants[215] = -4.0
    constants[216] = 2.8
    states[29] = 0.46
    constants[217] = -40.0
    constants[218] = -6.0
    constants[219] = 10000.0
    constants[220] = -48.0
    constants[221] = 6.0
    constants[222] = 2.8
    constants[223] = -57.5
    constants[224] = 0.0
    constants[225] = 0.0
    constants[226] = 1.0
    constants[227] = 5.0
    constants[228] = -5.0
    constants[229] = -10.0
    states[30] = -50.0
    constants[230] = 21.0
    constants[231] = 0.0
    constants[232] = 50.0
    constants[233] = 28.0
    states[31] = 0.01
    constants[234] = -34.0
    constants[235] = -5.0
    constants[236] = 10.0
    constants[237] = -29.0
    constants[238] = -4.0
    constants[239] = 11.2
    constants[240] = -85.0
    states[32] = 0.01
    constants[241] = 10.0
    constants[242] = -29.0
    constants[243] = -4.0
    constants[244] = 2.8
    states[33] = 0.46
    constants[245] = -40.0
    constants[246] = -6.0
    constants[247] = 10000.0
    constants[248] = -48.0
    constants[249] = 6.0
    constants[250] = 2.8
    constants[251] = -57.5
    constants[252] = 0.0
    constants[253] = 0.0
    constants[254] = 1.0
    constants[255] = 5.0
    constants[256] = -5.0
    constants[257] = -10.0
    states[34] = -50.0
    constants[258] = 21.0
    constants[259] = 0.0
    constants[260] = 50.0
    constants[261] = 28.0
    states[35] = 0.01
    constants[262] = -34.0
    constants[263] = -5.0
    constants[264] = 10.0
    constants[265] = -29.0
    constants[266] = -4.0
    constants[267] = 11.2
    constants[268] = -85.0
    states[36] = 0.01
    constants[269] = 10.0
    constants[270] = -29.0
    constants[271] = -4.0
    constants[272] = 2.8
    states[37] = 0.46
    constants[273] = -40.0
    constants[274] = -6.0
    constants[275] = 10000.0
    constants[276] = -48.0
    constants[277] = 6.0
    constants[278] = 2.8
    constants[279] = -57.5
    constants[280] = 0.0
    constants[281] = 0.0
    constants[282] = 1.0
    constants[283] = 5.0
    constants[284] = -5.0
    constants[285] = -10.0
    states[38] = -50.0
    constants[286] = 21.0
    constants[287] = 0.0
    constants[288] = 50.0
    constants[289] = 28.0
    states[39] = 0.01
    constants[290] = -34.0
    constants[291] = -5.0
    constants[292] = 10.0
    constants[293] = -29.0
    constants[294] = -4.0
    constants[295] = 11.2
    constants[296] = -85.0
    states[40] = 0.01
    constants[297] = 10.0
    constants[298] = -29.0
    constants[299] = -4.0
    constants[300] = 2.8
    states[41] = 0.46
    constants[301] = -40.0
    constants[302] = -6.0
    constants[303] = 10000.0
    constants[304] = -48.0
    constants[305] = 6.0
    constants[306] = 2.8
    constants[307] = -57.5
    constants[308] = 0.0
    constants[309] = 0.0
    constants[310] = 1.0
    constants[311] = 5.0
    constants[312] = -5.0
    constants[313] = -10.0
    states[42] = -50.0
    constants[314] = 21.0
    constants[315] = 0.0
    constants[316] = 50.0
    constants[317] = 28.0
    states[43] = 0.01
    constants[318] = -34.0
    constants[319] = -5.0
    constants[320] = 10.0
    constants[321] = -29.0
    constants[322] = -4.0
    constants[323] = 11.2
    constants[324] = -85.0
    states[44] = 0.01
    constants[325] = 10.0
    constants[326] = -29.0
    constants[327] = -4.0
    constants[328] = 2.8
    states[45] = 0.46
    constants[329] = -40.0
    constants[330] = -6.0
    constants[331] = 10000.0
    constants[332] = -48.0
    constants[333] = 6.0
    constants[334] = 2.8
    constants[335] = -57.5
    constants[336] = 0.0
    constants[337] = 0.0
    constants[338] = 1.0
    constants[339] = 5.0
    constants[340] = -5.0
    constants[341] = -10.0
    states[46] = -50.0
    constants[342] = 21.0
    constants[343] = 0.0
    constants[344] = 50.0
    constants[345] = 28.0
    states[47] = 0.01
    constants[346] = -34.0
    constants[347] = -5.0
    constants[348] = 10.0
    constants[349] = -29.0
    constants[350] = -4.0
    constants[351] = 11.2
    constants[352] = -85.0
    states[48] = 0.01
    constants[353] = 10.0
    constants[354] = -29.0
    constants[355] = -4.0
    constants[356] = 2.8
    states[49] = 0.46
    constants[357] = -40.0
    constants[358] = -6.0
    constants[359] = 10000.0
    constants[360] = -48.0
    constants[361] = 6.0
    constants[362] = 2.8
    constants[363] = -57.5
    constants[364] = 0.0
    constants[365] = 0.0
    constants[366] = 1.0
    constants[367] = 5.0
    constants[368] = -5.0
    constants[369] = -10.0
    return (states, constants)

def computeRates(voi, states, constants):
    rates = [0.0] * sizeStates; algebraic = [0.0] * sizeAlgebraic
    algebraic[4] = 1.00000/(1.00000+exp((states[10]-constants[117])/constants[116]))
    rates[0] = ((1.00000-states[0])*algebraic[4]--(constants[114]*states[0]))/constants[115]
    algebraic[9] = 1.00000/(1.00000+exp((states[14]-constants[145])/constants[144]))
    rates[1] = ((1.00000-states[1])*algebraic[9]--(constants[142]*states[1]))/constants[143]
    algebraic[14] = 1.00000/(1.00000+exp((states[18]-constants[173])/constants[172]))
    rates[2] = ((1.00000-states[2])*algebraic[14]--(constants[170]*states[2]))/constants[171]
    algebraic[19] = 1.00000/(1.00000+exp((states[22]-constants[201])/constants[200]))
    rates[3] = ((1.00000-states[3])*algebraic[19]--(constants[198]*states[3]))/constants[199]
    algebraic[24] = 1.00000/(1.00000+exp((states[26]-constants[229])/constants[228]))
    rates[4] = ((1.00000-states[4])*algebraic[24]--(constants[226]*states[4]))/constants[227]
    algebraic[29] = 1.00000/(1.00000+exp((states[30]-constants[257])/constants[256]))
    rates[5] = ((1.00000-states[5])*algebraic[29]--(constants[254]*states[5]))/constants[255]
    algebraic[34] = 1.00000/(1.00000+exp((states[34]-constants[285])/constants[284]))
    rates[6] = ((1.00000-states[6])*algebraic[34]--(constants[282]*states[6]))/constants[283]
    algebraic[39] = 1.00000/(1.00000+exp((states[38]-constants[313])/constants[312]))
    rates[7] = ((1.00000-states[7])*algebraic[39]--(constants[310]*states[7]))/constants[311]
    algebraic[44] = 1.00000/(1.00000+exp((states[42]-constants[341])/constants[340]))
    rates[8] = ((1.00000-states[8])*algebraic[44]--(constants[338]*states[8]))/constants[339]
    algebraic[49] = 1.00000/(1.00000+exp((states[46]-constants[369])/constants[368]))
    rates[9] = ((1.00000-states[9])*algebraic[49]--(constants[366]*states[9]))/constants[367]
    algebraic[1] = 1.00000/(1.00000+exp((states[10]-constants[97])/constants[98]))
    algebraic[51] = constants[96]/cosh((states[10]-constants[97])/(2.00000*constants[98]))
    rates[11] = (algebraic[1]-states[11])/algebraic[51]
    algebraic[2] = 1.00000/(1.00000+exp((states[10]-constants[102])/constants[103]))
    algebraic[52] = constants[101]/cosh((states[10]-constants[102])/(2.00000*constants[103]))
    rates[12] = (algebraic[2]-states[12])/algebraic[52]
    algebraic[3] = 1.00000/(1.00000+exp((states[10]-constants[108])/constants[109]))
    algebraic[53] = constants[107]/cosh((states[10]-constants[108])/(2.00000*constants[109]))
    rates[13] = (algebraic[3]-states[13])/algebraic[53]
    algebraic[6] = 1.00000/(1.00000+exp((states[14]-constants[125])/constants[126]))
    algebraic[55] = constants[124]/cosh((states[14]-constants[125])/(2.00000*constants[126]))
    rates[15] = (algebraic[6]-states[15])/algebraic[55]
    algebraic[7] = 1.00000/(1.00000+exp((states[14]-constants[130])/constants[131]))
    algebraic[56] = constants[129]/cosh((states[14]-constants[130])/(2.00000*constants[131]))
    rates[16] = (algebraic[7]-states[16])/algebraic[56]
    algebraic[8] = 1.00000/(1.00000+exp((states[14]-constants[136])/constants[137]))
    algebraic[57] = constants[135]/cosh((states[14]-constants[136])/(2.00000*constants[137]))
    rates[17] = (algebraic[8]-states[17])/algebraic[57]
    algebraic[11] = 1.00000/(1.00000+exp((states[18]-constants[153])/constants[154]))
    algebraic[59] = constants[152]/cosh((states[18]-constants[153])/(2.00000*constants[154]))
    rates[19] = (algebraic[11]-states[19])/algebraic[59]
    algebraic[12] = 1.00000/(1.00000+exp((states[18]-constants[158])/constants[159]))
    algebraic[60] = constants[157]/cosh((states[18]-constants[158])/(2.00000*constants[159]))
    rates[20] = (algebraic[12]-states[20])/algebraic[60]
    algebraic[13] = 1.00000/(1.00000+exp((states[18]-constants[164])/constants[165]))
    algebraic[61] = constants[163]/cosh((states[18]-constants[164])/(2.00000*constants[165]))
    rates[21] = (algebraic[13]-states[21])/algebraic[61]
    algebraic[16] = 1.00000/(1.00000+exp((states[22]-constants[181])/constants[182]))
    algebraic[63] = constants[180]/cosh((states[22]-constants[181])/(2.00000*constants[182]))
    rates[23] = (algebraic[16]-states[23])/algebraic[63]
    algebraic[17] = 1.00000/(1.00000+exp((states[22]-constants[186])/constants[187]))
    algebraic[64] = constants[185]/cosh((states[22]-constants[186])/(2.00000*constants[187]))
    rates[24] = (algebraic[17]-states[24])/algebraic[64]
    algebraic[18] = 1.00000/(1.00000+exp((states[22]-constants[192])/constants[193]))
    algebraic[65] = constants[191]/cosh((states[22]-constants[192])/(2.00000*constants[193]))
    rates[25] = (algebraic[18]-states[25])/algebraic[65]
    algebraic[21] = 1.00000/(1.00000+exp((states[26]-constants[209])/constants[210]))
    algebraic[67] = constants[208]/cosh((states[26]-constants[209])/(2.00000*constants[210]))
    rates[27] = (algebraic[21]-states[27])/algebraic[67]
    algebraic[22] = 1.00000/(1.00000+exp((states[26]-constants[214])/constants[215]))
    algebraic[68] = constants[213]/cosh((states[26]-constants[214])/(2.00000*constants[215]))
    rates[28] = (algebraic[22]-states[28])/algebraic[68]
    algebraic[23] = 1.00000/(1.00000+exp((states[26]-constants[220])/constants[221]))
    algebraic[69] = constants[219]/cosh((states[26]-constants[220])/(2.00000*constants[221]))
    rates[29] = (algebraic[23]-states[29])/algebraic[69]
    algebraic[26] = 1.00000/(1.00000+exp((states[30]-constants[237])/constants[238]))
    algebraic[71] = constants[236]/cosh((states[30]-constants[237])/(2.00000*constants[238]))
    rates[31] = (algebraic[26]-states[31])/algebraic[71]
    algebraic[27] = 1.00000/(1.00000+exp((states[30]-constants[242])/constants[243]))
    algebraic[72] = constants[241]/cosh((states[30]-constants[242])/(2.00000*constants[243]))
    rates[32] = (algebraic[27]-states[32])/algebraic[72]
    algebraic[28] = 1.00000/(1.00000+exp((states[30]-constants[248])/constants[249]))
    algebraic[73] = constants[247]/cosh((states[30]-constants[248])/(2.00000*constants[249]))
    rates[33] = (algebraic[28]-states[33])/algebraic[73]
    algebraic[31] = 1.00000/(1.00000+exp((states[34]-constants[265])/constants[266]))
    algebraic[75] = constants[264]/cosh((states[34]-constants[265])/(2.00000*constants[266]))
    rates[35] = (algebraic[31]-states[35])/algebraic[75]
    algebraic[32] = 1.00000/(1.00000+exp((states[34]-constants[270])/constants[271]))
    algebraic[76] = constants[269]/cosh((states[34]-constants[270])/(2.00000*constants[271]))
    rates[36] = (algebraic[32]-states[36])/algebraic[76]
    algebraic[33] = 1.00000/(1.00000+exp((states[34]-constants[276])/constants[277]))
    algebraic[77] = constants[275]/cosh((states[34]-constants[276])/(2.00000*constants[277]))
    rates[37] = (algebraic[33]-states[37])/algebraic[77]
    algebraic[36] = 1.00000/(1.00000+exp((states[38]-constants[293])/constants[294]))
    algebraic[79] = constants[292]/cosh((states[38]-constants[293])/(2.00000*constants[294]))
    rates[39] = (algebraic[36]-states[39])/algebraic[79]
    algebraic[37] = 1.00000/(1.00000+exp((states[38]-constants[298])/constants[299]))
    algebraic[80] = constants[297]/cosh((states[38]-constants[298])/(2.00000*constants[299]))
    rates[40] = (algebraic[37]-states[40])/algebraic[80]
    algebraic[38] = 1.00000/(1.00000+exp((states[38]-constants[304])/constants[305]))
    algebraic[81] = constants[303]/cosh((states[38]-constants[304])/(2.00000*constants[305]))
    rates[41] = (algebraic[38]-states[41])/algebraic[81]
    algebraic[41] = 1.00000/(1.00000+exp((states[42]-constants[321])/constants[322]))
    algebraic[83] = constants[320]/cosh((states[42]-constants[321])/(2.00000*constants[322]))
    rates[43] = (algebraic[41]-states[43])/algebraic[83]
    algebraic[42] = 1.00000/(1.00000+exp((states[42]-constants[326])/constants[327]))
    algebraic[84] = constants[325]/cosh((states[42]-constants[326])/(2.00000*constants[327]))
    rates[44] = (algebraic[42]-states[44])/algebraic[84]
    algebraic[43] = 1.00000/(1.00000+exp((states[42]-constants[332])/constants[333]))
    algebraic[85] = constants[331]/cosh((states[42]-constants[332])/(2.00000*constants[333]))
    rates[45] = (algebraic[43]-states[45])/algebraic[85]
    algebraic[46] = 1.00000/(1.00000+exp((states[46]-constants[349])/constants[350]))
    algebraic[87] = constants[348]/cosh((states[46]-constants[349])/(2.00000*constants[350]))
    rates[47] = (algebraic[46]-states[47])/algebraic[87]
    algebraic[47] = 1.00000/(1.00000+exp((states[46]-constants[354])/constants[355]))
    algebraic[88] = constants[353]/cosh((states[46]-constants[354])/(2.00000*constants[355]))
    rates[48] = (algebraic[47]-states[48])/algebraic[88]
    algebraic[48] = 1.00000/(1.00000+exp((states[46]-constants[360])/constants[361]))
    algebraic[89] = constants[359]/cosh((states[46]-constants[360])/(2.00000*constants[361]))
    rates[49] = (algebraic[48]-states[49])/algebraic[89]
    algebraic[110] = 1.00000/(1.00000+exp((states[10]-constants[105])/constants[106]))
    algebraic[120] = constants[104]*algebraic[110]*states[13]*(states[10]-constants[92])
    algebraic[50] = 1.00000/(1.00000+exp((states[10]-constants[94])/constants[95]))
    algebraic[90] = constants[93]*algebraic[50]**3.00000*(1.00000-states[11])*(states[10]-constants[92])
    algebraic[100] = constants[99]*states[12]**4.00000*(states[10]-constants[100])
    algebraic[130] = constants[110]*(states[10]-constants[111])
    algebraic[140] = constants[113]*(states[10]-constants[112])
    algebraic[0] = constants[0]*states[0]+constants[1]*states[0]+constants[2]*states[0]+constants[3]*states[0]+constants[4]*states[0]+constants[5]*states[0]+constants[6]*states[0]+constants[7]*states[0]+constants[8]*states[0]
    algebraic[150] = algebraic[0]*(states[10]-constants[112])
    rates[10] = (-(algebraic[120]+algebraic[90]+algebraic[100]+algebraic[130]+algebraic[140]+algebraic[150])+constants[91])/constants[90]
    algebraic[111] = 1.00000/(1.00000+exp((states[14]-constants[133])/constants[134]))
    algebraic[121] = constants[132]*algebraic[111]*states[17]*(states[14]-constants[120])
    algebraic[54] = 1.00000/(1.00000+exp((states[14]-constants[122])/constants[123]))
    algebraic[91] = constants[121]*algebraic[54]**3.00000*(1.00000-states[15])*(states[14]-constants[120])
    algebraic[101] = constants[127]*states[16]**4.00000*(states[14]-constants[128])
    algebraic[131] = constants[138]*(states[14]-constants[139])
    algebraic[141] = constants[141]*(states[14]-constants[140])
    algebraic[5] = constants[9]*states[1]+constants[10]*states[1]+constants[11]*states[1]+constants[12]*states[1]+constants[13]*states[1]+constants[14]*states[1]+constants[15]*states[1]+constants[16]*states[1]+constants[17]*states[1]
    algebraic[151] = algebraic[5]*(states[14]-constants[140])
    rates[14] = (-(algebraic[121]+algebraic[91]+algebraic[101]+algebraic[131]+algebraic[141]+algebraic[151])+constants[119])/constants[118]
    algebraic[112] = 1.00000/(1.00000+exp((states[18]-constants[161])/constants[162]))
    algebraic[122] = constants[160]*algebraic[112]*states[21]*(states[18]-constants[148])
    algebraic[58] = 1.00000/(1.00000+exp((states[18]-constants[150])/constants[151]))
    algebraic[92] = constants[149]*algebraic[58]**3.00000*(1.00000-states[19])*(states[18]-constants[148])
    algebraic[102] = constants[155]*states[20]**4.00000*(states[18]-constants[156])
    algebraic[132] = constants[166]*(states[18]-constants[167])
    algebraic[142] = constants[169]*(states[18]-constants[168])
    algebraic[10] = constants[18]*states[2]+constants[19]*states[2]+constants[20]*states[2]+constants[21]*states[2]+constants[22]*states[2]+constants[23]*states[2]+constants[24]*states[2]+constants[25]*states[2]+constants[26]*states[2]
    algebraic[152] = algebraic[10]*(states[18]-constants[168])
    rates[18] = (-(algebraic[122]+algebraic[92]+algebraic[102]+algebraic[132]+algebraic[142]+algebraic[152])+constants[147])/constants[146]
    algebraic[113] = 1.00000/(1.00000+exp((states[22]-constants[189])/constants[190]))
    algebraic[123] = constants[188]*algebraic[113]*states[25]*(states[22]-constants[176])
    algebraic[62] = 1.00000/(1.00000+exp((states[22]-constants[178])/constants[179]))
    algebraic[93] = constants[177]*algebraic[62]**3.00000*(1.00000-states[23])*(states[22]-constants[176])
    algebraic[103] = constants[183]*states[24]**4.00000*(states[22]-constants[184])
    algebraic[133] = constants[194]*(states[22]-constants[195])
    algebraic[143] = constants[197]*(states[22]-constants[196])
    algebraic[15] = constants[27]*states[3]+constants[28]*states[3]+constants[29]*states[3]+constants[30]*states[3]+constants[31]*states[3]+constants[32]*states[3]+constants[33]*states[3]+constants[34]*states[3]+constants[35]*states[3]
    algebraic[153] = algebraic[15]*(states[22]-constants[196])
    rates[22] = (-(algebraic[123]+algebraic[93]+algebraic[103]+algebraic[133]+algebraic[143]+algebraic[153])+constants[175])/constants[174]
    algebraic[114] = 1.00000/(1.00000+exp((states[26]-constants[217])/constants[218]))
    algebraic[124] = constants[216]*algebraic[114]*states[29]*(states[26]-constants[204])
    algebraic[66] = 1.00000/(1.00000+exp((states[26]-constants[206])/constants[207]))
    algebraic[94] = constants[205]*algebraic[66]**3.00000*(1.00000-states[27])*(states[26]-constants[204])
    algebraic[104] = constants[211]*states[28]**4.00000*(states[26]-constants[212])
    algebraic[134] = constants[222]*(states[26]-constants[223])
    algebraic[144] = constants[225]*(states[26]-constants[224])
    algebraic[20] = constants[36]*states[4]+constants[37]*states[4]+constants[38]*states[4]+constants[39]*states[4]+constants[40]*states[4]+constants[41]*states[4]+constants[42]*states[4]+constants[43]*states[4]+constants[44]*states[4]
    algebraic[154] = algebraic[20]*(states[26]-constants[224])
    rates[26] = (-(algebraic[124]+algebraic[94]+algebraic[104]+algebraic[134]+algebraic[144]+algebraic[154])+constants[203])/constants[202]
    algebraic[115] = 1.00000/(1.00000+exp((states[30]-constants[245])/constants[246]))
    algebraic[125] = constants[244]*algebraic[115]*states[33]*(states[30]-constants[232])
    algebraic[70] = 1.00000/(1.00000+exp((states[30]-constants[234])/constants[235]))
    algebraic[95] = constants[233]*algebraic[70]**3.00000*(1.00000-states[31])*(states[30]-constants[232])
    algebraic[105] = constants[239]*states[32]**4.00000*(states[30]-constants[240])
    algebraic[135] = constants[250]*(states[30]-constants[251])
    algebraic[145] = constants[253]*(states[30]-constants[252])
    algebraic[25] = constants[45]*states[5]+constants[46]*states[5]+constants[47]*states[5]+constants[48]*states[5]+constants[49]*states[5]+constants[50]*states[5]+constants[51]*states[5]+constants[52]*states[5]+constants[53]*states[5]
    algebraic[155] = algebraic[25]*(states[30]-constants[252])
    rates[30] = (-(algebraic[125]+algebraic[95]+algebraic[105]+algebraic[135]+algebraic[145]+algebraic[155])+constants[231])/constants[230]
    algebraic[116] = 1.00000/(1.00000+exp((states[34]-constants[273])/constants[274]))
    algebraic[126] = constants[272]*algebraic[116]*states[37]*(states[34]-constants[260])
    algebraic[74] = 1.00000/(1.00000+exp((states[34]-constants[262])/constants[263]))
    algebraic[96] = constants[261]*algebraic[74]**3.00000*(1.00000-states[35])*(states[34]-constants[260])
    algebraic[106] = constants[267]*states[36]**4.00000*(states[34]-constants[268])
    algebraic[136] = constants[278]*(states[34]-constants[279])
    algebraic[146] = constants[281]*(states[34]-constants[280])
    algebraic[30] = constants[54]*states[6]+constants[55]*states[6]+constants[56]*states[6]+constants[57]*states[6]+constants[58]*states[6]+constants[59]*states[6]+constants[60]*states[6]+constants[61]*states[6]+constants[62]*states[6]
    algebraic[156] = algebraic[30]*(states[34]-constants[280])
    rates[34] = (-(algebraic[126]+algebraic[96]+algebraic[106]+algebraic[136]+algebraic[146]+algebraic[156])+constants[259])/constants[258]
    algebraic[117] = 1.00000/(1.00000+exp((states[38]-constants[301])/constants[302]))
    algebraic[127] = constants[300]*algebraic[117]*states[41]*(states[38]-constants[288])
    algebraic[78] = 1.00000/(1.00000+exp((states[38]-constants[290])/constants[291]))
    algebraic[97] = constants[289]*algebraic[78]**3.00000*(1.00000-states[39])*(states[38]-constants[288])
    algebraic[107] = constants[295]*states[40]**4.00000*(states[38]-constants[296])
    algebraic[137] = constants[306]*(states[38]-constants[307])
    algebraic[147] = constants[309]*(states[38]-constants[308])
    algebraic[35] = constants[63]*states[7]+constants[64]*states[7]+constants[65]*states[7]+constants[66]*states[7]+constants[67]*states[7]+constants[68]*states[7]+constants[69]*states[7]+constants[70]*states[7]+constants[71]*states[7]
    algebraic[157] = algebraic[35]*(states[38]-constants[308])
    rates[38] = (-(algebraic[127]+algebraic[97]+algebraic[107]+algebraic[137]+algebraic[147]+algebraic[157])+constants[287])/constants[286]
    algebraic[118] = 1.00000/(1.00000+exp((states[42]-constants[329])/constants[330]))
    algebraic[128] = constants[328]*algebraic[118]*states[45]*(states[42]-constants[316])
    algebraic[82] = 1.00000/(1.00000+exp((states[42]-constants[318])/constants[319]))
    algebraic[98] = constants[317]*algebraic[82]**3.00000*(1.00000-states[43])*(states[42]-constants[316])
    algebraic[108] = constants[323]*states[44]**4.00000*(states[42]-constants[324])
    algebraic[138] = constants[334]*(states[42]-constants[335])
    algebraic[148] = constants[337]*(states[42]-constants[336])
    algebraic[40] = constants[72]*states[8]+constants[73]*states[8]+constants[74]*states[8]+constants[75]*states[8]+constants[76]*states[8]+constants[77]*states[8]+constants[78]*states[8]+constants[79]*states[8]+constants[80]*states[8]
    algebraic[158] = algebraic[40]*(states[42]-constants[336])
    rates[42] = (-(algebraic[128]+algebraic[98]+algebraic[108]+algebraic[138]+algebraic[148]+algebraic[158])+constants[315])/constants[314]
    algebraic[119] = 1.00000/(1.00000+exp((states[46]-constants[357])/constants[358]))
    algebraic[129] = constants[356]*algebraic[119]*states[49]*(states[46]-constants[344])
    algebraic[86] = 1.00000/(1.00000+exp((states[46]-constants[346])/constants[347]))
    algebraic[99] = constants[345]*algebraic[86]**3.00000*(1.00000-states[47])*(states[46]-constants[344])
    algebraic[109] = constants[351]*states[48]**4.00000*(states[46]-constants[352])
    algebraic[139] = constants[362]*(states[46]-constants[363])
    algebraic[149] = constants[365]*(states[46]-constants[364])
    algebraic[45] = constants[81]*states[9]+constants[82]*states[9]+constants[83]*states[9]+constants[84]*states[9]+constants[85]*states[9]+constants[86]*states[9]+constants[87]*states[9]+constants[88]*states[9]+constants[89]*states[9]
    algebraic[159] = algebraic[45]*(states[46]-constants[364])
    rates[46] = (-(algebraic[129]+algebraic[99]+algebraic[109]+algebraic[139]+algebraic[149]+algebraic[159])+constants[343])/constants[342]
    return(rates)

def computeAlgebraic(constants, states, voi):
    algebraic = array([[0.0] * len(voi)] * sizeAlgebraic)
    states = array(states)
    voi = array(voi)
    algebraic[4] = 1.00000/(1.00000+exp((states[10]-constants[117])/constants[116]))
    algebraic[9] = 1.00000/(1.00000+exp((states[14]-constants[145])/constants[144]))
    algebraic[14] = 1.00000/(1.00000+exp((states[18]-constants[173])/constants[172]))
    algebraic[19] = 1.00000/(1.00000+exp((states[22]-constants[201])/constants[200]))
    algebraic[24] = 1.00000/(1.00000+exp((states[26]-constants[229])/constants[228]))
    algebraic[29] = 1.00000/(1.00000+exp((states[30]-constants[257])/constants[256]))
    algebraic[34] = 1.00000/(1.00000+exp((states[34]-constants[285])/constants[284]))
    algebraic[39] = 1.00000/(1.00000+exp((states[38]-constants[313])/constants[312]))
    algebraic[44] = 1.00000/(1.00000+exp((states[42]-constants[341])/constants[340]))
    algebraic[49] = 1.00000/(1.00000+exp((states[46]-constants[369])/constants[368]))
    algebraic[1] = 1.00000/(1.00000+exp((states[10]-constants[97])/constants[98]))
    algebraic[51] = constants[96]/cosh((states[10]-constants[97])/(2.00000*constants[98]))
    algebraic[2] = 1.00000/(1.00000+exp((states[10]-constants[102])/constants[103]))
    algebraic[52] = constants[101]/cosh((states[10]-constants[102])/(2.00000*constants[103]))
    algebraic[3] = 1.00000/(1.00000+exp((states[10]-constants[108])/constants[109]))
    algebraic[53] = constants[107]/cosh((states[10]-constants[108])/(2.00000*constants[109]))
    algebraic[6] = 1.00000/(1.00000+exp((states[14]-constants[125])/constants[126]))
    algebraic[55] = constants[124]/cosh((states[14]-constants[125])/(2.00000*constants[126]))
    algebraic[7] = 1.00000/(1.00000+exp((states[14]-constants[130])/constants[131]))
    algebraic[56] = constants[129]/cosh((states[14]-constants[130])/(2.00000*constants[131]))
    algebraic[8] = 1.00000/(1.00000+exp((states[14]-constants[136])/constants[137]))
    algebraic[57] = constants[135]/cosh((states[14]-constants[136])/(2.00000*constants[137]))
    algebraic[11] = 1.00000/(1.00000+exp((states[18]-constants[153])/constants[154]))
    algebraic[59] = constants[152]/cosh((states[18]-constants[153])/(2.00000*constants[154]))
    algebraic[12] = 1.00000/(1.00000+exp((states[18]-constants[158])/constants[159]))
    algebraic[60] = constants[157]/cosh((states[18]-constants[158])/(2.00000*constants[159]))
    algebraic[13] = 1.00000/(1.00000+exp((states[18]-constants[164])/constants[165]))
    algebraic[61] = constants[163]/cosh((states[18]-constants[164])/(2.00000*constants[165]))
    algebraic[16] = 1.00000/(1.00000+exp((states[22]-constants[181])/constants[182]))
    algebraic[63] = constants[180]/cosh((states[22]-constants[181])/(2.00000*constants[182]))
    algebraic[17] = 1.00000/(1.00000+exp((states[22]-constants[186])/constants[187]))
    algebraic[64] = constants[185]/cosh((states[22]-constants[186])/(2.00000*constants[187]))
    algebraic[18] = 1.00000/(1.00000+exp((states[22]-constants[192])/constants[193]))
    algebraic[65] = constants[191]/cosh((states[22]-constants[192])/(2.00000*constants[193]))
    algebraic[21] = 1.00000/(1.00000+exp((states[26]-constants[209])/constants[210]))
    algebraic[67] = constants[208]/cosh((states[26]-constants[209])/(2.00000*constants[210]))
    algebraic[22] = 1.00000/(1.00000+exp((states[26]-constants[214])/constants[215]))
    algebraic[68] = constants[213]/cosh((states[26]-constants[214])/(2.00000*constants[215]))
    algebraic[23] = 1.00000/(1.00000+exp((states[26]-constants[220])/constants[221]))
    algebraic[69] = constants[219]/cosh((states[26]-constants[220])/(2.00000*constants[221]))
    algebraic[26] = 1.00000/(1.00000+exp((states[30]-constants[237])/constants[238]))
    algebraic[71] = constants[236]/cosh((states[30]-constants[237])/(2.00000*constants[238]))
    algebraic[27] = 1.00000/(1.00000+exp((states[30]-constants[242])/constants[243]))
    algebraic[72] = constants[241]/cosh((states[30]-constants[242])/(2.00000*constants[243]))
    algebraic[28] = 1.00000/(1.00000+exp((states[30]-constants[248])/constants[249]))
    algebraic[73] = constants[247]/cosh((states[30]-constants[248])/(2.00000*constants[249]))
    algebraic[31] = 1.00000/(1.00000+exp((states[34]-constants[265])/constants[266]))
    algebraic[75] = constants[264]/cosh((states[34]-constants[265])/(2.00000*constants[266]))
    algebraic[32] = 1.00000/(1.00000+exp((states[34]-constants[270])/constants[271]))
    algebraic[76] = constants[269]/cosh((states[34]-constants[270])/(2.00000*constants[271]))
    algebraic[33] = 1.00000/(1.00000+exp((states[34]-constants[276])/constants[277]))
    algebraic[77] = constants[275]/cosh((states[34]-constants[276])/(2.00000*constants[277]))
    algebraic[36] = 1.00000/(1.00000+exp((states[38]-constants[293])/constants[294]))
    algebraic[79] = constants[292]/cosh((states[38]-constants[293])/(2.00000*constants[294]))
    algebraic[37] = 1.00000/(1.00000+exp((states[38]-constants[298])/constants[299]))
    algebraic[80] = constants[297]/cosh((states[38]-constants[298])/(2.00000*constants[299]))
    algebraic[38] = 1.00000/(1.00000+exp((states[38]-constants[304])/constants[305]))
    algebraic[81] = constants[303]/cosh((states[38]-constants[304])/(2.00000*constants[305]))
    algebraic[41] = 1.00000/(1.00000+exp((states[42]-constants[321])/constants[322]))
    algebraic[83] = constants[320]/cosh((states[42]-constants[321])/(2.00000*constants[322]))
    algebraic[42] = 1.00000/(1.00000+exp((states[42]-constants[326])/constants[327]))
    algebraic[84] = constants[325]/cosh((states[42]-constants[326])/(2.00000*constants[327]))
    algebraic[43] = 1.00000/(1.00000+exp((states[42]-constants[332])/constants[333]))
    algebraic[85] = constants[331]/cosh((states[42]-constants[332])/(2.00000*constants[333]))
    algebraic[46] = 1.00000/(1.00000+exp((states[46]-constants[349])/constants[350]))
    algebraic[87] = constants[348]/cosh((states[46]-constants[349])/(2.00000*constants[350]))
    algebraic[47] = 1.00000/(1.00000+exp((states[46]-constants[354])/constants[355]))
    algebraic[88] = constants[353]/cosh((states[46]-constants[354])/(2.00000*constants[355]))
    algebraic[48] = 1.00000/(1.00000+exp((states[46]-constants[360])/constants[361]))
    algebraic[89] = constants[359]/cosh((states[46]-constants[360])/(2.00000*constants[361]))
    algebraic[110] = 1.00000/(1.00000+exp((states[10]-constants[105])/constants[106]))
    algebraic[120] = constants[104]*algebraic[110]*states[13]*(states[10]-constants[92])
    algebraic[50] = 1.00000/(1.00000+exp((states[10]-constants[94])/constants[95]))
    algebraic[90] = constants[93]*algebraic[50]**3.00000*(1.00000-states[11])*(states[10]-constants[92])
    algebraic[100] = constants[99]*states[12]**4.00000*(states[10]-constants[100])
    algebraic[130] = constants[110]*(states[10]-constants[111])
    algebraic[140] = constants[113]*(states[10]-constants[112])
    algebraic[0] = constants[0]*states[0]+constants[1]*states[0]+constants[2]*states[0]+constants[3]*states[0]+constants[4]*states[0]+constants[5]*states[0]+constants[6]*states[0]+constants[7]*states[0]+constants[8]*states[0]
    algebraic[150] = algebraic[0]*(states[10]-constants[112])
    algebraic[111] = 1.00000/(1.00000+exp((states[14]-constants[133])/constants[134]))
    algebraic[121] = constants[132]*algebraic[111]*states[17]*(states[14]-constants[120])
    algebraic[54] = 1.00000/(1.00000+exp((states[14]-constants[122])/constants[123]))
    algebraic[91] = constants[121]*algebraic[54]**3.00000*(1.00000-states[15])*(states[14]-constants[120])
    algebraic[101] = constants[127]*states[16]**4.00000*(states[14]-constants[128])
    algebraic[131] = constants[138]*(states[14]-constants[139])
    algebraic[141] = constants[141]*(states[14]-constants[140])
    algebraic[5] = constants[9]*states[1]+constants[10]*states[1]+constants[11]*states[1]+constants[12]*states[1]+constants[13]*states[1]+constants[14]*states[1]+constants[15]*states[1]+constants[16]*states[1]+constants[17]*states[1]
    algebraic[151] = algebraic[5]*(states[14]-constants[140])
    algebraic[112] = 1.00000/(1.00000+exp((states[18]-constants[161])/constants[162]))
    algebraic[122] = constants[160]*algebraic[112]*states[21]*(states[18]-constants[148])
    algebraic[58] = 1.00000/(1.00000+exp((states[18]-constants[150])/constants[151]))
    algebraic[92] = constants[149]*algebraic[58]**3.00000*(1.00000-states[19])*(states[18]-constants[148])
    algebraic[102] = constants[155]*states[20]**4.00000*(states[18]-constants[156])
    algebraic[132] = constants[166]*(states[18]-constants[167])
    algebraic[142] = constants[169]*(states[18]-constants[168])
    algebraic[10] = constants[18]*states[2]+constants[19]*states[2]+constants[20]*states[2]+constants[21]*states[2]+constants[22]*states[2]+constants[23]*states[2]+constants[24]*states[2]+constants[25]*states[2]+constants[26]*states[2]
    algebraic[152] = algebraic[10]*(states[18]-constants[168])
    algebraic[113] = 1.00000/(1.00000+exp((states[22]-constants[189])/constants[190]))
    algebraic[123] = constants[188]*algebraic[113]*states[25]*(states[22]-constants[176])
    algebraic[62] = 1.00000/(1.00000+exp((states[22]-constants[178])/constants[179]))
    algebraic[93] = constants[177]*algebraic[62]**3.00000*(1.00000-states[23])*(states[22]-constants[176])
    algebraic[103] = constants[183]*states[24]**4.00000*(states[22]-constants[184])
    algebraic[133] = constants[194]*(states[22]-constants[195])
    algebraic[143] = constants[197]*(states[22]-constants[196])
    algebraic[15] = constants[27]*states[3]+constants[28]*states[3]+constants[29]*states[3]+constants[30]*states[3]+constants[31]*states[3]+constants[32]*states[3]+constants[33]*states[3]+constants[34]*states[3]+constants[35]*states[3]
    algebraic[153] = algebraic[15]*(states[22]-constants[196])
    algebraic[114] = 1.00000/(1.00000+exp((states[26]-constants[217])/constants[218]))
    algebraic[124] = constants[216]*algebraic[114]*states[29]*(states[26]-constants[204])
    algebraic[66] = 1.00000/(1.00000+exp((states[26]-constants[206])/constants[207]))
    algebraic[94] = constants[205]*algebraic[66]**3.00000*(1.00000-states[27])*(states[26]-constants[204])
    algebraic[104] = constants[211]*states[28]**4.00000*(states[26]-constants[212])
    algebraic[134] = constants[222]*(states[26]-constants[223])
    algebraic[144] = constants[225]*(states[26]-constants[224])
    algebraic[20] = constants[36]*states[4]+constants[37]*states[4]+constants[38]*states[4]+constants[39]*states[4]+constants[40]*states[4]+constants[41]*states[4]+constants[42]*states[4]+constants[43]*states[4]+constants[44]*states[4]
    algebraic[154] = algebraic[20]*(states[26]-constants[224])
    algebraic[115] = 1.00000/(1.00000+exp((states[30]-constants[245])/constants[246]))
    algebraic[125] = constants[244]*algebraic[115]*states[33]*(states[30]-constants[232])
    algebraic[70] = 1.00000/(1.00000+exp((states[30]-constants[234])/constants[235]))
    algebraic[95] = constants[233]*algebraic[70]**3.00000*(1.00000-states[31])*(states[30]-constants[232])
    algebraic[105] = constants[239]*states[32]**4.00000*(states[30]-constants[240])
    algebraic[135] = constants[250]*(states[30]-constants[251])
    algebraic[145] = constants[253]*(states[30]-constants[252])
    algebraic[25] = constants[45]*states[5]+constants[46]*states[5]+constants[47]*states[5]+constants[48]*states[5]+constants[49]*states[5]+constants[50]*states[5]+constants[51]*states[5]+constants[52]*states[5]+constants[53]*states[5]
    algebraic[155] = algebraic[25]*(states[30]-constants[252])
    algebraic[116] = 1.00000/(1.00000+exp((states[34]-constants[273])/constants[274]))
    algebraic[126] = constants[272]*algebraic[116]*states[37]*(states[34]-constants[260])
    algebraic[74] = 1.00000/(1.00000+exp((states[34]-constants[262])/constants[263]))
    algebraic[96] = constants[261]*algebraic[74]**3.00000*(1.00000-states[35])*(states[34]-constants[260])
    algebraic[106] = constants[267]*states[36]**4.00000*(states[34]-constants[268])
    algebraic[136] = constants[278]*(states[34]-constants[279])
    algebraic[146] = constants[281]*(states[34]-constants[280])
    algebraic[30] = constants[54]*states[6]+constants[55]*states[6]+constants[56]*states[6]+constants[57]*states[6]+constants[58]*states[6]+constants[59]*states[6]+constants[60]*states[6]+constants[61]*states[6]+constants[62]*states[6]
    algebraic[156] = algebraic[30]*(states[34]-constants[280])
    algebraic[117] = 1.00000/(1.00000+exp((states[38]-constants[301])/constants[302]))
    algebraic[127] = constants[300]*algebraic[117]*states[41]*(states[38]-constants[288])
    algebraic[78] = 1.00000/(1.00000+exp((states[38]-constants[290])/constants[291]))
    algebraic[97] = constants[289]*algebraic[78]**3.00000*(1.00000-states[39])*(states[38]-constants[288])
    algebraic[107] = constants[295]*states[40]**4.00000*(states[38]-constants[296])
    algebraic[137] = constants[306]*(states[38]-constants[307])
    algebraic[147] = constants[309]*(states[38]-constants[308])
    algebraic[35] = constants[63]*states[7]+constants[64]*states[7]+constants[65]*states[7]+constants[66]*states[7]+constants[67]*states[7]+constants[68]*states[7]+constants[69]*states[7]+constants[70]*states[7]+constants[71]*states[7]
    algebraic[157] = algebraic[35]*(states[38]-constants[308])
    algebraic[118] = 1.00000/(1.00000+exp((states[42]-constants[329])/constants[330]))
    algebraic[128] = constants[328]*algebraic[118]*states[45]*(states[42]-constants[316])
    algebraic[82] = 1.00000/(1.00000+exp((states[42]-constants[318])/constants[319]))
    algebraic[98] = constants[317]*algebraic[82]**3.00000*(1.00000-states[43])*(states[42]-constants[316])
    algebraic[108] = constants[323]*states[44]**4.00000*(states[42]-constants[324])
    algebraic[138] = constants[334]*(states[42]-constants[335])
    algebraic[148] = constants[337]*(states[42]-constants[336])
    algebraic[40] = constants[72]*states[8]+constants[73]*states[8]+constants[74]*states[8]+constants[75]*states[8]+constants[76]*states[8]+constants[77]*states[8]+constants[78]*states[8]+constants[79]*states[8]+constants[80]*states[8]
    algebraic[158] = algebraic[40]*(states[42]-constants[336])
    algebraic[119] = 1.00000/(1.00000+exp((states[46]-constants[357])/constants[358]))
    algebraic[129] = constants[356]*algebraic[119]*states[49]*(states[46]-constants[344])
    algebraic[86] = 1.00000/(1.00000+exp((states[46]-constants[346])/constants[347]))
    algebraic[99] = constants[345]*algebraic[86]**3.00000*(1.00000-states[47])*(states[46]-constants[344])
    algebraic[109] = constants[351]*states[48]**4.00000*(states[46]-constants[352])
    algebraic[139] = constants[362]*(states[46]-constants[363])
    algebraic[149] = constants[365]*(states[46]-constants[364])
    algebraic[45] = constants[81]*states[9]+constants[82]*states[9]+constants[83]*states[9]+constants[84]*states[9]+constants[85]*states[9]+constants[86]*states[9]+constants[87]*states[9]+constants[88]*states[9]+constants[89]*states[9]
    algebraic[159] = algebraic[45]*(states[46]-constants[364])
    return algebraic

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)