<gh_stars>0



"""Author: SKHEO, KHU"""

import matplotlib.pyplot as plt
import numpy as np
from matplotlib.font_manager import FontProperties
import matplotlib.gridspec as gridspec
import random


class influent(object):
    def buffer_tank(switch):
        #t1,t2: hourly basis. e.g. 0, 12hr
        #switch = np.random.choice(6,1)

        if switch == 0: # morning (0~12), dry

            # 각 유입수 성상의 Mean value
            si_m =np.array([30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30
            ])
            ss_m =np.array( [63.63455,61.67313,61.71973,62.16018,64.57526,67.84871,72.14054,72.47069,69.7643,67.49915,62.83833,62.27237143,53.74197,54.44886,50.06769,46.35457,44.35819,42.57931,40.00033,40.38873,40.77713,40.46641,40.83539,40.46641,40.50525,40.52467,40.31105,40.11685,40.04693,40.34212,40.58293,40.89365,41.16553,41.86465,42.42395,43.94649,48.77431,59.88648,71.46084,80.00567,94.90087,105.7761,115.2104,120.011,118.9701,112.1109,102.4553,94.81153
            ])
            xi_m = np.array([52.28757143,51.66285714,46.76185714,49.95214286,48.007,48.50685714,48.31542857,39.62985714,38.09571429,36.67671429,34.69028571,31.66557143,28.23228571,26.256,23.77214286,21.898,21.01385714,19.36242857,19.47071429,19.28542857,18.47757143,18.88957143,19.06842857,18.80642857,18.04585714,18.102,16.91514286,16.862,16.75885714,16.83957143,16.54742857,16.87985714,16.81342857,16.53628571,17.664,17.901,20.22471429,22.31228571,31.09085714,37.80471429,42.14871429,50.65642857,59.44585714,70.141,77.07,82.70885714,87.174,84.82457143
            ])
            xs_m = np.array([228.8422857,224.8784286,213.1182857,210.2168571,209.8551429,209.8774286,212.3002857,211.598,207.301,198.8494286,192.2178571,186.6502857,181.1207143,173.3857143,165.7001429,157.7538571,149.8708571,142.9755714,137.0042857,131.949,128.582,125.5931429,123.5375714,122.3611429,121.5711429,120.4541429,119.0282857,117.3594286,115.659,114.534,113.6197143,112.9752857,112.5301429,112.2802857,112.3448571,112.8771429,113.3478571,116.9234286,122.7555714,133.1755714,148.2372857,162.0105714,175.9845714,190.1444286,206.4641429,221.929,235.1714286,249.2904286
            ])
            xbh_m = np.array([31.23642857,30.72685714,28.87557143,28.90757143,28.65114286,28.70928571,28.95714286,27.91428571,27.26628571,26.16942857,25.212,24.25714286,23.26142857,22.18257143,21.05257143,19.96128571,18.98714286,18.03742857,17.38614286,16.80371429,16.34,16.05385714,15.84528571,15.68528571,15.51285714,15.39485714,15.10471429,14.91371429,14.71328571,14.597,14.46285714,14.42828571,14.37128571,14.313,14.44514286,14.531,14.84128571,15.47042857,17.09414286,18.99771429,21.15414286,23.62971429,26.15885714,28.92071429,31.50371429,33.84857143,35.816,37.12385714
            ])
            xba_m = np.array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
            ])
            xp_m = np.array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
            ])
            so_m = np.array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
            ])
            sno_m = np.array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
            ])
            snh_m = np.array([30.24762,30.21283,31.04771,31.67387,33.15925,35.11773,37.86587,37.86587,36.8501,36.47441,34.38721,34.67942,32.06695,29.89975,27.06813,24.70265,23.38772,22.19802,20.31607,20.54218,20.71611,20.7509,20.66393,20.61175,20.54218,20.43782,20.40303,20.15953,20.02734,19.99951,20.10039,20.40303,20.82047,21.16834,21.6136,22.1354,24.68178,29.65625,34.24807,37.93544,43.39692,46.61468,49.24802,49.99941,49.24802,45.74154,40.85751,39.03469
            ])
            snd_m = np.array([6.36346,6.16731,6.17197,6.21602,6.45753,6.78487,7.21405,7.24707,6.97643,6.74992,6.28383,6.227238571,5.3742,5.44489,5.00677,4.63546,4.43582,4.25793,4.00003,4.03887,4.07771,4.04664,4.08354,4.04664,4.05053,4.05247,4.03111,4.01169,4.00469,4.03421,4.05829,4.08937,4.11655,4.18647,4.2424,4.39465,4.87743,5.98865,7.14608,8.00057,9.49009,10.57761,11.52104,12.0011,11.89701,11.21109,10.24553,9.48115
            ])
            xnd_m = np.array([11.74314286,11.55142857,10.85542857,10.86742857,10.77085714,10.793,10.88585714,10.49428571,10.25071429,9.838,9.478428571,9.119142857,8.745,8.339428571,7.914285714,7.504285714,7.138,6.781142857,6.536285714,6.317142857,6.142714286,6.035142857,5.956571429,5.896714286,5.832,5.787285714,5.678571429,5.606714286,5.531142857,5.487571429,5.437285714,5.424285714,5.402857143,5.381,5.430571429,5.462714286,5.579571429,5.816,6.426285714,7.142,7.952428571,8.883428571,9.834,10.87214286,11.84357143,12.725,13.46457143,13.95642857
            ])
            salk_m = np.array([7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7
            ])
            q_m = np.array([18794.42857,18884.85714,18100.57143,19539,18855.14286,19003.85714,18723.28571,15534.14286,15224.57143,15279.42857,14944,14023.57143,12824.42857,12433.14286,11718.85714,11296.85714,11417,10975.57143,11592.57143,11925.14286,11721.28571,12305.85714,12658.28571,12588.85714,12164.71429,12341.85714,11588.57143,11729.14286,11857.28571,12054.14286,11907.57143,12246.28571,12245.71429,12049,12956.71429,13052.57143,14680.85714,15808.85714,20882,23020.85714,23073.42857,25035,26709,28684.14286,28928.42857,28855.71429,28711.57143,26779.28571
            ])

            # 각 유입수 성상의 Std. Var. value, assume 10% of mean value
            si_s = 0
            ss_s = 0.1*ss_m
            xi_s  =0.1*xi_m
            xs_s  =0.1*xs_m
            xbh_s =0.1*xbh_m
            xba_s =0
            xp_s  =0
            so_s  =0
            sno_s =0
            snh_s =0.1*snh_m
            snd_s =0.1*snd_m
            xnd_s =0.1*xnd_m
            salk_s = 0
            q_s = 0.1*q_m



            rnd = np.random.randn(48)


            si = si_m + si_s*rnd
            ss =  ss_m + ss_s*rnd
            xi  = xi_m+ xi_s*rnd
            xs  = xs_m+ xs_s*rnd
            xbh = xbh_m+ xbh_s*rnd
            xba = xba_m+ xba_s*rnd
            xp  = xp_m+ xp_s*rnd
            so  = so_m+ so_s*rnd
            sno = sno_m+ sno_s*rnd
            snh = snh_m+ snh_s*rnd
            snd = snd_m+ snd_s*rnd
            xnd = xnd_m+ xnd_s*rnd
            salk = salk_m+ salk_s*rnd
            q = q_m+ q_s*rnd


            si_3 = sum(si*q)/sum(q)
            ss_3 = sum(ss*q)/sum(q)
            xi_3 = sum(xi*q)/sum(q)
            xs_3 = sum(xs*q)/sum(q)
            xbh_3 = sum(xbh*q)/sum(q)
            xba_3 = sum(xba*q)/sum(q)
            xp_3 = sum(xp*q)/sum(q)
            so_3 = sum(so*q)/sum(q)
            sno_3 = sum(sno*q)/sum(q)
            snh_3 = sum(snh*q)/sum(q)
            snd_3 = sum(snd*q)/sum(q)
            xnd_3 = sum(xnd*q)/sum(q)
            salk_3 = sum(salk*q)/sum(q)

            """
             List of variables :
                        0=V, 1=Si, 2=Ss, 3=Xi, 4=Xs, 5=Xbh, 6=Xba, 7=Xp, 8=So, 9=Sno, 10=Snh, 11=Snd, 12=Xnd, 13=Salk
                        (ref. BSM1 report Tbl. 1)
            """

            influent_mixed_instant=[0.66, si_3, ss_3, xi_3, xs_3, xbh_3, xba_3, xp_3, so_3, sno_3, snh_3, snd_3, xnd_3, salk_3]
            influent_var_instant=[si, ss, xi, xs, xbh, xba, xp, so, sno, snh, snd, xnd, salk]

        elif switch == 1: # evening, dry (13~24)

            si_m = np.array(
                [30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30
                 ])
            ss_m = np.array([
                88.37961, 81.2874, 75.7721, 70.37332, 68.27595, 67.03307, 66.76507, 67.07967, 68.08952, 68.72261,
                68.31479, 65.16874, 61.64516, 59.76219, 58.94655, 59.38933, 60.21274, 62.42662, 65.86786, 65.61928,
                64.00353, 59.54469, 58.34064, 57.33857, 58.6902, 60.46908, 63.25004, 62.37225, 62.21689, 62.01492,
                66.41162, 67.18843, 68.47015, 71.88808, 75.64392, 77.44222, 80.08335, 82.60408, 83.83531, 84.21983,
                83.377, 81.99584, 80.14161, 77.75294, 75.6245, 71.87255, 69.45669, 67.49915

            ])
            xi_m = np.array(
                [
                    84.13071429, 80.28414286, 77.06857143, 75.59528571, 69.53914286, 74.65371429, 70.989, 70.73328571,
                    67.836, 62.05642857, 57.04028571, 64.55685714, 60.49571429, 57.14742857, 58.18171429, 50.98471429,
                    48.55142857, 49.035, 47.16485714, 46.52028571, 44.63442857, 43.14114286, 41.92542857, 42.42557143,
                    45.12157143, 44.42414286, 45.24057143, 49.55514286, 48.18842857, 45.95257143, 47.28628571, 46.19,
                    49.68842857, 54.38728571, 55.24171429, 53.34771429, 50.395, 48.577, 62.72, 58.76257143, 58.61842857,
                    58.73971429, 49.65814286, 65.874, 61.58814286, 63.073, 60.55628571, 56.53585714

                ])
            xs_m = np.array(
                [
                    257.848, 262.6298571, 264.1517143, 262.6518571, 262.4, 256.2138571, 254.8904286, 253.9328571,
                    252.8947143, 252.5684286, 248.9338571, 239.2852857, 237.5595714, 237.319, 233.4257143, 232.6871429,
                    228.1955714, 221.1541429, 216.2652857, 212.509, 209.3434286, 206.2972857, 202.5087143, 199.1701429,
                    196.7577143, 197.271, 198.2177143, 197.4982857, 200.1368571, 202.351, 201.6157143, 202.3904286,
                    202.0877143, 202.6738571, 207.4925714, 212.324, 214.9942857, 215.0112857, 209.5072857, 215.379,
                    221.5514286, 224, 227.8102857, 220.4945714, 224.2621429, 228.6921429, 231.7928571, 233.6475714

                ])
            xbh_m = np.array(
                [
                    37.99771429, 38.10157143, 37.91357143, 37.583, 36.88214286, 36.76328571, 36.20871429, 36.07385714,
                    35.63671429, 34.95842857, 33.99714286, 33.76014286, 33.11757143, 32.71857143, 32.40085714, 31.519,
                    30.74971429, 30.02128571, 29.27, 28.781, 28.21971429, 27.71528571, 27.15942857, 26.84414286,
                    26.87557143, 26.85485714, 27.05085714, 27.45028571, 27.59142857, 27.58928571, 27.65585714, 27.62,
                    27.97514286, 28.56242857, 29.19271429, 29.51885714, 29.48785714, 29.28771429, 30.24742857,
                    30.46014286, 31.12985714, 31.41528571, 30.82985714, 31.81842857, 31.76114286, 32.41842857,
                    32.48314286, 32.24257143

                ])
            xba_m = np.array(
                [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
                 ])
            xp_m = np.array(
                [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
                 ])
            so_m = np.array(
                [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
                 ])
            sno_m = np.array(
                [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
                 ])
            snh_m = np.array(
                [
                    36.8501, 34.24807, 32.16088, 30.77985, 29.79539, 29.23881, 28.52221, 27.95867, 28.12564, 27.55166,
                    27.4647, 26.45589, 26.1776, 26.28891, 26.78984, 27.29076, 27.12379, 27.42295, 28.33436, 28.2787,
                    27.7082, 26.68548, 26.57068, 26.62286, 27.4647, 28.33436, 29.26664, 30.63027, 30.58853, 28.16043,
                    29.79539, 29.82322, 30.30328, 32.13305, 33.77149, 34.30373, 35.63953, 36.06393, 35.93174, 35.45168,
                    35.69519, 35.62561, 35.37863, 34.9438, 34.14371, 32.70355, 31.46515, 30.68245

                ])
            snd_m = np.array([
                8.83796, 8.12874, 7.57721, 7.03733, 6.8276, 6.70331, 6.67651, 6.70797, 6.80895, 6.87226, 6.83148,
                6.51687, 6.16452, 5.97622, 5.89466, 5.93893, 6.02127, 6.24266, 6.58679, 6.56193, 6.40035, 5.95447,
                5.83406, 5.73386, 5.86902, 6.04691, 6.325, 6.23723, 6.22169, 6.20149, 6.64116, 6.71884, 6.84702,
                7.18881, 7.56439, 7.74422, 8.00834, 8.26041, 8.38353, 8.42198, 8.3377, 8.19958, 8.01416, 7.7753,
                7.56245, 7.18726, 6.94567, 6.74992
            ])
            xnd_m = np.array(
                [
                    14.285, 14.324, 14.253, 14.12885714, 13.86557143, 13.82085714, 13.61228571, 13.56142857,
                    13.39714286, 13.14242857, 12.781, 12.69185714, 12.45014286, 12.30028571, 12.18071429, 11.84928571,
                    11.56014286, 11.286, 11.00357143, 10.82, 10.60885714, 10.41957143, 10.21028571, 10.09157143,
                    10.10342857, 10.096, 10.16971429, 10.31971429, 10.37285714, 10.37185714, 10.397, 10.38342857,
                    10.517, 10.738, 10.97457143, 11.09728571, 11.08542857, 11.01028571, 11.37128571, 11.45142857,
                    11.70314286, 11.81, 11.59014286, 11.96185714, 11.94042857, 12.18742857, 12.21185714, 12.12128571

                ])
            salk_m = np.array(
                [7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7
                 ])
            q_m = np.array([
                25837, 24434.42857, 23460.57143, 23183.14286, 21537.57143, 23435.57143, 22513.71429, 22524, 21785.71429,
                20117.57143, 18841.71429, 21912.14286, 20802.42857, 19755.28571, 20390.71429, 18081.42857, 17573.42857,
                18296.71429, 18018.28571, 18088.42857, 17634.85714, 17306.28571, 17140.28571, 17623.71429, 18903.57143,
                18585.71429, 18803.71429, 20603.14286, 19821.28571, 18723.71429, 19266, 18838, 20200.71429, 21855,
                21706.57143, 20578.14286, 19279.14286, 18634, 24062.85714, 22179.28571, 21564, 21389.71429, 17987.42857,
                24012.42857, 22299.85714, 22383.71429, 21308, 19839.42857

            ])


            rnd = np.random.randn(48)

            # 각 유입수 성상의 Std. Var. value, assume 10% of mean value
            si_s = 0
            ss_s = 0.1 * ss_m
            xi_s = 0.1 * xi_m
            xs_s = 0.1 * xs_m
            xbh_s = 0.1 * xbh_m
            xba_s = 0
            xp_s = 0
            so_s = 0
            sno_s = 0
            snh_s = 0.1 * snh_m
            snd_s = 0.1 * snd_m
            xnd_s = 0.1 * xnd_m
            salk_s = 0
            q_s = 0.1 * q_m

            rnd = np.random.randn(48)

            si = si_m + si_s * rnd
            ss = ss_m + ss_s * rnd
            xi = xi_m + xi_s * rnd
            xs = xs_m + xs_s * rnd
            xbh = xbh_m + xbh_s * rnd
            xba = xba_m + xba_s * rnd
            xp = xp_m + xp_s * rnd
            so = so_m + so_s * rnd
            sno = sno_m + sno_s * rnd
            snh = snh_m + snh_s * rnd
            snd = snd_m + snd_s * rnd
            xnd = xnd_m + xnd_s * rnd
            salk = salk_m + salk_s * rnd
            q = q_m + q_s * rnd

            si_3 = sum(si * q) / sum(q)
            ss_3 = sum(ss * q) / sum(q)
            xi_3 = sum(xi * q) / sum(q)
            xs_3 = sum(xs * q) / sum(q)
            xbh_3 = sum(xbh * q) / sum(q)
            xba_3 = sum(xba * q) / sum(q)
            xp_3 = sum(xp * q) / sum(q)
            so_3 = sum(so * q) / sum(q)
            sno_3 = sum(sno * q) / sum(q)
            snh_3 = sum(snh * q) / sum(q)
            snd_3 = sum(snd * q) / sum(q)
            xnd_3 = sum(xnd * q) / sum(q)
            salk_3 = sum(salk * q) / sum(q)

            """
             List of variables :
                        0=V, 1=Si, 2=Ss, 3=Xi, 4=Xs, 5=Xbh, 6=Xba, 7=Xp, 8=So, 9=Sno, 10=Snh, 11=Snd, 12=Xnd, 13=Salk
                        (ref. BSM1 report Tbl. 1)
            """

            influent_mixed_instant = [0.66, si_3, ss_3, xi_3, xs_3, xbh_3, xba_3, xp_3, so_3, sno_3, snh_3, snd_3,
                                      xnd_3, salk_3]
            influent_var_instant = [si, ss, xi, xs, xbh, xba, xp, so, sno, snh, snd, xnd, salk]

        elif switch == 2:  # carbon rich, morning (0~12hr)

            # 각 유입수 성상의 Mean value
            si_m = 1.5*np.array(
                [30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
                 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30
                 ])
            ss_m = 1.5*np.array(
                [63.63455, 61.67313, 61.71973, 62.16018, 64.57526, 67.84871, 72.14054, 72.47069, 69.7643, 67.49915,
                 62.83833, 62.27237143, 53.74197, 54.44886, 50.06769, 46.35457, 44.35819, 42.57931, 40.00033, 40.38873,
                 40.77713, 40.46641, 40.83539, 40.46641, 40.50525, 40.52467, 40.31105, 40.11685, 40.04693, 40.34212,
                 40.58293, 40.89365, 41.16553, 41.86465, 42.42395, 43.94649, 48.77431, 59.88648, 71.46084, 80.00567,
                 94.90087, 105.7761, 115.2104, 120.011, 118.9701, 112.1109, 102.4553, 94.81153
                 ])
            xi_m = 1.5*np.array(
                [52.28757143, 51.66285714, 46.76185714, 49.95214286, 48.007, 48.50685714, 48.31542857, 39.62985714,
                 38.09571429, 36.67671429, 34.69028571, 31.66557143, 28.23228571, 26.256, 23.77214286, 21.898,
                 21.01385714, 19.36242857, 19.47071429, 19.28542857, 18.47757143, 18.88957143, 19.06842857, 18.80642857,
                 18.04585714, 18.102, 16.91514286, 16.862, 16.75885714, 16.83957143, 16.54742857, 16.87985714,
                 16.81342857, 16.53628571, 17.664, 17.901, 20.22471429, 22.31228571, 31.09085714, 37.80471429,
                 42.14871429, 50.65642857, 59.44585714, 70.141, 77.07, 82.70885714, 87.174, 84.82457143
                 ])
            xs_m = 1.5*np.array(
                [228.8422857, 224.8784286, 213.1182857, 210.2168571, 209.8551429, 209.8774286, 212.3002857, 211.598,
                 207.301, 198.8494286, 192.2178571, 186.6502857, 181.1207143, 173.3857143, 165.7001429, 157.7538571,
                 149.8708571, 142.9755714, 137.0042857, 131.949, 128.582, 125.5931429, 123.5375714, 122.3611429,
                 121.5711429, 120.4541429, 119.0282857, 117.3594286, 115.659, 114.534, 113.6197143, 112.9752857,
                 112.5301429, 112.2802857, 112.3448571, 112.8771429, 113.3478571, 116.9234286, 122.7555714, 133.1755714,
                 148.2372857, 162.0105714, 175.9845714, 190.1444286, 206.4641429, 221.929, 235.1714286, 249.2904286
                 ])
            xbh_m = np.array(
                [31.23642857, 30.72685714, 28.87557143, 28.90757143, 28.65114286, 28.70928571, 28.95714286, 27.91428571,
                 27.26628571, 26.16942857, 25.212, 24.25714286, 23.26142857, 22.18257143, 21.05257143, 19.96128571,
                 18.98714286, 18.03742857, 17.38614286, 16.80371429, 16.34, 16.05385714, 15.84528571, 15.68528571,
                 15.51285714, 15.39485714, 15.10471429, 14.91371429, 14.71328571, 14.597, 14.46285714, 14.42828571,
                 14.37128571, 14.313, 14.44514286, 14.531, 14.84128571, 15.47042857, 17.09414286, 18.99771429,
                 21.15414286, 23.62971429, 26.15885714, 28.92071429, 31.50371429, 33.84857143, 35.816, 37.12385714
                 ])
            xba_m = np.array(
                [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
                 ])
            xp_m = np.array(
                [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
                 ])
            so_m = np.array(
                [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
                 ])
            sno_m = np.array(
                [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
                 ])
            snh_m = np.array(
                [30.24762, 30.21283, 31.04771, 31.67387, 33.15925, 35.11773, 37.86587, 37.86587, 36.8501, 36.47441,
                 34.38721, 34.67942, 32.06695, 29.89975, 27.06813, 24.70265, 23.38772, 22.19802, 20.31607, 20.54218,
                 20.71611, 20.7509, 20.66393, 20.61175, 20.54218, 20.43782, 20.40303, 20.15953, 20.02734, 19.99951,
                 20.10039, 20.40303, 20.82047, 21.16834, 21.6136, 22.1354, 24.68178, 29.65625, 34.24807, 37.93544,
                 43.39692, 46.61468, 49.24802, 49.99941, 49.24802, 45.74154, 40.85751, 39.03469
                 ])
            snd_m = np.array(
                [6.36346, 6.16731, 6.17197, 6.21602, 6.45753, 6.78487, 7.21405, 7.24707, 6.97643, 6.74992, 6.28383,
                 6.227238571, 5.3742, 5.44489, 5.00677, 4.63546, 4.43582, 4.25793, 4.00003, 4.03887, 4.07771, 4.04664,
                 4.08354, 4.04664, 4.05053, 4.05247, 4.03111, 4.01169, 4.00469, 4.03421, 4.05829, 4.08937, 4.11655,
                 4.18647, 4.2424, 4.39465, 4.87743, 5.98865, 7.14608, 8.00057, 9.49009, 10.57761, 11.52104, 12.0011,
                 11.89701, 11.21109, 10.24553, 9.48115
                 ])
            xnd_m = np.array(
                [11.74314286, 11.55142857, 10.85542857, 10.86742857, 10.77085714, 10.793, 10.88585714, 10.49428571,
                 10.25071429, 9.838, 9.478428571, 9.119142857, 8.745, 8.339428571, 7.914285714, 7.504285714, 7.138,
                 6.781142857, 6.536285714, 6.317142857, 6.142714286, 6.035142857, 5.956571429, 5.896714286, 5.832,
                 5.787285714, 5.678571429, 5.606714286, 5.531142857, 5.487571429, 5.437285714, 5.424285714, 5.402857143,
                 5.381, 5.430571429, 5.462714286, 5.579571429, 5.816, 6.426285714, 7.142, 7.952428571, 8.883428571,
                 9.834, 10.87214286, 11.84357143, 12.725, 13.46457143, 13.95642857
                 ])
            salk_m = np.array(
                [7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
                 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
                 ])
            q_m = np.array(
                [18794.42857, 18884.85714, 18100.57143, 19539, 18855.14286, 19003.85714, 18723.28571, 15534.14286,
                 15224.57143, 15279.42857, 14944, 14023.57143, 12824.42857, 12433.14286, 11718.85714, 11296.85714,
                 11417, 10975.57143, 11592.57143, 11925.14286, 11721.28571, 12305.85714, 12658.28571, 12588.85714,
                 12164.71429, 12341.85714, 11588.57143, 11729.14286, 11857.28571, 12054.14286, 11907.57143, 12246.28571,
                 12245.71429, 12049, 12956.71429, 13052.57143, 14680.85714, 15808.85714, 20882, 23020.85714,
                 23073.42857, 25035, 26709, 28684.14286, 28928.42857, 28855.71429, 28711.57143, 26779.28571
                 ])

            rnd = np.random.randn(48)

            # 각 유입수 성상의 Std. Var. value, assume 10% of mean value
            si_s = 0
            ss_s = 0.1 * ss_m
            xi_s = 0.1 * xi_m
            xs_s = 0.1 * xs_m
            xbh_s = 0.1 * xbh_m
            xba_s = 0
            xp_s = 0
            so_s = 0
            sno_s = 0
            snh_s = 0.1 * snh_m
            snd_s = 0.1 * snd_m
            xnd_s = 0.1 * xnd_m
            salk_s = 0
            q_s = 0.1 * q_m

            rnd = np.random.randn(48)

            si = si_m + si_s * rnd
            ss = ss_m + ss_s * rnd
            xi = xi_m + xi_s * rnd
            xs = xs_m + xs_s * rnd
            xbh = xbh_m + xbh_s * rnd
            xba = xba_m + xba_s * rnd
            xp = xp_m + xp_s * rnd
            so = so_m + so_s * rnd
            sno = sno_m + sno_s * rnd
            snh = snh_m + snh_s * rnd
            snd = snd_m + snd_s * rnd
            xnd = xnd_m + xnd_s * rnd
            salk = salk_m + salk_s * rnd
            q = q_m + q_s * rnd

            si_3 = sum(si * q) / sum(q)
            ss_3 = sum(ss * q) / sum(q)
            xi_3 = sum(xi * q) / sum(q)
            xs_3 = sum(xs * q) / sum(q)
            xbh_3 = sum(xbh * q) / sum(q)
            xba_3 = sum(xba * q) / sum(q)
            xp_3 = sum(xp * q) / sum(q)
            so_3 = sum(so * q) / sum(q)
            sno_3 = sum(sno * q) / sum(q)
            snh_3 = sum(snh * q) / sum(q)
            snd_3 = sum(snd * q) / sum(q)
            xnd_3 = sum(xnd * q) / sum(q)
            salk_3 = sum(salk * q) / sum(q)

            """
             List of variables :
                        0=V, 1=Si, 2=Ss, 3=Xi, 4=Xs, 5=Xbh, 6=Xba, 7=Xp, 8=So, 9=Sno, 10=Snh, 11=Snd, 12=Xnd, 13=Salk
                        (ref. BSM1 report Tbl. 1)
            """

            influent_mixed_instant = [0.66, si_3, ss_3, xi_3, xs_3, xbh_3, xba_3, xp_3, so_3, sno_3, snh_3, snd_3,
                                      xnd_3, salk_3]
            influent_var_instant = [si, ss, xi, xs, xbh, xba, xp, so, sno, snh, snd, xnd, salk]


        elif switch == 3:  # carbon rich, evening (13~24hr)

            si_m = 1.5*np.array(
                [30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
                 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30
                 ])
            ss_m = 1.5*np.array([
                88.37961, 81.2874, 75.7721, 70.37332, 68.27595, 67.03307, 66.76507, 67.07967, 68.08952, 68.72261,
                68.31479, 65.16874, 61.64516, 59.76219, 58.94655, 59.38933, 60.21274, 62.42662, 65.86786, 65.61928,
                64.00353, 59.54469, 58.34064, 57.33857, 58.6902, 60.46908, 63.25004, 62.37225, 62.21689, 62.01492,
                66.41162, 67.18843, 68.47015, 71.88808, 75.64392, 77.44222, 80.08335, 82.60408, 83.83531, 84.21983,
                83.377, 81.99584, 80.14161, 77.75294, 75.6245, 71.87255, 69.45669, 67.49915

            ])
            xi_m = 1.5*np.array(
                [
                    84.13071429, 80.28414286, 77.06857143, 75.59528571, 69.53914286, 74.65371429, 70.989, 70.73328571,
                    67.836, 62.05642857, 57.04028571, 64.55685714, 60.49571429, 57.14742857, 58.18171429, 50.98471429,
                    48.55142857, 49.035, 47.16485714, 46.52028571, 44.63442857, 43.14114286, 41.92542857, 42.42557143,
                    45.12157143, 44.42414286, 45.24057143, 49.55514286, 48.18842857, 45.95257143, 47.28628571, 46.19,
                    49.68842857, 54.38728571, 55.24171429, 53.34771429, 50.395, 48.577, 62.72, 58.76257143, 58.61842857,
                    58.73971429, 49.65814286, 65.874, 61.58814286, 63.073, 60.55628571, 56.53585714

                ])
            xs_m = 1.5*np.array(
                [
                    257.848, 262.6298571, 264.1517143, 262.6518571, 262.4, 256.2138571, 254.8904286, 253.9328571,
                    252.8947143, 252.5684286, 248.9338571, 239.2852857, 237.5595714, 237.319, 233.4257143, 232.6871429,
                    228.1955714, 221.1541429, 216.2652857, 212.509, 209.3434286, 206.2972857, 202.5087143, 199.1701429,
                    196.7577143, 197.271, 198.2177143, 197.4982857, 200.1368571, 202.351, 201.6157143, 202.3904286,
                    202.0877143, 202.6738571, 207.4925714, 212.324, 214.9942857, 215.0112857, 209.5072857, 215.379,
                    221.5514286, 224, 227.8102857, 220.4945714, 224.2621429, 228.6921429, 231.7928571, 233.6475714

                ])
            xbh_m = np.array(
                [
                    37.99771429, 38.10157143, 37.91357143, 37.583, 36.88214286, 36.76328571, 36.20871429, 36.07385714,
                    35.63671429, 34.95842857, 33.99714286, 33.76014286, 33.11757143, 32.71857143, 32.40085714, 31.519,
                    30.74971429, 30.02128571, 29.27, 28.781, 28.21971429, 27.71528571, 27.15942857, 26.84414286,
                    26.87557143, 26.85485714, 27.05085714, 27.45028571, 27.59142857, 27.58928571, 27.65585714, 27.62,
                    27.97514286, 28.56242857, 29.19271429, 29.51885714, 29.48785714, 29.28771429, 30.24742857,
                    30.46014286, 31.12985714, 31.41528571, 30.82985714, 31.81842857, 31.76114286, 32.41842857,
                    32.48314286, 32.24257143

                ])
            xba_m = np.array(
                [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
                 ])
            xp_m = np.array(
                [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
                 ])
            so_m = np.array(
                [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
                 ])
            sno_m = np.array(
                [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
                 ])
            snh_m = np.array(
                [
                    36.8501, 34.24807, 32.16088, 30.77985, 29.79539, 29.23881, 28.52221, 27.95867, 28.12564, 27.55166,
                    27.4647, 26.45589, 26.1776, 26.28891, 26.78984, 27.29076, 27.12379, 27.42295, 28.33436, 28.2787,
                    27.7082, 26.68548, 26.57068, 26.62286, 27.4647, 28.33436, 29.26664, 30.63027, 30.58853, 28.16043,
                    29.79539, 29.82322, 30.30328, 32.13305, 33.77149, 34.30373, 35.63953, 36.06393, 35.93174, 35.45168,
                    35.69519, 35.62561, 35.37863, 34.9438, 34.14371, 32.70355, 31.46515, 30.68245

                ])
            snd_m = np.array([
                8.83796, 8.12874, 7.57721, 7.03733, 6.8276, 6.70331, 6.67651, 6.70797, 6.80895, 6.87226, 6.83148,
                6.51687, 6.16452, 5.97622, 5.89466, 5.93893, 6.02127, 6.24266, 6.58679, 6.56193, 6.40035, 5.95447,
                5.83406, 5.73386, 5.86902, 6.04691, 6.325, 6.23723, 6.22169, 6.20149, 6.64116, 6.71884, 6.84702,
                7.18881, 7.56439, 7.74422, 8.00834, 8.26041, 8.38353, 8.42198, 8.3377, 8.19958, 8.01416, 7.7753,
                7.56245, 7.18726, 6.94567, 6.74992
            ])
            xnd_m = np.array(
                [
                    14.285, 14.324, 14.253, 14.12885714, 13.86557143, 13.82085714, 13.61228571, 13.56142857,
                    13.39714286, 13.14242857, 12.781, 12.69185714, 12.45014286, 12.30028571, 12.18071429, 11.84928571,
                    11.56014286, 11.286, 11.00357143, 10.82, 10.60885714, 10.41957143, 10.21028571, 10.09157143,
                    10.10342857, 10.096, 10.16971429, 10.31971429, 10.37285714, 10.37185714, 10.397, 10.38342857,
                    10.517, 10.738, 10.97457143, 11.09728571, 11.08542857, 11.01028571, 11.37128571, 11.45142857,
                    11.70314286, 11.81, 11.59014286, 11.96185714, 11.94042857, 12.18742857, 12.21185714, 12.12128571

                ])
            salk_m = np.array(
                [7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
                 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
                 ])
            q_m = np.array([
                25837, 24434.42857, 23460.57143, 23183.14286, 21537.57143, 23435.57143, 22513.71429, 22524, 21785.71429,
                20117.57143, 18841.71429, 21912.14286, 20802.42857, 19755.28571, 20390.71429, 18081.42857, 17573.42857,
                18296.71429, 18018.28571, 18088.42857, 17634.85714, 17306.28571, 17140.28571, 17623.71429, 18903.57143,
                18585.71429, 18803.71429, 20603.14286, 19821.28571, 18723.71429, 19266, 18838, 20200.71429, 21855,
                21706.57143, 20578.14286, 19279.14286, 18634, 24062.85714, 22179.28571, 21564, 21389.71429, 17987.42857,
                24012.42857, 22299.85714, 22383.71429, 21308, 19839.42857

            ])

            rnd = np.random.randn(48)

            # 각 유입수 성상의 Std. Var. value, assume 10% of mean value
            si_s = 0
            ss_s = 0.1 * ss_m
            xi_s = 0.1 * xi_m
            xs_s = 0.1 * xs_m
            xbh_s = 0.1 * xbh_m
            xba_s = 0
            xp_s = 0
            so_s = 0
            sno_s = 0
            snh_s = 0.1 * snh_m
            snd_s = 0.1 * snd_m
            xnd_s = 0.1 * xnd_m
            salk_s = 0
            q_s = 0.1 * q_m

            rnd = np.random.randn(48)

            si = si_m + si_s * rnd
            ss = ss_m + ss_s * rnd
            xi = xi_m + xi_s * rnd
            xs = xs_m + xs_s * rnd
            xbh = xbh_m + xbh_s * rnd
            xba = xba_m + xba_s * rnd
            xp = xp_m + xp_s * rnd
            so = so_m + so_s * rnd
            sno = sno_m + sno_s * rnd
            snh = snh_m + snh_s * rnd
            snd = snd_m + snd_s * rnd
            xnd = xnd_m + xnd_s * rnd
            salk = salk_m + salk_s * rnd
            q = q_m + q_s * rnd

            si_3 = sum(si * q) / sum(q)
            ss_3 = sum(ss * q) / sum(q)
            xi_3 = sum(xi * q) / sum(q)
            xs_3 = sum(xs * q) / sum(q)
            xbh_3 = sum(xbh * q) / sum(q)
            xba_3 = sum(xba * q) / sum(q)
            xp_3 = sum(xp * q) / sum(q)
            so_3 = sum(so * q) / sum(q)
            sno_3 = sum(sno * q) / sum(q)
            snh_3 = sum(snh * q) / sum(q)
            snd_3 = sum(snd * q) / sum(q)
            xnd_3 = sum(xnd * q) / sum(q)
            salk_3 = sum(salk * q) / sum(q)

            """
             List of variables :
                        0=V, 1=Si, 2=Ss, 3=Xi, 4=Xs, 5=Xbh, 6=Xba, 7=Xp, 8=So, 9=Sno, 10=Snh, 11=Snd, 12=Xnd, 13=Salk
                        (ref. BSM1 report Tbl. 1)
            """

            influent_mixed_instant = [0.66, si_3, ss_3, xi_3, xs_3, xbh_3, xba_3, xp_3, so_3, sno_3, snh_3, snd_3,
                                      xnd_3, salk_3]
            influent_var_instant = [si, ss, xi, xs, xbh, xba, xp, so, sno, snh, snd, xnd, salk]

        elif switch == 4:  # High, morning

            # 각 유입수 성상의 Mean value
            si_m = 1.5 * np.array(
                [30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
                 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30
                 ])
            ss_m = 1.5 * np.array(
                [63.63455, 61.67313, 61.71973, 62.16018, 64.57526, 67.84871, 72.14054, 72.47069, 69.7643, 67.49915,
                 62.83833, 62.27237143, 53.74197, 54.44886, 50.06769, 46.35457, 44.35819, 42.57931, 40.00033, 40.38873,
                 40.77713, 40.46641, 40.83539, 40.46641, 40.50525, 40.52467, 40.31105, 40.11685, 40.04693, 40.34212,
                 40.58293, 40.89365, 41.16553, 41.86465, 42.42395, 43.94649, 48.77431, 59.88648, 71.46084, 80.00567,
                 94.90087, 105.7761, 115.2104, 120.011, 118.9701, 112.1109, 102.4553, 94.81153
                 ])
            xi_m = 1.5 * np.array(
                [52.28757143, 51.66285714, 46.76185714, 49.95214286, 48.007, 48.50685714, 48.31542857, 39.62985714,
                 38.09571429, 36.67671429, 34.69028571, 31.66557143, 28.23228571, 26.256, 23.77214286, 21.898,
                 21.01385714, 19.36242857, 19.47071429, 19.28542857, 18.47757143, 18.88957143, 19.06842857, 18.80642857,
                 18.04585714, 18.102, 16.91514286, 16.862, 16.75885714, 16.83957143, 16.54742857, 16.87985714,
                 16.81342857, 16.53628571, 17.664, 17.901, 20.22471429, 22.31228571, 31.09085714, 37.80471429,
                 42.14871429, 50.65642857, 59.44585714, 70.141, 77.07, 82.70885714, 87.174, 84.82457143
                 ])
            xs_m = 1.5* np.array(
                [228.8422857, 224.8784286, 213.1182857, 210.2168571, 209.8551429, 209.8774286, 212.3002857, 211.598,
                 207.301, 198.8494286, 192.2178571, 186.6502857, 181.1207143, 173.3857143, 165.7001429, 157.7538571,
                 149.8708571, 142.9755714, 137.0042857, 131.949, 128.582, 125.5931429, 123.5375714, 122.3611429,
                 121.5711429, 120.4541429, 119.0282857, 117.3594286, 115.659, 114.534, 113.6197143, 112.9752857,
                 112.5301429, 112.2802857, 112.3448571, 112.8771429, 113.3478571, 116.9234286, 122.7555714, 133.1755714,
                 148.2372857, 162.0105714, 175.9845714, 190.1444286, 206.4641429, 221.929, 235.1714286, 249.2904286
                 ])
            xbh_m = 1.5 * np.array(
                [31.23642857, 30.72685714, 28.87557143, 28.90757143, 28.65114286, 28.70928571, 28.95714286, 27.91428571,
                 27.26628571, 26.16942857, 25.212, 24.25714286, 23.26142857, 22.18257143, 21.05257143, 19.96128571,
                 18.98714286, 18.03742857, 17.38614286, 16.80371429, 16.34, 16.05385714, 15.84528571, 15.68528571,
                 15.51285714, 15.39485714, 15.10471429, 14.91371429, 14.71328571, 14.597, 14.46285714, 14.42828571,
                 14.37128571, 14.313, 14.44514286, 14.531, 14.84128571, 15.47042857, 17.09414286, 18.99771429,
                 21.15414286, 23.62971429, 26.15885714, 28.92071429, 31.50371429, 33.84857143, 35.816, 37.12385714
                 ])
            xba_m = np.array(
                [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
                 ])
            xp_m = np.array(
                [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
                 ])
            so_m = np.array(
                [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
                 ])
            sno_m = np.array(
                [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
                 ])
            snh_m = 1.5 * np.array(
                [30.24762, 30.21283, 31.04771, 31.67387, 33.15925, 35.11773, 37.86587, 37.86587, 36.8501, 36.47441,
                 34.38721, 34.67942, 32.06695, 29.89975, 27.06813, 24.70265, 23.38772, 22.19802, 20.31607, 20.54218,
                 20.71611, 20.7509, 20.66393, 20.61175, 20.54218, 20.43782, 20.40303, 20.15953, 20.02734, 19.99951,
                 20.10039, 20.40303, 20.82047, 21.16834, 21.6136, 22.1354, 24.68178, 29.65625, 34.24807, 37.93544,
                 43.39692, 46.61468, 49.24802, 49.99941, 49.24802, 45.74154, 40.85751, 39.03469
                 ])
            snd_m = 1.5 * np.array(
                [6.36346, 6.16731, 6.17197, 6.21602, 6.45753, 6.78487, 7.21405, 7.24707, 6.97643, 6.74992, 6.28383,
                 6.227238571, 5.3742, 5.44489, 5.00677, 4.63546, 4.43582, 4.25793, 4.00003, 4.03887, 4.07771, 4.04664,
                 4.08354, 4.04664, 4.05053, 4.05247, 4.03111, 4.01169, 4.00469, 4.03421, 4.05829, 4.08937, 4.11655,
                 4.18647, 4.2424, 4.39465, 4.87743, 5.98865, 7.14608, 8.00057, 9.49009, 10.57761, 11.52104, 12.0011,
                 11.89701, 11.21109, 10.24553, 9.48115
                 ])
            xnd_m = 1.5 * np.array(
                [11.74314286, 11.55142857, 10.85542857, 10.86742857, 10.77085714, 10.793, 10.88585714, 10.49428571,
                 10.25071429, 9.838, 9.478428571, 9.119142857, 8.745, 8.339428571, 7.914285714, 7.504285714, 7.138,
                 6.781142857, 6.536285714, 6.317142857, 6.142714286, 6.035142857, 5.956571429, 5.896714286, 5.832,
                 5.787285714, 5.678571429, 5.606714286, 5.531142857, 5.487571429, 5.437285714, 5.424285714, 5.402857143,
                 5.381, 5.430571429, 5.462714286, 5.579571429, 5.816, 6.426285714, 7.142, 7.952428571, 8.883428571,
                 9.834, 10.87214286, 11.84357143, 12.725, 13.46457143, 13.95642857
                 ])
            salk_m = np.array(
                [7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
                 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
                 ])
            q_m = np.array(
                [18794.42857, 18884.85714, 18100.57143, 19539, 18855.14286, 19003.85714, 18723.28571, 15534.14286,
                 15224.57143, 15279.42857, 14944, 14023.57143, 12824.42857, 12433.14286, 11718.85714, 11296.85714,
                 11417, 10975.57143, 11592.57143, 11925.14286, 11721.28571, 12305.85714, 12658.28571, 12588.85714,
                 12164.71429, 12341.85714, 11588.57143, 11729.14286, 11857.28571, 12054.14286, 11907.57143, 12246.28571,
                 12245.71429, 12049, 12956.71429, 13052.57143, 14680.85714, 15808.85714, 20882, 23020.85714,
                 23073.42857, 25035, 26709, 28684.14286, 28928.42857, 28855.71429, 28711.57143, 26779.28571
                 ])

            rnd = np.random.randn(48)

            # 각 유입수 성상의 Std. Var. value, assume 10% of mean value
            si_s = 0
            ss_s = 0.1 * ss_m
            xi_s = 0.1 * xi_m
            xs_s = 0.1 * xs_m
            xbh_s = 0.1 * xbh_m
            xba_s = 0
            xp_s = 0
            so_s = 0
            sno_s = 0
            snh_s = 0.1 * snh_m
            snd_s = 0.1 * snd_m
            xnd_s = 0.1 * xnd_m
            salk_s = 0
            q_s = 0.1 * q_m

            rnd = np.random.randn(48)

            si = si_m + si_s * rnd
            ss = ss_m + ss_s * rnd
            xi = xi_m + xi_s * rnd
            xs = xs_m + xs_s * rnd
            xbh = xbh_m + xbh_s * rnd
            xba = xba_m + xba_s * rnd
            xp = xp_m + xp_s * rnd
            so = so_m + so_s * rnd
            sno = sno_m + sno_s * rnd
            snh = snh_m + snh_s * rnd
            snd = snd_m + snd_s * rnd
            xnd = xnd_m + xnd_s * rnd
            salk = salk_m + salk_s * rnd
            q = q_m + q_s * rnd

            si_3 = sum(si * q) / sum(q)
            ss_3 = sum(ss * q) / sum(q)
            xi_3 = sum(xi * q) / sum(q)
            xs_3 = sum(xs * q) / sum(q)
            xbh_3 = sum(xbh * q) / sum(q)
            xba_3 = sum(xba * q) / sum(q)
            xp_3 = sum(xp * q) / sum(q)
            so_3 = sum(so * q) / sum(q)
            sno_3 = sum(sno * q) / sum(q)
            snh_3 = sum(snh * q) / sum(q)
            snd_3 = sum(snd * q) / sum(q)
            xnd_3 = sum(xnd * q) / sum(q)
            salk_3 = sum(salk * q) / sum(q)

            """
             List of variables :
                        0=V, 1=Si, 2=Ss, 3=Xi, 4=Xs, 5=Xbh, 6=Xba, 7=Xp, 8=So, 9=Sno, 10=Snh, 11=Snd, 12=Xnd, 13=Salk
                        (ref. BSM1 report Tbl. 1)
            """

            influent_mixed_instant = [0.66, si_3, ss_3, xi_3, xs_3, xbh_3, xba_3, xp_3, so_3, sno_3, snh_3, snd_3,
                                      xnd_3, salk_3]
            influent_var_instant = [si, ss, xi, xs, xbh, xba, xp, so, sno, snh, snd, xnd, salk]

        elif switch == 5:  # High, evening (13~24hr)

            si_m = 1.5*np.array(
                [30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
                 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30
                 ])
            ss_m = 1.5*np.array([
                88.37961, 81.2874, 75.7721, 70.37332, 68.27595, 67.03307, 66.76507, 67.07967, 68.08952, 68.72261,
                68.31479, 65.16874, 61.64516, 59.76219, 58.94655, 59.38933, 60.21274, 62.42662, 65.86786, 65.61928,
                64.00353, 59.54469, 58.34064, 57.33857, 58.6902, 60.46908, 63.25004, 62.37225, 62.21689, 62.01492,
                66.41162, 67.18843, 68.47015, 71.88808, 75.64392, 77.44222, 80.08335, 82.60408, 83.83531, 84.21983,
                83.377, 81.99584, 80.14161, 77.75294, 75.6245, 71.87255, 69.45669, 67.49915

            ])
            xi_m = 1.5*np.array(
                [
                    84.13071429, 80.28414286, 77.06857143, 75.59528571, 69.53914286, 74.65371429, 70.989, 70.73328571,
                    67.836, 62.05642857, 57.04028571, 64.55685714, 60.49571429, 57.14742857, 58.18171429, 50.98471429,
                    48.55142857, 49.035, 47.16485714, 46.52028571, 44.63442857, 43.14114286, 41.92542857, 42.42557143,
                    45.12157143, 44.42414286, 45.24057143, 49.55514286, 48.18842857, 45.95257143, 47.28628571, 46.19,
                    49.68842857, 54.38728571, 55.24171429, 53.34771429, 50.395, 48.577, 62.72, 58.76257143, 58.61842857,
                    58.73971429, 49.65814286, 65.874, 61.58814286, 63.073, 60.55628571, 56.53585714

                ])
            xs_m = 1.5*np.array(
                [
                    257.848, 262.6298571, 264.1517143, 262.6518571, 262.4, 256.2138571, 254.8904286, 253.9328571,
                    252.8947143, 252.5684286, 248.9338571, 239.2852857, 237.5595714, 237.319, 233.4257143, 232.6871429,
                    228.1955714, 221.1541429, 216.2652857, 212.509, 209.3434286, 206.2972857, 202.5087143, 199.1701429,
                    196.7577143, 197.271, 198.2177143, 197.4982857, 200.1368571, 202.351, 201.6157143, 202.3904286,
                    202.0877143, 202.6738571, 207.4925714, 212.324, 214.9942857, 215.0112857, 209.5072857, 215.379,
                    221.5514286, 224, 227.8102857, 220.4945714, 224.2621429, 228.6921429, 231.7928571, 233.6475714

                ])
            xbh_m = 1.5*np.array(
                [
                    37.99771429, 38.10157143, 37.91357143, 37.583, 36.88214286, 36.76328571, 36.20871429, 36.07385714,
                    35.63671429, 34.95842857, 33.99714286, 33.76014286, 33.11757143, 32.71857143, 32.40085714, 31.519,
                    30.74971429, 30.02128571, 29.27, 28.781, 28.21971429, 27.71528571, 27.15942857, 26.84414286,
                    26.87557143, 26.85485714, 27.05085714, 27.45028571, 27.59142857, 27.58928571, 27.65585714, 27.62,
                    27.97514286, 28.56242857, 29.19271429, 29.51885714, 29.48785714, 29.28771429, 30.24742857,
                    30.46014286, 31.12985714, 31.41528571, 30.82985714, 31.81842857, 31.76114286, 32.41842857,
                    32.48314286, 32.24257143

                ])
            xba_m = np.array(
                [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
                 ])
            xp_m = np.array(
                [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
                 ])
            so_m = np.array(
                [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
                 ])
            sno_m = np.array(
                [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
                 ])
            snh_m = 1.5*np.array(
                [
                    36.8501, 34.24807, 32.16088, 30.77985, 29.79539, 29.23881, 28.52221, 27.95867, 28.12564, 27.55166,
                    27.4647, 26.45589, 26.1776, 26.28891, 26.78984, 27.29076, 27.12379, 27.42295, 28.33436, 28.2787,
                    27.7082, 26.68548, 26.57068, 26.62286, 27.4647, 28.33436, 29.26664, 30.63027, 30.58853, 28.16043,
                    29.79539, 29.82322, 30.30328, 32.13305, 33.77149, 34.30373, 35.63953, 36.06393, 35.93174, 35.45168,
                    35.69519, 35.62561, 35.37863, 34.9438, 34.14371, 32.70355, 31.46515, 30.68245

                ])
            snd_m = 1.5*np.array([
                8.83796, 8.12874, 7.57721, 7.03733, 6.8276, 6.70331, 6.67651, 6.70797, 6.80895, 6.87226, 6.83148,
                6.51687, 6.16452, 5.97622, 5.89466, 5.93893, 6.02127, 6.24266, 6.58679, 6.56193, 6.40035, 5.95447,
                5.83406, 5.73386, 5.86902, 6.04691, 6.325, 6.23723, 6.22169, 6.20149, 6.64116, 6.71884, 6.84702,
                7.18881, 7.56439, 7.74422, 8.00834, 8.26041, 8.38353, 8.42198, 8.3377, 8.19958, 8.01416, 7.7753,
                7.56245, 7.18726, 6.94567, 6.74992
            ])
            xnd_m = 1.5*np.array(
                [
                    14.285, 14.324, 14.253, 14.12885714, 13.86557143, 13.82085714, 13.61228571, 13.56142857,
                    13.39714286, 13.14242857, 12.781, 12.69185714, 12.45014286, 12.30028571, 12.18071429, 11.84928571,
                    11.56014286, 11.286, 11.00357143, 10.82, 10.60885714, 10.41957143, 10.21028571, 10.09157143,
                    10.10342857, 10.096, 10.16971429, 10.31971429, 10.37285714, 10.37185714, 10.397, 10.38342857,
                    10.517, 10.738, 10.97457143, 11.09728571, 11.08542857, 11.01028571, 11.37128571, 11.45142857,
                    11.70314286, 11.81, 11.59014286, 11.96185714, 11.94042857, 12.18742857, 12.21185714, 12.12128571

                ])
            salk_m = np.array(
                [7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
                 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
                 ])
            q_m = np.array([
                25837, 24434.42857, 23460.57143, 23183.14286, 21537.57143, 23435.57143, 22513.71429, 22524, 21785.71429,
                20117.57143, 18841.71429, 21912.14286, 20802.42857, 19755.28571, 20390.71429, 18081.42857, 17573.42857,
                18296.71429, 18018.28571, 18088.42857, 17634.85714, 17306.28571, 17140.28571, 17623.71429, 18903.57143,
                18585.71429, 18803.71429, 20603.14286, 19821.28571, 18723.71429, 19266, 18838, 20200.71429, 21855,
                21706.57143, 20578.14286, 19279.14286, 18634, 24062.85714, 22179.28571, 21564, 21389.71429, 17987.42857,
                24012.42857, 22299.85714, 22383.71429, 21308, 19839.42857

            ])

            rnd = np.random.randn(48)

            # 각 유입수 성상의 Std. Var. value, assume 10% of mean value
            si_s = 0
            ss_s = 0.1 * ss_m
            xi_s = 0.1 * xi_m
            xs_s = 0.1 * xs_m
            xbh_s = 0.1 * xbh_m
            xba_s = 0
            xp_s = 0
            so_s = 0
            sno_s = 0
            snh_s = 0.1 * snh_m
            snd_s = 0.1 * snd_m
            xnd_s = 0.1 * xnd_m
            salk_s = 0
            q_s = 0.1 * q_m

            rnd = np.random.randn(48)

            si = si_m + si_s * rnd
            ss = ss_m + ss_s * rnd
            xi = xi_m + xi_s * rnd
            xs = xs_m + xs_s * rnd
            xbh = xbh_m + xbh_s * rnd
            xba = xba_m + xba_s * rnd
            xp = xp_m + xp_s * rnd
            so = so_m + so_s * rnd
            sno = sno_m + sno_s * rnd
            snh = snh_m + snh_s * rnd
            snd = snd_m + snd_s * rnd
            xnd = xnd_m + xnd_s * rnd
            salk = salk_m + salk_s * rnd
            q = q_m + q_s * rnd

            si_3 = sum(si * q) / sum(q)
            ss_3 = sum(ss * q) / sum(q)
            xi_3 = sum(xi * q) / sum(q)
            xs_3 = sum(xs * q) / sum(q)
            xbh_3 = sum(xbh * q) / sum(q)
            xba_3 = sum(xba * q) / sum(q)
            xp_3 = sum(xp * q) / sum(q)
            so_3 = sum(so * q) / sum(q)
            sno_3 = sum(sno * q) / sum(q)
            snh_3 = sum(snh * q) / sum(q)
            snd_3 = sum(snd * q) / sum(q)
            xnd_3 = sum(xnd * q) / sum(q)
            salk_3 = sum(salk * q) / sum(q)

            """
             List of variables :
                        0=V, 1=Si, 2=Ss, 3=Xi, 4=Xs, 5=Xbh, 6=Xba, 7=Xp, 8=So, 9=Sno, 10=Snh, 11=Snd, 12=Xnd, 13=Salk
                        (ref. BSM1 report Tbl. 1)
            """

            influent_mixed_instant = [0.66, si_3, ss_3, xi_3, xs_3, xbh_3, xba_3, xp_3, so_3, sno_3, snh_3, snd_3,
                                      xnd_3, salk_3]
            influent_var_instant = [si, ss, xi, xs, xbh, xba, xp, so, sno, snh, snd, xnd, salk]

        elif switch == 6:  # Nitrogen rich, morning

            # 각 유입수 성상의 Mean value
            si_m = np.array(
                [30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
                 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30
                 ])
            ss_m = np.array(
                [63.63455, 61.67313, 61.71973, 62.16018, 64.57526, 67.84871, 72.14054, 72.47069, 69.7643, 67.49915,
                 62.83833, 62.27237143, 53.74197, 54.44886, 50.06769, 46.35457, 44.35819, 42.57931, 40.00033, 40.38873,
                 40.77713, 40.46641, 40.83539, 40.46641, 40.50525, 40.52467, 40.31105, 40.11685, 40.04693, 40.34212,
                 40.58293, 40.89365, 41.16553, 41.86465, 42.42395, 43.94649, 48.77431, 59.88648, 71.46084, 80.00567,
                 94.90087, 105.7761, 115.2104, 120.011, 118.9701, 112.1109, 102.4553, 94.81153
                 ])
            xi_m = np.array(
                [52.28757143, 51.66285714, 46.76185714, 49.95214286, 48.007, 48.50685714, 48.31542857, 39.62985714,
                 38.09571429, 36.67671429, 34.69028571, 31.66557143, 28.23228571, 26.256, 23.77214286, 21.898,
                 21.01385714, 19.36242857, 19.47071429, 19.28542857, 18.47757143, 18.88957143, 19.06842857, 18.80642857,
                 18.04585714, 18.102, 16.91514286, 16.862, 16.75885714, 16.83957143, 16.54742857, 16.87985714,
                 16.81342857, 16.53628571, 17.664, 17.901, 20.22471429, 22.31228571, 31.09085714, 37.80471429,
                 42.14871429, 50.65642857, 59.44585714, 70.141, 77.07, 82.70885714, 87.174, 84.82457143
                 ])
            xs_m = np.array(
                [228.8422857, 224.8784286, 213.1182857, 210.2168571, 209.8551429, 209.8774286, 212.3002857, 211.598,
                 207.301, 198.8494286, 192.2178571, 186.6502857, 181.1207143, 173.3857143, 165.7001429, 157.7538571,
                 149.8708571, 142.9755714, 137.0042857, 131.949, 128.582, 125.5931429, 123.5375714, 122.3611429,
                 121.5711429, 120.4541429, 119.0282857, 117.3594286, 115.659, 114.534, 113.6197143, 112.9752857,
                 112.5301429, 112.2802857, 112.3448571, 112.8771429, 113.3478571, 116.9234286, 122.7555714, 133.1755714,
                 148.2372857, 162.0105714, 175.9845714, 190.1444286, 206.4641429, 221.929, 235.1714286, 249.2904286
                 ])
            xbh_m = np.array(
                [31.23642857, 30.72685714, 28.87557143, 28.90757143, 28.65114286, 28.70928571, 28.95714286, 27.91428571,
                 27.26628571, 26.16942857, 25.212, 24.25714286, 23.26142857, 22.18257143, 21.05257143, 19.96128571,
                 18.98714286, 18.03742857, 17.38614286, 16.80371429, 16.34, 16.05385714, 15.84528571, 15.68528571,
                 15.51285714, 15.39485714, 15.10471429, 14.91371429, 14.71328571, 14.597, 14.46285714, 14.42828571,
                 14.37128571, 14.313, 14.44514286, 14.531, 14.84128571, 15.47042857, 17.09414286, 18.99771429,
                 21.15414286, 23.62971429, 26.15885714, 28.92071429, 31.50371429, 33.84857143, 35.816, 37.12385714
                 ])
            xba_m = np.array(
                [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
                 ])
            xp_m = np.array(
                [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
                 ])
            so_m = np.array(
                [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
                 ])
            sno_m = np.array(
                [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
                 ])
            snh_m = 1.5 * np.array(
                [30.24762, 30.21283, 31.04771, 31.67387, 33.15925, 35.11773, 37.86587, 37.86587, 36.8501, 36.47441,
                 34.38721, 34.67942, 32.06695, 29.89975, 27.06813, 24.70265, 23.38772, 22.19802, 20.31607, 20.54218,
                 20.71611, 20.7509, 20.66393, 20.61175, 20.54218, 20.43782, 20.40303, 20.15953, 20.02734, 19.99951,
                 20.10039, 20.40303, 20.82047, 21.16834, 21.6136, 22.1354, 24.68178, 29.65625, 34.24807, 37.93544,
                 43.39692, 46.61468, 49.24802, 49.99941, 49.24802, 45.74154, 40.85751, 39.03469
                 ])
            snd_m = 1.5 * np.array(
                [6.36346, 6.16731, 6.17197, 6.21602, 6.45753, 6.78487, 7.21405, 7.24707, 6.97643, 6.74992, 6.28383,
                 6.227238571, 5.3742, 5.44489, 5.00677, 4.63546, 4.43582, 4.25793, 4.00003, 4.03887, 4.07771, 4.04664,
                 4.08354, 4.04664, 4.05053, 4.05247, 4.03111, 4.01169, 4.00469, 4.03421, 4.05829, 4.08937, 4.11655,
                 4.18647, 4.2424, 4.39465, 4.87743, 5.98865, 7.14608, 8.00057, 9.49009, 10.57761, 11.52104, 12.0011,
                 11.89701, 11.21109, 10.24553, 9.48115
                 ])
            xnd_m = 1.5 * np.array(
                [11.74314286, 11.55142857, 10.85542857, 10.86742857, 10.77085714, 10.793, 10.88585714, 10.49428571,
                 10.25071429, 9.838, 9.478428571, 9.119142857, 8.745, 8.339428571, 7.914285714, 7.504285714, 7.138,
                 6.781142857, 6.536285714, 6.317142857, 6.142714286, 6.035142857, 5.956571429, 5.896714286, 5.832,
                 5.787285714, 5.678571429, 5.606714286, 5.531142857, 5.487571429, 5.437285714, 5.424285714, 5.402857143,
                 5.381, 5.430571429, 5.462714286, 5.579571429, 5.816, 6.426285714, 7.142, 7.952428571, 8.883428571,
                 9.834, 10.87214286, 11.84357143, 12.725, 13.46457143, 13.95642857
                 ])
            salk_m = np.array(
                [7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
                 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
                 ])
            q_m = np.array(
                [18794.42857, 18884.85714, 18100.57143, 19539, 18855.14286, 19003.85714, 18723.28571, 15534.14286,
                 15224.57143, 15279.42857, 14944, 14023.57143, 12824.42857, 12433.14286, 11718.85714, 11296.85714,
                 11417, 10975.57143, 11592.57143, 11925.14286, 11721.28571, 12305.85714, 12658.28571, 12588.85714,
                 12164.71429, 12341.85714, 11588.57143, 11729.14286, 11857.28571, 12054.14286, 11907.57143, 12246.28571,
                 12245.71429, 12049, 12956.71429, 13052.57143, 14680.85714, 15808.85714, 20882, 23020.85714,
                 23073.42857, 25035, 26709, 28684.14286, 28928.42857, 28855.71429, 28711.57143, 26779.28571
                 ])

            rnd = np.random.randn(48)

            # 각 유입수 성상의 Std. Var. value, assume 10% of mean value
            si_s = 0
            ss_s = 0.1 * ss_m
            xi_s = 0.1 * xi_m
            xs_s = 0.1 * xs_m
            xbh_s = 0.1 * xbh_m
            xba_s = 0
            xp_s = 0
            so_s = 0
            sno_s = 0
            snh_s = 0.1 * snh_m
            snd_s = 0.1 * snd_m
            xnd_s = 0.1 * xnd_m
            salk_s = 0
            q_s = 0.1 * q_m

            rnd = np.random.randn(48)

            si = si_m + si_s * rnd
            ss = ss_m + ss_s * rnd
            xi = xi_m + xi_s * rnd
            xs = xs_m + xs_s * rnd
            xbh = xbh_m + xbh_s * rnd
            xba = xba_m + xba_s * rnd
            xp = xp_m + xp_s * rnd
            so = so_m + so_s * rnd
            sno = sno_m + sno_s * rnd
            snh = snh_m + snh_s * rnd
            snd = snd_m + snd_s * rnd
            xnd = xnd_m + xnd_s * rnd
            salk = salk_m + salk_s * rnd
            q = q_m + q_s * rnd

            si_3 = sum(si * q) / sum(q)
            ss_3 = sum(ss * q) / sum(q)
            xi_3 = sum(xi * q) / sum(q)
            xs_3 = sum(xs * q) / sum(q)
            xbh_3 = sum(xbh * q) / sum(q)
            xba_3 = sum(xba * q) / sum(q)
            xp_3 = sum(xp * q) / sum(q)
            so_3 = sum(so * q) / sum(q)
            sno_3 = sum(sno * q) / sum(q)
            snh_3 = sum(snh * q) / sum(q)
            snd_3 = sum(snd * q) / sum(q)
            xnd_3 = sum(xnd * q) / sum(q)
            salk_3 = sum(salk * q) / sum(q)

            """
             List of variables :
                        0=V, 1=Si, 2=Ss, 3=Xi, 4=Xs, 5=Xbh, 6=Xba, 7=Xp, 8=So, 9=Sno, 10=Snh, 11=Snd, 12=Xnd, 13=Salk
                        (ref. BSM1 report Tbl. 1)
            """

            influent_mixed_instant = [0.66, si_3, ss_3, xi_3, xs_3, xbh_3, xba_3, xp_3, so_3, sno_3, snh_3, snd_3,
                                      xnd_3, salk_3]
            influent_var_instant = [si, ss, xi, xs, xbh, xba, xp, so, sno, snh, snd, xnd, salk]

        elif switch == 7:  # High, evening (13~24hr)

            si_m = np.array(
                [30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
                 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30
                 ])
            ss_m = np.array([
                88.37961, 81.2874, 75.7721, 70.37332, 68.27595, 67.03307, 66.76507, 67.07967, 68.08952, 68.72261,
                68.31479, 65.16874, 61.64516, 59.76219, 58.94655, 59.38933, 60.21274, 62.42662, 65.86786, 65.61928,
                64.00353, 59.54469, 58.34064, 57.33857, 58.6902, 60.46908, 63.25004, 62.37225, 62.21689, 62.01492,
                66.41162, 67.18843, 68.47015, 71.88808, 75.64392, 77.44222, 80.08335, 82.60408, 83.83531, 84.21983,
                83.377, 81.99584, 80.14161, 77.75294, 75.6245, 71.87255, 69.45669, 67.49915

            ])
            xi_m = np.array(
                [
                    84.13071429, 80.28414286, 77.06857143, 75.59528571, 69.53914286, 74.65371429, 70.989, 70.73328571,
                    67.836, 62.05642857, 57.04028571, 64.55685714, 60.49571429, 57.14742857, 58.18171429, 50.98471429,
                    48.55142857, 49.035, 47.16485714, 46.52028571, 44.63442857, 43.14114286, 41.92542857, 42.42557143,
                    45.12157143, 44.42414286, 45.24057143, 49.55514286, 48.18842857, 45.95257143, 47.28628571, 46.19,
                    49.68842857, 54.38728571, 55.24171429, 53.34771429, 50.395, 48.577, 62.72, 58.76257143, 58.61842857,
                    58.73971429, 49.65814286, 65.874, 61.58814286, 63.073, 60.55628571, 56.53585714

                ])
            xs_m = np.array(
                [
                    257.848, 262.6298571, 264.1517143, 262.6518571, 262.4, 256.2138571, 254.8904286, 253.9328571,
                    252.8947143, 252.5684286, 248.9338571, 239.2852857, 237.5595714, 237.319, 233.4257143, 232.6871429,
                    228.1955714, 221.1541429, 216.2652857, 212.509, 209.3434286, 206.2972857, 202.5087143, 199.1701429,
                    196.7577143, 197.271, 198.2177143, 197.4982857, 200.1368571, 202.351, 201.6157143, 202.3904286,
                    202.0877143, 202.6738571, 207.4925714, 212.324, 214.9942857, 215.0112857, 209.5072857, 215.379,
                    221.5514286, 224, 227.8102857, 220.4945714, 224.2621429, 228.6921429, 231.7928571, 233.6475714

                ])
            xbh_m = np.array(
                [
                    37.99771429, 38.10157143, 37.91357143, 37.583, 36.88214286, 36.76328571, 36.20871429, 36.07385714,
                    35.63671429, 34.95842857, 33.99714286, 33.76014286, 33.11757143, 32.71857143, 32.40085714, 31.519,
                    30.74971429, 30.02128571, 29.27, 28.781, 28.21971429, 27.71528571, 27.15942857, 26.84414286,
                    26.87557143, 26.85485714, 27.05085714, 27.45028571, 27.59142857, 27.58928571, 27.65585714, 27.62,
                    27.97514286, 28.56242857, 29.19271429, 29.51885714, 29.48785714, 29.28771429, 30.24742857,
                    30.46014286, 31.12985714, 31.41528571, 30.82985714, 31.81842857, 31.76114286, 32.41842857,
                    32.48314286, 32.24257143

                ])
            xba_m = np.array(
                [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
                 ])
            xp_m = np.array(
                [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
                 ])
            so_m = np.array(
                [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
                 ])
            sno_m = np.array(
                [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
                 ])
            snh_m = 1.5*np.array(
                [
                    36.8501, 34.24807, 32.16088, 30.77985, 29.79539, 29.23881, 28.52221, 27.95867, 28.12564, 27.55166,
                    27.4647, 26.45589, 26.1776, 26.28891, 26.78984, 27.29076, 27.12379, 27.42295, 28.33436, 28.2787,
                    27.7082, 26.68548, 26.57068, 26.62286, 27.4647, 28.33436, 29.26664, 30.63027, 30.58853, 28.16043,
                    29.79539, 29.82322, 30.30328, 32.13305, 33.77149, 34.30373, 35.63953, 36.06393, 35.93174, 35.45168,
                    35.69519, 35.62561, 35.37863, 34.9438, 34.14371, 32.70355, 31.46515, 30.68245

                ])
            snd_m = 1.5*np.array([
                8.83796, 8.12874, 7.57721, 7.03733, 6.8276, 6.70331, 6.67651, 6.70797, 6.80895, 6.87226, 6.83148,
                6.51687, 6.16452, 5.97622, 5.89466, 5.93893, 6.02127, 6.24266, 6.58679, 6.56193, 6.40035, 5.95447,
                5.83406, 5.73386, 5.86902, 6.04691, 6.325, 6.23723, 6.22169, 6.20149, 6.64116, 6.71884, 6.84702,
                7.18881, 7.56439, 7.74422, 8.00834, 8.26041, 8.38353, 8.42198, 8.3377, 8.19958, 8.01416, 7.7753,
                7.56245, 7.18726, 6.94567, 6.74992
            ])
            xnd_m = 1.5*np.array(
                [
                    14.285, 14.324, 14.253, 14.12885714, 13.86557143, 13.82085714, 13.61228571, 13.56142857,
                    13.39714286, 13.14242857, 12.781, 12.69185714, 12.45014286, 12.30028571, 12.18071429, 11.84928571,
                    11.56014286, 11.286, 11.00357143, 10.82, 10.60885714, 10.41957143, 10.21028571, 10.09157143,
                    10.10342857, 10.096, 10.16971429, 10.31971429, 10.37285714, 10.37185714, 10.397, 10.38342857,
                    10.517, 10.738, 10.97457143, 11.09728571, 11.08542857, 11.01028571, 11.37128571, 11.45142857,
                    11.70314286, 11.81, 11.59014286, 11.96185714, 11.94042857, 12.18742857, 12.21185714, 12.12128571

                ])
            salk_m = np.array(
                [7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
                 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
                 ])
            q_m = np.array([
                25837, 24434.42857, 23460.57143, 23183.14286, 21537.57143, 23435.57143, 22513.71429, 22524, 21785.71429,
                20117.57143, 18841.71429, 21912.14286, 20802.42857, 19755.28571, 20390.71429, 18081.42857, 17573.42857,
                18296.71429, 18018.28571, 18088.42857, 17634.85714, 17306.28571, 17140.28571, 17623.71429, 18903.57143,
                18585.71429, 18803.71429, 20603.14286, 19821.28571, 18723.71429, 19266, 18838, 20200.71429, 21855,
                21706.57143, 20578.14286, 19279.14286, 18634, 24062.85714, 22179.28571, 21564, 21389.71429, 17987.42857,
                24012.42857, 22299.85714, 22383.71429, 21308, 19839.42857

            ])

            rnd = np.random.randn(48)

            # 각 유입수 성상의 Std. Var. value, assume 10% of mean value
            si_s = 0
            ss_s = 0.1 * ss_m
            xi_s = 0.1 * xi_m
            xs_s = 0.1 * xs_m
            xbh_s = 0.1 * xbh_m
            xba_s = 0
            xp_s = 0
            so_s = 0
            sno_s = 0
            snh_s = 0.1 * snh_m
            snd_s = 0.1 * snd_m
            xnd_s = 0.1 * xnd_m
            salk_s = 0
            q_s = 0.1 * q_m

            rnd = np.random.randn(48)

            si = si_m + si_s * rnd
            ss = ss_m + ss_s * rnd
            xi = xi_m + xi_s * rnd
            xs = xs_m + xs_s * rnd
            xbh = xbh_m + xbh_s * rnd
            xba = xba_m + xba_s * rnd
            xp = xp_m + xp_s * rnd
            so = so_m + so_s * rnd
            sno = sno_m + sno_s * rnd
            snh = snh_m + snh_s * rnd
            snd = snd_m + snd_s * rnd
            xnd = xnd_m + xnd_s * rnd
            salk = salk_m + salk_s * rnd
            q = q_m + q_s * rnd

            si_3 = sum(si * q) / sum(q)
            ss_3 = sum(ss * q) / sum(q)
            xi_3 = sum(xi * q) / sum(q)
            xs_3 = sum(xs * q) / sum(q)
            xbh_3 = sum(xbh * q) / sum(q)
            xba_3 = sum(xba * q) / sum(q)
            xp_3 = sum(xp * q) / sum(q)
            so_3 = sum(so * q) / sum(q)
            sno_3 = sum(sno * q) / sum(q)
            snh_3 = sum(snh * q) / sum(q)
            snd_3 = sum(snd * q) / sum(q)
            xnd_3 = sum(xnd * q) / sum(q)
            salk_3 = sum(salk * q) / sum(q)

            """
             List of variables :
                        0=V, 1=Si, 2=Ss, 3=Xi, 4=Xs, 5=Xbh, 6=Xba, 7=Xp, 8=So, 9=Sno, 10=Snh, 11=Snd, 12=Xnd, 13=Salk
                        (ref. BSM1 report Tbl. 1)
            """

            influent_mixed_instant = [0.66, si_3, ss_3, xi_3, xs_3, xbh_3, xba_3, xp_3, so_3, sno_3, snh_3, snd_3,
                                      xnd_3, salk_3]
            influent_var_instant = [si, ss, xi, xs, xbh, xba, xp, so, sno, snh, snd, xnd, salk]


        influent_mixed = influent_mixed_instant
        influent_var = influent_var_instant




        return switch, influent_mixed , influent_var

