device_scheduler.rst 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. .. _storage_device_scheduler:
  2. Storage device scheduler: Linear model
  3. =======================================
  4. Introduction
  5. --------------
  6. This generic storage device scheduler is able to handle an EMS with multiple devices, with various types of constraints on the EMS level and on the device level,
  7. and with multiple market commitments on the EMS level.
  8. A typical example is a house with many devices. The commitments are assumed to be with regard to the flow of energy to the device (positive for consumption, negative for production). In practice, this generic scheduler is used in the **StorageScheduler** to schedule a storage device.
  9. The solver minimizes the costs of deviating from the commitments.
  10. Notation
  11. ---------
  12. Indexes
  13. ^^^^^^^^
  14. ================================ ================================================ ==============================================================================================================
  15. Symbol Variable in the Code Description
  16. ================================ ================================================ ==============================================================================================================
  17. :math:`c` c Commitments, for example, day-ahead or intra-day market commitments.
  18. :math:`d` d Devices, for example, a battery or a load.
  19. :math:`j` j 0-indexed time dimension.
  20. ================================ ================================================ ==============================================================================================================
  21. .. note::
  22. The time index :math:`j` has two interpretations: a time period or an instantaneous moment at the end of time period :math:`j`.
  23. For example, :math:`j` in flow constraints correspond to time periods, whereas :math:`j` used in a stock constraint refers to the end of time period :math:`j`.
  24. Parameters
  25. ^^^^^^^^^^
  26. ================================ ================================================ ==============================================================================================================
  27. Symbol Variable in the Code Description
  28. ================================ ================================================ ==============================================================================================================
  29. :math:`Price_{up}(c,j)` up_price Price of incurring an upwards deviations in commitment :math:`c` during time period :math:`j`.
  30. :math:`Price_{down}(c,j)` down_price Price of incurring a downwards deviations in commitment :math:`c` during time period :math:`j`.
  31. :math:`\eta_{up}(d,j)` device_derivative_up_efficiency Upwards conversion efficiency.
  32. :math:`\eta_{down}(d,j)` device_derivative_down_efficiency Downwards conversion efficiency.
  33. :math:`Stock_{min}(d,j)` device_min Minimum quantity for the stock of device :math:`d` at the end of time period :math:`j`.
  34. :math:`Stock_{max}(d,j)` device_max Maximum quantity for the stock of device :math:`d` at the end of time period :math:`j`.
  35. :math:`\epsilon(d,j)` efficiencies Stock energy losses.
  36. :math:`P_{max}(d,j)` device_derivative_max Maximum flow of device :math:`d` during time period :math:`j`.
  37. :math:`P_{min}(d,j)` device_derivative_min Minimum flow of device :math:`d` during time period :math:`j`.
  38. :math:`P^{ems}_{min}(j)` ems_derivative_min Minimum flow of the EMS during time period :math:`j`.
  39. :math:`P^{ems}_{max}(j)` ems_derivative_max Maximum flow of the EMS during time period :math:`j`.
  40. :math:`Commitment(c,j)` commitment_quantity Commitment c (at EMS level) over time step :math:`j`.
  41. :math:`M` M Large constant number, upper bound of :math:`Power_{up}(d,j)` and :math:`|Power_{down}(d,j)|`.
  42. :math:`D(d,j)` stock_delta Explicit energy gain or loss of device :math:`d` during time period :math:`j`.
  43. ================================ ================================================ ==============================================================================================================
  44. Variables
  45. ^^^^^^^^^
  46. ================================ ================================================ ==============================================================================================================
  47. Symbol Variable in the Code Description
  48. ================================ ================================================ ==============================================================================================================
  49. :math:`\Delta_{up}(c,j)` commitment_upwards_deviation Upwards deviation from the power commitment :math:`c` of the EMS during time period :math:`j`.
  50. :math:`\Delta_{down}(c,j)` commitment_downwards_deviation Downwards deviation from the power commitment :math:`c` of the EMS during time period :math:`j`.
  51. :math:`\Delta Stock(d,j)` n/a Change of stock of device :math:`d` at the end of time period :math:`j`.
  52. :math:`P_{up}(d,j)` device_power_up Upwards power of device :math:`d` during time period :math:`j`.
  53. :math:`P_{down}(d,j)` device_power_down Downwards power of device :math:`d` during time period :math:`j`.
  54. :math:`P^{ems}(j)` ems_power Aggregated power of all the devices during time period :math:`j`.
  55. :math:`\sigma(d,j)` device_power_sign Upwards power activation if :math:`\sigma(d,j)=1`, downwards power activation otherwise.
  56. ================================ ================================================ ==============================================================================================================
  57. Cost function
  58. --------------
  59. The cost function quantifies the total cost of upwards and downwards deviations from the different commitments.
  60. .. math::
  61. :name: cost_function
  62. \min [\sum_{c,j} \Delta_{up}(c,j) \cdot Price_{up}(c,j) + \Delta_{down}(c,j) \cdot Price_{down}(c,j)]
  63. State dynamics
  64. ---------------
  65. To simplify the description of the model, the auxiliary variable :math:`\Delta Stock(d,j)` is introduced in the documentation. It represents the
  66. change of :math:`Stock(d,j)`, taking into account conversion efficiencies but not considering the storage losses.
  67. .. math::
  68. :name: stock
  69. \Delta Stock(d,j) = \frac{P_{down}(d,j)}{\eta_{down}(d,j) } + P_{up}(d,j) \cdot \eta_{up}(d,j) + D(d,j)
  70. .. math::
  71. :name: device_bounds
  72. Stock_{min}(d,j) \leq Stock(d,j) - Stock(d,-1)\leq Stock_{max}(d,j)
  73. Perfect efficiency
  74. ^^^^^^^^^^^^^^^^^^^
  75. .. math::
  76. :name: efficiency_e1
  77. Stock(d, j) = Stock(d, j-1) + \Delta Stock(d,j)
  78. Left efficiency
  79. ^^^^^^^^^^^^^^^^^
  80. First apply the stock change, then apply the losses (i.e. the stock changes on the left side of the time interval in which the losses apply)
  81. .. math::
  82. :name: efficiency_left
  83. Stock(d, j) = (Stock(d, j-1) + \Delta Stock(d,j)) \cdot \epsilon(d,j)
  84. Right efficiency
  85. ^^^^^^^^^^^^^^^^^
  86. First apply the losses, then apply the stock change (i.e. the stock changes on the right side of the time interval in which the losses apply)
  87. .. math::
  88. :name: efficiency_right
  89. Stock(d, j) = Stock(d, j-1) \cdot \epsilon(d,j) + \Delta Stock(d,j)
  90. Linear efficiency
  91. ^^^^^^^^^^^^^^^^^
  92. Assume the change happens at a constant rate, leading to a linear stock change, and exponential decay, within the current interval
  93. .. math::
  94. :name: efficiency_linear
  95. Stock(d, j) = Stock(d, j-1) \cdot \epsilon(d,j) + \Delta Stock(d,j) \cdot \frac{\epsilon(d,j) - 1}{log(\epsilon(d,j))}
  96. Constraints
  97. --------------
  98. Device bounds
  99. ^^^^^^^^^^^^^
  100. .. math::
  101. :name: device_derivative_bounds
  102. P_{min}(d,j) \leq P_{up}(d,j) + P_{down}(d,j)\leq P_{max}(d,j)
  103. .. math::
  104. :name: device_down_derivative_bounds
  105. min(P_{min}(d,j),0) \leq P_{down}(d,j)\leq 0
  106. .. math::
  107. :name: device_up_derivative_bounds
  108. 0 \leq P_{up}(d,j)\leq max(P_{max}(d,j),0)
  109. Upwards/Downwards activation selection
  110. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  111. Avoid simultaneous upwards and downwards activation during the same time period.
  112. .. math::
  113. :name: device_up_derivative_sign
  114. P_{up}(d,j) \leq M \cdot \sigma(d,j)
  115. .. math::
  116. :name: device_down_derivative_sign
  117. -P_{down}(d,j) \leq M \cdot (1-\sigma(d,j))
  118. Grid constraints
  119. ^^^^^^^^^^^^^^^^^
  120. .. math::
  121. :name: device_derivative_equalities
  122. P^{ems}(d,j) = P_{up}(d,j) + P_{down}(d,j)
  123. .. math::
  124. :name: ems_derivative_bounds
  125. P^{ems}_{min}(j) \leq \sum_d P^{ems}(d,j) \leq P^{ems}_{max}(j)
  126. Power coupling constraints
  127. ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  128. .. math::
  129. :name: ems_flow_commitment_equalities
  130. \sum_d P^{ems}(d,j) = \sum_c Commitment(c,j) + \Delta_{up}(c,j) + \Delta_{down}(c,j)