CPF_PREDICTOR Performs the predictor step for the continuation power flow [V0, LAM0, Z] = CPF_PREDICTOR(VPRV, LAMPRV, YBUS, SXFR, PV, PQ, STEP, Z) Computes a prediction (approximation) to the next solution of the continuation power flow using a normalized tangent predictor. Inputs: V : complex bus voltage vector at current solution LAM : scalar lambda value at current solution YBUS : complex bus admittance matrix SXFR : complex vector of scheduled transfers (difference between bus injections in base and target cases) PV : vector of indices of PV buses PQ : vector of indices of PQ buses STEP : continuation step length Z : normalized tangent prediction vector from previous step VPRV : complex bus voltage vector at previous solution LAMPRV : scalar lambda value at previous solution PARAMETERIZATION : Value of cpf.parameterization option. Outputs: V0 : predicted complex bus voltage vector LAM0 : predicted lambda continuation parameter Z : the normalized tangent prediction vector
0001 function [V0, lam0, z] = cpf_predictor(V, lam, Ybus, Sxfr, pv, pq, ... 0002 step, z, Vprv, lamprv, parameterization) 0003 %CPF_PREDICTOR Performs the predictor step for the continuation power flow 0004 % [V0, LAM0, Z] = CPF_PREDICTOR(VPRV, LAMPRV, YBUS, SXFR, PV, PQ, STEP, Z) 0005 % 0006 % Computes a prediction (approximation) to the next solution of the 0007 % continuation power flow using a normalized tangent predictor. 0008 % 0009 % Inputs: 0010 % V : complex bus voltage vector at current solution 0011 % LAM : scalar lambda value at current solution 0012 % YBUS : complex bus admittance matrix 0013 % SXFR : complex vector of scheduled transfers (difference between 0014 % bus injections in base and target cases) 0015 % PV : vector of indices of PV buses 0016 % PQ : vector of indices of PQ buses 0017 % STEP : continuation step length 0018 % Z : normalized tangent prediction vector from previous step 0019 % VPRV : complex bus voltage vector at previous solution 0020 % LAMPRV : scalar lambda value at previous solution 0021 % PARAMETERIZATION : Value of cpf.parameterization option. 0022 % 0023 % Outputs: 0024 % V0 : predicted complex bus voltage vector 0025 % LAM0 : predicted lambda continuation parameter 0026 % Z : the normalized tangent prediction vector 0027 0028 % MATPOWER 0029 % Copyright (c) 1996-2015 by Power System Engineering Research Center (PSERC) 0030 % by Shrirang Abhyankar, Argonne National Laboratory 0031 % and Ray Zimmerman, PSERC Cornell 0032 % 0033 % $Id: cpf_predictor.m 2644 2015-03-11 19:34:22Z ray $ 0034 % 0035 % This file is part of MATPOWER. 0036 % Covered by the 3-clause BSD License (see LICENSE file for details). 0037 % See http://www.pserc.cornell.edu/matpower/ for more info. 0038 0039 %% sizes 0040 nb = length(V); 0041 npv = length(pv); 0042 npq = length(pq); 0043 0044 %% compute Jacobian for the power flow equations 0045 [dSbus_dVm, dSbus_dVa] = dSbus_dV(Ybus, V); 0046 0047 j11 = real(dSbus_dVa([pv; pq], [pv; pq])); 0048 j12 = real(dSbus_dVm([pv; pq], pq)); 0049 j21 = imag(dSbus_dVa(pq, [pv; pq])); 0050 j22 = imag(dSbus_dVm(pq, pq)); 0051 0052 J = [ j11 j12; 0053 j21 j22; ]; 0054 0055 dF_dlam = -[real(Sxfr([pv; pq])); imag(Sxfr(pq))]; 0056 [dP_dV, dP_dlam] = cpf_p_jac(parameterization, z, V, lam, Vprv, lamprv, pv, pq); 0057 0058 %% linear operator for computing the tangent predictor 0059 J = [ J dF_dlam; 0060 dP_dV dP_dlam ]; 0061 0062 % J = [ J, dF_dlam; 0063 % z([pv; pq; nb+pq; 2*nb+1])']; 0064 0065 Vaprv = angle(V); 0066 Vmprv = abs(V); 0067 0068 %% compute normalized tangent predictor 0069 s = zeros(npv+2*npq+1, 1); 0070 s(end,1) = 1; %% increase in the direction of lambda 0071 z([pv; pq; nb+pq; 2*nb+1]) = J\s; %% tangent vector 0072 z = z/norm(z); %% normalize tangent predictor 0073 0074 Va0 = Vaprv; 0075 Vm0 = Vmprv; 0076 lam0 = lam; 0077 0078 %% prediction for next step 0079 Va0([pv; pq]) = Vaprv([pv; pq]) + step * z([pv; pq]); 0080 Vm0([pq]) = Vmprv([pq]) + step * z([nb+pq]); 0081 lam0 = lam + step * z(2*nb+1); 0082 V0 = Vm0 .* exp(1j * Va0);