Skip to content

Commit

Permalink
Merge pull request #586 from jinningwang/bias
Browse files Browse the repository at this point in the history
  • Loading branch information
cuihantao authored Dec 13, 2024
2 parents b771d98 + 23ee2ee commit e442d38
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 5 deletions.
27 changes: 22 additions & 5 deletions andes/models/area.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,21 +56,29 @@ class ACEData(ModelData):
def __init__(self):
ModelData.__init__(self)
self.bus = IdxParam(model='Bus', info="bus idx for freq. measurement", mandatory=True)
self.bias = NumParam(default=1.0, info='bias parameter', tex_name=r'\beta',
unit='MW/0.1Hz', power=True)
self.bias = NumParam(default=-1.0, info='bias parameter', tex_name='B',
unit='MW/0.1Hz', power=True, non_positive=True)

self.busf = IdxParam(info='Optional BusFreq device idx', model='BusFreq',
default=None)


class ACEc(ACEData, Model):
"""
Area Control Error model.
Area Control Error model, where bias (B) is an approximation of the actual frequency response (:math:`\\beta`).
Given NERC's definition, the bias should be a negative number.
Continuous frequency sampling.
System base frequency from ``system.config.freq`` is used.
Note: area idx is automatically retrieved from `bus`.
Reference:
NERC, "Balancing and Frequency Control Reference Document, Chapter 1 Balancing Fundamentals: Bias
(B) vs. Frequency Response (Beta)", 2021. Available:
https://www.nerc.com/comm/RSTC_Reliability_Guidelines/Reference_Document_NERC_Balancing_and_Frequency_Control.pdf
"""

def __init__(self, system, config):
Expand Down Expand Up @@ -103,10 +111,12 @@ def __init__(self, system, config):
info='Bus frequency',
unit='p.u. (Hz)'
)
# NOTE: here, we use -abs(bias) to ensure that bias is negative to ensure compatibility
# with previous versions
self.ace = Algeb(info='area control error',
unit='p.u. (MW)',
tex_name='ace',
e_str='10 * (bias * imva) * sys_f * (f - 1) - ace',
e_str='- 10 * (-abs(bias) * imva) * sys_f * (f - 1) - ace',
)


Expand All @@ -122,6 +132,13 @@ class ACE(ACEc):
can be specified in ``ACE.config.offset``.
Note: area idx is automatically retrieved from `bus`.
Reference:
NERC, "Balancing and Frequency Control Reference Document, Chapter 1 Balancing Fundamentals: ACE Review",
2021. Available:
https://www.nerc.com/comm/RSTC_Reliability_Guidelines/Reference_Document_NERC_Balancing_and_Frequency_Control.pdf
"""

def __init__(self, system, config):
Expand All @@ -140,4 +157,4 @@ def __init__(self, system, config):
info='Sampled freq.',
)

self.ace.e_str = '10 * (bias * imva) * sys_f * (fs_v - 1) - ace'
self.ace.e_str = '- 10 * (bias * imva) * sys_f * (fs_v - 1) - ace'
2 changes: 2 additions & 0 deletions docs/source/release-notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ Other changes:
- Enhanced three-winding transformer parsing in PSS/E raw files by assigning the equivalent star bus ``area``,
``owner``, and ``zone`` using the high-voltage bus values.
- Minor fix on model ``TGOV1NDB``
- Clarification on models ``ACEc`` and ``ACE`` given NERC's definition, as NERC suggesst that both bias and beta
should be nevative

v1.9.2 (2024-03-25)
-------------------
Expand Down

0 comments on commit e442d38

Please sign in to comment.