Home > matpower5.1 > cpf_p.m

cpf_p

PURPOSE ^

CPF_P Computes the value of the CPF parameterization function.

SYNOPSIS ^

function P = cpf_p(parameterization, step, z, V, lam, Vprv, lamprv, pv, pq)

DESCRIPTION ^

CPF_P Computes the value of the CPF parameterization function.

   P = CPF_P(PARAMETERIZATION, STEP, Z, V, LAM, VPRV, LAMPRV, PV, PQ)

   Computes the value of the parameterization function at the current
   solution point.

   Inputs:
       PARAMETERIZATION : Value of cpf.parameterization option
       STEP : continuation step size
       Z : normalized tangent prediction vector from previous step
       V : complex bus voltage vector at current solution
       LAM : scalar lambda value at current solution
       VPRV : complex bus voltage vector at previous solution
       LAMPRV : scalar lambda value at previous solution
       PV : vector of indices of PV buses
       PQ : vector of indices of PQ buses

   Outputs:
       P : value of the parameterization function at the current point

   See also CPF_PREDICTOR, CPF_CORRECTOR.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function P = cpf_p(parameterization, step, z, V, lam, Vprv, lamprv, pv, pq)
0002 %CPF_P Computes the value of the CPF parameterization function.
0003 %
0004 %   P = CPF_P(PARAMETERIZATION, STEP, Z, V, LAM, VPRV, LAMPRV, PV, PQ)
0005 %
0006 %   Computes the value of the parameterization function at the current
0007 %   solution point.
0008 %
0009 %   Inputs:
0010 %       PARAMETERIZATION : Value of cpf.parameterization option
0011 %       STEP : continuation step size
0012 %       Z : normalized tangent prediction vector from previous step
0013 %       V : complex bus voltage vector at current solution
0014 %       LAM : scalar lambda value at current solution
0015 %       VPRV : complex bus voltage vector at previous solution
0016 %       LAMPRV : scalar lambda value at previous solution
0017 %       PV : vector of indices of PV buses
0018 %       PQ : vector of indices of PQ buses
0019 %
0020 %   Outputs:
0021 %       P : value of the parameterization function at the current point
0022 %
0023 %   See also CPF_PREDICTOR, CPF_CORRECTOR.
0024 
0025 %   MATPOWER
0026 %   Copyright (c) 1996-2015 by Power System Engineering Research Center (PSERC)
0027 %   by Shrirang Abhyankar, Argonne National Laboratory
0028 %   and Ray Zimmerman, PSERC Cornell
0029 %
0030 %   $Id: cpf_p.m 2644 2015-03-11 19:34:22Z ray $
0031 %
0032 %   This file is part of MATPOWER.
0033 %   Covered by the 3-clause BSD License (see LICENSE file for details).
0034 %   See http://www.pserc.cornell.edu/matpower/ for more info.
0035 
0036 %% evaluate P(x0, lambda0)
0037 if parameterization == 1        %% natural
0038     if lam >= lamprv
0039         P = lam - lamprv - step;
0040     else
0041         P = lamprv - lam - step;
0042     end
0043 elseif parameterization == 2    %% arc length
0044     Va = angle(V);
0045     Vm = abs(V);
0046     Vaprv = angle(Vprv);
0047     Vmprv = abs(Vprv);
0048     P = sum(([Va([pv; pq]); Vm(pq); lam] - [Vaprv([pv; pq]); Vmprv(pq); lamprv]).^2) - step^2;
0049 elseif parameterization == 3    %% pseudo arc length
0050     nb = length(V);
0051     Va = angle(V);
0052     Vm = abs(V);
0053     Vaprv = angle(Vprv);
0054     Vmprv = abs(Vprv);
0055     P = z([pv; pq; nb+pq; 2*nb+1])' * ...
0056         ( [Va([pv; pq]); Vm(pq); lam] - [Vaprv([pv; pq]); Vmprv(pq); lamprv] )...
0057         - step;
0058 end

Generated on Fri 20-Mar-2015 18:23:34 by m2html © 2005