hydesign.ems.ems_BM

Classes

ems

Energy management optimization model

ems_long_term_operation

Long term operation EMS. Predicts the operation of the plant throughout the entire lifetime, taking into account the battery

Functions

expand_to_lifetime(x[, life_h, weeks_per_season_per_year])

Expands (by repeating) a given variable to match an expected lifetime length.

ems_ORtools(wind_ts, solar_ts, price_ts, wind_BM_ts, ...)

ems_ORtools_parts(wind_ts, solar_ts, price_ts, ...[, ...])

EMS solver implemented in OR tools

ems_cplex(wind_ts, solar_ts, price_ts, wind_BM_ts, ...)

ems_cplex_parts(wind_ts, solar_ts, price_ts, ...[, ...])

EMS solver implemented in cplex

ems_Wind_Solar_Battery_Pyomo_parts(wind_ts, solar_ts, ...)

EMS solver implemented in Pyomo (Parts)

split_in_batch(array, N)

ems_Wind_Solar_Battery_Pyomo(wind_ts, solar_ts, ...[, ...])

EMS solver implemented in Pyomo

ems_operation_no_degradation(wind_t_deg, ...)

ems_operation_wind_batt_deg(wind_t_deg, ...[, batch_size])

operation_wind_batt_deg_parts(wind_t_deg, ...)

EMS operation for degraded Wind and battery based on an existing EMS.

operation_rule_base_no_penalty(wind_t_deg, ...[, ...])

EMS operation for degraded PV and battery based on an existing EMS.

Module Contents

class hydesign.ems.ems_BM.ems(N_time, life_h=25 * 365 * 24, weeks_per_season_per_year=None, ems_type='cplex')[source]

Bases: openmdao.api.ExplicitComponent

Energy management optimization model The energy management system optimization model consists in maximizing the revenue generated by the plant over a period of time, including a possible penalty for not meeting the requirement of energy generation during peak hours over the period. It also assigns a cost for rapid fluctuations of the battery in order to slow down its degradation. The EMS type can be either a CPLEX optimization or a rule-based ems (Faster but not as optimal).

Parameters:
  • wind_t (WPP power time series in DA [MW])

  • wind_BM_t (WPP power time series in HA [MW])

  • solar_t (PVP power time series [MW])

  • price_t (Electricity price time series)

  • price_up_reg_t (Up regulation price time series)

  • price_dwn_reg_t (Down regulation price time series)

  • SO_imbalance_t (System operator power imbalance time series)

  • b_P (Battery power capacity [MW])

  • b_E (Battery energy storage capacity [MW])

  • G_MW (Grid capacity [MW])

  • penalty_BM (Penalty for not meeting scheduled DA power)

  • bi_directional_state (Status of bi-directional flow from grid)

  • battery_depth_of_discharge (battery depth of discharge)

  • battery_charge_efficiency (Wake affected power curve)

  • peak_hr_quantile (Quantile of price time series to define peak price hours (above this quantile))

  • cost_of_battery_P_fluct_in_peak_price_ratio (cost of battery power fluctuations computed as a peak price ratio)

  • n_full_power_hours_expected_per_day_at_peak_price (Penalty occurs if number of full power hours expected per day at peak price are not reached)

Returns:

  • wind_t_ext (WPP power time series)

  • solar_t_ext (PVP power time series)

  • price_t_ext (Electricity price time series)

  • hpp_t (HPP power time series)

  • hpp_curt_t (HPP curtailed power time series)

  • b_t (Battery charge/discharge power time series)

  • b_E_SOC_t (Battery energy SOC time series)

  • penalty_t (Penalty for not reaching expected energy productin at peak hours)

weeks_per_season_per_year = None[source]
N_time[source]
ems_type = 'cplex'[source]
life_h = 219000[source]
setup()[source]

Declare inputs and outputs.

Available attributes:

name pathname comm options

compute(inputs, outputs)[source]

Compute outputs given inputs. The model is assumed to be in an unscaled state.

An inherited component may choose to either override this function or to define a compute_primal function.

Parameters:
  • inputs (Vector) – Unscaled, dimensional input variables read via inputs[key].

  • outputs (Vector) – Unscaled, dimensional output variables read via outputs[key].

  • discrete_inputs (dict-like or None) – If not None, dict-like object containing discrete input values.

  • discrete_outputs (dict-like or None) – If not None, dict-like object containing discrete output values.

