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