controller

Base class for controllers

class Controller(net, edges, **kwargs)[source]

Bases: object

Base class to create controllers. A controller has a global view of the network and can add new equations to the solution matrix.

Normally, a controller tries to minimize a certain function f.

__init__(net, edges, **kwargs)[source]

Inits Controller.

Parameters:
  • net (Network) – Network object. The controller stores a pointer to the network object.

  • edges (array_like) – List of names of the controlled elements.

Return type:

None.

compute_der(**kwargs)[source]

Returns the derivatives of f

compute_residuals(**kwargs)[source]

Returns f

property control_matrix

Returns the control matrix for the controller

property edge_mask

Returns the mask of edges updated by the controller

get_control_matrix()[source]

Returns the control matrix

get_edge()[source]

Returns the name of controlled edges

get_edge_index()[source]

Returns the index of controlled edges

is_initialized()[source]

Returns True if the controller is initializated, False otherwise

property stage

Returns the stage in which the controller is used

update()[source]

Updates the controlled parameters in the Network.