class hydesign.ems.ems_BM.ems_long_term_operation(N_time, num_batteries=1, life_h=25 * 365 * 24, ems_type='No_degradation', load_min_penalty_factor=1000000.0)[source]

Bases: openmdao.api.ExplicitComponent

Long term operation EMS. Predicts the operation of the plant throughout the entire lifetime, taking into account the battery and PV degradations.

Parameters:
  • ii_time (indices on the liftime timeseries. Hydesign operates in each range at constant battery health.)

  • SoH (Battery state of health at discretization levels)

  • wind_t_ext_deg (WPP power time series with degradation [MW])

  • solar_t_ext_deg (WPP power time series with degradation [MW])

  • wind_t_ext (WPP power time series [MW])

  • solar_t_ext (PVP power time series [MW])

  • price_t_ext (Electricity price time series)

  • b_P (Battery power capacity)

  • b_E (Battery energy storage capacity)

  • G_MW (Grid capacity)

  • battery_depth_of_discharge (battery depth of discharge)

  • battery_charge_efficiency (battery charge efficiency)

  • hpp_curt_t (HPP curtailed power time series)

  • b_t (Battery charge/discharge power time series)

  • b_E_SOC_t (Battery energy SOC time series)

  • peak_hr_quantile (Quantile of price time series to define peak price hours)

  • n_full_power_hours_expected_per_day_at_peak_price (Penalty occurs if number of full power hours expected per day at peak price are not reached)

Returns:

  • hpp_t_with_deg (HPP power time series)

  • hpp_curt_t_with_deg (HPP curtailed power time series)

  • b_t_with_deg (Battery charge/discharge power time series)

  • b_E_SOC_t_with_deg (Battery energy SOC time series)

  • penalty_t_with_deg (penalty for not reaching expected energy production at peak hours)

  • total_curtailment (total curtailment in the lifetime)

N_time[source]
life_h = 219000[source]
ems_type = 'No_degradation'[source]
load_min_penalty_factor = 1000000.0[source]
setup()[source]

Declare inputs and outputs.

Available attributes:

name pathname comm options

compute(inputs, outputs)[source]

Compute outputs given inputs. The model is assumed to be in an unscaled state.

An inherited component may choose to either override this function or to define a compute_primal function.

Parameters:
  • inputs (Vector) – Unscaled, dimensional input variables read via inputs[key].

  • outputs (Vector) – Unscaled, dimensional output variables read via outputs[key].

  • discrete_inputs (dict-like or None) – If not None, dict-like object containing discrete input values.

  • discrete_outputs (dict-like or None) – If not None, dict-like object containing discrete output values.

hydesign.ems.ems_BM.expand_to_lifetime(x, life_h=25 * 365 * 24, weeks_per_season_per_year=None)[source]

Expands (by repeating) a given variable to match an expected lifetime length.

If weeks_per_season_per_year is an int then it will first build a year out of the selected weeks

Parameters:
  • x (input variable)

  • life_h (lifetime in hours.)

  • weeks_per_season_per_year (None or int.)

Returns:

x_ext

Return type:

extended variable

hydesign.ems.ems_BM.ems_ORtools(wind_ts, solar_ts, price_ts, wind_BM_ts, price_up_reg_ts, price_dwn_reg_ts, SO_imbalance_ts, penalty_BM, bi_directional_status, P_batt_MW, E_batt_MWh_t, hpp_grid_connection, battery_depth_of_discharge, charge_efficiency, peak_hr_quantile=0.9, cost_of_battery_P_fluct_in_peak_price_ratio=0.5, n_full_power_hours_expected_per_day_at_peak_price=3, batch_size=1 * 24)[source]
hydesign.ems.ems_BM.ems_ORtools_parts(wind_ts, solar_ts, price_ts, wind_BM_ts, price_up_reg_ts, price_dwn_reg_ts, SO_imbalance_ts, penalty_BM, bi_directional_status, P_batt_MW, E_batt_MWh_t, hpp_grid_connection, battery_depth_of_discharge, charge_efficiency, peak_hr_quantile=0.9, cost_of_battery_P_fluct_in_peak_price_ratio=0.5, n_full_power_hours_expected_per_day_at_peak_price=3)[source]

EMS solver implemented in OR tools

