mp.form
- class mp.form
Bases:
handle
mp.form
- Abstract base class for MATPOWER formulation.Used as a mix-in class for all network model element classes. That is, each concrete network model element class must inherit, at least indirectly, from both
mp.nm_element
andmp.form
.mp.form
provides properties and methods that are specific to the network model formulation (e.g. DC version, AC polar power version, etc.).For more details, see the Network Model Formulations section in the MATPOWER Developer’s Manual and the derivations in MATPOWER Technical Note 5.
- mp.form Properties:
subclasses provide properties for model parameters
- mp.form Methods:
form_name()
- get char array w/name of formulationform_tag()
- get char array w/short label of formulationmodel_params()
- get cell array of names of model parametersmodel_vvars()
- get cell array of names of voltage state variablesmodel_zvars()
- get cell array of names of non-voltage state variablesget_params()
- get network model element parametersfind_form_class()
- get name of network element object’s formulation subclass
See also
mp.nm_element
.- Method Summary
- form_name()
Get user-readable name of formulation, e.g.
'DC'
,'AC-cartesian'
,'AC-polar'
.name = nme.form_name()
- Output:
name (char array) – name of formulation
Note: This is an abstract method that must be implemented by a subclass.
- form_tag()
Get short label of formulation, e.g.
'dc'
,'acc'
,'acp'
.tag = nme.form_tag()
- Output:
tag (char array) – short label of formulation
Note: This is an abstract method that must be implemented by a subclass.
- model_params()
Get cell array of names of model parameters.
params = nme.model_params()
- Output:
params (cell array of char arrays) – names of object properies for model parameters
Note: This is an abstract method that must be implemented by a subclass.
- model_vvars()
Get cell array of names of voltage state variables.
vtypes = nme.model_vvars()
- Output:
vtypes (cell array of char arrays) – names of network object properties for voltage state variables
The network model object, which inherits from
mp_idx_manager
, uses these values as set types for tracking its voltage state variables.Note: This is an abstract method that must be implemented by a subclass.
- model_zvars()
Get cell array of names of non-voltage state variables.
vtypes = nme.model_zvars()
- Output:
vtypes (cell array of char arrays) – names of network object properties for voltage state variables
The network model object, which inherits from
mp_idx_manager
, uses these values as set types for tracking its non-voltage state variables.Note: This is an abstract method that must be implemented by a subclass.
- get_params(idx, names)
Get network model element parameters.
[p1, p2, ..., pN] = nme.get_params(idx) pA = nme.get_params(idx, nameA) [pA, pB, ...] = nme.get_params(idx, {nameA, nameB, ...})
- Inputs:
idx (integer) – (optional) vector of indices of ports of interest, if empty or missing, returns parameters corresponding to all ports
names (char array or cell array of char arrays) – (optional) name(s) of parameters to return
- Outputs:
p1, p2, …, pN – full set of parameters in canonical order
pA, pB – parameters specified by
names
If a particular parameter in the object is empty, this method returns a sparse zero matrix or vector of the appropriate size.
- find_form_class()
Get name of network element object’s formulation subclass.
form_class = nme.find_form_class()
- Output:
form_class (char array)
Selects from this netork model elements parent classes, the
mp.form
subclass, that is not a subclass ofmp.nm_element
, with the longest inheritance path back tomp.form
.