Open and run in Colab (interactive) Edit on Gitlab Open and run in Kaggle (interactive) Launch with Binder

Hybridize

Evaluating hybridizing of a single technology power plant

Imports

Install hydesign if needed. Import basic libraries. Import HPP model assembly class. Import the examples file path.

[1]:
# Install hydesign if needed
import importlib
if not importlib.util.find_spec("hydesign"):
    !pip install git+https://gitlab.windenergy.dtu.dk/TOPFARM/hydesign.git
[2]:
import time
import pandas as pd
from hydesign.examples import examples_filepath

Existing PV

[3]:
%%capture
from hydesign.assembly.hpp_assembly_hybridization_pv import hpp_model
[4]:
examples_sites = pd.read_csv(f'{examples_filepath}examples_sites.csv', index_col=0, sep=';')
name = 'Denmark_hybridization_solar_Langelinie'
ex_site = examples_sites.loc[examples_sites.name == name]
ex_site
[4]:
case name longitude latitude altitude input_ts_fn sim_pars_fn price_fn price_col H2_demand_col Unnamed: 11 input_HA_ts_fn price_up_ts price_dwn_ts
13 Europe Denmark_hybridization_solar_Langelinie 11.290641 54.717469 0.042 Europe/GWA2/input_ts_Denmark_hybridization_sol... Europe/hpp_pars_Langelinie.yml Europe/2030-EL_PRICE.csv DK_E Europe/H2_demand.csv NaN NaN NaN NaN

select a site to run

[5]:
longitude = ex_site['longitude'].values[0]
latitude = ex_site['latitude'].values[0]
altitude = ex_site['altitude'].values[0]
[6]:
sim_pars_fn = examples_filepath+ex_site['sim_pars_fn'].values[0]
input_ts_fn = examples_filepath+ex_site['input_ts_fn'].values[0]
[7]:
clearance = 50
sp = 301
p_rated = 2
Nwt = 3
wind_MW_per_km2 = 10
b_P =  10 #MW
b_E_h = 3 #hours
cost_of_battery_P_fluct_in_peak_price_ratio = 0
delta_life = 5

x = [
# Wind plant design
clearance, sp, p_rated, Nwt, wind_MW_per_km2,
# Energy storage & EMS price constrains
b_P, b_E_h, cost_of_battery_P_fluct_in_peak_price_ratio,
# Time design
delta_life
]

Initializing the HPP model

Initialize the HPP model (hpp_model class) with the coordinates and the necessary input files.

[8]:
hpp = hpp_model(
    latitude=latitude,
    longitude=longitude,
    altitude=altitude,
    num_batteries = 10,
    work_dir = './',
    sim_pars_fn = sim_pars_fn,
    input_ts_fn = input_ts_fn,
)


Fixed parameters on the site
-------------------------------
longitude = 11.290641
latitude = 54.717469
altitude = 0.042
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Cell In[8], line 1
----> 1 hpp = hpp_model(
      2     latitude=latitude,
      3     longitude=longitude,
      4     altitude=altitude,
      5     num_batteries = 10,
      6     work_dir = './',
      7     sim_pars_fn = sim_pars_fn,
      8     input_ts_fn = input_ts_fn,
      9 )

File c:\sandbox\repo\topfarm\hydesign\hydesign\assembly\hpp_assembly_hybridization_pv.py:50, in hpp_model.__init__(self, sim_pars_fn, N_limit, **kwargs)
     48 wind_deg = self.wind_deg
     49 share_WT_deg_types = self.share_WT_deg_types
---> 50 N_life = self.N_life
     51 price = self.price
     53 input_ts_fn = sim_pars['input_ts_fn']

AttributeError: 'hpp_model' object has no attribute 'N_life'
[ ]:
start = time.time()

outs = hpp.evaluate(*x)

hpp.print_design(x, outs)

end = time.time()

print('exec. time [min]:', (end - start)/60 )

Existing wind

[ ]:
from hydesign.assembly.hpp_assembly_hybridization_wind import hpp_model

[ ]:
name = 'Denmark_hybridization_wind_Norhede_Hjortmose'
ex_site = examples_sites.loc[examples_sites.name == name]
longitude = ex_site['longitude'].values[0]
latitude = ex_site['latitude'].values[0]
altitude = ex_site['altitude'].values[0]

sim_pars_fn = examples_filepath+ex_site['sim_pars_fn'].values[0]
input_ts_fn = examples_filepath+ex_site['input_ts_fn'].values[0]

hpp = hpp_model(
latitude=latitude,
longitude=longitude,
altitude=altitude,
num_batteries = 10,
work_dir = './',
sim_pars_fn = sim_pars_fn,
input_ts_fn = input_ts_fn,
)

[ ]:
solar_MW = 100
surface_tilt = 25
surface_azimuth = 180
DC_AC_ratio =  1.475
b_P = 18 #MW
b_E_h = 6 #hours
cost_of_battery_P_fluct_in_peak_price_ratio = 0.319
delta_life = 5


x = [
# PV plant design
solar_MW,  surface_tilt, surface_azimuth, DC_AC_ratio,
# Energy storage & EMS price constrains
b_P, b_E_h, cost_of_battery_P_fluct_in_peak_price_ratio,
# Time design
delta_life
]

[ ]:
start = time.time()

outs = hpp.evaluate(*x)

hpp.print_design(x, outs)

end = time.time()

print('exec. time [min]:', (end - start)/60 )