Parameters:
  • wind_ts (WPP power time series in SM or DA)

  • wind_ts_BM (WPP power time series in BM or HA)

  • solar_ts (PVP power time series)

  • price_ts (price time series for Spot Market)

  • price_up_reg_ts (price time series for up regulation, mostly greater than or equal to SM price)

  • price_dwn_reg_ts (price time series for down regulation, mostly less than or equal to SM price)

  • SO_imbalance_ts (System operator power imbalance time series, to identify the need of up or down regulation at system level)

  • penalty_BM (whenever the scheduled DA power is not met, and that deficit power is taken from some other unit paid at price_reg_up and is generally higher than price_reg_up)

  • P_batt_MW (battery power)

  • E_batt_MWh_t (battery energy capacity time series)

  • hpp_grid_connection (grid connection)

  • battery_depth_of_discharge (battery depth of discharge)

  • charge_efficiency (battery charge efficiency)

  • peak_hr_quantile (quantile of price time series to define peak price hours)

  • cost_of_battery_P_fluct_in_peak_price_ratio (cost of battery power fluctuations computed as a peak price ratio)

  • n_full_power_hours_expected_per_day_at_peak_price (Penalty occurs if number of full power hours expected per day at peak price are not reached)

  • bi_directional_status (status of bi-directional flow from grid, 0 for No and 1 for Yes)

Returns:

  • P_HPP_ts (HPP power time series in SM)

  • P_HPP_BM_ts (HPP power time series in BM)

  • P_curtailment_ts (HPP curtailed power time series in SM)

  • P_curtailment_BM_ts (HPP curtailed power time series in BM)

  • …P_penalty_BM_t (power time series for the scheduled DA power not met in HA)

  • P_charge_discharge_ts (Battery charge - discharge power time series in SM)

  • P_charge_discharge_BM_ts (Battery charge - discharge power time series in BM)

  • P_up_reg_ts (Up regulation power time series)

  • P_dw_reg_ts (Down regulation power time series)

  • …P_up_HPP_max_t (Maximum Up regulation power time series)

  • …P_dw_HPP_max_t (Maximum Down regulation power time series)

  • E_SOC_ts (Battery energy SOC time series)

  • penalty_ts

  • …z_t (state of battery operation, 0 if charging and 1 if discharging)

hydesign.ems.ems_BM.ems_cplex(wind_ts, solar_ts, price_ts, wind_BM_ts, price_up_reg_ts, price_dwn_reg_ts, SO_imbalance_ts, penalty_BM, bi_directional_status, P_batt_MW, E_batt_MWh_t, hpp_grid_connection, battery_depth_of_discharge, charge_efficiency, peak_hr_quantile=0.9, cost_of_battery_P_fluct_in_peak_price_ratio=0.5, n_full_power_hours_expected_per_day_at_peak_price=3, batch_size=43)[source]
hydesign.ems.ems_BM.ems_cplex_parts(wind_ts, solar_ts, price_ts, wind_BM_ts, price_up_reg_ts, price_dwn_reg_ts, SO_imbalance_ts, penalty_BM, bi_directional_status, P_batt_MW, E_batt_MWh_t, hpp_grid_connection, battery_depth_of_discharge, charge_efficiency, peak_hr_quantile=0.9, cost_of_battery_P_fluct_in_peak_price_ratio=0.5, n_full_power_hours_expected_per_day_at_peak_price=3)[source]

EMS solver implemented in cplex

Parameters:
  • wind_ts (WPP power time series in SM or DA)

  • wind_ts_BM (WPP power time series in BM or HA)

  • solar_ts (PVP power time series)

  • price_ts (price time series for Spot Market)

  • price_up_reg_ts (price time series for up regulation, mostly greater than or equal to SM price)

  • price_dwn_reg_ts (price time series for down regulation, mostly less than or equal to SM price)

  • SO_imbalance_ts (System operator power imbalance time series, to identify the need of up or down regulation at system level)

  • penalty_BM (whenever the scheduled DA power is not met, and that deficit power is taken from some other unit paid at price_reg_up and is generally higher than price_reg_up)

  • P_batt_MW (battery power)

  • E_batt_MWh_t (battery energy capacity time series)

  • hpp_grid_connection (grid connection)

  • battery_depth_of_discharge (battery depth of discharge)

  • charge_efficiency (battery charge efficiency)

  • peak_hr_quantile (quantile of price time series to define peak price hours)

  • cost_of_battery_P_fluct_in_peak_price_ratio (cost of battery power fluctuations computed as a peak price ratio)

  • n_full_power_hours_expected_per_day_at_peak_price (Penalty occurs if number of full power hours expected per day at peak price are not reached)

  • bi_directional_status (status of bi-directional flow from grid, 0 for No and 1 for Yes)

