Пример #1
0
def setup_boiler(boiler_num=1):
    name_str = 'Boiler' + str(boiler_num)
    op = Output(capacity=np.array([
        0, 0.250000000000000, 0.500000000000000, 0.700000000000000,
        0.760000000000000, 0.800000000000000, 0.840000000000000,
        0.880000000000000, 0.920000000000000, 0.960000000000000, 1
    ]),
                heat=np.ones(11))
    ss = StateSpace(a=np.matrix('0,1; -8.7249e-9, -1.8681e-4'),
                    b=np.matrix('0; 8.7249e-9'),
                    c=np.matrix('1,0'),
                    d=np.matrix('0'))
    stu = Startup(time=np.array([0, 10]),
                  heat=np.array([0, 2]),
                  input=np.array([0, 2]))
    shd = Shutdown(time=np.array([0, 1000]),
                   heat=np.array([200, 0]),
                   input=np.array([200, 0]))

    boiler = Heater(name=name_str,
                    size=20000,
                    output=op,
                    state_space=ss,
                    startup=stu,
                    shutdown=shd,
                    start_cost=0,
                    ramp_rate=1.3333e3)
    return boiler
Пример #2
0
def setup_diesel_gen():
    op = Output(capacity=np.array([
        0, 0.0440436111111194, 0.0959544444443891, 0.274149999999907,
        1.00805555555550, 1.13232999999996
    ]),
                electricity=np.array([
                    0, 0.0386165028943384, 0.0640837968864363,
                    0.276878400371175, 0.429227220146803, 0.567247108410006
                ]))
    ss = StateSpace(a=np.matrix('0,1; -1.924e-6, -0.0028'),
                    b=np.matrix('0; 1.9240e-6'),
                    c=np.matrix('1,0'),
                    d=np.matrix('0'))
    stu = Startup(time=np.array([0, 1000]),
                  electricity=np.array([0, 333.3333]),
                  input=np.array([0, 1.2979e3]))
    shd = Shutdown(time=np.array([0, 1000]),
                   electricity=np.array([333.3333, 0]),
                   input=np.array([1.2979e3, 0]))
    start_cost = 66.6667
    dx_dt = 666.6692
    gen = ElectricGenerator(name='Gen3',
                            source='diesel',
                            size=1000,
                            output=op,
                            state_space=ss,
                            startup=stu,
                            shutdown=shd,
                            start_cost=start_cost,
                            ramp_rate=dx_dt)
    return gen
Пример #3
0
 def __init__(self, **kwargs):
     super().__init__(**kwargs)
     self.set_attrs(
         name='heater',
         source='ng',
         state_space=StateSpace(),
         startup=Startup(),
         shutdown=Shutdown(),
     )
     self.set_attrs(**kwargs)
Пример #4
0
 def __init__(self, **kwargs):
     super().__init__(**kwargs)
     self.set_attrs(
         name='chiller',
         state_space=StateSpace(),
         startup=Startup(),
         shutdown=Shutdown(),
         start_cost=0,  # [$]
         ramp_rate=0,  # [kW/hr]
     )
     self.set_attrs(**kwargs)
Пример #5
0
 def __init__(self, **kwargs):
     super().__init__(**kwargs)
     self.set_attrs(
         name='combined heat power',
         source='ng',
         state_space=StateSpace(),
         startup=Startup(),
         shutdown=Shutdown(),
         comm=Comm(),
         measure=Measure(),
         start_cost=0,
         restart_time=0,
         ramp_rate=0,
     )
     self.set_attrs(**kwargs)
