nothing
This commit is contained in:
parent
b9119fdb29
commit
438dbe5bf6
|
@ -133,7 +133,7 @@ def plot_evaluation_information(datasource, directory):
|
|||
axs[1, 1].cla()
|
||||
axs[1, 1].set_ylabel('Costs')
|
||||
axs[1, 1].bar(eval_data['time_step'], eval_data['operation_cost'])
|
||||
fig.savefig(f"{directory}/Evoluation Information.svg", format='svg', dpi=600, bbox_inches='tight')
|
||||
fig.savefig(f"{directory}/evaluation_information.svg", format='svg', dpi=600, bbox_inches='tight')
|
||||
print('evaluation figure have been plot and saved')
|
||||
|
||||
|
||||
|
|
12
tools.py
12
tools.py
|
@ -43,6 +43,8 @@ def optimization_base_result(env, month, day, initial_soc):
|
|||
NUM_GEN = len(DG_parameters.keys())
|
||||
battery_capacity = env.battery.capacity
|
||||
battery_efficiency = env.battery.efficiency
|
||||
solar_cofficient = env.solar.opex_cofficient
|
||||
wind_cofficient = env.wind.opex_cofficient
|
||||
|
||||
m = gp.Model("UC")
|
||||
|
||||
|
@ -82,8 +84,10 @@ def optimization_base_result(env, month, day, initial_soc):
|
|||
t in range(period) for g in range(NUM_GEN))
|
||||
cost_grid_import = gp.quicksum(grid_energy_import[t] * price[t] for t in range(period))
|
||||
cost_grid_export = gp.quicksum(grid_energy_export[t] * price[t] * env.sell_coefficient for t in range(period))
|
||||
cost_solar = gp.quicksum(pv[t] * solar_cofficient for t in range(period))
|
||||
cost_wind = gp.quicksum(wind[t] * wind_cofficient for t in range(period))
|
||||
|
||||
m.setObjective((cost_gen + cost_grid_import - cost_grid_export), GRB.MINIMIZE)
|
||||
m.setObjective((cost_gen + cost_grid_import - cost_grid_export + cost_solar + cost_wind), GRB.MINIMIZE)
|
||||
m.optimize()
|
||||
|
||||
output_record = {'pv': [], 'wind': [], 'price': [], 'load': [], 'netload': [],
|
||||
|
@ -95,11 +99,13 @@ def optimization_base_result(env, month, day, initial_soc):
|
|||
for g in range(NUM_GEN))
|
||||
grid_import_cost = grid_energy_import[t].x * price[t]
|
||||
grid_export_cost = grid_energy_export[t].x * price[t] * env.sell_coefficient
|
||||
solar_cost = pv[t] * solar_cofficient
|
||||
wind_cost = wind[t] * wind_cofficient
|
||||
output_record['pv'].append(pv[t])
|
||||
output_record['wind'].append(wind[t])
|
||||
output_record['price'].append(price[t])
|
||||
output_record['load'].append(load[t])
|
||||
output_record['netload'].append(load[t] - pv[t])
|
||||
output_record['netload'].append(load[t] - pv[t] - wind[t])
|
||||
output_record['soc'].append(soc[t].x)
|
||||
output_record['battery_energy_change'].append(battery_energy_change[t].x)
|
||||
output_record['grid_import'].append(grid_energy_import[t].x)
|
||||
|
@ -107,7 +113,7 @@ def optimization_base_result(env, month, day, initial_soc):
|
|||
output_record['gen1'].append(gen_output[0, t].x)
|
||||
output_record['gen2'].append(gen_output[1, t].x)
|
||||
output_record['gen3'].append(gen_output[2, t].x)
|
||||
output_record['step_cost'].append(gen_cost + grid_import_cost - grid_export_cost)
|
||||
output_record['step_cost'].append(gen_cost + grid_import_cost - grid_export_cost + solar_cost + wind_cost)
|
||||
output_record_df = pd.DataFrame.from_dict(output_record)
|
||||
return output_record_df
|
||||
|
||||
|
|
Loading…
Reference in New Issue