Returns:

  • P_HPP_ts (HPP power time series in SM)

  • P_HPP_BM_ts (HPP power time series in BM)

  • P_curtailment_ts (HPP curtailed power time series in SM)

  • P_curtailment_BM_ts (HPP curtailed power time series in BM)

  • …P_penalty_BM_t (power time series for the scheduled DA power not met in HA)

  • P_charge_discharge_ts (Battery charge - discharge power time series in SM)

  • P_charge_discharge_BM_ts (Battery charge - discharge power time series in BM)

  • P_up_reg_ts (Up regulation power time series)

  • P_dw_reg_ts (Down regulation power time series)

  • …P_up_HPP_max_t (Maximum Up regulation power time series)

  • …P_dw_HPP_max_t (Maximum Down regulation power time series)

  • E_SOC_ts (Battery energy SOC time series)

  • penalty_ts

  • …z_t (state of battery operation, 0 if charging and 1 if discharging)

hydesign.ems.ems_BM.ems_Wind_Solar_Battery_Pyomo_parts(wind_ts, solar_ts, price_ts, P_batt_MW, E_batt_MWh_t, hpp_grid_connection, battery_depth_of_discharge, charge_efficiency, peak_hr_quantile=0.9, cost_of_battery_P_fluct_in_peak_price_ratio=0.5, n_full_power_hours_expected_per_day_at_peak_price=3)[source]

EMS solver implemented in Pyomo (Parts)

Parameters:
  • wind_ts (WPP power time series)

  • solar_ts (PVP power time series)

  • price_ts (price time series)

  • P_batt_MW (battery power)

  • E_batt_MWh_t (battery energy capacity time series)

  • hpp_grid_connection (grid connection)

  • battery_depth_of_discharge (battery depth of discharge)

  • charge_efficiency (battery charge efficiency)

  • peak_hr_quantile (quantile of price time series to define peak price hours)

  • cost_of_battery_P_fluct_in_peak_price_ratio (cost of battery power fluctuations computed as a peak price ratio)

  • n_full_power_hours_expected_per_day_at_peak_price (Penalty occurs if number of full power hours expected per day at peak price are not reached)

Returns:

  • P_HPP_ts (HPP power time series)

  • P_curtailment_ts (HPP curtailed power time series)

  • P_charge_discharge_ts (Battery charge/discharge power time series)

  • E_SOC_ts (Battery energy SOC time series)

  • penalty_ts (penalty time series for not reaching expected energy production at peak hours)

hydesign.ems.ems_BM.split_in_batch(array, N)[source]
hydesign.ems.ems_BM.ems_Wind_Solar_Battery_Pyomo(wind_ts, solar_ts, price_ts, P_batt_MW, E_batt_MWh_t, hpp_grid_connection, battery_depth_of_discharge, charge_efficiency, peak_hr_quantile=0.9, cost_of_battery_P_fluct_in_peak_price_ratio=0.5, n_full_power_hours_expected_per_day_at_peak_price=3, batch_size=7 * 24)[source]

EMS solver implemented in Pyomo

Parameters:
  • wind_ts (WPP power time series)

  • solar_ts (PVP power time series)

  • price_ts (price time series)

  • P_batt_MW (battery power)

  • E_batt_MWh_t (battery energy capacity time series)

  • hpp_grid_connection (grid connection)

  • battery_depth_of_discharge (battery depth of discharge)

  • charge_efficiency (battery charge efficiency)

  • peak_hr_quantile (quantile of price time series to define peak price hours)

  • cost_of_battery_P_fluct_in_peak_price_ratio (cost of battery power fluctuations computed as a peak price ratio)

  • n_full_power_hours_expected_per_day_at_peak_price (Penalty occurs if number of full power hours expected per day at peak price are not reached)

Returns:

  • P_HPP_ts (HPP power time series)

  • P_curtailment_ts (HPP curtailed power time series)

  • P_charge_discharge_ts (Battery charge/discharge power time series)

  • E_SOC_ts (Battery energy SOC time series)

  • penalty_ts (penalty time series for not reaching expected energy production at peak hours)