Пример #6
0
def setup_chiller(name_str):
    wb = xlrd.open_workbook('instance\chiller_capacity_output.xlsx')
    sheet = wb.sheet_by_index(0)
    cap = []
    cooling = []
    if name_str == 'Carrier Chiller1':
        chiller_size = 7.279884675000000e+03
        dx_dt = 4.8533e3
        ss = StateSpace(a=np.matrix('0,1; -1.9997e-7, -0.1278'),
                        b=np.matrix('0; 1.9997e-7'),
                        c=np.matrix('1,0'),
                        d=np.matrix('0'))
        stu = Startup(time=np.array([0, 0.1000]),
                      cooling=np.array([0, 36.3994]),
                      input=np.array([0, 0.0050]))
        shd = Shutdown(time=np.array([0, 1000]),
                       cooling=np.array([3.6399e3, 0]),
                       input=np.array([0.4999, 0]))
        for i in range(2, 482):
            cap.append(sheet.cell_value(i, 0))
            cooling.append(sheet.cell_value(i, 1))
    elif name_str[:-1] == 'York Chiller':
        chiller_size = 5.268245045000001e+03
        dx_dt = 3.5122e3
        ss = StateSpace(a=np.matrix('0, 1; -3.8187e-7, -0.1767'),
                        b=np.matrix('0; 3.8187e-7'),
                        c=np.matrix('1,0'),
                        d=np.matrix('0'))
        stu = Startup(time=np.array([0, 10]),
                      cooling=np.array([0, 26.3764]),
                      input=np.array([0, 0.005]))
        shd = Shutdown(time=np.array([0, 1000]),
                       cooling=np.array([2.6376e3, 0]),
                       input=np.array([0.4998, 0]))
        for i in range(2, 129):
            cap.append(sheet.cell_value(i, 2))
            cooling.append(sheet.cell_value(i, 3))
    elif name_str == 'Carrier Chiller2' or name_str == 'Carrier Chiller3':
        chiller_size = 4.853256450000000e+03
        dx_dt = 3.2355e3
        ss = StateSpace(a=np.matrix('0,1; -4.4997e-7, -0.1918'),
                        b=np.matrix('0; 4.4997e-7'),
                        c=np.matrix('1,0'),
                        d=np.matrix('0'))
        stu = Startup(time=np.array([0, 10]),
                      cooling=np.array([0, 24.2663]),
                      input=np.array([0, 0.005]))
        shd = Shutdown(time=np.array([0, 1000]),
                       cooling=np.array([2.4266e3, 0]),
                       input=np.array([0.4997, 0]))
        for i in range(2, 423):
            cap.append(sheet.cell_value(i, 10))
            cooling.append(sheet.cell_value(i, 11))
    elif name_str == 'Carrier Chiller7' or name_str == 'Carrier Chiller8':
        chiller_size = 5.275278750000000e+03
        dx_dt = 3.5169e3
        ss = StateSpace(a=np.matrix('0,1; -3.8085e-7, -0.1764'),
                        b=np.matrix('0; 3.8085e-7'),
                        c=np.matrix('1,0'),
                        d=np.matrix('0'))
        stu = Startup(time=np.array([0, 10]),
                      cooling=np.array([0, 26.3764]),
                      input=np.array([0, 0.005]))
        shd = Shutdown(time=np.array([0, 1000]),
                       cooling=np.array([2.6376e3, 0]),
                       input=np.array([0.4998, 0]))
        for i in range(2, 663):
            cap.append(sheet.cell_value(i, 6))
            cooling.append(sheet.cell_value(i, 7))
    elif name_str == 'Carrier Chiller4':
        chiller_size = 1.758426250000000e+03
        dx_dt = 1.1723e3
        ss = StateSpace(a=np.matrix('0, 1; -3.4289e-6, -0.5294'),
                        b=np.matrix('0; 3.4289e-6'),
                        c=np.matrix('1,0'),
                        d=np.matrix('0'))
        stu = Startup(time=np.array([0, 10]),
                      cooling=np.array([0, 8.7921]),
                      input=np.array([0, 0.005]))
        shd = Shutdown(time=np.array([0, 1000]),
                       cooling=np.array([879.2131, 0]),
                       input=np.array([0.4995, 0]))
        for i in range(2, 7):
            cap.append(sheet.cell_value(i, 14))
            cooling.append(sheet.cell_value(i, 15))
    else:  #if it is the trane chiller
        chiller_size = 1.415462794200000e+03
        dx_dt = 943.6419
        ss = StateSpace(a=np.matrix('0, 1; -5.2926e-6, -0.6577'),
                        b=np.matrix('0; 5.2926e-6'),
                        c=np.matrix('1,0'),
                        d=np.matrix('0'))
        stu = Startup(time=np.array([0, 10]),
                      cooling=np.array([0, 7.0773]),
                      input=np.array([0, 0.005]))
        shd = Shutdown(time=np.array([0, 1000]),
                       cooling=np.array([707.7314, 0]),
                       input=np.array([0.4996, 0]))
        for i in range(2, 168):
            cap.append(sheet.cell_value(i, 16))
            cooling.append(sheet.cell_value(i, 17))
    op = Output(capacity=np.array(cap), cooling=np.array(cooling))
    chiller = ElectricChiller(name=name_str,
                              size=chiller_size,
                              output=op,
                              state_space=ss,
                              startup=stu,
                              shutdown=shd,
                              start_cost=0,
                              ramp_rate=dx_dt,
                              source='electricity')
    return chiller
