mp.form_acc

class mp.form_acc

Bases: mp.form_ac

mp.form_acc - Base class for MATPOWER AC cartesian formulations.

Used as a mix-in class for all network model element classes with an AC network model formulation with a cartesian repesentation for voltages. That is, each concrete network model element class with an AC cartesian formulation must inherit, at least indirectly, from both mp.nm_element and mp.form_acc.

Provides implementation of evaluation of voltage-related Jacobian and Hessian terms needed by some mp.form_ac methods.

mp.form_dc Methods:

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

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

Method Summary
form_name()

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

See mp.form.form_name().

form_tag()

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

See mp.form.form_tag().

model_vvars()

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

See mp.form.model_vvars().

port_inj_current_jac(n, v_, Y, M, invdiagvic, diagSlincJ)

Compute voltage-related terms of current injection Jacobian.

[Iu, Iw] = nme.port_inj_current_jac(n, v_, Y, M, invdiagvic, diagSlincJ)

Called by mp.form_ac.port_inj_current() to compute voltage-related Jacobian terms.

port_inj_current_hess_v(x_, lam, v_, z_, diaginvic, Y, M, diagSlincJ, dlamJ)

Compute voltage-related terms of current injection Hessian.

[Iuu, Iuw, Iww] = nme.port_inj_current_hess_v(x_, lam)
[Iuu, Iuw, Iww] = nme.port_inj_current_hess_v(x_, lam, sysx)
[Iuu, Iuw, Iww] = nme.port_inj_current_hess_v(x_, lam, sysx, idx)
[...] = nme.port_inj_current_hess_vz(x_, lam, v_, z_, diaginvic, Y, M, diagSlincJ, dlamJ)

Called by mp.form_ac.port_inj_current_hess() to compute voltage-related Hessian terms.

port_inj_current_hess_vz(x_, lam, v_, z_, diaginvic, N, dlamJ)

Compute voltage/non-voltage-related terms of current injection Hessian.

[Iuzr, Iuzi, Iwzr, Iwzi] = nme.port_inj_current_hess_vz(x_, lam)
[...] = nme.port_inj_current_hess_vz(x_, lam, sysx)
[...] = nme.port_inj_current_hess_vz(x_, lam, sysx, idx)
[...] = nme.port_inj_current_hess_vz(x_, lam, v_, z_, diaginvic, N, dlamJ)

Called by mp.form_ac.port_inj_current_hess() to compute voltage/non-voltage-related Hessian terms.

port_inj_power_jac(n, v_, Y, M, diagv, diagvi, diagIlincJ)

Compute voltage-related terms of power injection Jacobian.

[Su, Sw] = nme.port_inj_power_jac(...)

Called by mp.form_ac.port_inj_power() to compute voltage-related Jacobian terms.

port_inj_power_hess_v(x_, lam, v_, z_, diagvi, Y, M, diagIlincJ, dlamJ)

Compute voltage-related terms of power injection Hessian.

[Suu, Suw, Sww] = nme.port_inj_power_hess_v(x_, lam)
[Suu, Suw, Sww] = nme.port_inj_power_hess_v(x_, lam, sysx)
[Suu, Suw, Sww] = nme.port_inj_power_hess_v(x_, lam, sysx, idx)
[...] = nme.port_inj_power_hess_v(x_, lam, v_, z_, diagvi, Y, M, diagIlincJ, dlamJ)

Called by mp.form_ac.port_inj_power_hess() to compute voltage-related Hessian terms.

port_inj_power_hess_vz(x_, lam, v_, z_, diagvi, L, dlamJ)

Compute voltage/non-voltage-related terms of power injection Hessian.

[Suzr, Suzi, Swzr, Swzi] = nme.port_inj_power_hess_vz(x_, lam)
[...] = nme.port_inj_power_hess_vz(x_, lam, sysx)
[...] = nme.port_inj_power_hess_vz(x_, lam, sysx, idx)
[...] = nme.port_inj_power_hess_vz(x_, lam, v_, z_, diagvi, L, dlamJ)

Called by mp.form_ac.port_inj_power_hess() to compute voltage/non-voltage-related Hessian terms.

aux_data_va_vm(ad)

Return voltage angles/magnitudes from auxiliary data.

[va, vm] = nme.aux_data_va_vm(ad)

Connverts from cartesian voltage data stored in ad.vr and ad.vi.

Input:

ad (struct) – struct of auxiliary data

Outputs:
  • va (double) – vector of voltage angles corresponding to voltage information stored in auxiliary data

  • vm (double) – vector of voltage magnitudes corresponding to voltage information stored in auxiliary data

va_fcn(xx, idx, lim)

Compute voltage angle constraints and Jacobian.

g = nme.va_fcn(xx, idx, lim)
[g, dg] = nme.va_fcn(xx, idx, lim)

Compute constraint function and optionally the Jacobian for voltage angle limits.

Inputs:
  • xx (1 x 2 cell array) – real part of complex voltage in xx{1}, imaginary part in xx{2}

  • idx (integer) – index of subset of voltages of interest to include in constraint; if empty, include all

  • lim (double or cell array of double) – constraint bound(s), can be a vector, for equality constraints or an upper bound, or a cell array with {va_lb, va_ub} for dual-bound constraints

Outputs:
  • g (double) – constraint function, \(\g(\x)\)

  • dg (double) – constraint Jacobian, \(\g_\x\)

va_hess(xx, lam, idx)

Compute voltage angle Hessian.

d2G = nme.va_hess(xx, lam, idx)

Compute a sparse Hessian matrix for all or a selected subset of voltages. Rather than a full, 3-dimensional Hessian, it computes the Jacobian of the vector obtained by muliplying the transpose of the constraint Jacobian by a vector \(\lam\).

Inputs:
  • xx (1 x 2 cell array) – real part of complex voltage in xx{1}, imaginary part in xx{2}

  • lam (double) – vector \(\lam\) of multipliers, one for each constraint

  • idx (integer) – index of subset of voltages of interest to include in constraint; if empty, include all

Output:

d2G (double) – sparse constraint Hessian, \(\g_{\x\x}(\lam)\)

vm2_fcn(xx, idx, lim)

Compute squared voltage magnitude constraints and Jacobian.

g = nme.vm2_fcn(xx, idx, lim)
[g, dg] = nme.vm2_fcn(xx, idx, lim)

Compute constraint function and optionally the Jacobian for squared voltage magnitude limits.

Inputs:
  • xx (1 x 2 cell array) – real part of complex voltage in xx{1}, imaginary part in xx{2}

  • idx (integer) – index of subset of voltages of interest to include in constraint; if empty, include all

  • lim (double or cell array of double) – constraint bound(s), can be a vector, for equality constraints or an upper bound, or a cell array with {vm2_lb, vm2_ub} for dual-bound constraints

Outputs:
  • g (double) – constraint function, \(\g(\x)\)

  • dg (double) – constraint Jacobian, \(\g_\x\)

vm2_hess(xx, lam, idx)

Compute squared voltage magnitude Hessian.

d2G = nme.vm2_hess(xx, lam, idx)

Compute a sparse Hessian matrix for all or a selected subset of voltages. Rather than a full, 3-dimensional Hessian, it computes the Jacobian of the vector obtained by muliplying the transpose of the constraint Jacobian by a vector \(\lam\).

Inputs:
  • xx (1 x 2 cell array) – real part of complex voltage in xx{1}, imaginary part in xx{2}

  • lam (double) – vector \(\lam\) of multipliers, one for each constraint

  • idx (integer) – index of subset of voltages of interest to include in constraint; if empty, include all

Output:

d2G (double) – sparse constraint Hessian, \(\g_{\x\x}(\lam)\)