def flat_rate_PPA():

    myScheduler = mpc.Scheduler('WWHC_flat_rates_PPA.xlsx',
                                'hp_1000_ts_100000')

    pre_calc = myScheduler.pre_calculation()
    myScheduler.moving_horizon(pre_calc)
def pres(name, subname):

    myScheduler = mpc.Scheduler(name, subname)
    myScheduler.first_hour = 24
    myScheduler.total_timesteps = 48

    pre_calc = myScheduler.pre_calculation()
    res = myScheduler.moving_horizon(pre_calc)
    return res
def validation():

    # myScheduler = mpc.Scheduler(
    # 'findhorn - west whins.xlsx', 'hp_14_ts_550')
    myScheduler = mpc.Scheduler('WWHC_MPC_VP.xlsx', 'hp_1000_ts_300000')
    first_hour = 0
    timesteps = 168

    pre_calc = myScheduler.pre_calculation(first_hour, timesteps)
    myScheduler.moving_horizon(pre_calc, first_hour, timesteps)
def test_solver():

    myScheduler = mpc.Scheduler('WWHC_validation.xlsx', 'hp_1000_ts_50000')
    myScheduler.first_hour = 4000
    myScheduler.total_timesteps = 48
    pre_calc = myScheduler.pre_calculation()
    # print pre_calc['surplus'][4515:4539]
    # print pre_calc['max_capacity']

    hour = 0
    first_hour = 4000
    final_hour = 4048
    prev_result = {
        'HPt': 0,
        'EH': 0.0,
        'TSc': 0.0,
        'TSd': 0,
        'final_nodes_temp': [59.9, 53.4, 47.8, 43.5, 41.0],
        'HPtrs': 0,
        'HPtrd': 0,
        'import_cost': 200
    }
    myScheduler.solve(pre_calc, hour, first_hour, final_hour, prev_result)
Пример #5
0
# run controller and outputs for all combinations
for i in range(num_combos):

    # combo to be run
    subname = combinations[i]

    if controller == 'Fixed order control':
        # run fixed order controller
        print('Running fixed order controller...')
        fixed_order.FixedOrder(name,
                               subname).run_timesteps(first_hour, timesteps)

    elif controller == 'Model predictive control':
        # run mpc controller
        print('Running model predictive controller...')
        myScheduler = mpc.Scheduler(name, subname)
        pre_calc = myScheduler.pre_calculation(first_hour, timesteps)
        myScheduler.moving_horizon(pre_calc, first_hour, timesteps)

    else:
        raise Exception('Unsuitable controller chosen...')

    print('Running output analysis...')
    # run output analysis
    outputs.run_plots(name, subname)

tx = time.time()
outputs.run_KPIs(name)
ty = time.time()
tot_time = (ty - tx)
print('Time taken for running KPIs: ', round(tot_time, 2), 'seconds')
def test_smallest_TS():

    myScheduler = mpc.Scheduler('WWHC.xlsx', 'hp_1000_ts_100')

    pre_calc = myScheduler.pre_calculation()
    myScheduler.moving_horizon(pre_calc)
def tou():

    myScheduler = mpc.Scheduler('WWHC_tou.xlsx', 'hp_1000_ts_100000')

    pre_calc = myScheduler.pre_calculation()
    myScheduler.moving_horizon(pre_calc)