hyveopt package
Subpackages
- hyveopt.single_bus_pv_el_battery_det package
- Submodules
- hyveopt.single_bus_pv_el_battery_det.single_bus_pv_el_battery_det module
PlanningTimeConfig
PlanningTimeConfig.planning_horizon_duration
PlanningTimeConfig.planning_horizon_end
PlanningTimeConfig.planning_horizon_start
PlanningTimeConfig.range
PlanningTimeConfig.scenario_duration
PlanningTimeConfig.scenario_resolution
PlanningTimeConfig.scenario_subsampling
PlanningTimeConfig.scenarios_per_year
SCIPSolution
SerializableDataClass
SingleBusDesignData
SingleBusDesignModel
SingleBusDesignModel.AMPL_MODEL
SingleBusDesignModel.SolverParams
SingleBusDesignModel.build_scip_model()
SingleBusDesignModel.depr_rate_sce()
SingleBusDesignModel.depr_rate_year()
SingleBusDesignModel.get_scenarios_per_year()
SingleBusDesignModel.parse_glpsol_output()
SingleBusDesignModel.plot_daily_profiles()
SingleBusDesignModel.plot_solution()
SingleBusDesignModel.report()
SingleBusDesignModel.retrieve_scip_solution()
SingleBusDesignModel.scenario2year()
SingleBusDesignModel.solve()
generate_scenario_time_ranges()
- Module contents
Submodules
hyveopt.components module
- class hyveopt.components.ESS(index: int = None, name: str = None, gain: Gain = None, pnom_kW: float = None, soc_nom_kWh: float = None)[source]
Bases:
GainComponent
Energy storage system component. It considers a fixed rate of charge and fixed efficiency.
Attributes:
- pnom_kW: float
Nominal active power (kW).
- soc_nom_kWh: float
Nominal state of charge (kWh).
- class hyveopt.components.Electrolizer(index: int = None, name: str = None, gain: Gain = None, pnom_kW: float = None, pmin_pu: float = None, pmax_pu: float = None)[source]
Bases:
GainComponent
Represents a hydrogen electrolizer.
Attributes:
- pnom_kW: float
Nominal
- pmin_pu: float
Minimum power consumption in per unit.
- pmax_pu: float
Maximum power consumption in per unit.
- class hyveopt.components.Gain(breakpoints: List[float], slopes: List[float], intercepts: List[float])[source]
Bases:
CustomAttribute
- property domain
- class hyveopt.components.GainComponent(index: int = None, name: str = None, gain: hyveopt.components.Gain = None)[source]
Bases:
Component
- class hyveopt.components.PVSystem(index: int = None, name: str = None, gain: hyveopt.components.Gain = None, snom_KVA: float = None, solar_irradiance: shilps.components.TSParameter = None)[source]
Bases:
GainComponent
- solar_irradiance: TSParameter = None
- class hyveopt.components.PlantTemplate(name: str = None, batteries: Dict[int, TemplateESS] = None, electrolizers: Dict[int, TemplateElectrolizer] = None, pv_systems: Dict[int, TemplatePVSystem] = None)[source]
Bases:
Entity
Template for a hydrogen plant.
- class hyveopt.components.Range(min: float, max: float)[source]
Bases:
CustomAttribute
- class hyveopt.components.TemplateESS(index: int = None, name: str = None, gain: Gain = None, pnom_kW: Range = None, soc_nom_kWh: Range = None)[source]
Bases:
ESS
Template storage system component. It considers a fixed rate of charge and fixed efficiency.
Attributes:
- pnom_kW: float
Nominal active power (kW).
- soc_nom_kWh: float
Nominal state of charge (kWh).
- efficiency: float
Round-trip efficiency.
- class hyveopt.components.TemplateElectrolizer(index: int = None, name: str = None, gain: Gain = None, pnom_kW: float | List[float] = None, pmin_pu: float = None, pmax_pu: float = None)[source]
Bases:
Electrolizer
Represents a hydrogen electrolizer with fixed efficiency.
Attributes:
- pnom_kW: float
Nominal
- pmin_pu: float
Minimum power consumption in per unit.
- pmax_pu: float
Maximum power consumption in per unit.
hyveopt.constants module
hyveopt.datasets module
- hyveopt.datasets.generate_green_hydrogen_price_series(start_price=5.0, length=100, trend=-0.02, volatility=0.1)[source]
Generates a time series for green hydrogen prices with a downward trend and random fluctuations.
Parameters: - start_price (float): Initial price of green hydrogen per kg. - length (int): Number of time steps (e.g., days or months) for the time series. - trend (float): Long-term trend (negative for decreasing prices). - volatility (float): Magnitude of random fluctuations around the trend.
Returns: - pd.DataFrame: A DataFrame containing the generated time series.
hyveopt.degradation module
hyveopt.electrochemistry module
- hyveopt.electrochemistry.membrane_conductivity(T_kelvin, lambda_mem)[source]
Calculate the membrane conductivity.
Parameters: - T_kelvin: Temperature in Kelvin - lambda_mem: Humidification of the membrane
Returns: - Membrane conductivity in S/cm
- hyveopt.electrochemistry.membrane_resistance(delta_mem, T_celsius, lambda_mem)[source]
Calculate the membrane resistance.
Parameters: - delta_mem: Thickness of the membrane in cm - T_celsius: Temperature in degrees Celsius - lambda_mem: Humidification of the membrane
Returns: - Membrane resistance in ohms
- hyveopt.electrochemistry.nernst_potential(T_celsius, P_H2, P_O2, P_H2O)[source]
Calculate the Nernst potential.
Parameters: - T_celsius: Temperature in degrees Celsius - P_H2: Partial pressure of hydrogen in bar - P_O2: Partial pressure of oxygen in bar - P_H2O: Partial pressure of water in bar
Returns: - Nernst potential in volts
hyveopt.mass_transport module
hyveopt.pdata module
- class hyveopt.pdata.ESS(index: int = None, name: str = None, gain: Gain = None, pnom_kW: float = None, soc_nom_kWh: float = None)[source]
Bases:
GainComponent
Energy storage system component. It considers a fixed rate of charge and fixed efficiency.
Attributes:
- pnom_kW: float
Nominal active power (kW).
- soc_nom_kWh: float
Nominal state of charge (kWh).
- class hyveopt.pdata.EconomicData(index: int = None, name: str = None, inv_cost_per_kw: float = None)[source]
Bases:
Component
Economic data for a hydrogen plant.
- class hyveopt.pdata.Electrolizer(index: int = None, name: str = None, gain: Gain = None, pnom_kW: float = None, pmin_pu: float = None, pmax_pu: float = None)[source]
Bases:
GainComponent
Represents a hydrogen electrolizer.
Attributes:
- pnom_kW: float
Nominal
- pmin_pu: float
Minimum power consumption in per unit.
- pmax_pu: float
Maximum power consumption in per unit.
- class hyveopt.pdata.Gain(breakpoints: List[float], slopes: List[float], intercepts: List[float])[source]
Bases:
CustomAttribute
- property domain
- piecewise_linear(x)[source]
Evaluate a piecewise linear function.
Parameters: x : array_like
Input array.
- breakpointslist or array_like
Breakpoints of the piecewise function.
- slopeslist or array_like
Slopes of the linear pieces.
- interceptslist or array_like
Intercepts of the linear pieces.
Returns: np.ndarray
Output array where each element is the result of the piecewise linear function.
- class hyveopt.pdata.GainComponent(index: int = None, name: str = None, gain: hyveopt.pdata.Gain = None)[source]
Bases:
Component
- class hyveopt.pdata.PVSystem(index: int = None, name: str = None, gain: hyveopt.pdata.Gain = None, snom_KVA: float = None, solar_irradiance: shilps.components.TSParameter = None)[source]
Bases:
GainComponent
- solar_irradiance: TSParameter = None
- class hyveopt.pdata.PlantTemplate(name: str = None, batteries: Dict[int, TemplateESS] = None, electrolizers: Dict[int, TemplateElectrolizer] = None, pv_systems: Dict[int, TemplatePVSystem] = None, location: tuple = None)[source]
Bases:
Entity
Template for a hydrogen plant.
- class hyveopt.pdata.Range(min: float, max: float)[source]
Bases:
CustomAttribute
- class hyveopt.pdata.TemplateESS(index: int = None, name: str = None, gain: Gain = None, pnom_kW: Range = None, soc_nom_kWh: Range = None, inv_cost_per_kw: float = None, bat_kw_to_kwh: float = None)[source]
Bases:
ESS
Template storage system component. It considers a fixed rate of charge and fixed efficiency.
Attributes:
- pnom_kW: float
Nominal active power (kW).
- soc_nom_kWh: float
Nominal state of charge (kWh).
- efficiency: float
Round-trip efficiency.
- class hyveopt.pdata.TemplateElectrolizer(index: int = None, name: str = None, gain: Gain = None, pnom_kW: float | List[float] = None, pmin_pu: float = None, pmax_pu: float = None, inv_cost_per_kw: float = None)[source]
Bases:
Electrolizer
Represents a hydrogen electrolizer with fixed efficiency.
Attributes:
- pnom_kW: float
Nominal
- pmin_pu: float
Minimum power consumption in per unit.
- pmax_pu: float
Maximum power consumption in per unit.
hyveopt.plant_design module
- class hyveopt.plant_design.HydrogenPlantDesign(plant_template: PlantTemplate, time_config: TimeConfig, tsdata: DataTimeSeries)[source]
Bases:
ModelPlantDesign
hyveopt.shilps_api module
hyveopt.skeleton module
This is a skeleton file that can serve as a starting point for a Python
console script. To run this script uncomment the following lines in the
[options.entry_points]
section in setup.cfg
:
console_scripts =
fibonacci = hyveopt.skeleton:run
Then run pip install .
(or pip install -e .
for editable mode)
which will install the command fibonacci
inside your current environment.
Besides console scripts, the header (i.e. until _logger
…) of this file can
also be used as template for Python modules.
- Note:
This file can be renamed depending on your needs or safely removed if not needed.
- References:
- hyveopt.skeleton.fib(n)[source]
Fibonacci example function
- Args:
n (int): integer
- Returns:
int: n-th Fibonacci number
- hyveopt.skeleton.main(args)[source]
Wrapper allowing
fib()
to be called with string arguments in a CLI fashionInstead of returning the value from
fib()
, it prints the result to thestdout
in a nicely formatted message.- Args:
- args (List[str]): command line parameters as list of strings
(for example
["--verbose", "42"]
).
- hyveopt.skeleton.parse_args(args)[source]
Parse command line parameters
- Args:
- args (List[str]): command line parameters as list of strings
(for example
["--help"]
).
- Returns:
argparse.Namespace
: command line parameters namespace
hyveopt.thermodynamics module
- hyveopt.thermodynamics.antoine_pressure(temp_celsius: float, A: float, B: float, C: float)[source]
Calculate the saturation pressure using the Antoine equation.
Parameters: - temp_celsius: Temperature in degrees Celsius - A: Antoine coefficient A - B: Antoine coefficient B - C: Antoine coefficient C
Returns: - Saturation pressure in bar
hyveopt.utils module
- hyveopt.utils.compute_financial_metrics(cashflows: array, discount_rate: float)[source]
Computes common financial metrics including NPV, IRR, and Payback Period.
Parameters: - cashflows: np.array of cashflows where the first value is the initial investment (negative)
and subsequent values are returns.
discount_rate: The discount rate as a decimal (e.g., 0.1 for 10%).
Returns: - A dictionary containing NPV, IRR, and Payback Period.
- hyveopt.utils.plot_scenarios_with_confidence(matrix, time_range, xlabel='Hour of Day', ylabel='Value')[source]
Plot multiple time series (scenarios) over a time range, with the average and confidence interval.
Args: - matrix (numpy.ndarray): 2D array of shape (n_scenarios, time_range). - time_range (array-like): Time range (e.g., array of hours of the day). - xlabel (str): Label for the x-axis. - ylabel (str): Label for the y-axis.
Returns: - fig: Handle to the generated figure.