Commit 6447eee5 authored by jumu's avatar jumu
Browse files

Merge branch 'run_server' into 'master'

Run server

See merge request kdas/hydesign!3
parents 93d26f70 45f3383a
Pipeline #20071 failed with stages
in 48 seconds
......@@ -48,3 +48,8 @@ docs/_build
# pytest
.pytest_cache/
# pycache
__pycache__*
*.pyc
tests/__pycache__/*
This diff is collapsed.
import pkg_resources
__author__ = "Kaushik Das"
__email__ = "kdas at dtu dot dk"
__credits__ = "DTU Wind"
__version__ = pkg_resources.require(__package__)[0].version
__version__ = "0.1.0"
# import pkg_resources
#
# __author__ = "Kaushik Das"
# __email__ = "kdas at dtu dot dk"
# __credits__ = "DTU Wind"
#
#__version__ = pkg_resources.require(__package__)[0].version
......@@ -7,79 +7,254 @@ Created on Sun Nov 10 12:05:52 2019
# -*- coding: utf-8 -*-
from parameters_Simulation import *
from parameters_hpp import *
import pandas as pd
import numpy as np
from HyDesign import hpp
from HyDesign.sizing import HPP, read_csv_Data
if __name__ == "__main__":
ExampleHPP=hpp(
hpp_grid_connection,
hpp_land_area_available,
wind_rating_WT,
wind_nWT_per_string,
wind_lifetime_WT,
wind_rotor_diameter,
wind_hub_height,
wind_turbine_spacing,
wind_turbine_row_spacing,
solar_lifetime_PV
)
[wind_power_t, solar_power_t, spot_price_t] = ExampleHPP.load_Exogenous_Data_Sizing()
wind_power_t = wind_power_t.loc[start_date:end_date,'Pwind']/100
solar_power_t = solar_power_t.loc[start_date:end_date,'Psolar']/100
spot_price_t = spot_price_t.loc[start_date:end_date,'Price']
capacity_factor_wind = ExampleHPP.calculate_Capacity_Factor(wind_power_t, 1)
capacity_factor_solar = ExampleHPP.calculate_Capacity_Factor(solar_power_t, 1)
# =============================================================================
# # Alessandra's data
# =============================================================================
input_wind_ts_filename = './Data/aveW.csv'
input_solar_ts_filename = './Data/aveS.csv'
input_price_ts_filename = './Data/PriceProfilePPA.csv'
start_date = pd.to_datetime('2018-09-01 00:00')
end_date = pd.to_datetime("2019-08-31 23:00")
timeFormat_wind = "%d/%m/%Y %H:%M"
timeFormat_solar = "%d/%m/%Y %H:%M"
timeFormat_price = '%d/%m/%Y %H:%M'
timename = 'Time'
timeZone_wind = 'Asia/Kolkata'
timeZone_solar = 'Asia/Kolkata'
timeZone_price = 'Asia/Kolkata'
timeZone_analysis = 'Asia/Kolkata'
# inputs
# Alessandra's data
parameter_dict = {
# hpp parameters
'hpp_grid_connection': 300, # in MW
'hpp_land_area_available': 100, # in square km
'hpp_lifetime': 25, # [years]
'hpp_discount_factor': 0.07,
'hpp_BOS_soft_cost': 119940, # [Eur/MW]
'hpp_grid_connection_cost': 37074, # [Eur/MW]
# hpp wind parameters
'wind_rating_WT': 2.1,
'wind_nWT_per_string': 20,
'wind_lifetime_WT': 30,
'wind_rotor_diameter': 97, # in m
'wind_hub_height': 120, # in m
'wind_turbine_spacing': 5, # in terms of Rotor Diameter
'wind_turbine_row_spacing': 10, # in terms of Rotor Diameter
'wind_turbine_cost': 851000, # [EUR/MW]
'wind_civil_works_cost': 116986, # [Eur/MW]
'wind_fixed_onm_cost': 12805, # Wind fixed O&M cost per year [Eur/MW]
# hpp solar parameters
'solar_lifetime_PV': 30,
'solar_PV_cost': 219000, # [EUR/MW]
'solar_hardware_installation_cost': 241854, # [Eur/MW]
'solar_fixed_onm_cost': 8149, # Solar O&M cost per year [Eur/MW]
# hpp battery parameters
'battery_energy_cost': 181596, # Eur/MWh
'battery_power_cost': 64190, # Power conversion system cost[Eur/MW]
# Electric Balance of Plant, installation, commissioning cost [Eur/MW]
'battery_BOP_installation_commissioning_cost': 73360,
# Grid management control system cost[Eur/MW]
'battery_control_system_cost': 18340,
# Battery energy capacity maintenance cost [Eur/MWh] per year
'battery_energy_onm_cost': 10000,
'battery_depth_of_discharge': 0.9,
}
simulation_dict = {
'wind_as_component': 1,
'solar_as_component': 1,
'battery_as_component': 1,
}
ExampleHPP = HPP(
parameter_dict=parameter_dict,
simulation_dict=simulation_dict,
)
wind_power_t = read_csv_Data(
input_wind_ts_filename,
timename,
timeFormat_wind,
timeZone_wind,
timeZone_analysis,
)
solar_power_t = read_csv_Data(
input_solar_ts_filename,
timename,
timeFormat_solar,
timeZone_solar,
timeZone_analysis,
)
spot_price_t = read_csv_Data(
input_price_ts_filename,
timename,
timeFormat_price,
timeZone_price,
timeZone_analysis,
)
wind_power_t = wind_power_t.loc[start_date:end_date, 'Pwind'] / 100
solar_power_t = solar_power_t.loc[start_date:end_date, 'Psolar'] / 100
spot_price_t = spot_price_t.loc[start_date:end_date, 'Price']
capacity_factor_wind = ExampleHPP.calculate_Capacity_Factor(
wind_power_t, 1)
capacity_factor_solar = ExampleHPP.calculate_Capacity_Factor(
solar_power_t, 1)
# %% -----------------------------------------------
# Optimize the sizing of HPP (wind and solar)
# --------------------------------------------------
[hpp_wind_capacity, hpp_solar_capacity, P_HPP_t,
P_curtailment_t, hpp_investment_cost, hpp_maintenance_cost,
LCOE, NPV, IRR] = ExampleHPP.sizing_Wind_Solar(
wind_power_t, solar_power_t, spot_price_t)
# %%
AEP = P_HPP_t.mean() * 8760 / 1000
Curtailed_Energy = P_curtailment_t.sum() / 1000
# print("\033[H\033[J")
print()
print('Wind Capacity = %d MW' % hpp_wind_capacity)
print('Solar Capacity = %d MW' % hpp_solar_capacity)
print('AEP = %.0f GWh' % AEP)
print('Curtailed Energy = %.0f GWh' % Curtailed_Energy)
print('HPP Investment Cost = %.0f MEUR' % (hpp_investment_cost / 1e6))
print('HPP Maintenance Cost = %.0f MEUR' %
(hpp_maintenance_cost.sum() / 1e6))
print('HPP LCOE = %.2f EUR/MWh' % LCOE)
print('HPP NPV= %.0f MEUR' % (NPV / 1000000))
print('HPP IRR = %.0f%%' % (IRR * 100))
# %% -----------------------------------------------
# Eval a non-optimal HPP (wind and solar)
# --------------------------------------------------
[hpp_wind_capacity, hpp_solar_capacity, P_HPP_t,
P_curtailment_t, hpp_investment_cost, hpp_maintenance_cost,
LCOE, NPV, IRR] = ExampleHPP.eval_Wind_Solar(
wind_power_t, solar_power_t, spot_price_t,
Wind_MW=200, Solar_MW=300)
# %%
[hpp_wind_capacity, hpp_solar_capacity, P_HPP_t, P_curtailment_t, hpp_investment_cost, hpp_maintenance_cost, LCOE, NPV, IRR] = ExampleHPP.sizing_Wind_Solar(wind_power_t, solar_power_t, spot_price_t)
# %%
AEP = P_HPP_t.mean() * 8760 / 1000
Curtailed_Energy = P_curtailment_t.sum() / 1000
# print("\033[H\033[J")
print()
print('Wind Capacity = %d MW' % hpp_wind_capacity)
print('Solar Capacity = %d MW' % hpp_solar_capacity)
print('AEP = %.0f GWh' % AEP)
print('Curtailed Energy = %.0f GWh' % Curtailed_Energy)
print('HPP Investment Cost = %.0f MEUR' % (hpp_investment_cost / 1e6))
print('HPP Maintenance Cost = %.0f MEUR' %
(hpp_maintenance_cost.sum() / 1e6))
print('HPP LCOE = %.2f EUR/MWh' % LCOE)
print('HPP NPV= %.0f MEUR' % (NPV / 1000000))
print('HPP IRR = %.0f%%' % (IRR * 100))
AEP = P_HPP_t.sum()/len(P_HPP_t)*8760/1000
Curtailed_Energy = P_curtailment_t.sum()/1000
print("\033[H\033[J")
# %% --------------------------------------------------
# Optimize the sizing of HPP (wind, solar and battery)
# -----------------------------------------------------
[hpp_wind_capacity,
hpp_solar_capacity,
hpp_battery_power_rating,
hpp_battery_energy_capacity,
P_RES_available_t,
P_HPP_t,
P_curtailment_t,
P_charge_discharge_t,
E_SOC_t,
hpp_investment_cost,
hpp_maintenance_cost,
LCOE,
NPV,
IRR] = ExampleHPP.sizing_Wind_Solar_Battery(wind_power_t,
solar_power_t,
spot_price_t)
# %%
AEP = P_HPP_t.mean() * 8760 / 1000
Curtailed_Energy = P_curtailment_t.sum() / 1000
# print("\033[H\033[J")
print()
print('Wind Capacity = %d MW' % hpp_wind_capacity)
print('Solar Capacity = %d MW' % hpp_solar_capacity)
print('Battery Storage Power Rating = %d MW' % hpp_battery_power_rating)
print(
'Battery Storage Energy Rating = %d MWh' %
hpp_battery_energy_capacity)
print('AEP = %.0f GWh' % AEP)
print('Curtailed Energy = %.0f GWh' % Curtailed_Energy)
print('HPP Investment Cost = %.0f MEUR' % (hpp_investment_cost/1e6))
print('HPP Maintenance Cost = %.0f MEUR' % (hpp_maintenance_cost.sum()/1e6))
print('HPP Investment Cost = %.0f MEUR' % (hpp_investment_cost / 1e6))
print('HPP Maintenance Cost = %.0f MEUR' %
(hpp_maintenance_cost.sum() / 1e6))
print('HPP LCOE = %.2f EUR/MWh' % LCOE)
print('HPP NPV= %.0f MEUR' % (NPV/1000000))
print('HPP IRR = %.0f%%' % (IRR*100))
print('HPP NPV= %.0f MEUR' % (NPV / 1000000))
print('HPP IRR = %.0f%%' % (IRR * 100))
# %% --------------------------------------------------
# Eval a HPP (wind, solar and battery)
# -----------------------------------------------------
[hpp_wind_capacity,
hpp_solar_capacity,
hpp_battery_power_rating,
hpp_battery_energy_capacity,
P_RES_available_t,
P_HPP_t,
P_curtailment_t,
P_charge_discharge_t,
E_SOC_t,
hpp_investment_cost,
hpp_maintenance_cost,
LCOE,
NPV,
IRR] = ExampleHPP.eval_Wind_Solar_Battery(
wind_power_t,
solar_power_t,
spot_price_t,
Wind_MW=200,
Solar_MW=300,
P_batt_MW=100,
E_batt_MWh=300
)
# %%
[hpp_wind_capacity, hpp_solar_capacity, hpp_battery_power_rating, hpp_battery_energy_capacity, P_RES_available_t, P_HPP_t, P_curtailment_t, P_charge_discharge_t, E_SOC_t, hpp_investment_cost, hpp_maintenance_cost, LCOE, NPV, IRR] = ExampleHPP.sizing_Wind_Solar_Battery(wind_power_t, solar_power_t, spot_price_t)
# %%
AEP = P_HPP_t.sum()/len(P_HPP_t)*8760/1000
Curtailed_Energy = P_curtailment_t.sum()/1000
print("\033[H\033[J")
AEP = P_HPP_t.mean() * 8760 / 1000
Curtailed_Energy = P_curtailment_t.sum() / 1000
# print("\033[H\033[J")
print()
print('Wind Capacity = %d MW' % hpp_wind_capacity)
print('Solar Capacity = %d MW' % hpp_solar_capacity)
print('Battery Storage Power Rating = %d MW' % hpp_battery_power_rating)
print('Battery Storage Energy Rating = %d MWh' % hpp_battery_energy_capacity)
print(
'Battery Storage Energy Rating = %d MWh' %
hpp_battery_energy_capacity)
print('AEP = %.0f GWh' % AEP)
print('Curtailed Energy = %.0f GWh' % Curtailed_Energy)
print('HPP Investment Cost = %.0f MEUR' % (hpp_investment_cost/1e6))
print('HPP Maintenance Cost = %.0f MEUR' % (hpp_maintenance_cost.sum()/1e6))
print('HPP Investment Cost = %.0f MEUR' % (hpp_investment_cost / 1e6))
print('HPP Maintenance Cost = %.0f MEUR' %
(hpp_maintenance_cost.sum() / 1e6))
print('HPP LCOE = %.2f EUR/MWh' % LCOE)
print('HPP NPV= %.0f MEUR' % (NPV/1000000))
print('HPP IRR = %.0f%%' % (IRR*100))
print('HPP NPV= %.0f MEUR' % (NPV / 1000000))
print('HPP IRR = %.0f%%' % (IRR * 100))
# -*- coding: utf-8 -*-
"""
Created on Sun Jun 14 17:51:53 2020
@author: kdas
"""
import pandas as pd
# =============================================================================
# # Alessandra's data
# =============================================================================
CorRES_simulation = 0
sizing_simulation = 1
EMS_simulation = 0
wind_as_component = 1
solar_as_component = 1
battery_as_component = 1
input_dir_ts = r'Data' #r'C:\Users\kdas\OneDrive - Danmarks Tekniske Universitet\Work\Hybrid Power Plant\HyDesign\hydesign\HyDesign\Alessandra code\Hand in\Data'
#input_wind_ts_filename = r'\Wind\wind_pow.csv'
input_wind_ts_filename = r'\aveW.csv'
#input_solar_ts_filename = r'\Solar\solar_pow.csv'
input_solar_ts_filename = r'\aveS.csv'
#input_price_ts_filename = r'\Market\spot_2014_2016.csv'
input_price_ts_filename = r'\PriceProfilePPA.csv'
#start_date = pd.to_datetime("2016-01-01 00:00:00")
start_date=pd.to_datetime('2018-09-01 00:00')
#end_date = pd.to_datetime("2016-12-31 23:00:00")
end_date = pd.to_datetime("2019-08-31 23:00")
wind_zone = "DK2_wind"
solar_zone = "DK2_solar"
market_zone = "DK2"
#timeFormat_wind = "%d/%m/%Y %H:%M:%S"
timeFormat_wind = "%d/%m/%Y %H:%M"
#timeFormat_solar = "%d/%m/%Y %H:%M:%S"
timeFormat_solar = "%d/%m/%Y %H:%M"
#timeFormat_price = '%Y/%m/%d %H:%M:%S'
timeFormat_price = '%d/%m/%Y %H:%M'
timename ='Time'
#timeZone_wind = "UTC"
timeZone_wind = "IST"
#timeZone_solar = "UTC"
timeZone_solar = "IST"
#timeZone_price = "CET"
timeZone_price = "IST"
# =============================================================================
# =============================================================================
# Anatole's data
# =============================================================================
# CorRES_simulation = 1
# sizing_simulation = 1
# EMS_simulation = 0
# wind_as_component = 1
# solar_as_component = 1
# storage_as_component = 1
# input_dir_ts = r'C:\Users\kdas\OneDrive - Danmarks Tekniske Universitet\Work\Hybrid Power Plant\Data'
# #input_wind_ts_filename = r'\Wind\wind_pow.csv'
# input_wind_ts_filename = r'\Wind\Wind_Forecast_dataseed1\power_groups.csv'
# #input_price_ts_filename = r'\Market\spot_2014_2016.csv'
# input_price_ts_filename = r'\PriceProfilePPA.csv'
# #start_date = pd.to_datetime("2016-01-01 00:00:00")
# start_date=pd.to_datetime('2018-09-01 00:00')
# #end_date = pd.to_datetime("2016-12-31 23:00:00")
# end_date = pd.to_datetime("2019-08-31 23:00")
# wind_zone = "DK2_wind"
# solar_zone = "DK2_solar"
# market_zone = "DK2"
# #timeFormat_wind = "%d/%m/%Y %H:%M:%S"
# timeFormat_wind = "%d/%m/%Y %H:%M"
# #timeFormat_solar = "%d/%m/%Y %H:%M:%S"
# timeFormat_solar = "%d/%m/%Y %H:%M"
# #timeFormat_price = '%Y/%m/%d %H:%M:%S'
# timeFormat_price = '%d/%m/%Y %H:%M'
# timename ='Time'
# #timeZone_wind = "UTC"
# timeZone_wind = "IST"
# #timeZone_solar = "UTC"
# timeZone_solar = "IST"
# #timeZone_price = "CET"
# timeZone_price = "IST"
# =============================================================================
\ No newline at end of file
# -*- coding: utf-8 -*-
"""
Created on Sun Jun 14 18:22:37 2020
@author: kdas
"""
# Alessandra's data
#hpp parameters
hpp_grid_connection = 300 # in MW
hpp_land_area_available = 100 # in square km
# hpp_BOS_soft_cost = 119940 #[Eur/MW]
# hpp_grid_connection_cost = 37074 #[Eur/MW]
hpp_lifetime = 25 # [years]
hpp_discount_factor = 0.07
#hpp wind parameters
wind_rating_WT = 2.1
wind_nWT_per_string = 20
wind_lifetime_WT = 30
wind_rotor_diameter = 97 # in m
wind_hub_height = 120 # in m
wind_turbine_spacing = 5 # in terms of Rotor Diameter
wind_turbine_row_spacing = 10 # in terms of Rotor Diameter
# wind_turbine_cost = 851000 # [EUR/MW]
# wind_civil_works_cost = 116986 #[Eur/MW]
# wind_fixed_onm_cost = 12805 #Wind fixed O&M cost per year [Eur/MW]
#hpp solar parameters
solar_lifetime_PV = 30
# solar_PV_cost = 219000 # [EUR/MW]
# solar_hardware_installation_cost = 241854 #[Eur/MW]
# solar_fixed_onm_cost = 8149 #Solar O&M cost per year [Eur/MW]
#hpp battery parameters
hpp_BOS_soft_cost = 119940 #[Eur/MW]
hpp_grid_connection_cost = 37074 #[Eur/MW]
wind_turbine_cost = 851000 # [EUR/MW]
wind_civil_works_cost = 116986 #[Eur/MW]
wind_fixed_onm_cost = 12805 #Wind fixed O&M cost per year [Eur/MW]
solar_PV_cost = 219000 # [EUR/MW]
solar_hardware_installation_cost = 241854 #[Eur/MW]
solar_fixed_onm_cost = 8149 #Solar O&M cost per year [Eur/MW]
battery_energy_cost = 181596 #163436 272394Eur/MWh
battery_power_cost = 64190 # 64190-64190*0.1 64190*1.6Power conversion system cost[Eur/MW]
battery_BOP_installation_commissioning_cost = 73360 #73360-73360*0.1# 73360-73360*0.1 73360*1.6Electric Balance of Plant, installation, commissioning cost [Eur/MW]
battery_control_system_cost = 18340# 18340-18340*0.1 18340*1.6Grid management control system cost[Eur/MW]
battery_energy_onm_cost = 10000 #4000 13000Battery energy capacity maintenance cost [Eur/MWh] per year
battery_depth_of_discharge = 0.9
\ No newline at end of file
This diff is collapsed.
......@@ -26,7 +26,7 @@ dependencies:
- pandas
- pip
- psutil
- python
- python=3.7
- pytest
- scikit-learn
- scipy
......@@ -42,6 +42,9 @@ dependencies:
- wisdem
- zarr
- pip:
- chaospy==3.3.8
- docplex==2.15.194
- numpy-financial==1.0.0
- sphinx-rtd-theme==0.4.1
- sphinx-pynpoint-theme
- sphinxcontrib-napoleon==0.7
\ No newline at end of file
- sphinxcontrib-napoleon==0.7
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 4efd704a34ac61307c6e8a459b5d942c
config: 86a0b5aa05ab7c992978d2e3da6ac700
tags: 645f666f9bcd5a90fca523b33c5a78b7
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment