Home > matpower7.1 > lib > opf_vlim_hess.m

opf_vlim_hess

PURPOSE ^

OPF_VLIM_HESS Evaluates Hessian of voltage magnitudes.

SYNOPSIS ^

function d2Vlims = opf_vlim_hess(x, lambda, mpc, idx, mpopt)

DESCRIPTION ^

OPF_VLIM_HESS  Evaluates Hessian of voltage magnitudes.
   D2VLIMS = OPF_VLIM_HESS(X, LAMBDA, MPC, IDX, MPOPT)

   Hessian evaluation function for voltage magnitudes.

   Inputs:
     X : optimization vector
     LAMBDA : column vector of Lagrange multipliers on active and reactive
              power balance constraints
     MPC : MATPOWER case struct
     IDX : index of buses whose voltage magnitudes should be fixed
     MPOPT : MATPOWER options struct

   Outputs:
     D2VLIMS : Hessian of voltage magnitudes.

   Example:
       d2Vlims = opf_vlim_hess(x, lambda, mpc, idx, mpopt);

   See also OPF_VLIM_FCN.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function d2Vlims = opf_vlim_hess(x, lambda, mpc, idx, mpopt)
0002 %OPF_VLIM_HESS  Evaluates Hessian of voltage magnitudes.
0003 %   D2VLIMS = OPF_VLIM_HESS(X, LAMBDA, MPC, IDX, MPOPT)
0004 %
0005 %   Hessian evaluation function for voltage magnitudes.
0006 %
0007 %   Inputs:
0008 %     X : optimization vector
0009 %     LAMBDA : column vector of Lagrange multipliers on active and reactive
0010 %              power balance constraints
0011 %     MPC : MATPOWER case struct
0012 %     IDX : index of buses whose voltage magnitudes should be fixed
0013 %     MPOPT : MATPOWER options struct
0014 %
0015 %   Outputs:
0016 %     D2VLIMS : Hessian of voltage magnitudes.
0017 %
0018 %   Example:
0019 %       d2Vlims = opf_vlim_hess(x, lambda, mpc, idx, mpopt);
0020 %
0021 %   See also OPF_VLIM_FCN.
0022 
0023 %   MATPOWER
0024 %   Copyright (c) 2018, Power Systems Engineering Research Center (PSERC)
0025 %   by Baljinnyam Sereeter, Delft University of Technology
0026 %   and Ray Zimmerman, PSERC Cornell
0027 %
0028 %   This file is part of MATPOWER.
0029 %   Covered by the 3-clause BSD License (see LICENSE file for details).
0030 %   See https://matpower.org for more info.
0031 
0032 %% unpack data
0033 [Vr, Vi] = deal(x{:});
0034 
0035 %% problem dimensions
0036 nb = length(Vi);            %% number of buses
0037 n = length(idx);            %% number of buses with voltage limits
0038 
0039 %%----- evaluate Hessian of voltage limit constraints -----
0040 nlam = length(lambda) / 2;
0041 if nlam
0042     lam = lambda(nlam+1:2*nlam) - lambda(1:nlam);   %% lamVmax - lamVmin
0043 else    %% keep dimensions of empty matrices/vectors compatible
0044     lam = zeros(0,1);
0045 end
0046 
0047 dlam = sparse(idx, idx, 2*lam, nb, nb);
0048 zz = sparse(nb, nb);
0049 
0050 %% construct Hessian
0051 d2Vlims = [dlam zz; zz dlam];

Generated on Fri 09-Oct-2020 11:21:31 by m2html © 2005