mp.element_container

class mp.element_container

Bases: handle

mp.element_container - Mix-in class to handle named/ordered element object array.

Implements an element container that is used for MATPOWER model and data model converter objects. Provides the properties to store the constructors for each element and the elements themselves. Also provides a method to modify an existing set of element constructors.

mp.element_container Properties:
mp.element_container Methods:

See also mp.mapped_array.

Property Summary
element_classes

Cell array of function handles of constructors for individual elements, filled by constructor of subclass.

elements

A mapped array (mp.mapped_array) to hold the element objects included inside this container object.

Method Summary
modify_element_classes(class_list)

Modify an existing set of element constructors.

obj.modify_element_classes(class_list)
Input:

class_list (cell array) – list of element class modifiers, where each modifier is one of the following:

  1. a handle to a constructor to append to obj.element_classes, or

  2. a char array B, indicating to remove any element E in the list for which isa(E(), B) is true, or

  3. a 2-element cell array {A,B} where A is a handle to a constructor to replace any element E in the list for which isa(E(), B) is true, i.e. B is a char array

Also accepts a single element class modifier of type 1 or 2 (A single type 3 modifier has to be enclosed in a single-element cell array to keep it from being interpreted as a list of 2 modifiers).

Can be used to modify the list of element constructors in the element_classes property by appending, removing, or replacing entries. See Table 9.2 in the MATPOWER Developer’s Manual for more information.