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 = 8 sizeStates = 4 sizeConstants = 566 from math import * from numpy import * def createLegends(): legend_states = [""] * sizeStates legend_rates = [""] * sizeStates legend_algebraic = [""] * sizeAlgebraic legend_voi = "" legend_constants = [""] * sizeConstants legend_constants[0] = "AMK in component input_values (dimensionless)" legend_constants[1] = "TVD in component input_values (L_per_minute)" legend_constants[2] = "STH in component input_values (dimensionless)" legend_constants[3] = "NOD in component input_values (monovalent_mEq_per_minute)" legend_constants[4] = "KOD in component input_values (monovalent_mEq_per_minute)" legend_constants[5] = "VUD in component input_values (L_per_minute)" legend_constants[6] = "A1K in component parameter_values (minute)" legend_constants[7] = "A2K in component parameter_values (minute)" legend_constants[8] = "A3K in component parameter_values (minute)" legend_constants[9] = "A4K in component parameter_values (minute)" legend_constants[10] = "A4K2 in component parameter_values (minute)" legend_constants[11] = "AARK in component parameter_values (mmHg_minute_per_L)" legend_constants[12] = "AARLL in component parameter_values (mmHg_minute_per_L)" legend_constants[13] = "ADHINF in component parameter_values (dimensionless)" legend_constants[14] = "ADHKLL in component parameter_values (dimensionless)" legend_constants[15] = "ADHKUL in component parameter_values (dimensionless)" legend_constants[16] = "ADHPAM in component parameter_values (per_mmHg2)" legend_constants[17] = "ADHPUL in component parameter_values (mmHg)" legend_constants[18] = "ADHTC in component parameter_values (minute)" legend_constants[19] = "ADHVLL in component parameter_values (dimensionless)" legend_constants[20] = "ADHVUL in component parameter_values (dimensionless)" legend_constants[21] = "AH10 in component parameter_values (dimensionless)" legend_constants[22] = "AH11 in component parameter_values (minute)" legend_constants[23] = "AH9 in component parameter_values (per_mmHg)" legend_constants[24] = "AHMNAR in component parameter_values (dimensionless)" legend_constants[25] = "AHTHM in component parameter_values (dimensionless)" legend_constants[26] = "ALCLK in component parameter_values (dimensionless)" legend_constants[27] = "ALDINF in component parameter_values (dimensionless)" legend_constants[28] = "ALDKNS in component parameter_values (dimensionless)" legend_constants[29] = "ALDMM in component parameter_values (dimensionless)" legend_constants[30] = "AM1LL in component parameter_values (dimensionless)" legend_constants[31] = "AM1UL in component parameter_values (dimensionless)" legend_constants[32] = "AMCSNS in component parameter_values (dimensionless)" legend_constants[33] = "AMKM in component parameter_values (dimensionless)" legend_constants[34] = "AMKMUL in component parameter_values (dimensionless)" legend_constants[35] = "AMM1LM in component parameter_values (dimensionless)" legend_constants[36] = "AMM4 in component parameter_values (dimensionless)" legend_constants[37] = "AMNALL in component parameter_values (dimensionless)" legend_constants[38] = "AMNAM in component parameter_values (dimensionless)" legend_constants[39] = "AMNAUL in component parameter_values (dimensionless)" legend_constants[40] = "AMT in component parameter_values (minute)" legend_constants[41] = "ANCSNS in component parameter_values (dimensionless)" legend_constants[42] = "ANGINF in component parameter_values (dimensionless)" legend_constants[43] = "ANGKNS in component parameter_values (dimensionless)" legend_constants[44] = "ANMALD in component parameter_values (dimensionless)" legend_constants[45] = "ANMAM in component parameter_values (dimensionless)" legend_constants[46] = "ANMARL in component parameter_values (dimensionless)" legend_constants[47] = "ANMEM in component parameter_values (dimensionless)" legend_constants[48] = "ANMKEL in component parameter_values (dimensionless)" legend_constants[49] = "ANMKEM in component parameter_values (dimensionless)" legend_constants[50] = "ANMLL in component parameter_values (dimensionless)" legend_constants[51] = "ANMNAM in component parameter_values (dimensionless)" legend_constants[52] = "ANMSLT in component parameter_values (dimensionless)" legend_constants[53] = "ANMTM in component parameter_values (dimensionless)" legend_constants[54] = "ANMUL in component parameter_values (dimensionless)" legend_constants[55] = "ANPTC in component parameter_values (minute)" legend_constants[56] = "ANPXAF in component parameter_values (mmHg_minute_per_L)" legend_constants[57] = "ANPXUL in component parameter_values (dimensionless)" legend_constants[58] = "ANT in component parameter_values (minute)" legend_constants[59] = "ANULL in component parameter_values (dimensionless)" legend_constants[60] = "ANUM in component parameter_values (dimensionless)" legend_constants[61] = "ANUVM in component parameter_values (dimensionless)" legend_constants[62] = "ANV in component parameter_values (minute)" legend_constants[63] = "ANXM in component parameter_values (dimensionless)" legend_constants[64] = "ANY in component parameter_values (litre)" legend_constants[65] = "AR1LM in component parameter_values (dimensionless)" legend_constants[66] = "AR2LM in component parameter_values (dimensionless)" legend_constants[67] = "ARF in component parameter_values (dimensionless)" legend_constants[68] = "AUC1 in component parameter_values (dimensionless)" legend_constants[69] = "AUDMP in component parameter_values (minute)" legend_constants[70] = "AUK in component parameter_values (per_minute)" legend_constants[71] = "AUL in component parameter_values (litre)" legend_constants[72] = "AULPM in component parameter_values (dimensionless)" legend_constants[73] = "AUM1 in component parameter_values (dimensionless)" legend_constants[74] = "AUM2 in component parameter_values (dimensionless)" legend_constants[75] = "AUMAX in component parameter_values (dimensionless)" legend_constants[76] = "AUMIN in component parameter_values (dimensionless)" legend_constants[77] = "AUMK1 in component parameter_values (dimensionless)" legend_constants[78] = "AUN1 in component parameter_values (dimensionless)" legend_constants[79] = "AURG in component parameter_values (dimensionless)" legend_constants[80] = "AUS in component parameter_values (dimensionless)" legend_constants[81] = "AUSLP in component parameter_values (dimensionless)" legend_constants[82] = "AUTO in component parameter_values (dimensionless)" legend_constants[83] = "AUTOGN in component parameter_values (dimensionless)" legend_constants[84] = "AUTOSN in component parameter_values (dimensionless)" legend_constants[85] = "AUX in component parameter_values (dimensionless)" legend_constants[86] = "BAROTC in component parameter_values (minute)" legend_constants[87] = "CFC in component parameter_values (L_per_minute_per_mmHg)" legend_constants[88] = "CKEEX in component parameter_values (dimensionless)" legend_constants[89] = "CMPTSS in component parameter_values (dimensionless)" legend_constants[90] = "CN2 in component parameter_values (per_mmHg)" legend_constants[91] = "CN7 in component parameter_values (dimensionless)" legend_constants[92] = "CNR in component parameter_values (monovalent_mEq_per_litre)" legend_constants[93] = "CPF in component parameter_values (L_per_minute_per_mmHg)" legend_constants[94] = "CPK in component parameter_values (L_per_minute_per_mmHg)" legend_constants[95] = "CPR in component parameter_values (gram_per_L)" legend_constants[96] = "CV in component parameter_values (L_per_mmHg)" legend_constants[97] = "CRRFLX in component parameter_values (mmHg)" legend_constants[98] = "DIURET in component parameter_values (dimensionless)" legend_constants[99] = "DHDTR in component parameter_values (per_mmHg_per_minute)" legend_constants[100] = "DTNAR in component parameter_values (monovalent_mEq_per_minute)" legend_constants[101] = "DTNARL in component parameter_values (monovalent_mEq_per_minute)" legend_constants[102] = "EARK in component parameter_values (mmHg_minute_per_L)" legend_constants[103] = "EARLL in component parameter_values (mmHg_minute_per_L)" legend_constants[104] = "EFAFR in component parameter_values (dimensionless)" legend_constants[105] = "EXC in component parameter_values (dimensionless)" legend_constants[106] = "EXCML in component parameter_values (dimensionless)" legend_constants[107] = "EXCXP in component parameter_values (dimensionless)" legend_constants[108] = "EXCXP2 in component parameter_values (dimensionless)" legend_constants[109] = "EXE in component parameter_values (mmHg)" legend_constants[110] = "GCOPF in component parameter_values (per_mmHg)" legend_constants[111] = "GFLC in component parameter_values (L_per_minute_per_mmHg)" legend_constants[112] = "GFNDMP in component parameter_values (dimensionless)" legend_constants[113] = "GFNLL in component parameter_values (L_per_minute)" legend_constants[114] = "GPPD in component parameter_values (dimensionless)" legend_constants[115] = "HM6 in component parameter_values (mmHg)" legend_constants[116] = "HM8 in component parameter_values (L_per_minute_per_mmHg)" legend_constants[117] = "HTAUML in component parameter_values (dimensionless)" legend_constants[118] = "KORGN in component parameter_values (dimensionless)" legend_constants[119] = "KORNER in component parameter_values (dimensionless)" legend_constants[120] = "KORREN in component parameter_values (dimensionless)" legend_constants[121] = "KORTC in component parameter_values (minute)" legend_constants[122] = "LPDE in component parameter_values (dimensionless)" legend_constants[123] = "LPK in component parameter_values (L_per_minute)" legend_constants[124] = "LPPR in component parameter_values (gram_per_minute)" legend_constants[125] = "MDFL1 in component parameter_values (dimensionless)" legend_constants[126] = "MDFLKM in component parameter_values (monovalent_mEq_per_litre)" legend_constants[127] = "MDFLW2 in component parameter_values (dimensionless)" legend_constants[128] = "MDFLWX in component parameter_values (dimensionless)" legend_constants[129] = "MDMP in component parameter_values (dimensionless)" legend_constants[130] = "O2A in component parameter_values (dimensionless)" legend_constants[131] = "O2CHMO in component parameter_values (per_mmHg)" legend_constants[132] = "OMM in component parameter_values (mL_per_minute)" legend_constants[133] = "PA4 in component parameter_values (dimensionless)" legend_constants[134] = "PAEX in component parameter_values (dimensionless)" legend_constants[135] = "PCE in component parameter_values (dimensionless)" legend_constants[136] = "PCR in component parameter_values (mmHg)" legend_constants[137] = "PR1LL in component parameter_values (mmHg)" legend_constants[138] = "PGHF in component parameter_values (L_mmHg_per_gram)" legend_constants[139] = "PK2 in component parameter_values (mmHg_per_mL)" legend_constants[140] = "PL2 in component parameter_values (L_mL_per_minute_per_mmHg)" legend_constants[141] = "PLDF in component parameter_values (mmHg)" legend_constants[142] = "PM5 in component parameter_values (per_mmHg)" legend_constants[143] = "PO2ADV in component parameter_values (dimensionless)" legend_constants[144] = "POK in component parameter_values (dimensionless)" legend_constants[145] = "POM in component parameter_values (dimensionless)" legend_constants[146] = "POM2 in component parameter_values (dimensionless)" legend_constants[147] = "PON in component parameter_values (dimensionless)" legend_constants[148] = "POR in component parameter_values (mmHg)" legend_constants[149] = "POZ in component parameter_values (dimensionless)" legend_constants[150] = "PXTP in component parameter_values (mmHg)" legend_constants[151] = "QAOLM in component parameter_values (dimensionless)" legend_constants[152] = "QRF in component parameter_values (L_per_minute)" legend_constants[153] = "RABSC in component parameter_values (per_mmHg)" legend_constants[154] = "RAM in component parameter_values (mmHg_minute_per_L)" legend_constants[155] = "RAPRSP in component parameter_values (mmHg)" legend_constants[156] = "RAR in component parameter_values (mmHg_minute_per_L)" legend_constants[157] = "RCDFDP in component parameter_values (minute)" legend_constants[158] = "RCDFPC in component parameter_values (dimensionless)" legend_constants[159] = "REK in component parameter_values (dimensionless)" legend_constants[160] = "RFABKM in component parameter_values (monovalent_mEq_per_minute)" legend_constants[161] = "RFABDM in component parameter_values (dimensionless)" legend_constants[162] = "RFABDP in component parameter_values (dimensionless)" legend_constants[163] = "RFCDFT in component parameter_values (dimensionless)" legend_constants[164] = "RKC in component parameter_values (per_minute)" legend_constants[165] = "RNAGTC in component parameter_values (minute)" legend_constants[166] = "RNAUAD in component parameter_values (per_minute)" legend_constants[167] = "RPS in component parameter_values (dimensionless)" legend_constants[168] = "RTPPR in component parameter_values (dimensionless)" legend_constants[169] = "RTPPRS in component parameter_values (mmHg)" legend_constants[170] = "RTSPRS in component parameter_values (mmHg)" legend_constants[171] = "RVRS in component parameter_values (mmHg_minute_per_L)" legend_constants[172] = "RVSM in component parameter_values (mmHg_minute_per_L)" legend_constants[173] = "SR in component parameter_values (dimensionless)" legend_constants[174] = "SR2 in component parameter_values (dimensionless)" legend_constants[175] = "SRK in component parameter_values (minute)" legend_constants[176] = "SRK2 in component parameter_values (minute)" legend_constants[177] = "STA in component parameter_values (dimensionless)" legend_constants[178] = "TENSGN in component parameter_values (dimensionless)" legend_constants[179] = "TENSTC in component parameter_values (minute)" legend_constants[180] = "TIMETR in component parameter_values (minute)" legend_constants[181] = "TRNSFS in component parameter_values (dimensionless)" legend_constants[182] = "TRPL in component parameter_values (L_per_minute)" legend_constants[183] = "TSSLML in component parameter_values (dimensionless)" legend_constants[184] = "TSSLTC in component parameter_values (per_minute)" legend_constants[185] = "TVDDL in component parameter_values (minute)" legend_constants[186] = "U in component parameter_values (dimensionless)" legend_constants[187] = "VID1 in component parameter_values (L_per_minute)" legend_constants[188] = "VIDML in component parameter_values (litre2_per_monovalent_mEq_per_minute)" legend_constants[189] = "VNTSTM in component parameter_values (dimensionless)" legend_constants[190] = "VP1 in component parameter_values (dimensionless)" legend_constants[191] = "VPTISS in component parameter_values (litre)" legend_constants[192] = "VTSF in component parameter_values (litre)" legend_constants[193] = "VV9 in component parameter_values (litre)" legend_constants[194] = "X in component parameter_values (dimensionless)" legend_constants[195] = "Z in component parameter_values (dimensionless)" legend_constants[196] = "Z4 in component parameter_values (dimensionless)" legend_constants[197] = "Z5 in component parameter_values (dimensionless)" legend_constants[198] = "Z6 in component parameter_values (dimensionless)" legend_constants[199] = "Z7 in component parameter_values (dimensionless)" legend_constants[200] = "Z10 in component parameter_values (mmHg)" legend_constants[201] = "Z11 in component parameter_values (per_mmHg2)" legend_constants[202] = "Z12 in component parameter_values (dimensionless)" legend_constants[203] = "Z13 in component parameter_values (dimensionless)" legend_constants[204] = "Z14 in component parameter_values (dimensionless)" legend_constants[205] = "Z16 in component parameter_values (dimensionless)" legend_constants[206] = "Z18 in component parameter_values (dimensionless)" legend_constants[207] = "Z19 in component parameter_values (dimensionless)" legend_constants[208] = "KID in component parameter_values (monovalent_mEq_per_minute)" legend_constants[209] = "URFORM in component parameter_values (mOsm_per_minute)" legend_constants[210] = "AUV in component parameter_values (dimensionless)" legend_constants[211] = "AUY in component parameter_values (dimensionless)" legend_constants[212] = "O2M in component parameter_values (mL_per_minute)" legend_constants[213] = "NID in component parameter_values (monovalent_mEq_per_minute)" legend_constants[214] = "ATRFBM in component parameter_values (dimensionless)" legend_constants[215] = "GBL in component parameter_values (mmHg)" legend_constants[216] = "RNAUGN in component parameter_values (minute_per_L)" legend_constants[217] = "RNAULL in component parameter_values (dimensionless)" legend_constants[218] = "RNAUUL in component parameter_values (dimensionless)" legend_constants[219] = "HSR in component parameter_values (dimensionless)" legend_constants[220] = "HSL in component parameter_values (dimensionless)" legend_constants[221] = "HMK in component parameter_values (dimensionless)" legend_constants[222] = "PO2AMB in component parameter_values (mmHg)" legend_constants[223] = "HKM in component parameter_values (dimensionless)" legend_constants[224] = "DR in component parameter_values (L_per_minute)" legend_constants[225] = "ANPKNS in component parameter_values (dimensionless)" legend_constants[226] = "RMULT1 in component parameter_values (dimensionless)" legend_constants[227] = "GLPCA in component parameter_values (mmHg)" legend_constants[228] = "RFN in component parameter_values (L_per_minute)" legend_constants[229] = "RFABX in component parameter_values (dimensionless)" legend_constants[230] = "ANPINF in component parameter_values (dimensionless)" legend_constants[231] = "FIS in component parameter_values (L_per_minute_per_mmHg)" legend_constants[232] = "CPPD in component parameter_values (gram_per_L)" legend_constants[233] = "TRRBC in component parameter_values (L_per_minute)" legend_constants[234] = "HYL in component parameter_values (gram)" legend_constants[235] = "ATRVM in component parameter_values (litre)" legend_constants[236] = "ADHC_init in component state_variables (dimensionless)" legend_constants[237] = "AHY_init in component state_variables (dimensionless)" legend_constants[238] = "AMC_init in component state_variables (dimensionless)" legend_constants[239] = "AMM1T_init in component state_variables (dimensionless)" legend_constants[240] = "AMM2_init in component state_variables (dimensionless)" legend_constants[241] = "ANC_init in component state_variables (dimensionless)" legend_constants[242] = "ANPC_init in component state_variables (dimensionless)" legend_constants[243] = "ANX1_init in component state_variables (dimensionless)" legend_constants[244] = "AR1T_init in component state_variables (dimensionless)" legend_constants[245] = "AR2T_init in component state_variables (dimensionless)" legend_constants[246] = "AR3T_init in component state_variables (dimensionless)" legend_constants[247] = "AU1_init in component state_variables (dimensionless)" legend_constants[248] = "AU4_init in component state_variables (dimensionless)" legend_constants[249] = "AU6_init in component state_variables (dimensionless)" legend_constants[250] = "DTKA_init in component state_variables (monovalent_mEq_per_minute)" legend_constants[251] = "HMD1_init in component state_variables (dimensionless)" legend_constants[252] = "HPL_init in component state_variables (dimensionless)" legend_constants[253] = "HPR_init in component state_variables (dimensionless)" legend_constants[254] = "KTOT_init in component state_variables (monovalent_mEq)" legend_constants[255] = "NAE_init in component state_variables (monovalent_mEq)" legend_constants[256] = "O2VAD1_init in component state_variables (dimensionless)" legend_constants[257] = "OSV_init in component state_variables (dimensionless)" legend_constants[258] = "OVA_init in component state_variables (mL_per_L)" legend_constants[259] = "OVS_init in component state_variables (dimensionless)" legend_constants[260] = "PAR1_init in component state_variables (mmHg)" legend_constants[261] = "PC_init in component state_variables (mmHg)" legend_constants[262] = "PLUR_init in component state_variables (mOsm)" legend_constants[263] = "PPR1_init in component state_variables (gram)" legend_constants[264] = "PRP_init in component state_variables (gram)" legend_constants[265] = "QO2T_init in component state_variables (mL)" legend_constants[266] = "QOM1_init in component state_variables (mL)" legend_constants[267] = "RNAUG3_init in component state_variables (dimensionless)" legend_constants[268] = "TSP_init in component state_variables (gram)" legend_constants[269] = "TVD_init in component state_variables (L_per_minute)" legend_constants[270] = "VAS1_init in component state_variables (litre)" legend_constants[271] = "VIC_init in component state_variables (litre)" legend_constants[272] = "VLA1_init in component state_variables (litre)" legend_constants[273] = "VPA1_init in component state_variables (litre)" legend_constants[274] = "VPF1_init in component state_variables (litre)" legend_constants[275] = "VP_init in component state_variables (litre)" legend_constants[276] = "VRA1_init in component state_variables (litre)" legend_constants[277] = "VRC_init in component state_variables (litre)" legend_constants[278] = "VTS2_init in component state_variables (litre)" legend_constants[279] = "VTW_init in component state_variables (litre)" legend_constants[280] = "VV6_init in component state_variables (litre)" legend_constants[281] = "VV7_init in component state_variables (litre)" legend_constants[282] = "VVS1_init in component state_variables (litre)" legend_voi = "time in component environment (minute)" legend_algebraic[4] = "CKE in component extracellular_K_concentration (monovalent_mEq_per_litre)" legend_algebraic[3] = "VEC in component extracellular_fluid_volume (litre)" legend_algebraic[5] = "CNA in component extracellular_Na_concentration (monovalent_mEq_per_litre)" legend_states[0] = "VTW in component total_body_water (litre)" legend_constants[283] = "A1K in component parameter_values (minute)" legend_constants[284] = "A2K in component parameter_values (minute)" legend_constants[285] = "A3K in component parameter_values (minute)" legend_constants[286] = "A4K in component parameter_values (minute)" legend_constants[287] = "A4K2 in component parameter_values (minute)" legend_constants[288] = "AARK in component parameter_values (mmHg_minute_per_L)" legend_constants[289] = "AARLL in component parameter_values (mmHg_minute_per_L)" legend_constants[290] = "ADHINF in component parameter_values (dimensionless)" legend_constants[291] = "ADHKLL in component parameter_values (dimensionless)" legend_constants[292] = "ADHKUL in component parameter_values (dimensionless)" legend_constants[293] = "ADHPAM in component parameter_values (per_mmHg2)" legend_constants[294] = "ADHPUL in component parameter_values (mmHg)" legend_constants[295] = "ADHTC in component parameter_values (minute)" legend_constants[296] = "ADHVLL in component parameter_values (dimensionless)" legend_constants[297] = "ADHVUL in component parameter_values (dimensionless)" legend_constants[298] = "AH10 in component parameter_values (dimensionless)" legend_constants[299] = "AH11 in component parameter_values (minute)" legend_constants[300] = "AH9 in component parameter_values (per_mmHg)" legend_constants[301] = "AHMNAR in component parameter_values (dimensionless)" legend_constants[302] = "AHTHM in component parameter_values (dimensionless)" legend_constants[303] = "ALCLK in component parameter_values (dimensionless)" legend_constants[304] = "ALDINF in component parameter_values (dimensionless)" legend_constants[305] = "ALDKNS in component parameter_values (dimensionless)" legend_constants[306] = "ALDMM in component parameter_values (dimensionless)" legend_constants[307] = "AM1LL in component parameter_values (dimensionless)" legend_constants[308] = "AM1UL in component parameter_values (dimensionless)" legend_constants[309] = "AMCSNS in component parameter_values (dimensionless)" legend_constants[310] = "AMKM in component parameter_values (dimensionless)" legend_constants[311] = "AMKMUL in component parameter_values (dimensionless)" legend_constants[312] = "AMM1LM in component parameter_values (dimensionless)" legend_constants[313] = "AMM4 in component parameter_values (dimensionless)" legend_constants[314] = "AMNALL in component parameter_values (dimensionless)" legend_constants[315] = "AMNAM in component parameter_values (dimensionless)" legend_constants[316] = "AMNAUL in component parameter_values (dimensionless)" legend_constants[317] = "AMT in component parameter_values (minute)" legend_constants[318] = "ANCSNS in component parameter_values (dimensionless)" legend_constants[319] = "ANGINF in component parameter_values (dimensionless)" legend_constants[320] = "ANGKNS in component parameter_values (dimensionless)" legend_constants[321] = "ANMALD in component parameter_values (dimensionless)" legend_constants[322] = "ANMAM in component parameter_values (dimensionless)" legend_constants[323] = "ANMARL in component parameter_values (dimensionless)" legend_constants[324] = "ANMEM in component parameter_values (dimensionless)" legend_constants[325] = "ANMKEL in component parameter_values (dimensionless)" legend_constants[326] = "ANMKEM in component parameter_values (dimensionless)" legend_constants[327] = "ANMLL in component parameter_values (dimensionless)" legend_constants[328] = "ANMNAM in component parameter_values (dimensionless)" legend_constants[329] = "ANMSLT in component parameter_values (dimensionless)" legend_constants[330] = "ANMTM in component parameter_values (dimensionless)" legend_constants[331] = "ANMUL in component parameter_values (dimensionless)" legend_constants[332] = "ANPTC in component parameter_values (minute)" legend_constants[333] = "ANPXAF in component parameter_values (mmHg_minute_per_L)" legend_constants[334] = "ANPXUL in component parameter_values (dimensionless)" legend_constants[335] = "ANT in component parameter_values (minute)" legend_constants[336] = "ANULL in component parameter_values (dimensionless)" legend_constants[337] = "ANUM in component parameter_values (dimensionless)" legend_constants[338] = "ANUVM in component parameter_values (dimensionless)" legend_constants[339] = "ANV in component parameter_values (minute)" legend_constants[340] = "ANXM in component parameter_values (dimensionless)" legend_constants[341] = "ANY in component parameter_values (litre)" legend_constants[342] = "AR1LM in component parameter_values (dimensionless)" legend_constants[343] = "AR2LM in component parameter_values (dimensionless)" legend_constants[344] = "ARF in component parameter_values (dimensionless)" legend_constants[345] = "AUC1 in component parameter_values (dimensionless)" legend_constants[346] = "AUDMP in component parameter_values (minute)" legend_constants[347] = "AUK in component parameter_values (per_minute)" legend_constants[348] = "AUL in component parameter_values (litre)" legend_constants[349] = "AULPM in component parameter_values (dimensionless)" legend_constants[350] = "AUM1 in component parameter_values (dimensionless)" legend_constants[351] = "AUM2 in component parameter_values (dimensionless)" legend_constants[352] = "AUMAX in component parameter_values (dimensionless)" legend_constants[353] = "AUMIN in component parameter_values (dimensionless)" legend_constants[354] = "AUMK1 in component parameter_values (dimensionless)" legend_constants[355] = "AUN1 in component parameter_values (dimensionless)" legend_constants[356] = "AURG in component parameter_values (dimensionless)" legend_constants[357] = "AUS in component parameter_values (dimensionless)" legend_constants[358] = "AUSLP in component parameter_values (dimensionless)" legend_constants[359] = "AUTO in component parameter_values (dimensionless)" legend_constants[360] = "AUTOGN in component parameter_values (dimensionless)" legend_constants[361] = "AUTOSN in component parameter_values (dimensionless)" legend_constants[362] = "AUX in component parameter_values (dimensionless)" legend_constants[363] = "BAROTC in component parameter_values (minute)" legend_constants[364] = "CFC in component parameter_values (L_per_minute_per_mmHg)" legend_constants[365] = "CKEEX in component parameter_values (dimensionless)" legend_constants[366] = "CMPTSS in component parameter_values (dimensionless)" legend_constants[367] = "CN2 in component parameter_values (per_mmHg)" legend_constants[368] = "CN7 in component parameter_values (dimensionless)" legend_constants[369] = "CNR in component parameter_values (monovalent_mEq_per_litre)" legend_constants[370] = "CPF in component parameter_values (L_per_minute_per_mmHg)" legend_constants[371] = "CPK in component parameter_values (L_per_minute_per_mmHg)" legend_constants[372] = "CPR in component parameter_values (gram_per_L)" legend_constants[373] = "CV in component parameter_values (L_per_mmHg)" legend_constants[374] = "CRRFLX in component parameter_values (mmHg)" legend_constants[375] = "DIURET in component parameter_values (dimensionless)" legend_constants[376] = "DHDTR in component parameter_values (per_mmHg_per_minute)" legend_constants[377] = "DTNAR in component parameter_values (monovalent_mEq_per_minute)" legend_constants[378] = "DTNARL in component parameter_values (monovalent_mEq_per_minute)" legend_constants[379] = "EARK in component parameter_values (mmHg_minute_per_L)" legend_constants[380] = "EARLL in component parameter_values (mmHg_minute_per_L)" legend_constants[381] = "EFAFR in component parameter_values (dimensionless)" legend_constants[382] = "EXC in component parameter_values (dimensionless)" legend_constants[383] = "EXCML in component parameter_values (dimensionless)" legend_constants[384] = "EXCXP in component parameter_values (dimensionless)" legend_constants[385] = "EXCXP2 in component parameter_values (dimensionless)" legend_constants[386] = "EXE in component parameter_values (mmHg)" legend_constants[387] = "GCOPF in component parameter_values (per_mmHg)" legend_constants[388] = "GFLC in component parameter_values (L_per_minute_per_mmHg)" legend_constants[389] = "GFNDMP in component parameter_values (dimensionless)" legend_constants[390] = "GFNLL in component parameter_values (L_per_minute)" legend_constants[391] = "GPPD in component parameter_values (dimensionless)" legend_constants[392] = "HM6 in component parameter_values (mmHg)" legend_constants[393] = "HM8 in component parameter_values (L_per_minute_per_mmHg)" legend_constants[394] = "HTAUML in component parameter_values (dimensionless)" legend_constants[395] = "KORGN in component parameter_values (dimensionless)" legend_constants[396] = "KORNER in component parameter_values (dimensionless)" legend_constants[397] = "KORREN in component parameter_values (dimensionless)" legend_constants[398] = "KORTC in component parameter_values (minute)" legend_constants[399] = "LPDE in component parameter_values (dimensionless)" legend_constants[400] = "LPK in component parameter_values (L_per_minute)" legend_constants[401] = "LPPR in component parameter_values (gram_per_minute)" legend_constants[402] = "MDFL1 in component parameter_values (dimensionless)" legend_constants[403] = "MDFLKM in component parameter_values (monovalent_mEq_per_litre)" legend_constants[404] = "MDFLW2 in component parameter_values (dimensionless)" legend_constants[405] = "MDFLWX in component parameter_values (dimensionless)" legend_constants[406] = "MDMP in component parameter_values (dimensionless)" legend_constants[407] = "O2A in component parameter_values (dimensionless)" legend_constants[408] = "O2CHMO in component parameter_values (per_mmHg)" legend_constants[409] = "OMM in component parameter_values (mL_per_minute)" legend_constants[410] = "PA4 in component parameter_values (dimensionless)" legend_constants[411] = "PAEX in component parameter_values (dimensionless)" legend_constants[412] = "PCE in component parameter_values (dimensionless)" legend_constants[413] = "PCR in component parameter_values (mmHg)" legend_constants[414] = "PR1LL in component parameter_values (mmHg)" legend_constants[415] = "PGHF in component parameter_values (L_mmHg_per_gram)" legend_constants[416] = "PK2 in component parameter_values (mmHg_per_mL)" legend_constants[417] = "PL2 in component parameter_values (L_mL_per_minute_per_mmHg)" legend_constants[418] = "PLDF in component parameter_values (mmHg)" legend_constants[419] = "PM5 in component parameter_values (per_mmHg)" legend_constants[420] = "PO2ADV in component parameter_values (dimensionless)" legend_constants[421] = "POK in component parameter_values (dimensionless)" legend_constants[422] = "POM in component parameter_values (dimensionless)" legend_constants[423] = "POM2 in component parameter_values (dimensionless)" legend_constants[424] = "PON in component parameter_values (dimensionless)" legend_constants[425] = "POR in component parameter_values (mmHg)" legend_constants[426] = "POZ in component parameter_values (dimensionless)" legend_constants[427] = "PXTP in component parameter_values (mmHg)" legend_constants[428] = "QAOLM in component parameter_values (dimensionless)" legend_constants[429] = "QRF in component parameter_values (L_per_minute)" legend_constants[430] = "RABSC in component parameter_values (per_mmHg)" legend_constants[431] = "RAM in component parameter_values (mmHg_minute_per_L)" legend_constants[432] = "RAPRSP in component parameter_values (mmHg)" legend_constants[433] = "RAR in component parameter_values (mmHg_minute_per_L)" legend_constants[434] = "RCDFDP in component parameter_values (minute)" legend_constants[435] = "RCDFPC in component parameter_values (dimensionless)" legend_constants[436] = "REK in component parameter_values (dimensionless)" legend_constants[437] = "RFABKM in component parameter_values (monovalent_mEq_per_minute)" legend_constants[438] = "RFABDM in component parameter_values (dimensionless)" legend_constants[439] = "RFABDP in component parameter_values (dimensionless)" legend_constants[440] = "RFCDFT in component parameter_values (dimensionless)" legend_constants[441] = "RKC in component parameter_values (per_minute)" legend_constants[442] = "RNAGTC in component parameter_values (minute)" legend_constants[443] = "RNAUAD in component parameter_values (per_minute)" legend_constants[444] = "RPS in component parameter_values (dimensionless)" legend_constants[445] = "RTPPR in component parameter_values (dimensionless)" legend_constants[446] = "RTPPRS in component parameter_values (mmHg)" legend_constants[447] = "RTSPRS in component parameter_values (mmHg)" legend_constants[448] = "RVRS in component parameter_values (mmHg_minute_per_L)" legend_constants[449] = "RVSM in component parameter_values (mmHg_minute_per_L)" legend_constants[450] = "SR in component parameter_values (dimensionless)" legend_constants[451] = "SR2 in component parameter_values (dimensionless)" legend_constants[452] = "SRK in component parameter_values (minute)" legend_constants[453] = "SRK2 in component parameter_values (minute)" legend_constants[454] = "STA in component parameter_values (dimensionless)" legend_constants[455] = "TENSGN in component parameter_values (dimensionless)" legend_constants[456] = "TENSTC in component parameter_values (minute)" legend_constants[457] = "TIMETR in component parameter_values (minute)" legend_constants[458] = "TRNSFS in component parameter_values (dimensionless)" legend_constants[459] = "TRPL in component parameter_values (L_per_minute)" legend_constants[460] = "TSSLML in component parameter_values (dimensionless)" legend_constants[461] = "TSSLTC in component parameter_values (per_minute)" legend_constants[462] = "TVDDL in component parameter_values (minute)" legend_constants[463] = "U in component parameter_values (dimensionless)" legend_constants[464] = "VID1 in component parameter_values (L_per_minute)" legend_constants[465] = "VIDML in component parameter_values (litre2_per_monovalent_mEq_per_minute)" legend_constants[466] = "VNTSTM in component parameter_values (dimensionless)" legend_constants[467] = "VP1 in component parameter_values (dimensionless)" legend_constants[468] = "VPTISS in component parameter_values (litre)" legend_constants[469] = "VTSF in component parameter_values (litre)" legend_constants[470] = "VV9 in component parameter_values (litre)" legend_constants[471] = "X in component parameter_values (dimensionless)" legend_constants[472] = "Z in component parameter_values (dimensionless)" legend_constants[473] = "Z4 in component parameter_values (dimensionless)" legend_constants[474] = "Z5 in component parameter_values (dimensionless)" legend_constants[475] = "Z6 in component parameter_values (dimensionless)" legend_constants[476] = "Z7 in component parameter_values (dimensionless)" legend_constants[477] = "Z10 in component parameter_values (mmHg)" legend_constants[478] = "Z11 in component parameter_values (per_mmHg2)" legend_constants[479] = "Z12 in component parameter_values (dimensionless)" legend_constants[480] = "Z13 in component parameter_values (dimensionless)" legend_constants[481] = "Z14 in component parameter_values (dimensionless)" legend_constants[482] = "Z16 in component parameter_values (dimensionless)" legend_constants[483] = "Z18 in component parameter_values (dimensionless)" legend_constants[484] = "Z19 in component parameter_values (dimensionless)" legend_constants[485] = "KID in component parameter_values (monovalent_mEq_per_minute)" legend_constants[486] = "URFORM in component parameter_values (mOsm_per_minute)" legend_constants[487] = "AUV in component parameter_values (dimensionless)" legend_constants[488] = "AUY in component parameter_values (dimensionless)" legend_constants[489] = "O2M in component parameter_values (mL_per_minute)" legend_constants[490] = "NID in component parameter_values (monovalent_mEq_per_minute)" legend_constants[491] = "ATRFBM in component parameter_values (dimensionless)" legend_constants[492] = "GBL in component parameter_values (mmHg)" legend_constants[493] = "RNAUGN in component parameter_values (minute_per_L)" legend_constants[494] = "RNAULL in component parameter_values (dimensionless)" legend_constants[495] = "RNAUUL in component parameter_values (dimensionless)" legend_constants[496] = "HSR in component parameter_values (dimensionless)" legend_constants[497] = "HSL in component parameter_values (dimensionless)" legend_constants[498] = "HMK in component parameter_values (dimensionless)" legend_constants[499] = "PO2AMB in component parameter_values (mmHg)" legend_constants[500] = "HKM in component parameter_values (dimensionless)" legend_constants[501] = "DR in component parameter_values (L_per_minute)" legend_constants[502] = "ANPKNS in component parameter_values (dimensionless)" legend_constants[503] = "RMULT1 in component parameter_values (dimensionless)" legend_constants[504] = "GLPCA in component parameter_values (mmHg)" legend_constants[505] = "RFN in component parameter_values (L_per_minute)" legend_constants[506] = "RFABX in component parameter_values (dimensionless)" legend_constants[507] = "ANPINF in component parameter_values (dimensionless)" legend_constants[508] = "FIS in component parameter_values (L_per_minute_per_mmHg)" legend_constants[509] = "CPPD in component parameter_values (gram_per_L)" legend_constants[510] = "TRRBC in component parameter_values (L_per_minute)" legend_constants[511] = "HYL in component parameter_values (gram)" legend_constants[512] = "ATRVM in component parameter_values (litre)" legend_constants[513] = "ADHC_init in component state_variables (dimensionless)" legend_constants[514] = "AHY_init in component state_variables (dimensionless)" legend_constants[515] = "AMC_init in component state_variables (dimensionless)" legend_constants[516] = "AMM1T_init in component state_variables (dimensionless)" legend_constants[517] = "AMM2_init in component state_variables (dimensionless)" legend_constants[518] = "ANC_init in component state_variables (dimensionless)" legend_constants[519] = "ANPC_init in component state_variables (dimensionless)" legend_constants[520] = "ANX1_init in component state_variables (dimensionless)" legend_constants[521] = "AR1T_init in component state_variables (dimensionless)" legend_constants[522] = "AR2T_init in component state_variables (dimensionless)" legend_constants[523] = "AR3T_init in component state_variables (dimensionless)" legend_constants[524] = "AU1_init in component state_variables (dimensionless)" legend_constants[525] = "AU4_init in component state_variables (dimensionless)" legend_constants[526] = "AU6_init in component state_variables (dimensionless)" legend_constants[527] = "DTKA_init in component state_variables (monovalent_mEq_per_minute)" legend_constants[528] = "HMD1_init in component state_variables (dimensionless)" legend_constants[529] = "HPL_init in component state_variables (dimensionless)" legend_constants[530] = "HPR_init in component state_variables (dimensionless)" legend_constants[531] = "KTOT_init in component state_variables (monovalent_mEq)" legend_constants[532] = "NAE_init in component state_variables (monovalent_mEq)" legend_constants[533] = "O2VAD1_init in component state_variables (dimensionless)" legend_constants[534] = "OSV_init in component state_variables (dimensionless)" legend_constants[535] = "OVA_init in component state_variables (mL_per_L)" legend_constants[536] = "OVS_init in component state_variables (dimensionless)" legend_constants[537] = "PAR1_init in component state_variables (mmHg)" legend_constants[538] = "PC_init in component state_variables (mmHg)" legend_constants[539] = "PLUR_init in component state_variables (mOsm)" legend_constants[540] = "PPR1_init in component state_variables (gram)" legend_constants[541] = "PRP_init in component state_variables (gram)" legend_constants[542] = "QO2T_init in component state_variables (mL)" legend_constants[543] = "QOM1_init in component state_variables (mL)" legend_constants[544] = "RNAUG3_init in component state_variables (dimensionless)" legend_constants[545] = "TSP_init in component state_variables (gram)" legend_constants[546] = "TVD_init in component state_variables (L_per_minute)" legend_constants[547] = "VAS1_init in component state_variables (litre)" legend_constants[548] = "VIC_init in component state_variables (litre)" legend_constants[549] = "VLA1_init in component state_variables (litre)" legend_constants[550] = "VPA1_init in component state_variables (litre)" legend_constants[551] = "VPF1_init in component state_variables (litre)" legend_constants[552] = "VP_init in component state_variables (litre)" legend_constants[553] = "VRA1_init in component state_variables (litre)" legend_constants[554] = "VRC_init in component state_variables (litre)" legend_constants[555] = "VTS2_init in component state_variables (litre)" legend_constants[556] = "VTW_init in component state_variables (litre)" legend_constants[557] = "VV6_init in component state_variables (litre)" legend_constants[558] = "VV7_init in component state_variables (litre)" legend_constants[559] = "VVS1_init in component state_variables (litre)" legend_constants[560] = "NED in component extracellular_Na_concentration (monovalent_mEq_per_minute)" legend_states[1] = "NAE in component extracellular_Na_concentration (monovalent_mEq)" legend_constants[561] = "AMK1 in component aldosterone_effect_on_cellular_K_distribution (dimensionless)" legend_algebraic[0] = "KE in component extracellular_K_concentration (monovalent_mEq)" legend_states[2] = "KTOT in component extracellular_K_concentration (monovalent_mEq)" legend_constants[562] = "KTOTD in component extracellular_K_concentration (monovalent_mEq_per_minute)" legend_states[3] = "VIC in component intracellular_fluid_volume (litre)" legend_algebraic[2] = "CKI in component intracellular_K_concentration (monovalent_mEq_per_litre)" legend_algebraic[1] = "KI in component intracellular_K_concentration (monovalent_mEq)" legend_algebraic[7] = "VID in component intracellular_fluid_volume (L_per_minute)" legend_algebraic[6] = "CCD in component intracellular_fluid_volume (monovalent_mEq_per_litre)" legend_rates[1] = "d/dt NAE in component extracellular_Na_concentration (monovalent_mEq)" legend_rates[2] = "d/dt KTOT in component extracellular_K_concentration (monovalent_mEq)" legend_rates[3] = "d/dt VIC in component intracellular_fluid_volume (litre)" legend_rates[0] = "d/dt VTW in component total_body_water (litre)" return (legend_states, legend_algebraic, legend_voi, legend_constants) def initConsts(): constants = [0.0] * sizeConstants; states = [0.0] * sizeStates; constants[0] = 1.037 constants[1] = 0.000980838 constants[2] = 0.977181 constants[3] = 0.0959449 constants[4] = 0.0804374 constants[5] = 0.000989 constants[6] = 0.5 constants[7] = 60 constants[8] = 40000 constants[9] = 0.1 constants[10] = 40000 constants[11] = 1 constants[12] = 4 constants[13] = 0 constants[14] = 0.2 constants[15] = 5 constants[16] = 0.3 constants[17] = 85 constants[18] = 15 constants[19] = 0.93617 constants[20] = 2.5 constants[21] = 0.333 constants[22] = 1000 constants[23] = 1 constants[24] = 0.3 constants[25] = 2 constants[26] = 0.3 constants[27] = 0 constants[28] = 0 constants[29] = 2.5 constants[30] = 0 constants[31] = 5 constants[32] = 0.65 constants[33] = 0.5 constants[34] = 12 constants[35] = 0.005 constants[36] = 0.005 constants[37] = 0.04 constants[38] = 0.8 constants[39] = 15 constants[40] = 60 constants[41] = 0.4 constants[42] = 0 constants[43] = 0 constants[44] = 2.5 constants[45] = 1.4 constants[46] = 0.86 constants[47] = 1.6 constants[48] = 0.3 constants[49] = 2 constants[50] = 0.7 constants[51] = 1 constants[52] = 2 constants[53] = 1.5 constants[54] = 1.8 constants[55] = 4 constants[56] = 1.5 constants[57] = 10 constants[58] = 12 constants[59] = 0.8 constants[60] = 6 constants[61] = 0 constants[62] = 5000 constants[63] = 0 constants[64] = -0.2 constants[65] = 0.005 constants[66] = 0.005 constants[67] = 0.5 constants[68] = 0.3 constants[69] = 0.3 constants[70] = 0.004 constants[71] = 1.5 constants[72] = 0 constants[73] = 3 constants[74] = 1 constants[75] = 5.0 constants[76] = 0.4 constants[77] = 0.3 constants[78] = 0.5 constants[79] = 1.0 constants[80] = 1 constants[81] = 1.5 constants[82] = 0 constants[83] = 7 constants[84] = 0.9 constants[85] = 1 constants[86] = 0.16 constants[87] = 0.01167 constants[88] = 4 constants[89] = 2 constants[90] = 0.0212 constants[91] = 0.2 constants[92] = 139 constants[93] = 0.0003 constants[94] = 0.000253 constants[95] = 40 constants[96] = 0.1 constants[97] = 0 constants[98] = 1 constants[99] = 0.05 constants[100] = 0.675 constants[101] = 1e-06 constants[102] = 1 constants[103] = 24 constants[104] = 0 constants[105] = 1 constants[106] = 0.01 constants[107] = 1.0 constants[108] = 0.17 constants[109] = 0 constants[110] = 0.8092 constants[111] = 0.0208333 constants[112] = 3 constants[113] = 0.001 constants[114] = 1.0 constants[115] = 1850 constants[116] = 4.714e-08 constants[117] = 0.4 constants[118] = 1 constants[119] = 0 constants[120] = 0 constants[121] = 10000 constants[122] = 8 constants[123] = 2.728e-14 constants[124] = 0.03 constants[125] = 10 constants[126] = 0.667 constants[127] = 0.005 constants[128] = 0.01 constants[129] = 0 constants[130] = 0.1 constants[131] = 0.01 constants[132] = 57.1 constants[133] = 1 constants[134] = 2 constants[135] = 1 constants[136] = 15 constants[137] = 0 constants[138] = -2 constants[139] = 0.79167 constants[140] = 1.8 constants[141] = 4.2 constants[142] = 30 constants[143] = 0.001 constants[144] = 0.1 constants[145] = 0.04 constants[146] = 2 constants[147] = 0.1 constants[148] = 35 constants[149] = 2 constants[150] = 8 constants[151] = 0.2 constants[152] = 0.15 constants[153] = 0.5 constants[154] = 96.3 constants[155] = 0 constants[156] = 30.52 constants[157] = 2000 constants[158] = 0 constants[159] = 1 constants[160] = 0.03 constants[161] = 0.3 constants[162] = 1 constants[163] = 0 constants[164] = 5.8e-06 constants[165] = 15 constants[166] = 0 constants[167] = 0 constants[168] = 0.9 constants[169] = 15.2 constants[170] = 6 constants[171] = 19.167 constants[172] = 1 constants[173] = 1 constants[174] = 1 constants[175] = 5 constants[176] = 10000 constants[177] = 0 constants[178] = 0 constants[179] = 0.05 constants[180] = 0 constants[181] = 0 constants[182] = 0 constants[183] = 0.15 constants[184] = 0.005 constants[185] = 30 constants[186] = 4 constants[187] = 0.01 constants[188] = 0.01 constants[189] = 1 constants[190] = 0.01 constants[191] = 0.0175 constants[192] = 6 constants[193] = 2.51 constants[194] = 4 constants[195] = 1 constants[196] = 0.5 constants[197] = 0.3 constants[198] = 20 constants[199] = 5 constants[200] = 45 constants[201] = 0.01 constants[202] = 5 constants[203] = 0.625 constants[204] = 5 constants[205] = 5 constants[206] = 5 constants[207] = 5 constants[208] = 0.08 constants[209] = 0.24 constants[210] = 0.55 constants[211] = 0 constants[212] = 164 constants[213] = 0.1 constants[214] = 0 constants[215] = 0 constants[216] = 0.6 constants[217] = 0.3 constants[218] = 10 constants[219] = 1 constants[220] = 1 constants[221] = 90 constants[222] = 150 constants[223] = 0.53333 constants[224] = 0 constants[225] = 0 constants[226] = 1 constants[227] = 1.0 constants[228] = 1.22057 constants[229] = 0.8 constants[230] = 0 constants[231] = 0 constants[232] = 31.9719 constants[233] = 0 constants[234] = 60 constants[235] = 0 constants[236] = 1.0 constants[237] = 0.301963 constants[238] = 1.0 constants[239] = 1.00269 constants[240] = 1.09071 constants[241] = 0.859476 constants[242] = 1.0 constants[243] = 0 constants[244] = 1.02127 constants[245] = 1.01179 constants[246] = 1.1448 constants[247] = 1.00007 constants[248] = -0.060024 constants[249] = 1.00132 constants[250] = 0.0367573 constants[251] = 1 constants[252] = 1.00163 constants[253] = 1.00237 constants[254] = 3622.54 constants[255] = 2109.91 constants[256] = 2.368e-07 constants[257] = 0.694163 constants[258] = 204.497 constants[259] = 0.699673 constants[260] = 103.525 constants[261] = 16.9144 constants[262] = 159.549 constants[263] = 0.419998 constants[264] = 216.243 constants[265] = 72.2362 constants[266] = 48.0839 constants[267] = 0 constants[268] = 279.945 constants[269] = 0.000980838 constants[270] = 0.862514 constants[271] = 25.0404 constants[272] = 0.379883 constants[273] = 0.38131 constants[274] = 0.0123238 constants[275] = 3.00449 constants[276] = 0.100043 constants[277] = 2.00439 constants[278] = 0 constants[279] = 39.8952 constants[280] = 0.0101913 constants[281] = 0.00366525 constants[282] = 3.28246 constants[283] = 0.5 constants[284] = 60 constants[285] = 40000 constants[286] = 0.1 constants[287] = 40000 constants[288] = 1 constants[289] = 4 constants[290] = 0 constants[291] = 0.2 constants[292] = 5 constants[293] = 0.3 constants[294] = 85 constants[295] = 15 constants[296] = 0.93617 constants[297] = 2.5 constants[298] = 0.333 constants[299] = 1000 constants[300] = 1 constants[301] = 0.3 constants[302] = 2 constants[303] = 0.3 constants[304] = 0 constants[305] = 0 constants[306] = 2.5 constants[307] = 0 constants[308] = 5 constants[309] = 0.65 constants[310] = 0.5 constants[311] = 12 constants[312] = 0.005 constants[313] = 0.005 constants[314] = 0.04 constants[315] = 0.8 constants[316] = 15 constants[317] = 60 constants[318] = 0.4 constants[319] = 0 constants[320] = 0 constants[321] = 2.5 constants[322] = 1.4 constants[323] = 0.86 constants[324] = 1.6 constants[325] = 0.3 constants[326] = 2 constants[327] = 0.7 constants[328] = 1 constants[329] = 2 constants[330] = 1.5 constants[331] = 1.8 constants[332] = 4 constants[333] = 1.5 constants[334] = 10 constants[335] = 12 constants[336] = 0.8 constants[337] = 6 constants[338] = 0 constants[339] = 5000 constants[340] = 0 constants[341] = -0.2 constants[342] = 0.005 constants[343] = 0.005 constants[344] = 0.5 constants[345] = 0.3 constants[346] = 0.3 constants[347] = 0.004 constants[348] = 1.5 constants[349] = 0 constants[350] = 3 constants[351] = 1 constants[352] = 5.0 constants[353] = 0.4 constants[354] = 0.3 constants[355] = 0.5 constants[356] = 1.0 constants[357] = 1 constants[358] = 1.5 constants[359] = 0 constants[360] = 7 constants[361] = 0.9 constants[362] = 1 constants[363] = 0.16 constants[364] = 0.01167 constants[365] = 4 constants[366] = 2 constants[367] = 0.0212 constants[368] = 0.2 constants[369] = 139 constants[370] = 0.0003 constants[371] = 0.000253 constants[372] = 40 constants[373] = 0.1 constants[374] = 0 constants[375] = 1 constants[376] = 0.05 constants[377] = 0.675 constants[378] = 1e-06 constants[379] = 1 constants[380] = 24 constants[381] = 0 constants[382] = 1 constants[383] = 0.01 constants[384] = 1.0 constants[385] = 0.17 constants[386] = 0 constants[387] = 0.8092 constants[388] = 0.0208333 constants[389] = 3 constants[390] = 0.001 constants[391] = 1.0 constants[392] = 1850 constants[393] = 4.714e-08 constants[394] = 0.4 constants[395] = 1 constants[396] = 0 constants[397] = 0 constants[398] = 10000 constants[399] = 8 constants[400] = 2.728e-14 constants[401] = 0.03 constants[402] = 10 constants[403] = 0.667 constants[404] = 0.005 constants[405] = 0.01 constants[406] = 0 constants[407] = 0.1 constants[408] = 0.01 constants[409] = 57.1 constants[410] = 1 constants[411] = 2 constants[412] = 1 constants[413] = 15 constants[414] = 0 constants[415] = -2 constants[416] = 0.79167 constants[417] = 1.8 constants[418] = 4.2 constants[419] = 30 constants[420] = 0.001 constants[421] = 0.1 constants[422] = 0.04 constants[423] = 2 constants[424] = 0.1 constants[425] = 35 constants[426] = 2 constants[427] = 8 constants[428] = 0.2 constants[429] = 0.15 constants[430] = 0.5 constants[431] = 96.3 constants[432] = 0 constants[433] = 30.52 constants[434] = 2000 constants[435] = 0 constants[436] = 1 constants[437] = 0.03 constants[438] = 0.3 constants[439] = 1 constants[440] = 0 constants[441] = 5.8e-06 constants[442] = 15 constants[443] = 0 constants[444] = 0 constants[445] = 0.9 constants[446] = 15.2 constants[447] = 6 constants[448] = 19.167 constants[449] = 1 constants[450] = 1 constants[451] = 1 constants[452] = 5 constants[453] = 10000 constants[454] = 0 constants[455] = 0 constants[456] = 0.05 constants[457] = 0 constants[458] = 0 constants[459] = 0 constants[460] = 0.15 constants[461] = 0.005 constants[462] = 30 constants[463] = 4 constants[464] = 0.01 constants[465] = 0.01 constants[466] = 1 constants[467] = 0.01 constants[468] = 0.0175 constants[469] = 6 constants[470] = 2.51 constants[471] = 4 constants[472] = 1 constants[473] = 0.5 constants[474] = 0.3 constants[475] = 20 constants[476] = 5 constants[477] = 45 constants[478] = 0.01 constants[479] = 5 constants[480] = 0.625 constants[481] = 5 constants[482] = 5 constants[483] = 5 constants[484] = 5 constants[485] = 0.08 constants[486] = 0.24 constants[487] = 0.55 constants[488] = 0 constants[489] = 164 constants[490] = 0.1 constants[491] = 0 constants[492] = 0 constants[493] = 0.6 constants[494] = 0.3 constants[495] = 10 constants[496] = 1 constants[497] = 1 constants[498] = 90 constants[499] = 150 constants[500] = 0.53333 constants[501] = 0 constants[502] = 0 constants[503] = 1 constants[504] = 1.0 constants[505] = 1.22057 constants[506] = 0.8 constants[507] = 0 constants[508] = 0 constants[509] = 31.9719 constants[510] = 0 constants[511] = 60 constants[512] = 0 constants[513] = 1.0 constants[514] = 0.301963 constants[515] = 1.0 constants[516] = 1.00269 constants[517] = 1.09071 constants[518] = 0.859476 constants[519] = 1.0 constants[520] = 0 constants[521] = 1.02127 constants[522] = 1.01179 constants[523] = 1.1448 constants[524] = 1.00007 constants[525] = -0.060024 constants[526] = 1.00132 constants[527] = 0.0367573 constants[528] = 1 constants[529] = 1.00163 constants[530] = 1.00237 constants[531] = 3622.54 constants[532] = 2109.91 constants[533] = 2.368e-07 constants[534] = 0.694163 constants[535] = 204.497 constants[536] = 0.699673 constants[537] = 103.525 constants[538] = 16.9144 constants[539] = 159.549 constants[540] = 0.419998 constants[541] = 216.243 constants[542] = 72.2362 constants[543] = 48.0839 constants[544] = 0 constants[545] = 279.945 constants[546] = 0.000980838 constants[547] = 0.862514 constants[548] = 25.0404 constants[549] = 0.379883 constants[550] = 0.38131 constants[551] = 0.0123238 constants[552] = 3.00449 constants[553] = 0.100043 constants[554] = 2.00439 constants[555] = 0 constants[556] = 39.8952 constants[557] = 0.0101913 constants[558] = 0.00366525 constants[559] = 3.28246 constants[560] = (constants[490]*constants[2]-constants[3])+constants[459]*142.000 constants[561] = (constants[0]-1.00000)*constants[303]+1.00000 constants[562] = constants[485]-constants[4] constants[563] = constants[1]-constants[5] constants[564] = constants[560] constants[565] = constants[562] states[0] = constants[556] states[1] = constants[532] states[2] = constants[531] states[3] = constants[548] return (states, constants) def computeRates(voi, states, constants): rates = [0.0] * sizeStates; algebraic = [0.0] * sizeAlgebraic rates[0] = constants[563] rates[1] = constants[564] rates[2] = constants[565] algebraic[3] = states[0]-states[3] algebraic[5] = states[1]/algebraic[3] algebraic[0] = (states[2]-3000.00)/(constants[561]*9.33330) algebraic[1] = states[2]-algebraic[0] algebraic[2] = algebraic[1]/states[3] algebraic[6] = algebraic[2]-algebraic[5] algebraic[7] = algebraic[6]*constants[465] rates[3] = algebraic[7] return(rates) def computeAlgebraic(constants, states, voi): algebraic = array([[0.0] * len(voi)] * sizeAlgebraic) states = array(states) voi = array(voi) algebraic[3] = states[0]-states[3] algebraic[5] = states[1]/algebraic[3] algebraic[0] = (states[2]-3000.00)/(constants[561]*9.33330) algebraic[1] = states[2]-algebraic[0] algebraic[2] = algebraic[1]/states[3] algebraic[6] = algebraic[2]-algebraic[5] algebraic[7] = algebraic[6]*constants[465] algebraic[4] = algebraic[0]/algebraic[3] 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)