From 63fbdf67c2ebbe78af947d79f1da45a645eb9c14 Mon Sep 17 00:00:00 2001 From: rodrigomha Date: Fri, 20 Dec 2024 11:42:53 -0800 Subject: [PATCH] formatter --- docs/src/formulation_library/Branch.md | 20 +++++++++---------- .../devices/TwoTerminalDC_branches.jl | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/docs/src/formulation_library/Branch.md b/docs/src/formulation_library/Branch.md index feca4bfde..73f8a6c43 100644 --- a/docs/src/formulation_library/Branch.md +++ b/docs/src/formulation_library/Branch.md @@ -15,9 +15,9 @@ 7. [`HVDCTwoTerminalPiecewiseLoss`](#HVDCTwoTerminalPiecewiseLoss) 8. [`HVDCTwoTerminalVSCLoss`](#HVDCTwoTerminalVSCLoss) 9. [`HVDCTwoTerminalVSCLossBilinear`](#HVDCTwoTerminalVSCLossBilinear) - 10. [`HVDCTwoTerminalVSCLossQuadratic`](#HVDCTwoTerminalVSCLossQuadratic) - 11. [`PhaseAngleControl`](#PhaseAngleControl) - 12. [Valid configurations](#Valid-configurations) +10. [`HVDCTwoTerminalVSCLossQuadratic`](#HVDCTwoTerminalVSCLossQuadratic) +11. [`PhaseAngleControl`](#PhaseAngleControl) +12. [Valid configurations](#Valid-configurations) ## `StaticBranch` @@ -310,7 +310,6 @@ In addition, the `HVDCLosses` are subtracted to the `from` bus in the `ActivePow * * * - ## `HVDCTwoTerminalPiecewiseLoss` Formulation valid for `PTDFPowerModel` Network model @@ -327,6 +326,7 @@ This formulation creates uses ``S`` segments to define different loss factors (p + Bounds: ``[R^\text{from,min}, R^\text{from,max}]`` + Symbol: ``f^\text{from}`` + - [`HVDCActivePowerReceivedToVariable`](@ref): + Bounds: ``[R^\text{to,min}, R^\text{to,max}]`` @@ -378,6 +378,7 @@ Define ``n=2S+2``, then the following constraints are used to specify the segmen 0 \le w_i \le z_i \text { for } i=1, ..., n-1 && \end{align*} ``` + with ``w_{S+1} = 0`` to prevent a solution in the deadband. Then the receiving flows can be computed as: ```math @@ -403,6 +404,7 @@ HVDCTwoTerminalVSCLoss + Bounds: ``[P^\text{from,min}, P^\text{from,max}]`` + Symbol: ``p_c^\text{from}`` + - [`HVDCActiveDCPowerSentToVariable`](@ref): + Bounds: ``[P^\text{to,min}, P^\text{to,max}]`` @@ -584,7 +586,6 @@ Each `HVDCActiveDCPowerSentFromVariable` ``f^\text{from}`` and `HVDCActiveDCPowe \end{align*} ``` - * * * ## `HVDCTwoTerminalVSCLossBilinear` @@ -601,6 +602,7 @@ HVDCTwoTerminalVSCLossBilinear + Bounds: ``[P^\text{from,min}, P^\text{from,max}]`` + Symbol: ``p_c^\text{from}`` + - [`HVDCActiveDCPowerSentToVariable`](@ref): + Bounds: ``[P^\text{to,min}, P^\text{to,max}]`` @@ -629,7 +631,6 @@ HVDCTwoTerminalVSCLossBilinear + Symbol: ``p_c^{loss}`` - **Static Parameters** - ``P^\text{from,min}`` = `PowerSystems.get_active_power_limits_from(branch).min` @@ -663,7 +664,6 @@ Each `HVDCActiveDCPowerSentFromVariable` ``p^\text{from}`` and `HVDCActiveDCPowe (p_{c,t}^{from})^2 + (q_{c,t}^{from})^2 \le \text{rating}^2, & \ \forall c \in \mathcal{C}, \ \forall t \in \mathcal{T} \\ (p_{c,t}^{to})^2 + (q_{c,t}^{to})^2 \le \text{rating}^2, & \ \forall c \in \mathcal{C}, \ \forall t \in \mathcal{T} \end{align*} - ``` * * * @@ -682,6 +682,7 @@ HVDCTwoTerminalVSCLossQuadratic + Bounds: ``[P^\text{from,min}, P^\text{from,max}]`` + Symbol: ``p_c^\text{from}`` + - [`HVDCActiveDCPowerSentToVariable`](@ref): + Bounds: ``[P^\text{to,min}, P^\text{to,max}]`` @@ -714,11 +715,11 @@ The `loss` term is a `PowerSystems.QuadraticCurve` that has the quadratic term ` **Expressions:** -Each `HVDCActiveDCPowerSentFromVariable` ``p^\text{from}`` and `HVDCActiveDCPowerSentToVariable` ``p^\text{to}`` is added to the nodal balance expression `ActivePowerBalance`, by subtracting the received flow to the respective bus. That is, ``p^\text{from}`` subtract the flow to the `from` bus, while ``p^\text{to}`` subtract the flow to the `to` bus. Similarly for the reactive power variables. +Each `HVDCActiveDCPowerSentFromVariable` ``p^\text{from}`` and `HVDCActiveDCPowerSentToVariable` ``p^\text{to}`` is added to the nodal balance expression `ActivePowerBalance`, by subtracting the received flow to the respective bus. That is, ``p^\text{from}`` subtract the flow to the `from` bus, while ``p^\text{to}`` subtract the flow to the `to` bus. Similarly for the reactive power variables. **Constraints:** -The quadratic model only approximates losses in the `from` side of the line, proportional to the `from` power sent or received. +The quadratic model only approximates losses in the `from` side of the line, proportional to the `from` power sent or received. ```math \begin{align*} @@ -727,7 +728,6 @@ The quadratic model only approximates losses in the `from` side of the line, pro (p_{c,t}^{from})^2 + (q_{c,t}^{from})^2 \le \text{rating}^2, & \ \forall c \in \mathcal{C}, & \ \forall t \in \mathcal{T} \\ (p_{c,t}^{to})^2 + (q_{c,t}^{to})^2 \le \text{rating}^2, & \ \forall c \in \mathcal{C}, \ \forall t \in \mathcal{T} \end{align*} - ``` * * * diff --git a/src/devices_models/devices/TwoTerminalDC_branches.jl b/src/devices_models/devices/TwoTerminalDC_branches.jl index 6f9de2522..c560e042e 100644 --- a/src/devices_models/devices/TwoTerminalDC_branches.jl +++ b/src/devices_models/devices/TwoTerminalDC_branches.jl @@ -2011,7 +2011,7 @@ function add_constraints!( for t in time_steps constraint[name, t] = JuMP.@constraint( JuMPmodel, - power_from_var[name, t] - losses_var[name, t] == -power_to_var[name, t] + power_from_var[name, t] - losses_var[name, t] == -power_to_var[name, t] ) end end