Пример #7
0
def setup_mgt(n_gt=1):
    cap1 = np.array([
        0, 0.00110499999998137, 0.00361777777760290, 0.385651944444515,
        0.388592222222127, 0.431189166666474, 0.484720833333675,
        0.491660000000149, 0.505131388888694, 0.586546944444534,
        0.621058055555681, 1.05868694444420, 1.06167222222197,
        1.07020861111116, 1.07115888888901
    ])
    cap2 = np.array([
        0, 0.000956666666781530, 0.00366805555578321, 0.388506666666362,
        0.396046111111296, 0.438080833333079, 0.493104722222313,
        0.497185555555392, 0.515001388888806, 0.590879722222220,
        0.629853611110942, 1.07497166666691, 1.07684916666662,
        1.08608277777792, 1.08781305555580
    ])
    elec1 = np.array([
        0, 0.686800696496086, 0.510127443690416, 0.309220510095308,
        0.312715841910826, 0.306017287041821, 0.362823346550335,
        0.353123964797020, 0.315108043596381, 0.368046107155067,
        0.358760399187536, 0.344788257890904, 0.343248719213812,
        0.343656819850057, 0.344227297586808
    ])
    elec2 = np.array([
        0, 0.459853195951741, 0.428405275836534, 0.316385631927067,
        0.313322663749180, 0.312953937427671, 0.362498468567169,
        0.364462640163305, 0.313690064224268, 0.365898726735581,
        0.358972505189864, 0.347214900723712, 0.353977200593419,
        0.349119253281163, 0.348170539023118
    ])
    heat = np.ones((15)) * 0.5
    if n_gt == 1:
        out = Output(capacity=cap1, electricity=elec1, heat=heat)
    else:
        out = Output(capacity=cap2, electricity=elec2, heat=heat)

    ss = StateSpace(a=np.matrix('0,1; -0.3085, -225.8605'),
                    b=np.matrix('0,0.3085'),
                    c=np.matrix('1,0'),
                    d=np.matrix('0'))
    startup1 = Startup(time=np.array([0, 0.1]),
                       electricity=np.array([0, 0.129387]),
                       input=np.array([0, 0.548259]),
                       heat=np.array([0, 0.271938]))
    startup2 = Startup(time=np.array([0, 10]),
                       electricity=np.array([0, 12.9387]),
                       input=np.array([0, 54.8259]),
                       heat=np.array([0, 27.1938]))
    shutdown = Shutdown(time=np.array([0, 1000]),
                        electricity=np.array([1.2939e3, 0]),
                        input=np.array([5.4826e3, 0]),
                        heat=np.array([2.7194e3, 0]))
    #comm = Comm(on_off = 51700, set = 51100),
    #measure = Measure(on_off = 32300, input = 31200, electric=31100, thermal =31300),
    mgt = MicroTurbine(name='GT1',
                       output=out,
                       size=5000,
                       startup=startup1,
                       shutdown=shutdown,
                       start_cost=323.4671,
                       restart_time=15,
                       ramp_rate=1.3344e3)
    if n_gt == 2:
        mgt.name = 'GWSPE'
        mgt.size = 43750
        mgt.startup = startup2
    elif n_gt == 3:
        mgt.name = 'GWSPB'
        mgt.size = 2750
    elif n_gt == 4:
        mgt.name = 'GWSPA'
        mgt.size = 2750
    return mgt