ams.core.service.ZonalSum#
- class ams.core.service.ZonalSum(u: Callable, zone: str, name: str = None, tex_name: str = None, unit: str = None, info: str = None, vtype: Type = None, rfun: Callable = None, rargs: dict = None, no_parse: bool = False, sparse: bool = False)[source]#
Build zonal sum matrix for a vector in the shape of collection model,
AreaorZone. The value array is in the shape of (nr, nc), where nr is the length of rid instance idx, and nc is the length of the cid value.In an IEEE-14 Bus system, we have the zonal definition by the
Zonemodel. Suppose in it we have two regions, "ZONE1" and "ZONE2".Follwing it, we have a zonal SFR requirement model
SFRthat defines the zonal reserve requirements for each zone.All 14 buses are classified to a zone by the IdxParam
zone, and the 5 generators are connected to buses (idx): [2, 3, 1, 6, 8], and the zone of these generators are thereby: ['ZONE1', 'ZONE1', 'ZONE2', 'ZONE2', 'ZONE1'].In the RTED model, we have the Vars
pruandprdin the shape of generators.Then, the Zone model has idx ['ZONE1', 'ZONE2'], and the
gsmvalue will be [[1, 1, 0, 0, 1], [0, 0, 1, 1, 0]].Finally, the zonal reserve requirements can be formulated as constraints in the optimization problem: "gsm @ pru <= du" and "gsm @ prd <= dd".
See
gsmdefinition inams.routines.rted.RTEDModelfor more details.- Parameters:
- uCallable
Input.
- zonestr
Zonal model name, e.g., "Area" or "Zone".
- namestr
Instance name.
- tex_namestr
TeX name.
- unitstr
Unit.
- infostr
Description.
- vtypeType
Variable type.
- rfunCallable, optional
Function to apply to the output of
fun.- rargsdict, optional
Keyword arguments to pass to
rfun.- no_parse: bool, optional
True to skip parsing the service.
- sparse: bool, optional
True to return output as scipy csr_matrix.
- __init__(u: Callable, zone: str, name: str = None, tex_name: str = None, unit: str = None, info: str = None, vtype: Type = None, rfun: Callable = None, rargs: dict = None, no_parse: bool = False, sparse: bool = False)[source]#
Methods
Assign memory for
self.vand set the array to zero.evaluate(*args, **kwargs)Return all the indexes of this item.
get_idx()Return name in a list
parse(*args, **kwargs)update()Update the Parameter value.
Attributes