### Install Libraries for PyWake P2X Example Source: https://topfarm.pages.windenergy.dtu.dk/hydesign/notebooks/PyWake_P2X_Example Installs the 'hydesign' and 'py_wake' libraries from GitLab if they are not already found. These libraries are essential for running the hybrid power plant simulation. ```python # Install hydesign if needed import importlib if not importlib.util.find_spec("hydesign"): !pip install git+https://gitlab.windenergy.dtu.dk/TOPFARM/hydesign.git # Install pywake if needed if not importlib.util.find_spec("py_wake"): !pip install git+https://gitlab.windenergy.dtu.dk/TOPFARM/PyWake.git ``` -------------------------------- ### Simple Installation of HyDesign from PyPI Source: https://topfarm.pages.windenergy.dtu.dk/hydesign/_sources/installation.rst Installs the latest official release of HyDesign from PyPI. This is the simplest method for users who want a stable release. ```bash pip install hydesign ``` -------------------------------- ### Install and Import Libraries for Hybrid Power Plant Simulation Source: https://topfarm.pages.windenergy.dtu.dk/hydesign/_sources/notebooks/PyWake_P2X_Example.ipynb Installs the 'hydesign' and 'py_wake' libraries if they are not already present. These libraries are essential for setting up and running the hybrid power plant simulation. ```python # Install hydesign if needed import importlib if not importlib.util.find_spec("hydesign"): !pip install git+https://gitlab.windenergy.dtu.dk/TOPFARM/hydesign.git ``` ```python # Install pywake if needed if not importlib.util.find_spec("py_wake"): !pip install git+https://gitlab.windenergy.dtu.dk/TOPFARM/PyWake.git ``` -------------------------------- ### Install and Import hydesign Libraries Source: https://topfarm.pages.windenergy.dtu.dk/hydesign/notebooks/constant_output Installs the hydesign library if not already present and imports necessary modules for plant sizing and evaluation. This includes pandas for data manipulation, numpy for numerical operations, the HPP model assembly class, and plotting utilities. ```python # Install hydesign if needed import importlib if not importlib.util.find_spec("hydesign"): !pip install git+https://gitlab.windenergy.dtu.dk/TOPFARM/hydesign.git import pandas as pd import numpy as np from hydesign.assembly.hpp_assembly_constantoutput import hpp_model_constant_output as hpp_model from hydesign.examples import examples_filepath import matplotlib.pyplot as plt ``` -------------------------------- ### Install and Import Hydesign Library Source: https://topfarm.pages.windenergy.dtu.dk/hydesign/_sources/notebooks/Hybridize.ipynb This snippet demonstrates how to install the hydesign library if it's not already present and imports necessary components like time, pandas, and example file paths. It uses `importlib` to check for the library's existence before attempting installation via pip. ```python # Install hydesign if needed import importlib if not importlib.util.find_spec("hydesign"): !pip install git+https://gitlab.windenergy.dtu.dk/TOPFARM/hydesign.git ``` ```python import time import pandas as pd from hydesign.examples import examples_filepath ``` -------------------------------- ### Install HyDesign from GitLab Source: https://topfarm.pages.windenergy.dtu.dk/hydesign/_sources/installation.rst Installs the latest version of HyDesign directly from the GitLab repository. This method includes any recent updates not yet released on PyPI. ```bash pip install git+https://gitlab.windenergy.dtu.dk/TOPFARM/hydesign.git ``` -------------------------------- ### Initialize HyDesign P2X Model with Example Data Source: https://topfarm.pages.windenergy.dtu.dk/hydesign/notebooks/break_even_price_and_PPA Loads example site data, extracts relevant parameters (longitude, latitude, altitude, file paths), and initializes the HyDesign P2X model. This setup is crucial for running simulations with predefined or custom site configurations. ```python %%capture import pandas as pd from hydesign.assembly.hpp_assembly import hpp_model from hydesign.assembly.hpp_assembly_P2X import hpp_model_P2X from hydesign.examples import examples_filepath examples_sites = pd.read_csv(f'{examples_filepath}examples_sites.csv', index_col=0, sep=';') name = 'France_good_wind' 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] input_ts_fn = examples_filepath+ex_site['input_ts_fn'].values[0] sim_pars_fn = examples_filepath+ex_site['sim_pars_fn'].values[0] H2_demand_fn = examples_filepath+ex_site['H2_demand_col'].values[0] hpp = hpp_model_P2X( latitude=latitude, longitude=longitude, altitude=altitude, num_batteries = 1, work_dir = './', sim_pars_fn = sim_pars_fn, input_ts_fn = input_ts_fn, H2_demand_fn=H2_demand_fn) ``` -------------------------------- ### Setup Hybrid Power Plant Model with PyWake Source: https://topfarm.pages.windenergy.dtu.dk/hydesign/notebooks/PyWake_P2X_Example Configures and initializes the hybrid power plant model using PyWake. This involves setting site parameters, wind turbine specifications, farm layout, and simulation parameters for a comprehensive evaluation. ```python name = 'Denmark_good_wind' examples_sites = pd.read_csv(f'{examples_filepath}examples_sites.csv', index_col=0, sep=';') 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] intervals_per_hour = 1 n_wt = 40 n_loads = 4 wt = DTU10MW_1WT_Surrogate() d = wt.diameter() site = Hornsrev1Site() sx = 4 * d sy = 5 * d x, y = regular_generic_layout(n_wt, sx, sy, stagger=0, rotation=0) N_ws = 365 * 24 * intervals_per_hour time_stamp = np.arange(N_ws) / 6 / 24 farm = NOJ(site, wt, turbulenceModel=STF2017TurbulenceModel(), deflectionModel=JimenezWakeDeflection(), superpositionModel=LinearSum()) yaw = 30 * np.sin(np.arange(N_ws) / 100) tilt = np.zeros(N_ws) hpp = hpp_model(latitude=latitude, longitude=longitude, altitude=altitude, sim_pars_fn=sim_pars_fn, input_ts_fn=input_ts_fn, intervals_per_hour=intervals_per_hour, farm=farm, x=x, y=y, tilt=tilt, time_stamp=time_stamp, n_loads=n_loads, H2_demand_fn=6000, Nwt=n_wt) ``` -------------------------------- ### Editable Basic Installation of HyDesign Source: https://topfarm.pages.windenergy.dtu.dk/hydesign/_sources/installation.rst Installs HyDesign in editable mode from a local clone of the GitLab repository. This is useful for development as changes to the source code are immediately reflected without reinstallation. ```bash git clone https://gitlab.windenergy.dtu.dk/TOPFARM/hydesign.git cd hydesign pip install -e . ``` -------------------------------- ### Install and Import HyDesign and Libraries Source: https://topfarm.pages.windenergy.dtu.dk/hydesign/notebooks/HPP_evaluation_P2MeOH Installs the HyDesign library if not already present and imports essential Python libraries for data manipulation, time series analysis, and HPP modeling. It also includes a utility to find example file paths. ```python # Install hydesign if needed import importlib if not importlib.util.find_spec("hydesign"): !pip install git+https://gitlab.windenergy.dtu.dk/TOPFARM/hydesign.git import os import time import yaml import numpy as np import pandas as pd import matplotlib.pyplot as plt from hydesign.assembly.hpp_assembly_P2MeOH_bidirectional import hpp_model_P2MeOH_bidirectional as hpp_model from hydesign.examples import examples_filepath ``` -------------------------------- ### Load Example Site Data with Pandas Source: https://topfarm.pages.windenergy.dtu.dk/hydesign/notebooks/HPP_evaluation_P2X Loads example site data from a CSV file into a pandas DataFrame. This data includes geographical coordinates and file paths for input time series and simulation parameters. The CSV is semicolon-separated and uses the first column as the index. ```python examples_sites = pd.read_csv(f'{examples_filepath}examples_sites.csv', index_col=0, sep=';') print(examples_sites) ``` -------------------------------- ### Install and Import hydesign Library Source: https://topfarm.pages.windenergy.dtu.dk/hydesign/_sources/notebooks/Example_ISO_prob.ipynb This code snippet installs the hydesign library from a Git repository if it's not already found. It then imports necessary libraries including numpy, pandas, scipy, and specific modules from statsmodels and hydesign for weather transformations and examples. ```python # Install hydesign if needed import importlib if not importlib.util.find_spec("hydesign"): !pip install git+https://gitlab.windenergy.dtu.dk/TOPFARM/hydesign.git import numpy as np from numpy import newaxis as na import pandas as pd import scipy from statsmodels.distributions.empirical_distribution import ECDF, monotone_fn_inverter from hydesign.weather.weather import isoprob_transfrom from hydesign.examples import examples_filepath ``` -------------------------------- ### Install HyDesign Library Source: https://topfarm.pages.windenergy.dtu.dk/hydesign/notebooks/Example_ISO_prob This code snippet installs the HyDesign library from a Git repository if it's not already found. It uses `importlib` to check for the library and `pip` to install it if necessary. This is a prerequisite for using the library's functionalities. ```python # Install hydesign if needed import importlib if not importlib.util.find_spec("hydesign"): !pip install git+https://gitlab.windenergy.dtu.dk/TOPFARM/hydesign.git ``` -------------------------------- ### Install and Import Hydesign and Libraries Source: https://topfarm.pages.windenergy.dtu.dk/hydesign/notebooks/Hybridize Installs the hydesign library if not already present and imports essential Python libraries including pandas for data manipulation and time for performance measurement. ```python # Install hydesign if needed import importlib if not importlib.util.find_spec("hydesign"): !pip install git+https://gitlab.windenergy.dtu.dk/TOPFARM/hydesign.git import time import pandas as pd from hydesign.examples import examples_filepath ``` -------------------------------- ### Configure Optimization Inputs for Hydesign Source: https://topfarm.pages.windenergy.dtu.dk/hydesign/_sources/notebooks/Simple_Sizing_Example.ipynb Sets up the input parameters for the EfficientGlobalOptimizationDriver in Hydesign. This includes defining fixed and design variables for battery capacity, duration, and cost ratios. ```python inputs = { 'b_P [MW]': { 'var_type': 'fixed', 'value': 50 }, 'b_E_h [h]': { 'var_type': 'fixed', 'value': 6 }, 'cost_of_battery_P_fluct_in_peak_price_ratio': { 'var_type': 'fixed', 'value': 10 } } EGOD = EfficientGlobalOptimizationDriver(**inputs) ``` -------------------------------- ### Import Libraries for PyWake P2X Example Source: https://topfarm.pages.windenergy.dtu.dk/hydesign/notebooks/PyWake_P2X_Example Imports necessary libraries for the PyWake P2X example, including numpy, pandas, hydesign components, py_wake models, and matplotlib for plotting. These are fundamental for setting up and running the simulation. ```python import numpy as np import pandas as pd from hydesign.assembly.hpp_pywake_p2x import hpp_model from hydesign.examples import examples_filepath from py_wake.examples.data.hornsrev1 import Hornsrev1Site from py_wake.turbulence_models.stf import STF2017TurbulenceModel from py_wake import NOJ from py_wake.deflection_models import JimenezWakeDeflection from py_wake.examples.data.dtu10mw_surrogate import DTU10MW_1WT_Surrogate from py_wake.superposition_models import LinearSum from topfarm.utils import regular_generic_layout from scipy.spatial import ConvexHull import matplotlib.pyplot as plt ``` -------------------------------- ### Install and Import Hydesign Library Source: https://topfarm.pages.windenergy.dtu.dk/hydesign/notebooks/evaluate_with_reliability Installs the hydesign library from a Git repository if it's not already found. It then imports necessary libraries for the simulation. ```python # Install hydesign if needed import importlib if not importlib.util.find_spec("hydesign"): !pip install git+https://gitlab.windenergy.dtu.dk/TOPFARM/hydesign.git ``` ```python import time import numpy as np import pandas as pd import os import matplotlib.pyplot as plt from hydesign.assembly.hpp_assembly import hpp_model from hydesign.examples import examples_filepath ``` -------------------------------- ### Select Site Coordinates and Parameters Source: https://topfarm.pages.windenergy.dtu.dk/hydesign/notebooks/HPP_evaluation_P2X Selects a specific site from the loaded example site data based on its name. It then extracts the longitude, latitude, and altitude for the chosen site, which can be used for further simulations or analysis. ```python name = 'Denmark_good_wind' 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] ``` -------------------------------- ### Install and Import HyDesign and Libraries (Python) Source: https://topfarm.pages.windenergy.dtu.dk/hydesign/_sources/notebooks/HPP_evaluation_P2MeOH.ipynb Installs the HyDesign library if not already present and imports essential Python libraries for data manipulation, simulation, and plotting. This includes pandas for data handling, yaml for configuration files, numpy for numerical operations, and specific HyDesign modules for hybrid power plant assembly. ```python # Install hydesign if needed import importlib if not importlib.util.find_spec("hydesign"): !pip install git+https://gitlab.windenergy.dtu.dk/TOPFARM/hydesign.git import os import time import yaml import numpy as np import pandas as pd import matplotlib.pyplot as plt from hydesign.assembly.hpp_assembly_P2MeOH_bidirectional import hpp_model_P2MeOH_bidirectional as hpp_model from hydesign.examples import examples_filepath ``` -------------------------------- ### Developer Installation of HyDesign Source: https://topfarm.pages.windenergy.dtu.dk/hydesign/_sources/installation.rst Installs HyDesign in editable mode with all optional dependencies included. This provides a complete setup for development, testing, and advanced features. ```bash git clone https://gitlab.windenergy.dtu.dk/TOPFARM/hydesign.git cd hydesign pip install -e .[all] ``` -------------------------------- ### Install and Import HyDesign and Libraries Source: https://topfarm.pages.windenergy.dtu.dk/hydesign/notebooks/HPP_evaluation_BM Installs the HyDesign library if not already present and imports necessary Python libraries for data manipulation, time series analysis, and HPP modeling. This setup is crucial for running the subsequent code examples. ```python # Install hydesign if needed import importlib if not importlib.util.find_spec("hydesign"): !pip install git+https://gitlab.windenergy.dtu.dk/TOPFARM/hydesign.git import os import time import yaml import numpy as np import pandas as pd import matplotlib.pyplot as plt from hydesign.assembly.hpp_assembly_BM import hpp_model from hydesign.examples import examples_filepath ``` -------------------------------- ### Install CPLEX Community Edition Source: https://topfarm.pages.windenergy.dtu.dk/hydesign/_sources/installation.rst Installs the community edition of CPLEX using pip. CPLEX is a prerequisite for HyDesign and is recommended to be installed before HyDesign. ```bash pip install cplex ``` -------------------------------- ### Load Site Data and Define Optimization Inputs Source: https://topfarm.pages.windenergy.dtu.dk/hydesign/_sources/notebooks/Simple_Sizing_P2X_Example.ipynb Loads site-specific data from a CSV file and defines the input parameters for the hybrid power plant optimization. This includes geographical information, time-series data file paths, and simulation parameters. ```python examples_sites = pd.read_csv(f'{examples_filepath}examples_sites.csv', index_col=0, sep=';') ex_site = examples_sites.loc[4] longitude = ex_site['longitude'] latitude = ex_site['latitude'] altitude = ex_site['altitude'] input_ts_fn = examples_filepath+ex_site['input_ts_fn'] sim_pars_fn = examples_filepath+ex_site['sim_pars_fn'] H2_demand_fn = examples_filepath+ex_site['H2_demand_col'] inputs = { 'name': ex_site['name'], 'longitude': longitude, 'latitude': latitude, 'altitude': altitude, 'input_ts_fn': input_ts_fn, 'sim_pars_fn': sim_pars_fn, 'H2_demand_fn': H2_demand_fn, 'opt_var': "NPV_over_CAPEX", 'num_batteries': 10, 'n_procs': n_procs, 'n_doe': n_doe, 'n_clusters': n_procs, 'n_seed': 0, 'max_iter': 10, 'final_design_fn': 'hydesign_design_0.csv', 'npred': 3e4, 'tol': 1e-6, 'min_conv_iter': 3, 'work_dir': './', 'hpp_model': hpp_model, 'variables': { 'clearance [m]': {'var_type':'design', 'limits':[10, 60], 'types':'int' }, # {'var_type':'fixed', # 'value': 35 # }, 'sp [W/m2]': {'var_type':'design', 'limits':[200, 360], 'types':'int' }, 'p_rated [MW]': {'var_type':'design', 'limits':[1, 10], 'types':'int' }, # {'var_type':'fixed', # 'value': 6 # }, 'Nwt': {'var_type':'design', 'limits':[0, 400], 'types':'int' }, # {'var_type':'fixed', # 'value': 200 # }, 'wind_MW_per_km2 [MW/km2]': # {'var_type':'design', # 'limits':[5, 9], # 'types':'float' # }, {'var_type':'fixed', 'value': 7 }, 'solar_MW [MW]': # {'var_type':'design', # 'limits':[0, 400], # 'types':'int' # }, {'var_type':'fixed', 'value': 200 }, 'surface_tilt [deg]': # {'var_type':'design', # 'limits':[0, 50], # 'types':'float' # }, {'var_type':'fixed', 'value': 25 }, 'surface_azimuth [deg]': # {'var_type':'design', # 'limits':[150, 210], # 'types':'float' # }, {'var_type':'fixed', 'value': 180 }, 'DC_AC_ratio': # {'var_type':'design', # 'limits':[1, 2.0], # 'types':'float' # }, ``` -------------------------------- ### Update Anaconda Environment Source: https://topfarm.pages.windenergy.dtu.dk/hydesign/_sources/installation.rst Updates all packages in the root Anaconda environment. This command ensures that all installed packages are up-to-date. ```bash conda update --all ``` -------------------------------- ### Initialize HPP Model with Parameters Source: https://topfarm.pages.windenergy.dtu.dk/hydesign/notebooks/Quickstart Initializes the HPP model with geographical coordinates, turbine and PV parameters, battery configuration, and input file paths. This sets up the model for simulation. ```python hpp = hpp_model( latitude=latitude, longitude=longitude, altitude=altitude, rotor_diameter_m = rotor_diameter_m, hub_height_m = hub_height_m, wt_rated_power_MW = wt_rated_power_MW, surface_tilt_deg = surface_tilt_deg, surface_azimuth_deg = surface_azimuth_deg, DC_AC_ratio = DC_AC_ratio, num_batteries = 5, work_dir = './', sim_pars_fn = sim_pars_fn, input_ts_fn = input_ts_fn, ) ``` -------------------------------- ### Configure Site and Input Parameters for Optimization Source: https://topfarm.pages.windenergy.dtu.dk/hydesign/notebooks/constant_output Loads site-specific data (longitude, latitude, altitude) and input file paths for time series and simulation parameters. It also specifies the hydrogen demand file and sets up the optimization variables and their configurations. ```python ex_site = examples_sites.loc[9] longitude = ex_site['longitude'] latitude = ex_site['latitude'] altitude = ex_site['altitude'] input_ts_fn = examples_filepath+ex_site['input_ts_fn'] sim_pars_fn = examples_filepath+ex_site['sim_pars_fn'].replace('.yml','_benchmark.yml') H2_demand_fn = examples_filepath+ex_site['H2_demand_col'] inputs = { 'name': ex_site['name'], 'longitude': longitude, 'latitude': latitude, 'altitude': altitude, 'input_ts_fn': input_ts_fn, 'sim_pars_fn': sim_pars_fn, 'H2_demand_fn': H2_demand_fn, 'opt_var': "NPV_over_CAPEX", 'num_batteries': 10, 'n_procs': n_procs - 1, 'n_doe': 20, 'n_clusters': 5, 'n_seed': 0, 'max_iter': 2, 'final_design_fn': 'hydesign_design_0.csv', 'npred': 3e4, 'tol': 1e-6, 'min_conv_iter': 3, 'work_dir': './', 'hpp_model': hpp_model, 'PPA_price': 40, 'load_min': 3, # MW 'variables': { 'clearance [m]': #{'var_type':'design', # 'limits':[10, 60], # 'types':'int' # }, {'var_type':'fixed', 'value': 35 }, 'sp [W/m2]': #{'var_type':'design', # 'limits':[200, 359], # 'types':'int' # }, {'var_type':'fixed', 'value': 300 }, 'p_rated [MW]': {'var_type':'design', 'limits':[1, 10], 'types':'int' }, # {'var_type':'fixed', # 'value': 6 # }, 'Nwt': {'var_type':'design', 'limits':[1, 400], 'types':'int' }, # {'var_type':'fixed', # 'value': 200 # }, 'wind_MW_per_km2 [MW/km2]': #{'var_type':'design', # 'limits':[5, 9], # 'types':'float' # }, {'var_type':'fixed', 'value': 7 }, 'solar_MW [MW]': {'var_type':'design', 'limits':[1, 400], 'types':'int' }, #{'var_type':'fixed', # 'value': 20 # }, 'surface_tilt [deg]': # {'var_type':'design', # 'limits':[0, 50], # 'types':'float' # }, {'var_type':'fixed', 'value': 25 }, 'surface_azimuth [deg]': # {'var_type':'design', # 'limits':[150, 210], # 'types':'float' # }, {'var_type':'fixed', 'value': 180 }, 'DC_AC_ratio': # {'var_type':'design', # 'limits':[1, 2.0], # 'types':'float' # }, {'var_type':'fixed', 'value':1.6, }, 'b_P [MW]': {'var_type':'design', 'limits':[0, 100], 'types':'int' }, #{'var_type':'fixed', # 'value': 50 # }, 'b_E_h [h]': {'var_type':'design', 'limits':[1, 10], 'types':'int' }, #{'var_type':'fixed', # 'value': 6 # }, 'cost_of_battery_P_fluct_in_peak_price_ratio': {'var_type':'design', 'limits':[0, 20], 'types':'float' }, # {'var_type':'fixed', ``` -------------------------------- ### Activate Anaconda Root Environment Source: https://topfarm.pages.windenergy.dtu.dk/hydesign/_sources/installation.rst Activates the root Anaconda environment. This command is used to switch to the base environment where Anaconda is installed. ```bash activate ``` -------------------------------- ### Create and Activate HyDesign Conda Environment Source: https://topfarm.pages.windenergy.dtu.dk/hydesign/_sources/installation.rst Clones the HyDesign repository, navigates into the directory, creates a new Conda environment from 'environment.yml', and activates it. This is the recommended method for installing HyDesign to avoid dependency conflicts. ```bash git clone https://gitlab.windenergy.dtu.dk/TOPFARM/hydesign.git cd hydesign conda env create --file environment.yml conda activate hydesign ``` -------------------------------- ### Import Optimization Driver and OS Module Source: https://topfarm.pages.windenergy.dtu.dk/hydesign/notebooks/constant_output Imports the necessary EfficientGlobalOptimizationDriver from the hydesign library and the os module for system operations. This is a prerequisite for setting up the optimization process. ```python from hydesign.Parallel_EGO import EfficientGlobalOptimizationDriver import os ``` -------------------------------- ### Display Project Parameters and Results Source: https://topfarm.pages.windenergy.dtu.dk/hydesign/_sources/notebooks/Simple_Sizing_Example.ipynb This snippet displays a table containing various parameters and results for a wind energy project. It includes site conditions, system capacities, cost breakdowns, financial metrics, and optimization outcomes. The data is presented for a specific scenario, 'France_good_wind'. ```python import pandas as pd data = { 'surface_azimuth [deg]': [180.000], 'DC_AC_ratio': [1.000], 'b_P [MW]': [50.000], 'b_E_h [h]': [6.000], 'cost_of_battery_P_fluct_in_peak_price_ratio': [10.000], 'NPV_over_CAPEX': [0.843], 'NPV [MEuro]': [407.749], 'IRR': [0.123], 'LCOE [Euro/MWh]': [34.895], 'Revenues [MEuro]': [50.812], 'CAPEX [MEuro]': [483.739], 'OPEX [MEuro]': [8.286], 'Wind CAPEX [MEuro]': [342.383], 'Wind OPEX [MEuro]': [7.386], 'PV CAPEX [MEuro]': [46.000], 'PV OPEX [MEuro]': [0.900], 'Batt CAPEX [MEuro]': [25.774], 'Batt OPEX [MEuro]': [0.000], 'Shared CAPEX [MEuro]': [69.582], 'Shared OPEX [MEuro]': [0.000], 'penalty lifetime [MEuro]': [0.000], 'AEP [GWh]': [1281.154], 'GUF': [0.488], 'grid [MW]': [300.000], 'wind [MW]': [310.000], 'solar [MW]': [200.000], 'Battery Energy [MWh]': [300.000], 'Battery Power [MW]': [50.000], 'Total curtailment [GWh]': [725.295], 'Total curtailment with deg [GWh]': [280.323], 'Awpp [km2]': [62.000], 'Apvp [km2]': [2.452], 'Plant area [km2]': [62.000], 'Rotor diam [m]': [210.627], 'Hub height [m]': [165.314], 'Number of batteries used in lifetime': [2.000], 'Break-even PPA price [Euro/MWh]': [23.340], 'Capacity factor wind [-]': [0.415] } df = pd.DataFrame(data) # Assuming the table display is handled by a Jupyter environment or similar # For demonstration, we'll print the DataFrame print(df.to_string()) # The original context suggests this might be part of a larger output, possibly from a tool like EGOD # print("Optimization with 9 iterations and 141 model evaluations took 16.19 minutes") ``` -------------------------------- ### Load and Select Example Site Data with Pandas Source: https://topfarm.pages.windenergy.dtu.dk/hydesign/_sources/notebooks/Hybridize.ipynb This snippet demonstrates how to load site data from a CSV file using pandas and select a specific site by name. It reads 'examples_sites.csv' and filters for the 'Denmark_hybridization_solar_Langelinie' site. ```python import pandas as pd examples_filepath = './' 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 ``` -------------------------------- ### Load Site Data and Define Optimization Inputs Source: https://topfarm.pages.windenergy.dtu.dk/hydesign/_sources/notebooks/Simple_Sizing_Example.ipynb Loads site-specific data from a CSV file and defines the input parameters for the hybrid power plant optimization. This includes geographical coordinates, file paths for time-series data, simulation parameters, and hydrogen demand. It also sets up optimization variables with their types and limits. ```python examples_sites = pd.read_csv(f'{examples_filepath}examples_sites.csv', index_col=0, sep=';') ex_site = examples_sites.loc[4] longitude = ex_site['longitude'] latitude = ex_site['latitude'] altitude = ex_site['altitude'] input_ts_fn = examples_filepath+ex_site['input_ts_fn'] sim_pars_fn = examples_filepath+ex_site['sim_pars_fn'] H2_demand_fn = examples_filepath+ex_site['H2_demand_col'] inputs = { 'name': ex_site['name'], 'longitude': longitude, 'latitude': latitude, 'altitude': altitude, 'input_ts_fn': input_ts_fn, 'sim_pars_fn': sim_pars_fn, 'H2_demand_fn': H2_demand_fn, 'opt_var': "NPV_over_CAPEX", 'num_batteries': 10, 'n_procs': n_procs, 'n_doe': n_doe, 'n_clusters': n_procs, 'n_seed': 0, 'max_iter': 10, 'final_design_fn': 'hydesign_design_0.csv', 'npred': 3e4, 'tol': 1e-6, 'min_conv_iter': 3, 'work_dir': './', 'hpp_model': hpp_model, 'variables': { 'clearance [m]': {'var_type':'design', 'limits':[10, 60], 'types':'int' }, # {'var_type':'fixed', # 'value': 35 # }, 'sp [W/m2]': {'var_type':'design', 'limits':[200, 360], 'types':'int' }, 'p_rated [MW]': {'var_type':'design', 'limits':[1, 10], 'types':'int' }, # {'var_type':'fixed', # 'value': 6 # }, 'Nwt': {'var_type':'design', 'limits':[0, 400], 'types':'int' }, # {'var_type':'fixed', # 'value': 200 # }, 'wind_MW_per_km2 [MW/km2]': {'var_type':'design', 'limits':[5, 9], 'types':'float' }, # {'var_type':'fixed', # 'value': 7 # }, 'solar_MW [MW]': # {'var_type':'design', # 'limits':[0, 400], # 'types':'int' # }, {'var_type':'fixed', 'value': 200 }, 'surface_tilt [deg]': # {'var_type':'design', # 'limits':[0, 50], # 'types':'float' # }, {'var_type':'fixed', 'value': 25 }, 'surface_azimuth [deg]': # {'var_type':'design', # 'limits':[150, 210], # 'types':'float' # }, {'var_type':'fixed', 'value': 180 }, 'DC_AC_ratio': # {'var_type':'design', # 'limits':[1, 2.0], # 'types':'float' # }, {'var_type':'fixed', 'value': 1.5 } } } ``` -------------------------------- ### Install and Import HyDesign Libraries Source: https://topfarm.pages.windenergy.dtu.dk/hydesign/_sources/notebooks/constant_output.ipynb This snippet shows how to install the hydesign library if it's not already present and then imports essential Python libraries including pandas, numpy, the HPP model assembly class, and utilities for accessing example file paths. It also imports matplotlib for plotting. ```python # Install hydesign if needed import importlib if not importlib.util.find_spec("hydesign"): !pip install git+https://gitlab.windenergy.dtu.dk/TOPFARM/hydesign.git import pandas as pd import numpy as np from hydesign.assembly.hpp_assembly_constantoutput import hpp_model_constant_output as hpp_model from hydesign.examples import examples_filepath import matplotlib.pyplot as plt ``` -------------------------------- ### Display Optimized Project Parameters Table Source: https://topfarm.pages.windenergy.dtu.dk/hydesign/_sources/notebooks/Simple_Sizing_Example.ipynb This snippet renders an HTML table summarizing the optimized parameters for a wind energy project. It includes detailed metrics such as clearance, solar irradiance, rated power, wind turbine count, land use, battery specifications, and financial indicators like Break-even PPA price. The table also shows optimization details like objective function, time, and number of model evaluations. ```python import pandas as pd # This is a representation of the data that would generate the HTML table. # The actual generation is typically done by libraries like pandas in a Jupyter environment. data = { 'clearance [m]': [60.0], 'sp [W/m2]': [287.0], 'p_rated [MW]': [10.0], 'Nwt': [31.0], 'wind_MW_per_km2 [MW/km2]': [5.0], 'solar_MW [MW]': [200.0], 'surface_tilt [deg]': [25.0], 'surface_azimuth [deg]': [180.0], 'DC_AC_ratio': [1.0], 'b_P [MW]': [50.0], 'Apvp [km2]': [2.452], 'Plant area [km2]': [62.0], 'Rotor diam [m]': [210.627033], 'Hub height [m]': [165.313517], 'Number of batteries used in lifetime': [2.0], 'Break-even PPA price [Euro/MWh]': [23.339817], 'Capacity factor wind [-]': [0.41521], 'design obj': ['NPV_over_CAPEX'], 'opt time [min]': [16.19], 'n_model_evals': [141] } df_optimized = pd.DataFrame(data, index=['France_good_wind']) # In a Jupyter Notebook, simply having df_optimized as the last line would render the HTML table. # For a script, you might use df_optimized.to_html() # Example of how the HTML might be generated (simplified): html_output = """
| clearance [m] | sp [W/m2] | p_rated [MW] | Nwt | wind_MW_per_km2 [MW/km2] | solar_MW [MW] | surface_tilt [deg] | surface_azimuth [deg] | DC_AC_ratio | b_P [MW] | Apvp [km2] | Plant area [km2] | Rotor diam [m] | Hub height [m] | Number of batteries used in lifetime | Break-even PPA price [Euro/MWh] | Capacity factor wind [-] | design obj | opt time [min] | n_model_evals | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| France_good_wind | 60.0 | 287.0 | 10.0 | 31.0 | 5.0 | 200.0 | 25.0 | 180.0 | 1.0 | 50.0 | 2.452 | 62.0 | 210.627033 | 165.313517 | 2.0 | 23.339817 | 0.41521 | NPV_over_CAPEX | 16.19 | 141 |
1 rows × 20 columns