hydesign.ems.ems_BM.ems_operation_no_degradation(wind_t_deg, batt_degradation, hpp_curt_t, b_t, b_E_SOC_t, b_P, b_E, battery_depth_of_discharge, battery_charge_efficiency, P_up_reg_t, P_dwn_reg_t, P_up_max_t, P_dwn_max_t, price_up_t, price_dwn_t, hpp_t, penalty_BM)[source]
hydesign.ems.ems_BM.ems_operation_wind_batt_deg(wind_t_deg, batt_degradation, hpp_curt_t, b_t, b_E_SOC_t, b_P, b_E, battery_depth_of_discharge, battery_charge_efficiency, P_up_reg_t, P_dwn_reg_t, P_up_max_t, P_dwn_max_t, price_up_t, price_dwn_t, hpp_t, penalty_BM, batch_size=365 * 24)[source]
hydesign.ems.ems_BM.operation_wind_batt_deg_parts(wind_t_deg, batt_degradation, hpp_curt_t, b_t, b_E_SOC_t, b_P, b_E, battery_depth_of_discharge, battery_charge_efficiency, P_up_reg_t, P_dwn_reg_t, P_up_max_t, P_dwn_max_t, price_up_t, price_dwn_t, hpp_t, penalty_BM, b_E_SOC_0)[source]

EMS operation for degraded Wind and battery based on an existing EMS.

Parameters:
  • wind_t_deg (Wind time series including degradation)

  • solar_t_deg (PV time series including degradation)

  • batt_degradation (Battery degradation as health factor [0=dead,1=new])

  • wind_t (WPP power time series)

  • solar_t (PVP power time series)

  • hpp_curt_t (HPP curtailment time series results form an EMS planed without degradation)

  • hpp_curt_BM_t (HPP curtailment time series results form an EMS planed without degradation in BM)

  • b_t (HPP battery power (charge/discharge) time series results form an EMS planed without degradation)

  • b_BM_t (HPP battery power (charge/discharge) time series results form an EMS planed without degradation in BM)

  • b_E_SOC_t (HPP battery state of charge (SoC) time series results form an EMS planed without degradation)

  • b_E_SOC_0 (Initial charge status of the actual operation)

  • price_ts (price time series)

  • G_MW (grid connection)

  • E_batt_MWh_t (battery energy capacity time series)

  • battery_depth_of_discharge (battery depth of discharge)

  • battery_charge_efficiency (battery charge efficiency)

  • peak_hr_quantile (quantile of price time series to define peak price hours)

  • cost_of_battery_P_fluct_in_peak_price_ratio (cost of battery power fluctuations computed as a peak price ratio)

  • n_full_power_hours_expected_per_day_at_peak_price (Penalty occurs if number of full power hours expected per day at peak price are not reached)

Returns:

  • Hpp_deg (HPP power time series)

  • P_curt_deg (HPP curtailed power time series)

  • b_t_sat (Battery charge/discharge power time series)

  • b_E_SOC_t_sat (Battery energy SOC time series)

  • Hpp_up (Up regulation power time series)

  • Hpp_dwn (Down regulation power time series)

  • penalty_ts (penalty for not reaching expected energy production at peak hours)

hydesign.ems.ems_BM.operation_rule_base_no_penalty(wind_t_deg, solar_t_deg, batt_degradation, wind_t, solar_t, hpp_curt_t, b_t, b_E_SOC_t, G_MW, b_E, battery_depth_of_discharge, battery_charge_efficiency, b_E_SOC_0=None, load_min=3, load_min_penalty_factor=1000000.0, change_BES_charging='only_for_less_power')[source]

EMS operation for degraded PV and battery based on an existing EMS.

Parameters:
  • wind_t_deg (Wind time series including degradation)

  • solar_t_deg (PV time series including degradation)

  • batt_degradation (Battery degradation as health factor [0=dead,1=new])

  • b_t (HPP battery power (charge/discharge) time series results form an EMS planed without degradation)

  • b_E_SOC_t (HPP battery state of charge (SoC) time series results form an EMS planed without degradation)

  • G_MW (grid connection)

  • E_batt_MWh_t (battery energy capacity time series)

  • battery_depth_of_discharge (battery depth of discharge)

  • battery_charge_efficiency (battery charge efficiency)

  • b_E_SOC_0 (Initial charge status of the actual operation)

  • load_min (minimum electrical load to meet [MW])

  • load_min_penalty_factor (penalty factor to scale the penalty when not meeting required load)

Returns:

  • Hpp_deg (HPP power time series)

  • P_curt_deg (HPP curtailed power time series)

  • b_t_sat (Battery charge/discharge power time series)

  • b_E_SOC_t_sat (Battery energy SOC time series)

  • penalty_ts (penalty for not reaching minimum electrical load constraint)