Skip to content

Commit

Permalink
Minor fix in model ACEc
Browse files Browse the repository at this point in the history
  • Loading branch information
jinningwang committed Dec 12, 2024
1 parent b9657fe commit c3a4745
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions andes/models/area.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ 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='B',
unit='MW/0.1Hz', power=True)
unit='MW/0.1Hz', power=True, non_positive=True)

self.busf = IdxParam(info='Optional BusFreq device idx', model='BusFreq',
default=None)
Expand All @@ -66,6 +66,7 @@ def __init__(self):
class ACEc(ACEData, 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.
Expand Down Expand Up @@ -110,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 Down

0 comments on commit c3a4745

Please sign in to comment.