"""
# plotting
influent_var_history = np.zeros((10,48))
influent_mixed_history = np.zeros((10,14))
for i in range(10):
    switch, influent_mixed , influent_var = influent.buffer_tank()
    print(switch)
    influent_var_history[i] = influent_var[1]
    influent_mixed_history[i] = influent_mixed
for i in range(10):
    #plt.plot(influent_var_history[i])
    plt.scatter(i,influent_mixed_history[i][2])

"""

"""Author: SKHEO, KHU"""

import matplotlib.pyplot as plt
import numpy as np
from matplotlib.font_manager import FontProperties
import matplotlib.gridspec as gridspec
import random


class influent(object):
    def buffer_tank(switch):
        #t1,t2: hourly basis. e.g. 0, 12hr
        #switch = np.random.choice(6,1)

        if switch == 0: # morning (0~12), dry

            # 각 유입수 성상의 Mean value
            si_m =np.array([30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30
            ])
            ss_m =np.array( [63.63455,61.67313,61.71973,62.16018,64.57526,67.84871,72.14054,72.47069,69.7643,67.49915,62.83833,62.27237143,53.74197,54.44886,50.06769,46.35457,44.35819,42.57931,40.00033,40.38873,40.77713,40.46641,40.83539,40.46641,40.50525,40.52467,40.31105,40.11685,40.04693,40.34212,40.58293,40.89365,41.16553,41.86465,42.42395,43.94649,48.77431,59.88648,71.46084,80.00567,94.90087,105.7761,115.2104,120.011,118.9701,112.1109,102.4553,94.81153
            ])
            xi_m = np.array([52.28757143,51.66285714,46.76185714,49.95214286,48.007,48.50685714,48.31542857,39.62985714,38.09571429,36.67671429,34.69028571,31.66557143,28.23228571,26.256,23.77214286,21.898,21.01385714,19.36242857,19.47071429,19.28542857,18.47757143,18.88957143,19.06842857,18.80642857,18.04585714,18.102,16.91514286,16.862,16.75885714,16.83957143,16.54742857,16.87985714,16.81342857,16.53628571,17.664,17.901,20.22471429,22.31228571,31.09085714,37.80471429,42.14871429,50.65642857,59.44585714,70.141,77.07,82.70885714,87.174,84.82457143
            ])
            xs_m = np.array([228.8422857,224.8784286,213.1182857,210.2168571,209.8551429,209.8774286,212.3002857,211.598,207.301,198.8494286,192.2178571,186.6502857,181.1207143,173.3857143,165.7001429,157.7538571,149.8708571,142.9755714,137.0042857,131.949,128.582,125.5931429,123.5375714,122.3611429,121.5711429,120.4541429,119.0282857,117.3594286,115.659,114.534,113.6197143,112.9752857,112.5301429,112.2802857,112.3448571,112.8771429,113.3478571,116.9234286,122.7555714,133.1755714,148.2372857,162.0105714,175.9845714,190.1444286,206.4641429,221.929,235.1714286,249.2904286
            ])
            xbh_m = np.array([31.23642857,30.72685714,28.87557143,28.90757143,28.65114286,28.70928571,28.95714286,27.91428571,27.26628571,26.16942857,25.212,24.25714286,23.26142857,22.18257143,21.05257143,19.96128571,18.98714286,18.03742857,17.38614286,16.80371429,16.34,16.05385714,15.84528571,15.68528571,15.51285714,15.39485714,15.10471429,14.91371429,14.71328571,14.597,14.46285714,14.42828571,14.37128571,14.313,14.44514286,14.531,14.84128571,15.47042857,17.09414286,18.99771429,21.15414286,23.62971429,26.15885714,28.92071429,31.50371429,33.84857143,35.816,37.12385714
            ])
            xba_m = np.array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
            ])
            xp_m = np.array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
            ])
            so_m = np.array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
            ])
            sno_m = np.array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
            ])
            snh_m = np.array([30.24762,30.21283,31.04771,31.67387,33.15925,35.11773,37.86587,37.86587,36.8501,36.47441,34.38721,34.67942,32.06695,29.89975,27.06813,24.70265,23.38772,22.19802,20.31607,20.54218,20.71611,20.7509,20.66393,20.61175,20.54218,20.43782,20.40303,20.15953,20.02734,19.99951,20.10039,20.40303,20.82047,21.16834,21.6136,22.1354,24.68178,29.65625,34.24807,37.93544,43.39692,46.61468,49.24802,49.99941,49.24802,45.74154,40.85751,39.03469
            ])
            snd_m = np.array([6.36346,6.16731,6.17197,6.21602,6.45753,6.78487,7.21405,7.24707,6.97643,6.74992,6.28383,6.227238571,5.3742,5.44489,5.00677,4.63546,4.43582,4.25793,4.00003,4.03887,4.07771,4.04664,4.08354,4.04664,4.05053,4.05247,4.03111,4.01169,4.00469,4.03421,4.05829,4.08937,4.11655,4.18647,4.2424,4.39465,4.87743,5.98865,7.14608,8.00057,9.49009,10.57761,11.52104,12.0011,11.89701,11.21109,10.24553,9.48115
            ])
            xnd_m = np.array([11.74314286,11.55142857,10.85542857,10.86742857,10.77085714,10.793,10.88585714,10.49428571,10.25071429,9.838,9.478428571,9.119142857,8.745,8.339428571,7.914285714,7.504285714,7.138,6.781142857,6.536285714,6.317142857,6.142714286,6.035142857,5.956571429,5.896714286,5.832,5.787285714,5.678571429,5.606714286,5.531142857,5.487571429,5.437285714,5.424285714,5.402857143,5.381,5.430571429,5.462714286,5.579571429,5.816,6.426285714,7.142,7.952428571,8.883428571,9.834,10.87214286,11.84357143,12.725,13.46457143,13.95642857
            ])
            salk_m = np.array([7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7
            ])
            q_m = np.array([18794.42857,18884.85714,18100.57143,19539,18855.14286,19003.85714,18723.28571,15534.14286,15224.57143,15279.42857,14944,14023.57143,12824.42857,12433.14286,11718.85714,11296.85714,11417,10975.57143,11592.57143,11925.14286,11721.28571,12305.85714,12658.28571,12588.85714,12164.71429,12341.85714,11588.57143,11729.14286,11857.28571,12054.14286,11907.57143,12246.28571,12245.71429,12049,12956.71429,13052.57143,14680.85714,15808.85714,20882,23020.85714,23073.42857,25035,26709,28684.14286,28928.42857,28855.71429,28711.57143,26779.28571
            ])

            # 각 유입수 성상의 Std. Var. value, assume 10% of mean value
            si_s = 0
            ss_s = 0.1*ss_m
            xi_s  =0.1*xi_m
            xs_s  =0.1*xs_m
            xbh_s =0.1*xbh_m
            xba_s =0
            xp_s  =0
            so_s  =0
            sno_s =0
            snh_s =0.1*snh_m
            snd_s =0.1*snd_m
            xnd_s =0.1*xnd_m
            salk_s = 0
            q_s = 0.1*q_m



            rnd = np.random.randn(48)


            si = si_m + si_s*rnd
            ss =  ss_m + ss_s*rnd
            xi  = xi_m+ xi_s*rnd
            xs  = xs_m+ xs_s*rnd
            xbh = xbh_m+ xbh_s*rnd
            xba = xba_m+ xba_s*rnd
            xp  = xp_m+ xp_s*rnd
            so  = so_m+ so_s*rnd
            sno = sno_m+ sno_s*rnd
            snh = snh_m+ snh_s*rnd
            snd = snd_m+ snd_s*rnd
            xnd = xnd_m+ xnd_s*rnd
            salk = salk_m+ salk_s*rnd
            q = q_m+ q_s*rnd


            si_3 = sum(si*q)/sum(q)
            ss_3 = sum(ss*q)/sum(q)
            xi_3 = sum(xi*q)/sum(q)
            xs_3 = sum(xs*q)/sum(q)
            xbh_3 = sum(xbh*q)/sum(q)
            xba_3 = sum(xba*q)/sum(q)
            xp_3 = sum(xp*q)/sum(q)
            so_3 = sum(so*q)/sum(q)
            sno_3 = sum(sno*q)/sum(q)
            snh_3 = sum(snh*q)/sum(q)
            snd_3 = sum(snd*q)/sum(q)
            xnd_3 = sum(xnd*q)/sum(q)
            salk_3 = sum(salk*q)/sum(q)

            """
             List of variables :
                        0=V, 1=Si, 2=Ss, 3=Xi, 4=Xs, 5=Xbh, 6=Xba, 7=Xp, 8=So, 9=Sno, 10=Snh, 11=Snd, 12=Xnd, 13=Salk
                        (ref. BSM1 report Tbl. 1)
            """

            influent_mixed_instant=[0.66, si_3, ss_3, xi_3, xs_3, xbh_3, xba_3, xp_3, so_3, sno_3, snh_3, snd_3, xnd_3, salk_3]
            influent_var_instant=[si, ss, xi, xs, xbh, xba, xp, so, sno, snh, snd, xnd, salk]

        elif switch == 1: # evening, dry (13~24)

            si_m = np.array(
                [30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30
                 ])
            ss_m = np.array([
                88.37961, 81.2874, 75.7721, 70.37332, 68.27595, 67.03307, 66.76507, 67.07967, 68.08952, 68.72261,
                68.31479, 65.16874, 61.64516, 59.76219, 58.94655, 59.38933, 60.21274, 62.42662, 65.86786, 65.61928,
                64.00353, 59.54469, 58.34064, 57.33857, 58.6902, 60.46908, 63.25004, 62.37225, 62.21689, 62.01492,
                66.41162, 67.18843, 68.47015, 71.88808, 75.64392, 77.44222, 80.08335, 82.60408, 83.83531, 84.21983,
                83.377, 81.99584, 80.14161, 77.75294, 75.6245, 71.87255, 69.45669, 67.49915

            ])
            xi_m = np.array(
                [
                    84.13071429, 80.28414286, 77.06857143, 75.59528571, 69.53914286, 74.65371429, 70.989, 70.73328571,
                    67.836, 62.05642857, 57.04028571, 64.55685714, 60.49571429, 57.14742857, 58.18171429, 50.98471429,
                    48.55142857, 49.035, 47.16485714, 46.52028571, 44.63442857, 43.14114286, 41.92542857, 42.42557143,
                    45.12157143, 44.42414286, 45.24057143, 49.55514286, 48.18842857, 45.95257143, 47.28628571, 46.19,
                    49.68842857, 54.38728571, 55.24171429, 53.34771429, 50.395, 48.577, 62.72, 58.76257143, 58.61842857,
                    58.73971429, 49.65814286, 65.874, 61.58814286, 63.073, 60.55628571, 56.53585714

                ])
            xs_m = np.array(
                [
                    257.848, 262.6298571, 264.1517143, 262.6518571, 262.4, 256.2138571, 254.8904286, 253.9328571,
                    252.8947143, 252.5684286, 248.9338571, 239.2852857, 237.5595714, 237.319, 233.4257143, 232.6871429,
                    228.1955714, 221.1541429, 216.2652857, 212.509, 209.3434286, 206.2972857, 202.5087143, 199.1701429,
                    196.7577143, 197.271, 198.2177143, 197.4982857, 200.1368571, 202.351, 201.6157143, 202.3904286,
                    202.0877143, 202.6738571, 207.4925714, 212.324, 214.9942857, 215.0112857, 209.5072857, 215.379,
                    221.5514286, 224, 227.8102857, 220.4945714, 224.2621429, 228.6921429, 231.7928571, 233.6475714

                ])
            xbh_m = np.array(
                [
                    37.99771429, 38.10157143, 37.91357143, 37.583, 36.88214286, 36.76328571, 36.20871429, 36.07385714,
                    35.63671429, 34.95842857, 33.99714286, 33.76014286, 33.11757143, 32.71857143, 32.40085714, 31.519,
                    30.74971429, 30.02128571, 29.27, 28.781, 28.21971429, 27.71528571, 27.15942857, 26.84414286,
                    26.87557143, 26.85485714, 27.05085714, 27.45028571, 27.59142857, 27.58928571, 27.65585714, 27.62,
                    27.97514286, 28.56242857, 29.19271429, 29.51885714, 29.48785714, 29.28771429, 30.24742857,
                    30.46014286, 31.12985714, 31.41528571, 30.82985714, 31.81842857, 31.76114286, 32.41842857,
                    32.48314286, 32.24257143

                ])
            xba_m = np.array(
                [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
                 ])
            xp_m = np.array(
                [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
                 ])
            so_m = np.array(
                [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
                 ])
            sno_m = np.array(
                [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
                 ])
            snh_m = np.array(
                [
                    36.8501, 34.24807, 32.16088, 30.77985, 29.79539, 29.23881, 28.52221, 27.95867, 28.12564, 27.55166,
                    27.4647, 26.45589, 26.1776, 26.28891, 26.78984, 27.29076, 27.12379, 27.42295, 28.33436, 28.2787,
                    27.7082, 26.68548, 26.57068, 26.62286, 27.4647, 28.33436, 29.26664, 30.63027, 30.58853, 28.16043,
                    29.79539, 29.82322, 30.30328, 32.13305, 33.77149, 34.30373, 35.63953, 36.06393, 35.93174, 35.45168,
                    35.69519, 35.62561, 35.37863, 34.9438, 34.14371, 32.70355, 31.46515, 30.68245

                ])
            snd_m = np.array([
                8.83796, 8.12874, 7.57721, 7.03733, 6.8276, 6.70331, 6.67651, 6.70797, 6.80895, 6.87226, 6.83148,
                6.51687, 6.16452, 5.97622, 5.89466, 5.93893, 6.02127, 6.24266, 6.58679, 6.56193, 6.40035, 5.95447,
                5.83406, 5.73386, 5.86902, 6.04691, 6.325, 6.23723, 6.22169, 6.20149, 6.64116, 6.71884, 6.84702,
                7.18881, 7.56439, 7.74422, 8.00834, 8.26041, 8.38353, 8.42198, 8.3377, 8.19958, 8.01416, 7.7753,
                7.56245, 7.18726, 6.94567, 6.74992
            ])
            xnd_m = np.array(
                [
                    14.285, 14.324, 14.253, 14.12885714, 13.86557143, 13.82085714, 13.61228571, 13.56142857,
                    13.39714286, 13.14242857, 12.781, 12.69185714, 12.45014286, 12.30028571, 12.18071429, 11.84928571,
                    11.56014286, 11.286, 11.00357143, 10.82, 10.60885714, 10.41957143, 10.21028571, 10.09157143,
                    10.10342857, 10.096, 10.16971429, 10.31971429, 10.37285714, 10.37185714, 10.397, 10.38342857,
                    10.517, 10.738, 10.97457143, 11.09728571, 11.08542857, 11.01028571, 11.37128571, 11.45142857,
                    11.70314286, 11.81, 11.59014286, 11.96185714, 11.94042857, 12.18742857, 12.21185714, 12.12128571

                ])
            salk_m = np.array(
                [7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7
                 ])
            q_m = np.array([
                25837, 24434.42857, 23460.57143, 23183.14286, 21537.57143, 23435.57143, 22513.71429, 22524, 21785.71429,
                20117.57143, 18841.71429, 21912.14286, 20802.42857, 19755.28571, 20390.71429, 18081.42857, 17573.42857,
                18296.71429, 18018.28571, 18088.42857, 17634.85714, 17306.28571, 17140.28571, 17623.71429, 18903.57143,
                18585.71429, 18803.71429, 20603.14286, 19821.28571, 18723.71429, 19266, 18838, 20200.71429, 21855,
                21706.57143, 20578.14286, 19279.14286, 18634, 24062.85714, 22179.28571, 21564, 21389.71429, 17987.42857,
                24012.42857, 22299.85714, 22383.71429, 21308, 19839.42857

            ])


            rnd = np.random.randn(48)

            # 각 유입수 성상의 Std. Var. value, assume 10% of mean value
            si_s = 0
            ss_s = 0.1 * ss_m
            xi_s = 0.1 * xi_m
            xs_s = 0.1 * xs_m
            xbh_s = 0.1 * xbh_m
            xba_s = 0
            xp_s = 0
            so_s = 0
            sno_s = 0
            snh_s = 0.1 * snh_m
            snd_s = 0.1 * snd_m
            xnd_s = 0.1 * xnd_m
            salk_s = 0
            q_s = 0.1 * q_m

            rnd = np.random.randn(48)

            si = si_m + si_s * rnd
            ss = ss_m + ss_s * rnd
            xi = xi_m + xi_s * rnd
            xs = xs_m + xs_s * rnd
            xbh = xbh_m + xbh_s * rnd
            xba = xba_m + xba_s * rnd
            xp = xp_m + xp_s * rnd
            so = so_m + so_s * rnd
            sno = sno_m + sno_s * rnd
            snh = snh_m + snh_s * rnd
            snd = snd_m + snd_s * rnd
            xnd = xnd_m + xnd_s * rnd
            salk = salk_m + salk_s * rnd
            q = q_m + q_s * rnd

            si_3 = sum(si * q) / sum(q)
            ss_3 = sum(ss * q) / sum(q)
            xi_3 = sum(xi * q) / sum(q)
            xs_3 = sum(xs * q) / sum(q)
            xbh_3 = sum(xbh * q) / sum(q)
            xba_3 = sum(xba * q) / sum(q)
            xp_3 = sum(xp * q) / sum(q)
            so_3 = sum(so * q) / sum(q)
            sno_3 = sum(sno * q) / sum(q)
            snh_3 = sum(snh * q) / sum(q)
            snd_3 = sum(snd * q) / sum(q)
            xnd_3 = sum(xnd * q) / sum(q)
            salk_3 = sum(salk * q) / sum(q)

            """
             List of variables :
                        0=V, 1=Si, 2=Ss, 3=Xi, 4=Xs, 5=Xbh, 6=Xba, 7=Xp, 8=So, 9=Sno, 10=Snh, 11=Snd, 12=Xnd, 13=Salk
                        (ref. BSM1 report Tbl. 1)
            """

            influent_mixed_instant = [0.66, si_3, ss_3, xi_3, xs_3, xbh_3, xba_3, xp_3, so_3, sno_3, snh_3, snd_3,
                                      xnd_3, salk_3]
            influent_var_instant = [si, ss, xi, xs, xbh, xba, xp, so, sno, snh, snd, xnd, salk]

        elif switch == 2:  # carbon rich, morning (0~12hr)

            # 각 유입수 성상의 Mean value
            si_m = 1.5*np.array(
                [30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
                 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30
                 ])
            ss_m = 1.5*np.array(
                [63.63455, 61.67313, 61.71973, 62.16018, 64.57526, 67.84871, 72.14054, 72.47069, 69.7643, 67.49915,
                 62.83833, 62.27237143, 53.74197, 54.44886, 50.06769, 46.35457, 44.35819, 42.57931, 40.00033, 40.38873,
                 40.77713, 40.46641, 40.83539, 40.46641, 40.50525, 40.52467, 40.31105, 40.11685, 40.04693, 40.34212,
                 40.58293, 40.89365, 41.16553, 41.86465, 42.42395, 43.94649, 48.77431, 59.88648, 71.46084, 80.00567,
                 94.90087, 105.7761, 115.2104, 120.011, 118.9701, 112.1109, 102.4553, 94.81153
                 ])
            xi_m = 1.5*np.array(
                [52.28757143, 51.66285714, 46.76185714, 49.95214286, 48.007, 48.50685714, 48.31542857, 39.62985714,
                 38.09571429, 36.67671429, 34.69028571, 31.66557143, 28.23228571, 26.256, 23.77214286, 21.898,
                 21.01385714, 19.36242857, 19.47071429, 19.28542857, 18.47757143, 18.88957143, 19.06842857, 18.80642857,
                 18.04585714, 18.102, 16.91514286, 16.862, 16.75885714, 16.83957143, 16.54742857, 16.87985714,
                 16.81342857, 16.53628571, 17.664, 17.901, 20.22471429, 22.31228571, 31.09085714, 37.80471429,
                 42.14871429, 50.65642857, 59.44585714, 70.141, 77.07, 82.70885714, 87.174, 84.82457143
                 ])
            xs_m = 1.5*np.array(
                [228.8422857, 224.8784286, 213.1182857, 210.2168571, 209.8551429, 209.8774286, 212.3002857, 211.598,
                 207.301, 198.8494286, 192.2178571, 186.6502857, 181.1207143, 173.3857143, 165.7001429, 157.7538571,
                 149.8708571, 142.9755714, 137.0042857, 131.949, 128.582, 125.5931429, 123.5375714, 122.3611429,
                 121.5711429, 120.4541429, 119.0282857, 117.3594286, 115.659, 114.534, 113.6197143, 112.9752857,
                 112.5301429, 112.2802857, 112.3448571, 112.8771429, 113.3478571, 116.9234286, 122.7555714, 133.1755714,
                 148.2372857, 162.0105714, 175.9845714, 190.1444286, 206.4641429, 221.929, 235.1714286, 249.2904286
                 ])
            xbh_m = np.array(
                [31.23642857, 30.72685714, 28.87557143, 28.90757143, 28.65114286, 28.70928571, 28.95714286, 27.91428571,
                 27.26628571, 26.16942857, 25.212, 24.25714286, 23.26142857, 22.18257143, 21.05257143, 19.96128571,
                 18.98714286, 18.03742857, 17.38614286, 16.80371429, 16.34, 16.05385714, 15.84528571, 15.68528571,
                 15.51285714, 15.39485714, 15.10471429, 14.91371429, 14.71328571, 14.597, 14.46285714, 14.42828571,
                 14.37128571, 14.313, 14.44514286, 14.531, 14.84128571, 15.47042857, 17.09414286, 18.99771429,
                 21.15414286, 23.62971429, 26.15885714, 28.92071429, 31.50371429, 33.84857143, 35.816, 37.12385714
                 ])
            xba_m = np.array(
                [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
                 ])
            xp_m = np.array(
                [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
                 ])
            so_m = np.array(
                [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
                 ])
            sno_m = np.array(
                [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
                 ])
            snh_m = np.array(
                [30.24762, 30.21283, 31.04771, 31.67387, 33.15925, 35.11773, 37.86587, 37.86587, 36.8501, 36.47441,
                 34.38721, 34.67942, 32.06695, 29.89975, 27.06813, 24.70265, 23.38772, 22.19802, 20.31607, 20.54218,
                 20.71611, 20.7509, 20.66393, 20.61175, 20.54218, 20.43782, 20.40303, 20.15953, 20.02734, 19.99951,
                 20.10039, 20.40303, 20.82047, 21.16834, 21.6136, 22.1354, 24.68178, 29.65625, 34.24807, 37.93544,
                 43.39692, 46.61468, 49.24802, 49.99941, 49.24802, 45.74154, 40.85751, 39.03469
                 ])
            snd_m = np.array(
                [6.36346, 6.16731, 6.17197, 6.21602, 6.45753, 6.78487, 7.21405, 7.24707, 6.97643, 6.74992, 6.28383,
                 6.227238571, 5.3742, 5.44489, 5.00677, 4.63546, 4.43582, 4.25793, 4.00003, 4.03887, 4.07771, 4.04664,
                 4.08354, 4.04664, 4.05053, 4.05247, 4.03111, 4.01169, 4.00469, 4.03421, 4.05829, 4.08937, 4.11655,
                 4.18647, 4.2424, 4.39465, 4.87743, 5.98865, 7.14608, 8.00057, 9.49009, 10.57761, 11.52104, 12.0011,
                 11.89701, 11.21109, 10.24553, 9.48115
                 ])
            xnd_m = np.array(
                [11.74314286, 11.55142857, 10.85542857, 10.86742857, 10.77085714, 10.793, 10.88585714, 10.49428571,
                 10.25071429, 9.838, 9.478428571, 9.119142857, 8.745, 8.339428571, 7.914285714, 7.504285714, 7.138,
                 6.781142857, 6.536285714, 6.317142857, 6.142714286, 6.035142857, 5.956571429, 5.896714286, 5.832,
                 5.787285714, 5.678571429, 5.606714286, 5.531142857, 5.487571429, 5.437285714, 5.424285714, 5.402857143,
                 5.381, 5.430571429, 5.462714286, 5.579571429, 5.816, 6.426285714, 7.142, 7.952428571, 8.883428571,
                 9.834, 10.87214286, 11.84357143, 12.725, 13.46457143, 13.95642857
                 ])
            salk_m = np.array(
                [7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
                 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
                 ])
            q_m = np.array(
                [18794.42857, 18884.85714, 18100.57143, 19539, 18855.14286, 19003.85714, 18723.28571, 15534.14286,
                 15224.57143, 15279.42857, 14944, 14023.57143, 12824.42857, 12433.14286, 11718.85714, 11296.85714,
                 11417, 10975.57143, 11592.57143, 11925.14286, 11721.28571, 12305.85714, 12658.28571, 12588.85714,
                 12164.71429, 12341.85714, 11588.57143, 11729.14286, 11857.28571, 12054.14286, 11907.57143, 12246.28571,
                 12245.71429, 12049, 12956.71429, 13052.57143, 14680.85714, 15808.85714, 20882, 23020.85714,
                 23073.42857, 25035, 26709, 28684.14286, 28928.42857, 28855.71429, 28711.57143, 26779.28571
                 ])

            rnd = np.random.randn(48)

            # 각 유입수 성상의 Std. Var. value, assume 10% of mean value
            si_s = 0
            ss_s = 0.1 * ss_m
            xi_s = 0.1 * xi_m
            xs_s = 0.1 * xs_m
            xbh_s = 0.1 * xbh_m
            xba_s = 0
            xp_s = 0
            so_s = 0
            sno_s = 0
            snh_s = 0.1 * snh_m
            snd_s = 0.1 * snd_m
            xnd_s = 0.1 * xnd_m
            salk_s = 0
            q_s = 0.1 * q_m

            rnd = np.random.randn(48)

            si = si_m + si_s * rnd
            ss = ss_m + ss_s * rnd
            xi = xi_m + xi_s * rnd
            xs = xs_m + xs_s * rnd
            xbh = xbh_m + xbh_s * rnd
            xba = xba_m + xba_s * rnd
            xp = xp_m + xp_s * rnd
            so = so_m + so_s * rnd
            sno = sno_m + sno_s * rnd
            snh = snh_m + snh_s * rnd
            snd = snd_m + snd_s * rnd
            xnd = xnd_m + xnd_s * rnd
            salk = salk_m + salk_s * rnd
            q = q_m + q_s * rnd

            si_3 = sum(si * q) / sum(q)
            ss_3 = sum(ss * q) / sum(q)
            xi_3 = sum(xi * q) / sum(q)
            xs_3 = sum(xs * q) / sum(q)
            xbh_3 = sum(xbh * q) / sum(q)
            xba_3 = sum(xba * q) / sum(q)
            xp_3 = sum(xp * q) / sum(q)
            so_3 = sum(so * q) / sum(q)
            sno_3 = sum(sno * q) / sum(q)
            snh_3 = sum(snh * q) / sum(q)
            snd_3 = sum(snd * q) / sum(q)
            xnd_3 = sum(xnd * q) / sum(q)
            salk_3 = sum(salk * q) / sum(q)

            """
             List of variables :
                        0=V, 1=Si, 2=Ss, 3=Xi, 4=Xs, 5=Xbh, 6=Xba, 7=Xp, 8=So, 9=Sno, 10=Snh, 11=Snd, 12=Xnd, 13=Salk
                        (ref. BSM1 report Tbl. 1)
            """

            influent_mixed_instant = [0.66, si_3, ss_3, xi_3, xs_3, xbh_3, xba_3, xp_3, so_3, sno_3, snh_3, snd_3,
                                      xnd_3, salk_3]
            influent_var_instant = [si, ss, xi, xs, xbh, xba, xp, so, sno, snh, snd, xnd, salk]


        elif switch == 3:  # carbon rich, evening (13~24hr)

            si_m = 1.5*np.array(
                [30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
                 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30
                 ])
            ss_m = 1.5*np.array([
                88.37961, 81.2874, 75.7721, 70.37332, 68.27595, 67.03307, 66.76507, 67.07967, 68.08952, 68.72261,
                68.31479, 65.16874, 61.64516, 59.76219, 58.94655, 59.38933, 60.21274, 62.42662, 65.86786, 65.61928,
                64.00353, 59.54469, 58.34064, 57.33857, 58.6902, 60.46908, 63.25004, 62.37225, 62.21689, 62.01492,
                66.41162, 67.18843, 68.47015, 71.88808, 75.64392, 77.44222, 80.08335, 82.60408, 83.83531, 84.21983,
                83.377, 81.99584, 80.14161, 77.75294, 75.6245, 71.87255, 69.45669, 67.49915

            ])
            xi_m = 1.5*np.array(
                [
                    84.13071429, 80.28414286, 77.06857143, 75.59528571, 69.53914286, 74.65371429, 70.989, 70.73328571,
                    67.836, 62.05642857, 57.04028571, 64.55685714, 60.49571429, 57.14742857, 58.18171429, 50.98471429,
                    48.55142857, 49.035, 47.16485714, 46.52028571, 44.63442857, 43.14114286, 41.92542857, 42.42557143,
                    45.12157143, 44.42414286, 45.24057143, 49.55514286, 48.18842857, 45.95257143, 47.28628571, 46.19,
                    49.68842857, 54.38728571, 55.24171429, 53.34771429, 50.395, 48.577, 62.72, 58.76257143, 58.61842857,
                    58.73971429, 49.65814286, 65.874, 61.58814286, 63.073, 60.55628571, 56.53585714

                ])
            xs_m = 1.5*np.array(
                [
                    257.848, 262.6298571, 264.1517143, 262.6518571, 262.4, 256.2138571, 254.8904286, 253.9328571,
                    252.8947143, 252.5684286, 248.9338571, 239.2852857, 237.5595714, 237.319, 233.4257143, 232.6871429,
                    228.1955714, 221.1541429, 216.2652857, 212.509, 209.3434286, 206.2972857, 202.5087143, 199.1701429,
                    196.7577143, 197.271, 198.2177143, 197.4982857, 200.1368571, 202.351, 201.6157143, 202.3904286,
                    202.0877143, 202.6738571, 207.4925714, 212.324, 214.9942857, 215.0112857, 209.5072857, 215.379,
                    221.5514286, 224, 227.8102857, 220.4945714, 224.2621429, 228.6921429, 231.7928571, 233.6475714

                ])
            xbh_m = np.array(
                [
                    37.99771429, 38.10157143, 37.91357143, 37.583, 36.88214286, 36.76328571, 36.20871429, 36.07385714,
                    35.63671429, 34.95842857, 33.99714286, 33.76014286, 33.11757143, 32.71857143, 32.40085714, 31.519,
                    30.74971429, 30.02128571, 29.27, 28.781, 28.21971429, 27.71528571, 27.15942857, 26.84414286,
                    26.87557143, 26.85485714, 27.05085714, 27.45028571, 27.59142857, 27.58928571, 27.65585714, 27.62,
                    27.97514286, 28.56242857, 29.19271429, 29.51885714, 29.48785714, 29.28771429, 30.24742857,
                    30.46014286, 31.12985714, 31.41528571, 30.82985714, 31.81842857, 31.76114286, 32.41842857,
                    32.48314286, 32.24257143

                ])
            xba_m = np.array(
                [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
                 ])
            xp_m = np.array(
                [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
                 ])
            so_m = np.array(
                [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
                 ])
            sno_m = np.array(
                [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
                 ])
            snh_m = np.array(
                [
                    36.8501, 34.24807, 32.16088, 30.77985, 29.79539, 29.23881, 28.52221, 27.95867, 28.12564, 27.55166,
                    27.4647, 26.45589, 26.1776, 26.28891, 26.78984, 27.29076, 27.12379, 27.42295, 28.33436, 28.2787,
                    27.7082, 26.68548, 26.57068, 26.62286, 27.4647, 28.33436, 29.26664, 30.63027, 30.58853, 28.16043,
                    29.79539, 29.82322, 30.30328, 32.13305, 33.77149, 34.30373, 35.63953, 36.06393, 35.93174, 35.45168,
                    35.69519, 35.62561, 35.37863, 34.9438, 34.14371, 32.70355, 31.46515, 30.68245

                ])
            snd_m = np.array([
                8.83796, 8.12874, 7.57721, 7.03733, 6.8276, 6.70331, 6.67651, 6.70797, 6.80895, 6.87226, 6.83148,
                6.51687, 6.16452, 5.97622, 5.89466, 5.93893, 6.02127, 6.24266, 6.58679, 6.56193, 6.40035, 5.95447,
                5.83406, 5.73386, 5.86902, 6.04691, 6.325, 6.23723, 6.22169, 6.20149, 6.64116, 6.71884, 6.84702,
                7.18881, 7.56439, 7.74422, 8.00834, 8.26041, 8.38353, 8.42198, 8.3377, 8.19958, 8.01416, 7.7753,
                7.56245, 7.18726, 6.94567, 6.74992
            ])
            xnd_m = np.array(
                [
                    14.285, 14.324, 14.253, 14.12885714, 13.86557143, 13.82085714, 13.61228571, 13.56142857,
                    13.39714286, 13.14242857, 12.781, 12.69185714, 12.45014286, 12.30028571, 12.18071429, 11.84928571,
                    11.56014286, 11.286, 11.00357143, 10.82, 10.60885714, 10.41957143, 10.21028571, 10.09157143,
                    10.10342857, 10.096, 10.16971429, 10.31971429, 10.37285714, 10.37185714, 10.397, 10.38342857,
                    10.517, 10.738, 10.97457143, 11.09728571, 11.08542857, 11.01028571, 11.37128571, 11.45142857,
                    11.70314286, 11.81, 11.59014286, 11.96185714, 11.94042857, 12.18742857, 12.21185714, 12.12128571

                ])
            salk_m = np.array(
                [7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
                 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
                 ])
            q_m = np.array([
                25837, 24434.42857, 23460.57143, 23183.14286, 21537.57143, 23435.57143, 22513.71429, 22524, 21785.71429,
                20117.57143, 18841.71429, 21912.14286, 20802.42857, 19755.28571, 20390.71429, 18081.42857, 17573.42857,
                18296.71429, 18018.28571, 18088.42857, 17634.85714, 17306.28571, 17140.28571, 17623.71429, 18903.57143,
                18585.71429, 18803.71429, 20603.14286, 19821.28571, 18723.71429, 19266, 18838, 20200.71429, 21855,
                21706.57143, 20578.14286, 19279.14286, 18634, 24062.85714, 22179.28571, 21564, 21389.71429, 17987.42857,
                24012.42857, 22299.85714, 22383.71429, 21308, 19839.42857

            ])

            rnd = np.random.randn(48)

            # 각 유입수 성상의 Std. Var. value, assume 10% of mean value
            si_s = 0
            ss_s = 0.1 * ss_m
            xi_s = 0.1 * xi_m
            xs_s = 0.1 * xs_m
            xbh_s = 0.1 * xbh_m
            xba_s = 0
            xp_s = 0
            so_s = 0
            sno_s = 0
            snh_s = 0.1 * snh_m
            snd_s = 0.1 * snd_m
            xnd_s = 0.1 * xnd_m
            salk_s = 0
            q_s = 0.1 * q_m

            rnd = np.random.randn(48)

            si = si_m + si_s * rnd
            ss = ss_m + ss_s * rnd
            xi = xi_m + xi_s * rnd
            xs = xs_m + xs_s * rnd
            xbh = xbh_m + xbh_s * rnd
            xba = xba_m + xba_s * rnd
            xp = xp_m + xp_s * rnd
            so = so_m + so_s * rnd
            sno = sno_m + sno_s * rnd
            snh = snh_m + snh_s * rnd
            snd = snd_m + snd_s * rnd
            xnd = xnd_m + xnd_s * rnd
            salk = salk_m + salk_s * rnd
            q = q_m + q_s * rnd

            si_3 = sum(si * q) / sum(q)
            ss_3 = sum(ss * q) / sum(q)
            xi_3 = sum(xi * q) / sum(q)
            xs_3 = sum(xs * q) / sum(q)
            xbh_3 = sum(xbh * q) / sum(q)
            xba_3 = sum(xba * q) / sum(q)
            xp_3 = sum(xp * q) / sum(q)
            so_3 = sum(so * q) / sum(q)
            sno_3 = sum(sno * q) / sum(q)
            snh_3 = sum(snh * q) / sum(q)
            snd_3 = sum(snd * q) / sum(q)
            xnd_3 = sum(xnd * q) / sum(q)
            salk_3 = sum(salk * q) / sum(q)

            """
             List of variables :
                        0=V, 1=Si, 2=Ss, 3=Xi, 4=Xs, 5=Xbh, 6=Xba, 7=Xp, 8=So, 9=Sno, 10=Snh, 11=Snd, 12=Xnd, 13=Salk
                        (ref. BSM1 report Tbl. 1)
            """

            influent_mixed_instant = [0.66, si_3, ss_3, xi_3, xs_3, xbh_3, xba_3, xp_3, so_3, sno_3, snh_3, snd_3,
                                      xnd_3, salk_3]
            influent_var_instant = [si, ss, xi, xs, xbh, xba, xp, so, sno, snh, snd, xnd, salk]

        elif switch == 4:  # High, morning

            # 각 유입수 성상의 Mean value
            si_m = 1.5 * np.array(
                [30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
                 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30
                 ])
            ss_m = 1.5 * np.array(
                [63.63455, 61.67313, 61.71973, 62.16018, 64.57526, 67.84871, 72.14054, 72.47069, 69.7643, 67.49915,
                 62.83833, 62.27237143, 53.74197, 54.44886, 50.06769, 46.35457, 44.35819, 42.57931, 40.00033, 40.38873,
                 40.77713, 40.46641, 40.83539, 40.46641, 40.50525, 40.52467, 40.31105, 40.11685, 40.04693, 40.34212,
                 40.58293, 40.89365, 41.16553, 41.86465, 42.42395, 43.94649, 48.77431, 59.88648, 71.46084, 80.00567,
                 94.90087, 105.7761, 115.2104, 120.011, 118.9701, 112.1109, 102.4553, 94.81153
                 ])
            xi_m = 1.5 * np.array(
                [52.28757143, 51.66285714, 46.76185714, 49.95214286, 48.007, 48.50685714, 48.31542857, 39.62985714,
                 38.09571429, 36.67671429, 34.69028571, 31.66557143, 28.23228571, 26.256, 23.77214286, 21.898,
                 21.01385714, 19.36242857, 19.47071429, 19.28542857, 18.47757143, 18.88957143, 19.06842857, 18.80642857,
                 18.04585714, 18.102, 16.91514286, 16.862, 16.75885714, 16.83957143, 16.54742857, 16.87985714,
                 16.81342857, 16.53628571, 17.664, 17.901, 20.22471429, 22.31228571, 31.09085714, 37.80471429,
                 42.14871429, 50.65642857, 59.44585714, 70.141, 77.07, 82.70885714, 87.174, 84.82457143
                 ])
            xs_m = 1.5* np.array(
                [228.8422857, 224.8784286, 213.1182857, 210.2168571, 209.8551429, 209.8774286, 212.3002857, 211.598,
                 207.301, 198.8494286, 192.2178571, 186.6502857, 181.1207143, 173.3857143, 165.7001429, 157.7538571,
                 149.8708571, 142.9755714, 137.0042857, 131.949, 128.582, 125.5931429, 123.5375714, 122.3611429,
                 121.5711429, 120.4541429, 119.0282857, 117.3594286, 115.659, 114.534, 113.6197143, 112.9752857,
                 112.5301429, 112.2802857, 112.3448571, 112.8771429, 113.3478571, 116.9234286, 122.7555714, 133.1755714,
                 148.2372857, 162.0105714, 175.9845714, 190.1444286, 206.4641429, 221.929, 235.1714286, 249.2904286
                 ])
            xbh_m = 1.5 * np.array(
                [31.23642857, 30.72685714, 28.87557143, 28.90757143, 28.65114286, 28.70928571, 28.95714286, 27.91428571,
                 27.26628571, 26.16942857, 25.212, 24.25714286, 23.26142857, 22.18257143, 21.05257143, 19.96128571,
                 18.98714286, 18.03742857, 17.38614286, 16.80371429, 16.34, 16.05385714, 15.84528571, 15.68528571,
                 15.51285714, 15.39485714, 15.10471429, 14.91371429, 14.71328571, 14.597, 14.46285714, 14.42828571,
                 14.37128571, 14.313, 14.44514286, 14.531, 14.84128571, 15.47042857, 17.09414286, 18.99771429,
                 21.15414286, 23.62971429, 26.15885714, 28.92071429, 31.50371429, 33.84857143, 35.816, 37.12385714
                 ])
            xba_m = np.array(
                [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
                 ])
            xp_m = np.array(
                [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
                 ])
            so_m = np.array(
                [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
                 ])
            sno_m = np.array(
                [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
                 ])
            snh_m = 1.5 * np.array(
                [30.24762, 30.21283, 31.04771, 31.67387, 33.15925, 35.11773, 37.86587, 37.86587, 36.8501, 36.47441,
                 34.38721, 34.67942, 32.06695, 29.89975, 27.06813, 24.70265, 23.38772, 22.19802, 20.31607, 20.54218,
                 20.71611, 20.7509, 20.66393, 20.61175, 20.54218, 20.43782, 20.40303, 20.15953, 20.02734, 19.99951,
                 20.10039, 20.40303, 20.82047, 21.16834, 21.6136, 22.1354, 24.68178, 29.65625, 34.24807, 37.93544,
                 43.39692, 46.61468, 49.24802, 49.99941, 49.24802, 45.74154, 40.85751, 39.03469
                 ])
            snd_m = 1.5 * np.array(
                [6.36346, 6.16731, 6.17197, 6.21602, 6.45753, 6.78487, 7.21405, 7.24707, 6.97643, 6.74992, 6.28383,
                 6.227238571, 5.3742, 5.44489, 5.00677, 4.63546, 4.43582, 4.25793, 4.00003, 4.03887, 4.07771, 4.04664,
                 4.08354, 4.04664, 4.05053, 4.05247, 4.03111, 4.01169, 4.00469, 4.03421, 4.05829, 4.08937, 4.11655,
                 4.18647, 4.2424, 4.39465, 4.87743, 5.98865, 7.14608, 8.00057, 9.49009, 10.57761, 11.52104, 12.0011,
                 11.89701, 11.21109, 10.24553, 9.48115
                 ])
            xnd_m = 1.5 * np.array(
                [11.74314286, 11.55142857, 10.85542857, 10.86742857, 10.77085714, 10.793, 10.88585714, 10.49428571,
                 10.25071429, 9.838, 9.478428571, 9.119142857, 8.745, 8.339428571, 7.914285714, 7.504285714, 7.138,
                 6.781142857, 6.536285714, 6.317142857, 6.142714286, 6.035142857, 5.956571429, 5.896714286, 5.832,
                 5.787285714, 5.678571429, 5.606714286, 5.531142857, 5.487571429, 5.437285714, 5.424285714, 5.402857143,
                 5.381, 5.430571429, 5.462714286, 5.579571429, 5.816, 6.426285714, 7.142, 7.952428571, 8.883428571,
                 9.834, 10.87214286, 11.84357143, 12.725, 13.46457143, 13.95642857
                 ])
            salk_m = np.array(
                [7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
                 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
                 ])
            q_m = np.array(
                [18794.42857, 18884.85714, 18100.57143, 19539, 18855.14286, 19003.85714, 18723.28571, 15534.14286,
                 15224.57143, 15279.42857, 14944, 14023.57143, 12824.42857, 12433.14286, 11718.85714, 11296.85714,
                 11417, 10975.57143, 11592.57143, 11925.14286, 11721.28571, 12305.85714, 12658.28571, 12588.85714,
                 12164.71429, 12341.85714, 11588.57143, 11729.14286, 11857.28571, 12054.14286, 11907.57143, 12246.28571,
                 12245.71429, 12049, 12956.71429, 13052.57143, 14680.85714, 15808.85714, 20882, 23020.85714,
                 23073.42857, 25035, 26709, 28684.14286, 28928.42857, 28855.71429, 28711.57143, 26779.28571
                 ])

            rnd = np.random.randn(48)

            # 각 유입수 성상의 Std. Var. value, assume 10% of mean value
            si_s = 0
            ss_s = 0.1 * ss_m
            xi_s = 0.1 * xi_m
            xs_s = 0.1 * xs_m
            xbh_s = 0.1 * xbh_m
            xba_s = 0
            xp_s = 0
            so_s = 0
            sno_s = 0
            snh_s = 0.1 * snh_m
            snd_s = 0.1 * snd_m
            xnd_s = 0.1 * xnd_m
            salk_s = 0
            q_s = 0.1 * q_m

            rnd = np.random.randn(48)

            si = si_m + si_s * rnd
            ss = ss_m + ss_s * rnd
            xi = xi_m + xi_s * rnd
            xs = xs_m + xs_s * rnd
            xbh = xbh_m + xbh_s * rnd
            xba = xba_m + xba_s * rnd
            xp = xp_m + xp_s * rnd
            so = so_m + so_s * rnd
            sno = sno_m + sno_s * rnd
            snh = snh_m + snh_s * rnd
            snd = snd_m + snd_s * rnd
            xnd = xnd_m + xnd_s * rnd
            salk = salk_m + salk_s * rnd
            q = q_m + q_s * rnd

            si_3 = sum(si * q) / sum(q)
            ss_3 = sum(ss * q) / sum(q)
            xi_3 = sum(xi * q) / sum(q)
            xs_3 = sum(xs * q) / sum(q)
            xbh_3 = sum(xbh * q) / sum(q)
            xba_3 = sum(xba * q) / sum(q)
            xp_3 = sum(xp * q) / sum(q)
            so_3 = sum(so * q) / sum(q)
            sno_3 = sum(sno * q) / sum(q)
            snh_3 = sum(snh * q) / sum(q)
            snd_3 = sum(snd * q) / sum(q)
            xnd_3 = sum(xnd * q) / sum(q)
            salk_3 = sum(salk * q) / sum(q)

            """
             List of variables :
                        0=V, 1=Si, 2=Ss, 3=Xi, 4=Xs, 5=Xbh, 6=Xba, 7=Xp, 8=So, 9=Sno, 10=Snh, 11=Snd, 12=Xnd, 13=Salk
                        (ref. BSM1 report Tbl. 1)
            """

            influent_mixed_instant = [0.66, si_3, ss_3, xi_3, xs_3, xbh_3, xba_3, xp_3, so_3, sno_3, snh_3, snd_3,
                                      xnd_3, salk_3]
            influent_var_instant = [si, ss, xi, xs, xbh, xba, xp, so, sno, snh, snd, xnd, salk]

        elif switch == 5:  # High, evening (13~24hr)

            si_m = 1.5*np.array(
                [30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
                 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30
                 ])
            ss_m = 1.5*np.array([
                88.37961, 81.2874, 75.7721, 70.37332, 68.27595, 67.03307, 66.76507, 67.07967, 68.08952, 68.72261,
                68.31479, 65.16874, 61.64516, 59.76219, 58.94655, 59.38933, 60.21274, 62.42662, 65.86786, 65.61928,
                64.00353, 59.54469, 58.34064, 57.33857, 58.6902, 60.46908, 63.25004, 62.37225, 62.21689, 62.01492,
                66.41162, 67.18843, 68.47015, 71.88808, 75.64392, 77.44222, 80.08335, 82.60408, 83.83531, 84.21983,
                83.377, 81.99584, 80.14161, 77.75294, 75.6245, 71.87255, 69.45669, 67.49915

            ])
            xi_m = 1.5*np.array(
                [
                    84.13071429, 80.28414286, 77.06857143, 75.59528571, 69.53914286, 74.65371429, 70.989, 70.73328571,
                    67.836, 62.05642857, 57.04028571, 64.55685714, 60.49571429, 57.14742857, 58.18171429, 50.98471429,
                    48.55142857, 49.035, 47.16485714, 46.52028571, 44.63442857, 43.14114286, 41.92542857, 42.42557143,
                    45.12157143, 44.42414286, 45.24057143, 49.55514286, 48.18842857, 45.95257143, 47.28628571, 46.19,
                    49.68842857, 54.38728571, 55.24171429, 53.34771429, 50.395, 48.577, 62.72, 58.76257143, 58.61842857,
                    58.73971429, 49.65814286, 65.874, 61.58814286, 63.073, 60.55628571, 56.53585714

                ])
            xs_m = 1.5*np.array(
                [
                    257.848, 262.6298571, 264.1517143, 262.6518571, 262.4, 256.2138571, 254.8904286, 253.9328571,
                    252.8947143, 252.5684286, 248.9338571, 239.2852857, 237.5595714, 237.319, 233.4257143, 232.6871429,
                    228.1955714, 221.1541429, 216.2652857, 212.509, 209.3434286, 206.2972857, 202.5087143, 199.1701429,
                    196.7577143, 197.271, 198.2177143, 197.4982857, 200.1368571, 202.351, 201.6157143, 202.3904286,
                    202.0877143, 202.6738571, 207.4925714, 212.324, 214.9942857, 215.0112857, 209.5072857, 215.379,
                    221.5514286, 224, 227.8102857, 220.4945714, 224.2621429, 228.6921429, 231.7928571, 233.6475714

                ])
            xbh_m = 1.5*np.array(
                [
                    37.99771429, 38.10157143, 37.91357143, 37.583, 36.88214286, 36.76328571, 36.20871429, 36.07385714,
                    35.63671429, 34.95842857, 33.99714286, 33.76014286, 33.11757143, 32.71857143, 32.40085714, 31.519,
                    30.74971429, 30.02128571, 29.27, 28.781, 28.21971429, 27.71528571, 27.15942857, 26.84414286,
                    26.87557143, 26.85485714, 27.05085714, 27.45028571, 27.59142857, 27.58928571, 27.65585714, 27.62,
                    27.97514286, 28.56242857, 29.19271429, 29.51885714, 29.48785714, 29.28771429, 30.24742857,
                    30.46014286, 31.12985714, 31.41528571, 30.82985714, 31.81842857, 31.76114286, 32.41842857,
                    32.48314286, 32.24257143

                ])
            xba_m = np.array(
                [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
                 ])
            xp_m = np.array(
                [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
                 ])
            so_m = np.array(
                [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
                 ])
            sno_m = np.array(
                [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
                 ])
            snh_m = 1.5*np.array(
                [
                    36.8501, 34.24807, 32.16088, 30.77985, 29.79539, 29.23881, 28.52221, 27.95867, 28.12564, 27.55166,
                    27.4647, 26.45589, 26.1776, 26.28891, 26.78984, 27.29076, 27.12379, 27.42295, 28.33436, 28.2787,
                    27.7082, 26.68548, 26.57068, 26.62286, 27.4647, 28.33436, 29.26664, 30.63027, 30.58853, 28.16043,
                    29.79539, 29.82322, 30.30328, 32.13305, 33.77149, 34.30373, 35.63953, 36.06393, 35.93174, 35.45168,
                    35.69519, 35.62561, 35.37863, 34.9438, 34.14371, 32.70355, 31.46515, 30.68245

                ])
            snd_m = 1.5*np.array([
                8.83796, 8.12874, 7.57721, 7.03733, 6.8276, 6.70331, 6.67651, 6.70797, 6.80895, 6.87226, 6.83148,
                6.51687, 6.16452, 5.97622, 5.89466, 5.93893, 6.02127, 6.24266, 6.58679, 6.56193, 6.40035, 5.95447,
                5.83406, 5.73386, 5.86902, 6.04691, 6.325, 6.23723, 6.22169, 6.20149, 6.64116, 6.71884, 6.84702,
                7.18881, 7.56439, 7.74422, 8.00834, 8.26041, 8.38353, 8.42198, 8.3377, 8.19958, 8.01416, 7.7753,
                7.56245, 7.18726, 6.94567, 6.74992
            ])
            xnd_m = 1.5*np.array(
                [
                    14.285, 14.324, 14.253, 14.12885714, 13.86557143, 13.82085714, 13.61228571, 13.56142857,
                    13.39714286, 13.14242857, 12.781, 12.69185714, 12.45014286, 12.30028571, 12.18071429, 11.84928571,
                    11.56014286, 11.286, 11.00357143, 10.82, 10.60885714, 10.41957143, 10.21028571, 10.09157143,
                    10.10342857, 10.096, 10.16971429, 10.31971429, 10.37285714, 10.37185714, 10.397, 10.38342857,
                    10.517, 10.738, 10.97457143, 11.09728571, 11.08542857, 11.01028571, 11.37128571, 11.45142857,
                    11.70314286, 11.81, 11.59014286, 11.96185714, 11.94042857, 12.18742857, 12.21185714, 12.12128571

                ])
            salk_m = np.array(
                [7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
                 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
                 ])
            q_m = np.array([
                25837, 24434.42857, 23460.57143, 23183.14286, 21537.57143, 23435.57143, 22513.71429, 22524, 21785.71429,
                20117.57143, 18841.71429, 21912.14286, 20802.42857, 19755.28571, 20390.71429, 18081.42857, 17573.42857,
                18296.71429, 18018.28571, 18088.42857, 17634.85714, 17306.28571, 17140.28571, 17623.71429, 18903.57143,
                18585.71429, 18803.71429, 20603.14286, 19821.28571, 18723.71429, 19266, 18838, 20200.71429, 21855,
                21706.57143, 20578.14286, 19279.14286, 18634, 24062.85714, 22179.28571, 21564, 21389.71429, 17987.42857,
                24012.42857, 22299.85714, 22383.71429, 21308, 19839.42857

            ])

            rnd = np.random.randn(48)

            # 각 유입수 성상의 Std. Var. value, assume 10% of mean value
            si_s = 0
            ss_s = 0.1 * ss_m
            xi_s = 0.1 * xi_m
            xs_s = 0.1 * xs_m
            xbh_s = 0.1 * xbh_m
            xba_s = 0
            xp_s = 0
            so_s = 0
            sno_s = 0
            snh_s = 0.1 * snh_m
            snd_s = 0.1 * snd_m
            xnd_s = 0.1 * xnd_m
            salk_s = 0
            q_s = 0.1 * q_m

            rnd = np.random.randn(48)

            si = si_m + si_s * rnd
            ss = ss_m + ss_s * rnd
            xi = xi_m + xi_s * rnd
            xs = xs_m + xs_s * rnd
            xbh = xbh_m + xbh_s * rnd
            xba = xba_m + xba_s * rnd
            xp = xp_m + xp_s * rnd
            so = so_m + so_s * rnd
            sno = sno_m + sno_s * rnd
            snh = snh_m + snh_s * rnd
            snd = snd_m + snd_s * rnd
            xnd = xnd_m + xnd_s * rnd
            salk = salk_m + salk_s * rnd
            q = q_m + q_s * rnd

            si_3 = sum(si * q) / sum(q)
            ss_3 = sum(ss * q) / sum(q)
            xi_3 = sum(xi * q) / sum(q)
            xs_3 = sum(xs * q) / sum(q)
            xbh_3 = sum(xbh * q) / sum(q)
            xba_3 = sum(xba * q) / sum(q)
            xp_3 = sum(xp * q) / sum(q)
            so_3 = sum(so * q) / sum(q)
            sno_3 = sum(sno * q) / sum(q)
            snh_3 = sum(snh * q) / sum(q)
            snd_3 = sum(snd * q) / sum(q)
            xnd_3 = sum(xnd * q) / sum(q)
            salk_3 = sum(salk * q) / sum(q)

            """
             List of variables :
                        0=V, 1=Si, 2=Ss, 3=Xi, 4=Xs, 5=Xbh, 6=Xba, 7=Xp, 8=So, 9=Sno, 10=Snh, 11=Snd, 12=Xnd, 13=Salk
                        (ref. BSM1 report Tbl. 1)
            """

            influent_mixed_instant = [0.66, si_3, ss_3, xi_3, xs_3, xbh_3, xba_3, xp_3, so_3, sno_3, snh_3, snd_3,
                                      xnd_3, salk_3]
            influent_var_instant = [si, ss, xi, xs, xbh, xba, xp, so, sno, snh, snd, xnd, salk]

        elif switch == 6:  # Nitrogen rich, morning

            # 각 유입수 성상의 Mean value
            si_m = np.array(
                [30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
                 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30
                 ])
            ss_m = np.array(
                [63.63455, 61.67313, 61.71973, 62.16018, 64.57526, 67.84871, 72.14054, 72.47069, 69.7643, 67.49915,
                 62.83833, 62.27237143, 53.74197, 54.44886, 50.06769, 46.35457, 44.35819, 42.57931, 40.00033, 40.38873,
                 40.77713, 40.46641, 40.83539, 40.46641, 40.50525, 40.52467, 40.31105, 40.11685, 40.04693, 40.34212,
                 40.58293, 40.89365, 41.16553, 41.86465, 42.42395, 43.94649, 48.77431, 59.88648, 71.46084, 80.00567,
                 94.90087, 105.7761, 115.2104, 120.011, 118.9701, 112.1109, 102.4553, 94.81153
                 ])
            xi_m = np.array(
                [52.28757143, 51.66285714, 46.76185714, 49.95214286, 48.007, 48.50685714, 48.31542857, 39.62985714,
                 38.09571429, 36.67671429, 34.69028571, 31.66557143, 28.23228571, 26.256, 23.77214286, 21.898,
                 21.01385714, 19.36242857, 19.47071429, 19.28542857, 18.47757143, 18.88957143, 19.06842857, 18.80642857,
                 18.04585714, 18.102, 16.91514286, 16.862, 16.75885714, 16.83957143, 16.54742857, 16.87985714,
                 16.81342857, 16.53628571, 17.664, 17.901, 20.22471429, 22.31228571, 31.09085714, 37.80471429,
                 42.14871429, 50.65642857, 59.44585714, 70.141, 77.07, 82.70885714, 87.174, 84.82457143
                 ])
            xs_m = np.array(
                [228.8422857, 224.8784286, 213.1182857, 210.2168571, 209.8551429, 209.8774286, 212.3002857, 211.598,
                 207.301, 198.8494286, 192.2178571, 186.6502857, 181.1207143, 173.3857143, 165.7001429, 157.7538571,
                 149.8708571, 142.9755714, 137.0042857, 131.949, 128.582, 125.5931429, 123.5375714, 122.3611429,
                 121.5711429, 120.4541429, 119.0282857, 117.3594286, 115.659, 114.534, 113.6197143, 112.9752857,
                 112.5301429, 112.2802857, 112.3448571, 112.8771429, 113.3478571, 116.9234286, 122.7555714, 133.1755714,
                 148.2372857, 162.0105714, 175.9845714, 190.1444286, 206.4641429, 221.929, 235.1714286, 249.2904286
                 ])
            xbh_m = np.array(
                [31.23642857, 30.72685714, 28.87557143, 28.90757143, 28.65114286, 28.70928571, 28.95714286, 27.91428571,
                 27.26628571, 26.16942857, 25.212, 24.25714286, 23.26142857, 22.18257143, 21.05257143, 19.96128571,
                 18.98714286, 18.03742857, 17.38614286, 16.80371429, 16.34, 16.05385714, 15.84528571, 15.68528571,
                 15.51285714, 15.39485714, 15.10471429, 14.91371429, 14.71328571, 14.597, 14.46285714, 14.42828571,
                 14.37128571, 14.313, 14.44514286, 14.531, 14.84128571, 15.47042857, 17.09414286, 18.99771429,
                 21.15414286, 23.62971429, 26.15885714, 28.92071429, 31.50371429, 33.84857143, 35.816, 37.12385714
                 ])
            xba_m = np.array(
                [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
                 ])
            xp_m = np.array(
                [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
                 ])
            so_m = np.array(
                [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
                 ])
            sno_m = np.array(
                [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
                 ])
            snh_m = 1.5 * np.array(
                [30.24762, 30.21283, 31.04771, 31.67387, 33.15925, 35.11773, 37.86587, 37.86587, 36.8501, 36.47441,
                 34.38721, 34.67942, 32.06695, 29.89975, 27.06813, 24.70265, 23.38772, 22.19802, 20.31607, 20.54218,
                 20.71611, 20.7509, 20.66393, 20.61175, 20.54218, 20.43782, 20.40303, 20.15953, 20.02734, 19.99951,
                 20.10039, 20.40303, 20.82047, 21.16834, 21.6136, 22.1354, 24.68178, 29.65625, 34.24807, 37.93544,
                 43.39692, 46.61468, 49.24802, 49.99941, 49.24802, 45.74154, 40.85751, 39.03469
                 ])
            snd_m = 1.5 * np.array(
                [6.36346, 6.16731, 6.17197, 6.21602, 6.45753, 6.78487, 7.21405, 7.24707, 6.97643, 6.74992, 6.28383,
                 6.227238571, 5.3742, 5.44489, 5.00677, 4.63546, 4.43582, 4.25793, 4.00003, 4.03887, 4.07771, 4.04664,
                 4.08354, 4.04664, 4.05053, 4.05247, 4.03111, 4.01169, 4.00469, 4.03421, 4.05829, 4.08937, 4.11655,
                 4.18647, 4.2424, 4.39465, 4.87743, 5.98865, 7.14608, 8.00057, 9.49009, 10.57761, 11.52104, 12.0011,
                 11.89701, 11.21109, 10.24553, 9.48115
                 ])
            xnd_m = 1.5 * np.array(
                [11.74314286, 11.55142857, 10.85542857, 10.86742857, 10.77085714, 10.793, 10.88585714, 10.49428571,
                 10.25071429, 9.838, 9.478428571, 9.119142857, 8.745, 8.339428571, 7.914285714, 7.504285714, 7.138,
                 6.781142857, 6.536285714, 6.317142857, 6.142714286, 6.035142857, 5.956571429, 5.896714286, 5.832,
                 5.787285714, 5.678571429, 5.606714286, 5.531142857, 5.487571429, 5.437285714, 5.424285714, 5.402857143,
                 5.381, 5.430571429, 5.462714286, 5.579571429, 5.816, 6.426285714, 7.142, 7.952428571, 8.883428571,
                 9.834, 10.87214286, 11.84357143, 12.725, 13.46457143, 13.95642857
                 ])
            salk_m = np.array(
                [7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
                 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
                 ])
            q_m = np.array(
                [18794.42857, 18884.85714, 18100.57143, 19539, 18855.14286, 19003.85714, 18723.28571, 15534.14286,
                 15224.57143, 15279.42857, 14944, 14023.57143, 12824.42857, 12433.14286, 11718.85714, 11296.85714,
                 11417, 10975.57143, 11592.57143, 11925.14286, 11721.28571, 12305.85714, 12658.28571, 12588.85714,
                 12164.71429, 12341.85714, 11588.57143, 11729.14286, 11857.28571, 12054.14286, 11907.57143, 12246.28571,
                 12245.71429, 12049, 12956.71429, 13052.57143, 14680.85714, 15808.85714, 20882, 23020.85714,
                 23073.42857, 25035, 26709, 28684.14286, 28928.42857, 28855.71429, 28711.57143, 26779.28571
                 ])

            rnd = np.random.randn(48)

            # 각 유입수 성상의 Std. Var. value, assume 10% of mean value
            si_s = 0
            ss_s = 0.1 * ss_m
            xi_s = 0.1 * xi_m
            xs_s = 0.1 * xs_m
            xbh_s = 0.1 * xbh_m
            xba_s = 0
            xp_s = 0
            so_s = 0
            sno_s = 0
            snh_s = 0.1 * snh_m
            snd_s = 0.1 * snd_m
            xnd_s = 0.1 * xnd_m
            salk_s = 0
            q_s = 0.1 * q_m

            rnd = np.random.randn(48)

            si = si_m + si_s * rnd
            ss = ss_m + ss_s * rnd
            xi = xi_m + xi_s * rnd
            xs = xs_m + xs_s * rnd
            xbh = xbh_m + xbh_s * rnd
            xba = xba_m + xba_s * rnd
            xp = xp_m + xp_s * rnd
            so = so_m + so_s * rnd
            sno = sno_m + sno_s * rnd
            snh = snh_m + snh_s * rnd
            snd = snd_m + snd_s * rnd
            xnd = xnd_m + xnd_s * rnd
            salk = salk_m + salk_s * rnd
            q = q_m + q_s * rnd

            si_3 = sum(si * q) / sum(q)
            ss_3 = sum(ss * q) / sum(q)
            xi_3 = sum(xi * q) / sum(q)
            xs_3 = sum(xs * q) / sum(q)
            xbh_3 = sum(xbh * q) / sum(q)
            xba_3 = sum(xba * q) / sum(q)
            xp_3 = sum(xp * q) / sum(q)
            so_3 = sum(so * q) / sum(q)
            sno_3 = sum(sno * q) / sum(q)
            snh_3 = sum(snh * q) / sum(q)
            snd_3 = sum(snd * q) / sum(q)
            xnd_3 = sum(xnd * q) / sum(q)
            salk_3 = sum(salk * q) / sum(q)

            """
             List of variables :
                        0=V, 1=Si, 2=Ss, 3=Xi, 4=Xs, 5=Xbh, 6=Xba, 7=Xp, 8=So, 9=Sno, 10=Snh, 11=Snd, 12=Xnd, 13=Salk
                        (ref. BSM1 report Tbl. 1)
            """

            influent_mixed_instant = [0.66, si_3, ss_3, xi_3, xs_3, xbh_3, xba_3, xp_3, so_3, sno_3, snh_3, snd_3,
                                      xnd_3, salk_3]
            influent_var_instant = [si, ss, xi, xs, xbh, xba, xp, so, sno, snh, snd, xnd, salk]

        elif switch == 7:  # High, evening (13~24hr)

            si_m = np.array(
                [30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
                 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30
                 ])
            ss_m = np.array([
                88.37961, 81.2874, 75.7721, 70.37332, 68.27595, 67.03307, 66.76507, 67.07967, 68.08952, 68.72261,
                68.31479, 65.16874, 61.64516, 59.76219, 58.94655, 59.38933, 60.21274, 62.42662, 65.86786, 65.61928,
                64.00353, 59.54469, 58.34064, 57.33857, 58.6902, 60.46908, 63.25004, 62.37225, 62.21689, 62.01492,
                66.41162, 67.18843, 68.47015, 71.88808, 75.64392, 77.44222, 80.08335, 82.60408, 83.83531, 84.21983,
                83.377, 81.99584, 80.14161, 77.75294, 75.6245, 71.87255, 69.45669, 67.49915

            ])
            xi_m = np.array(
                [
                    84.13071429, 80.28414286, 77.06857143, 75.59528571, 69.53914286, 74.65371429, 70.989, 70.73328571,
                    67.836, 62.05642857, 57.04028571, 64.55685714, 60.49571429, 57.14742857, 58.18171429, 50.98471429,
                    48.55142857, 49.035, 47.16485714, 46.52028571, 44.63442857, 43.14114286, 41.92542857, 42.42557143,
                    45.12157143, 44.42414286, 45.24057143, 49.55514286, 48.18842857, 45.95257143, 47.28628571, 46.19,
                    49.68842857, 54.38728571, 55.24171429, 53.34771429, 50.395, 48.577, 62.72, 58.76257143, 58.61842857,
                    58.73971429, 49.65814286, 65.874, 61.58814286, 63.073, 60.55628571, 56.53585714

                ])
            xs_m = np.array(
                [
                    257.848, 262.6298571, 264.1517143, 262.6518571, 262.4, 256.2138571, 254.8904286, 253.9328571,
                    252.8947143, 252.5684286, 248.9338571, 239.2852857, 237.5595714, 237.319, 233.4257143, 232.6871429,
                    228.1955714, 221.1541429, 216.2652857, 212.509, 209.3434286, 206.2972857, 202.5087143, 199.1701429,
                    196.7577143, 197.271, 198.2177143, 197.4982857, 200.1368571, 202.351, 201.6157143, 202.3904286,
                    202.0877143, 202.6738571, 207.4925714, 212.324, 214.9942857, 215.0112857, 209.5072857, 215.379,
                    221.5514286, 224, 227.8102857, 220.4945714, 224.2621429, 228.6921429, 231.7928571, 233.6475714

                ])
            xbh_m = np.array(
                [
                    37.99771429, 38.10157143, 37.91357143, 37.583, 36.88214286, 36.76328571, 36.20871429, 36.07385714,
                    35.63671429, 34.95842857, 33.99714286, 33.76014286, 33.11757143, 32.71857143, 32.40085714, 31.519,
                    30.74971429, 30.02128571, 29.27, 28.781, 28.21971429, 27.71528571, 27.15942857, 26.84414286,
                    26.87557143, 26.85485714, 27.05085714, 27.45028571, 27.59142857, 27.58928571, 27.65585714, 27.62,
                    27.97514286, 28.56242857, 29.19271429, 29.51885714, 29.48785714, 29.28771429, 30.24742857,
                    30.46014286, 31.12985714, 31.41528571, 30.82985714, 31.81842857, 31.76114286, 32.41842857,
                    32.48314286, 32.24257143

                ])
            xba_m = np.array(
                [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
                 ])
            xp_m = np.array(
                [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
                 ])
            so_m = np.array(
                [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
                 ])
            sno_m = np.array(
                [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
                 ])
            snh_m = 1.5*np.array(
                [
                    36.8501, 34.24807, 32.16088, 30.77985, 29.79539, 29.23881, 28.52221, 27.95867, 28.12564, 27.55166,
                    27.4647, 26.45589, 26.1776, 26.28891, 26.78984, 27.29076, 27.12379, 27.42295, 28.33436, 28.2787,
                    27.7082, 26.68548, 26.57068, 26.62286, 27.4647, 28.33436, 29.26664, 30.63027, 30.58853, 28.16043,
                    29.79539, 29.82322, 30.30328, 32.13305, 33.77149, 34.30373, 35.63953, 36.06393, 35.93174, 35.45168,
                    35.69519, 35.62561, 35.37863, 34.9438, 34.14371, 32.70355, 31.46515, 30.68245

                ])
            snd_m = 1.5*np.array([
                8.83796, 8.12874, 7.57721, 7.03733, 6.8276, 6.70331, 6.67651, 6.70797, 6.80895, 6.87226, 6.83148,
                6.51687, 6.16452, 5.97622, 5.89466, 5.93893, 6.02127, 6.24266, 6.58679, 6.56193, 6.40035, 5.95447,
                5.83406, 5.73386, 5.86902, 6.04691, 6.325, 6.23723, 6.22169, 6.20149, 6.64116, 6.71884, 6.84702,
                7.18881, 7.56439, 7.74422, 8.00834, 8.26041, 8.38353, 8.42198, 8.3377, 8.19958, 8.01416, 7.7753,
                7.56245, 7.18726, 6.94567, 6.74992
            ])
            xnd_m = 1.5*np.array(
                [
                    14.285, 14.324, 14.253, 14.12885714, 13.86557143, 13.82085714, 13.61228571, 13.56142857,
                    13.39714286, 13.14242857, 12.781, 12.69185714, 12.45014286, 12.30028571, 12.18071429, 11.84928571,
                    11.56014286, 11.286, 11.00357143, 10.82, 10.60885714, 10.41957143, 10.21028571, 10.09157143,
                    10.10342857, 10.096, 10.16971429, 10.31971429, 10.37285714, 10.37185714, 10.397, 10.38342857,
                    10.517, 10.738, 10.97457143, 11.09728571, 11.08542857, 11.01028571, 11.37128571, 11.45142857,
                    11.70314286, 11.81, 11.59014286, 11.96185714, 11.94042857, 12.18742857, 12.21185714, 12.12128571

                ])
            salk_m = np.array(
                [7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
                 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
                 ])
            q_m = np.array([
                25837, 24434.42857, 23460.57143, 23183.14286, 21537.57143, 23435.57143, 22513.71429, 22524, 21785.71429,
                20117.57143, 18841.71429, 21912.14286, 20802.42857, 19755.28571, 20390.71429, 18081.42857, 17573.42857,
                18296.71429, 18018.28571, 18088.42857, 17634.85714, 17306.28571, 17140.28571, 17623.71429, 18903.57143,
                18585.71429, 18803.71429, 20603.14286, 19821.28571, 18723.71429, 19266, 18838, 20200.71429, 21855,
                21706.57143, 20578.14286, 19279.14286, 18634, 24062.85714, 22179.28571, 21564, 21389.71429, 17987.42857,
                24012.42857, 22299.85714, 22383.71429, 21308, 19839.42857

            ])

            rnd = np.random.randn(48)

            # 각 유입수 성상의 Std. Var. value, assume 10% of mean value
            si_s = 0
            ss_s = 0.1 * ss_m
            xi_s = 0.1 * xi_m
            xs_s = 0.1 * xs_m
            xbh_s = 0.1 * xbh_m
            xba_s = 0
            xp_s = 0
            so_s = 0
            sno_s = 0
            snh_s = 0.1 * snh_m
            snd_s = 0.1 * snd_m
            xnd_s = 0.1 * xnd_m
            salk_s = 0
            q_s = 0.1 * q_m

            rnd = np.random.randn(48)

            si = si_m + si_s * rnd
            ss = ss_m + ss_s * rnd
            xi = xi_m + xi_s * rnd
            xs = xs_m + xs_s * rnd
            xbh = xbh_m + xbh_s * rnd
            xba = xba_m + xba_s * rnd
            xp = xp_m + xp_s * rnd
            so = so_m + so_s * rnd
            sno = sno_m + sno_s * rnd
            snh = snh_m + snh_s * rnd
            snd = snd_m + snd_s * rnd
            xnd = xnd_m + xnd_s * rnd
            salk = salk_m + salk_s * rnd
            q = q_m + q_s * rnd

            si_3 = sum(si * q) / sum(q)
            ss_3 = sum(ss * q) / sum(q)
            xi_3 = sum(xi * q) / sum(q)
            xs_3 = sum(xs * q) / sum(q)
            xbh_3 = sum(xbh * q) / sum(q)
            xba_3 = sum(xba * q) / sum(q)
            xp_3 = sum(xp * q) / sum(q)
            so_3 = sum(so * q) / sum(q)
            sno_3 = sum(sno * q) / sum(q)
            snh_3 = sum(snh * q) / sum(q)
            snd_3 = sum(snd * q) / sum(q)
            xnd_3 = sum(xnd * q) / sum(q)
            salk_3 = sum(salk * q) / sum(q)

            """
             List of variables :
                        0=V, 1=Si, 2=Ss, 3=Xi, 4=Xs, 5=Xbh, 6=Xba, 7=Xp, 8=So, 9=Sno, 10=Snh, 11=Snd, 12=Xnd, 13=Salk
                        (ref. BSM1 report Tbl. 1)
            """

            influent_mixed_instant = [0.66, si_3, ss_3, xi_3, xs_3, xbh_3, xba_3, xp_3, so_3, sno_3, snh_3, snd_3,
                                      xnd_3, salk_3]
            influent_var_instant = [si, ss, xi, xs, xbh, xba, xp, so, sno, snh, snd, xnd, salk]


        influent_mixed = influent_mixed_instant
        influent_var = influent_var_instant




        return switch, influent_mixed , influent_var

