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, Area or Zone. 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 Zone model. Suppose in it we have two regions, "ZONE1" and "ZONE2".

Follwing it, we have a zonal SFR requirement model SFR that 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 pru and prd in the shape of generators.

Then, the Zone model has idx ['ZONE1', 'ZONE2'], and the gsm value 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 gsm definition in ams.routines.rted.RTEDModel for 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(n)

Assign memory for self.v and set the array to zero.

evaluate(*args, **kwargs)

get_all_idxes()

Return all the indexes of this item.

get_idx()

get_names()

Return name in a list

parse(*args, **kwargs)

update()

Update the Parameter value.

Attributes

class_name

Return the class name

n

Return the count of values in self.v.

shape

Return the shape of the service.

size

Return the size.

v

Value of the service.

v0

v1