{ "cells": [ { "cell_type": "markdown", "id": "65a3ce1a", "metadata": {}, "source": [ "(discharge_group)=\n", "# discharge_group\n", "The sum discharge of the objects connected to a discharge_group is restricted by the constraints defined in the discharge_group\n", "\n", "| | |\n", "|---|---|\n", "|Input connections|{ref}`plant`, {ref}`gate`, {ref}`tunnel`, {ref}`river`|\n", "|Output connections|{ref}`plant`, {ref}`gate`, {ref}`river`, {ref}`tunnel`|\n", "|License|SHOP_OPEN|\n", "|Release version|13.0.0.a|\n", "\n", "```{contents}\n", ":local:\n", ":depth: 1\n", "```\n", "\n", "## Introduction\n", "\n", "The discharge group functionality was originally created to model complex discharge restrictions in Swedish rivers with shared ownership. The functionality has since evolved to become more versatile, and can be used to add several types of sum discharge restrictions to a collection of different objects in SHOP. The discharge group object is a simple object which represents one or several sum discharge restrictions. All objects that are connected to a discharge group contribute to the total sum discharge which has to abide by the restrictions defined on the discharge group.\n", "\n", "||\n", "|---|\n", "| Figure 1: A representation of a discharge group connected to two [plants](plant) and one [gate](gate). |\n", "\n", "\n", "## 1 Necessary input and basic behavior\n", "\n", "There are no strictly necessary input attributes for the discharge_group object. To have any impact on the optimization problem, the discharge_group has to be connected to at least one physical object (see the valid connection list at the top of this page) and at least one constraint must be defined. The resulting total discharge in the discharge_group is found on the output TXY attribute [actual_discharge_m3s](discharge_group:actual_discharge_m3s), which is simply the sum of the discharge of all objects connected to the discharge_group.\n", "\n", "## 2 Simple sum discharge constraints\n", "\n", "The simplest sum discharge constraints that can be defined on a discharge_group are minimum and maximum discharge limits. These constraints can be specified with the [min_discharge_m3s](discharge_group:min_discharge_m3s) and [max_discharge_m3s](discharge_group:max_discharge_m3s) TXY attributes. The penalty cost for breaking these min and max limits can be specified with the [min_discharge_penalty_cost](discharge_group:min_discharge_penalty_cost) and [max_discharge_penalty_cost](discharge_group:max_discharge_penalty_cost) TXY attributes, otherwise the penalty cost is set by the global [discharge_group_penalty_cost](global_settings:discharge_group_penalty_cost) attribute on the [global_settings](global_settings) object. Any incurred penalties are saved to the [min_discharge_penalty](discharge_group:min_discharge_penalty) and [max_discharge_penalty](discharge_group:max_discharge_penalty) output TXY attributes.\n", "\n", "Basic ramping constraints for the sum discharge can also be defined through the TXY attributes [ramping_up_m3s](discharge_group:ramping_up_m3s) and [ramping_down_m3s](discharge_group:ramping_down_m3s), these dictate how much the sum discharge can change in one hour in either direction. Note that the unit of the ramping attributes is m3/s per hour, which is converted internally in SHOP to account for the length of each time step in the current optimization run. No ramping constraints are added for the initial time step. Accompanying TXY attributes to define the penalty cost for breaking the ramping constraints are available as [ramping_up_penalty_cost](discharge_group:ramping_up_penalty_cost) and [ramping_down_penalty_cost](discharge_group:ramping_down_penalty_cost). The global [discharge_group_penalty_cost](global_settings:discharge_group_penalty_cost) is again used as penalty cost if no penalty cost attributes are given. If the ramping constraints are broken, the resulting penalty is saved to the [ramping_up_penalty](discharge_group:ramping_up_penalty) and [ramping_down_penalty](discharge_group:ramping_down_penalty) output TXY attributes.\n", "\n", "\n", "## 3 Modelling accumulated volume constraints with slack\n", "\n", "Some discharge constraints are formulated as a discharge profile with a certain tolerances for deviating from the accumulated discharged volume specified by the profile. This can be modelled by a discharge_group with the [weighted_discharge_m3s](discharge_group:weighted_discharge_m3s) attribute defining the discharge profile. The maximal accumulated volume deviation from this profile that is tolerated is then specified with the [max_accumulated_deviation_mm3_up](discharge_group:max_accumulated_deviation_mm3_up) and [max_accumulated_deviation_mm3_down](discharge_group:max_accumulated_deviation_mm3_down) attributes. If these tolerances are zero at all times, the discharge profile must be followed exactly to avoid incurring any penalties. Otherwise, the sum discharge can deviate from the profile as long as the total discharged volume is within the specified bounds. Any initial accumulated deviation at the start of the optimization period can be specified with the [initial_deviation_mm3](discharge_group:initial_deviation_mm3) double attribute. The [accumulated_deviation_mm3](discharge_group:accumulated_deviation_mm3) output TXY is the resulting accumulated volume deviation of the discharge_group, while [upper_slack_mm3](discharge_group:upper_slack_mm3) and [lower_slack_mm3](discharge_group:lower_slack_mm3) calculate the distance from the values in accumulated_deviation_mm3 to the upper and lower limits. Note that all of the attributes related to volume (name ends with '_mm3') represent values at the end of each time step. That means that the first value in accumulated_deviation_mm3 is the accumulated deviation at the *end* of the first time step, not the deviation at the start (which would be equal to initial_deviation_mm3). [penalty_cost_up_per_mm3](discharge_group:penalty_cost_up_per_mm3) and [penalty_cost_down_per_mm3](discharge_group:penalty_cost_down_per_mm3) specify the penalty cost for breaking the accumulated discharge restriction, and the [upper_penalty_mm3](discharge_group:upper_penalty_mm3) and [lower_penalty_mm3](discharge_group:lower_penalty_mm3) attributes save the incurred penalty. An illustration of these restrictions and their impact on the optimization results are shown in Figure 2. The topology used is the one illustrated in Figure 1.\n", "\n", "||\n", "|---|\n", "| Figure 2: Two cases where the penalty for breaking the accumulated deviation tolerances are low (first row) and high (second row). The initial deviation is set to -0.01 Mm3, and the deviation tolerances are set to 0.02 Mm3 in both directions. The discharge in the case where without any discharge_group is also shown as a yellow line. The sum discharge adapts to the discharge profile when penalties are low, but the accumulated volume deviation is often outside the specified tolerances. When the penalties are set higher, the accumulated discharge stays within the tolerances for all time steps. |\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "## Attributes" ] }, { "cell_type": "code", "execution_count": 1, "id": "8dbdfb0b", "metadata": { "tags": [ "remove-input", "full-width" ] }, "outputs": [ { "data": { "text/html": [ "