"""
# plotting
influent_var_history = np.zeros((10,48))
influent_mixed_history = np.zeros((10,14))
for i in range(10):
    switch, influent_mixed , influent_var = influent.buffer_tank()
    print(switch)
    influent_var_history[i] = influent_var[1]
    influent_mixed_history[i] = influent_mixed
for i in range(10):
    #plt.plot(influent_var_history[i])
    plt.scatter(i,influent_mixed_history[i][2])

"""
Author: SKHEO, KHU #t1,t2: hourly basis. e.g. 0, 12hr #switch = np.random.choice(6,1) # morning (0~12), dry # 각 유입수 성상의 Mean value # 각 유입수 성상의 Std. Var. value, assume 10% of mean value List of variables :
                         0=V, 1=Si, 2=Ss, 3=Xi, 4=Xs, 5=Xbh, 6=Xba, 7=Xp, 8=So, 9=Sno, 10=Snh, 11=Snd, 12=Xnd, 13=Salk
                         (ref. BSM1 report Tbl. 1) # evening, dry (13~24) # 각 유입수 성상의 Std. Var. value, assume 10% of mean value List of variables :
                         0=V, 1=Si, 2=Ss, 3=Xi, 4=Xs, 5=Xbh, 6=Xba, 7=Xp, 8=So, 9=Sno, 10=Snh, 11=Snd, 12=Xnd, 13=Salk
                         (ref. BSM1 report Tbl. 1) # carbon rich, morning (0~12hr) # 각 유입수 성상의 Mean value # 각 유입수 성상의 Std. Var. value, assume 10% of mean value List of variables :
                         0=V, 1=Si, 2=Ss, 3=Xi, 4=Xs, 5=Xbh, 6=Xba, 7=Xp, 8=So, 9=Sno, 10=Snh, 11=Snd, 12=Xnd, 13=Salk
                         (ref. BSM1 report Tbl. 1) # carbon rich, evening (13~24hr) # 각 유입수 성상의 Std. Var. value, assume 10% of mean value List of variables :
                         0=V, 1=Si, 2=Ss, 3=Xi, 4=Xs, 5=Xbh, 6=Xba, 7=Xp, 8=So, 9=Sno, 10=Snh, 11=Snd, 12=Xnd, 13=Salk
                         (ref. BSM1 report Tbl. 1) # High, morning # 각 유입수 성상의 Mean value # 각 유입수 성상의 Std. Var. value, assume 10% of mean value List of variables :
                         0=V, 1=Si, 2=Ss, 3=Xi, 4=Xs, 5=Xbh, 6=Xba, 7=Xp, 8=So, 9=Sno, 10=Snh, 11=Snd, 12=Xnd, 13=Salk
                         (ref. BSM1 report Tbl. 1) # High, evening (13~24hr) # 각 유입수 성상의 Std. Var. value, assume 10% of mean value List of variables :
                         0=V, 1=Si, 2=Ss, 3=Xi, 4=Xs, 5=Xbh, 6=Xba, 7=Xp, 8=So, 9=Sno, 10=Snh, 11=Snd, 12=Xnd, 13=Salk
                         (ref. BSM1 report Tbl. 1) # Nitrogen rich, morning # 각 유입수 성상의 Mean value # 각 유입수 성상의 Std. Var. value, assume 10% of mean value List of variables :
                         0=V, 1=Si, 2=Ss, 3=Xi, 4=Xs, 5=Xbh, 6=Xba, 7=Xp, 8=So, 9=Sno, 10=Snh, 11=Snd, 12=Xnd, 13=Salk
                         (ref. BSM1 report Tbl. 1) # High, evening (13~24hr) # 각 유입수 성상의 Std. Var. value, assume 10% of mean value List of variables :
                         0=V, 1=Si, 2=Ss, 3=Xi, 4=Xs, 5=Xbh, 6=Xba, 7=Xp, 8=So, 9=Sno, 10=Snh, 11=Snd, 12=Xnd, 13=Salk
                         (ref. BSM1 report Tbl. 1) # plotting
 influent_var_history = np.zeros((10,48))
 influent_mixed_history = np.zeros((10,14))
 for i in range(10):
     switch, influent_mixed , influent_var = influent.buffer_tank()
     print(switch)
     influent_var_history[i] = influent_var[1]
     influent_mixed_history[i] = influent_mixed
 for i in range(10):
     #plt.plot(influent_var_history[i])
     plt.scatter(i,influent_mixed_history[i][2])