mp.form_dc

class mp.form_dc

Bases: mp.form

mp.form_dc - Base class for MATPOWER DC formulations.

Used as a mix-in class for all network model element classes with a DC network model formulation. That is, each concrete network model element class with a DC formulation must inherit, at least indirectly, from both mp.nm_element and mp.form_dc.

mp.form_dc defines the port active power injection as a linear function of the state variables \(\x\), that is, the voltage angles \(\Va\) and non-voltage states \(\z\), as

(3.6)\[\begin{split}\gP(\x) &= \left[\begin{array}{cc}\BB & \KK\end{array}\right] \x + \pv \\ &= \BB \Va + \KK \z + \pv,\end{split}\]

where \(\BB\), \(\KK\), and \(\pv\) are the model parameters.

For more details, see the DC Formulation section in the MATPOWER Developer’s Manual and the derivations in MATPOWER Technical Note 5.

mp.form_dc Properties:
  • B - \(n_p n_k \times n_n\) matrix \(\BB\) of model parameters

  • K - \(n_p n_k \times n_z\) matrix \(\KK\) of model parameters

  • p - \(n_p n_k \times 1\) vector \(\pv\) of model parameters

  • params_ncols - specify number of columns for each parameter

mp.form_dc Methods:
  • form_name() - get char array w/name of formulation ('DC')

  • form_tag() - get char array w/short label of formulation ('dc')

  • model_params() - get network model element parameters ({'B', 'K', 'p'})

  • model_vvars() - get cell array of names of voltage state variables ({'va'})

  • model_zvars() - get cell array of names of non-voltage state variables ({'z'})

  • port_inj_power() - compute port power injections from network state

See also mp.form, mp.form_ac, mp.nm_element.

Property Summary
B = []

(double) \(n_p n_k \times n_n\) matrix \(\BB\) of model parameter coefficients for \(\Va\)

K = []

(double) \(n_p n_k \times n_z\) matrix \(\KK\) of model parameter coefficients for \(\z\)

p = []

(double) \(n_p n_k \times 1\) vector \(\pv\) of model parameters

param_ncols = struct('B',2,'K',3,'p',1)

(struct) specify number of columns for each parameter, where

  • 1 => single column (i.e. a vector)

  • 2 => \(n_p\) columns

  • 3 => \(n_z\) columns

Method Summary
form_name()

Get user-readable name of formulation, i.e. 'DC'.

See mp.form.form_name().

form_tag()

Get short label of formulation, i.e. 'dc'.

See mp.form.form_tag().

model_params()

Get cell array of names of model parameters, i.e. {'B', 'K', 'p'}.

See mp.form.model_params().

model_vvars()

Get cell array of names of voltage state variables, i.e. {'va'}.

See mp.form.model_vvars().

model_zvars()

Get cell array of names of non-voltage state variables, i.e. {'z'}.

See mp.form.model_zvars().

port_inj_power(x, sysx, idx)

Compute port power injections from network state.

P = nme.port_inj_power(x, sysx, idx)

Compute the active power injections for all or a selected subset of ports.

The state can be provided as a stacked aggregate of the state variables (port voltages and non-voltage states) for the full collection of network model elements of this type, or as the combined state for the entire network.

Inputs:
  • x (double) – state vector \(\x\)

  • sysx (0 or 1) – which state is provided in x

    • 0 – class aggregate state

    • 1 – (default) full system state

  • idx (integer) – (optional) vector of indices of ports of interest, if empty or missing, returns injections corresponding to all ports

Outputs:

P (double) – vector of port power injections, \(\gP(\x)\)