Home > matpower7.0 > lib > cpf_p_jac.m

cpf_p_jac

PURPOSE ^

CPF_P_JAC Computes partial derivatives of CPF parameterization function.

SYNOPSIS ^

function [dP_dV, dP_dlam] = cpf_p_jac(parameterization, z, V, lam, Vprv, lamprv, pv, pq)

DESCRIPTION ^

CPF_P_JAC Computes partial derivatives of CPF parameterization function.
   [DP_DV, DP_DLAM ] = CPF_P_JAC(PARAMETERIZATION, Z, V, LAM, ...
                                                   VPRV, LAMPRV, PV, PQ)

   Computes the partial derivatives of the continuation power flow
   parameterization function w.r.t. bus voltages and the continuation
   parameter lambda.

   Inputs:
       PARAMETERIZATION : Value of cpf.parameterization option.
       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:
       DP_DV : partial of parameterization function w.r.t. voltages
       DP_DLAM : partial of parameterization function w.r.t. lambda

   See also CPF_PREDICTOR, CPF_CORRECTOR.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [dP_dV, dP_dlam] = cpf_p_jac(parameterization, z, V, lam, Vprv, lamprv, pv, pq)
0002 %CPF_P_JAC Computes partial derivatives of CPF parameterization function.
0003 %   [DP_DV, DP_DLAM ] = CPF_P_JAC(PARAMETERIZATION, Z, V, LAM, ...
0004 %                                                   VPRV, LAMPRV, PV, PQ)
0005 %
0006 %   Computes the partial derivatives of the continuation power flow
0007 %   parameterization function w.r.t. bus voltages and the continuation
0008 %   parameter lambda.
0009 %
0010 %   Inputs:
0011 %       PARAMETERIZATION : Value of cpf.parameterization option.
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 %       DP_DV : partial of parameterization function w.r.t. voltages
0022 %       DP_DLAM : partial of parameterization function w.r.t. lambda
0023 %
0024 %   See also CPF_PREDICTOR, CPF_CORRECTOR.
0025 
0026 %   MATPOWER
0027 %   Copyright (c) 1996-2016, Power Systems Engineering Research Center (PSERC)
0028 %   by Shrirang Abhyankar, Argonne National Laboratory
0029 %   and Ray Zimmerman, PSERC Cornell
0030 %
0031 %   This file is part of MATPOWER.
0032 %   Covered by the 3-clause BSD License (see LICENSE file for details).
0033 %   See https://matpower.org for more info.
0034 
0035 if parameterization == 1        %% natural
0036     npv = length(pv);
0037     npq = length(pq);
0038     dP_dV = zeros(1, npv+2*npq);
0039     if lam >= lamprv
0040         dP_dlam = 1.0;
0041     else
0042         dP_dlam = -1.0;
0043     end
0044 elseif parameterization == 2    %% arc length
0045     Va = angle(V);
0046     Vm = abs(V);
0047     Vaprv = angle(Vprv);
0048     Vmprv = abs(Vprv);
0049     dP_dV = 2*([Va([pv; pq]); Vm(pq)] - [Vaprv([pv; pq]); Vmprv(pq)])';
0050     if lam == lamprv    %% first step
0051         dP_dlam = 1.0;  %% avoid singular Jacobian that would result
0052                         %% from [dP_dV, dP_dlam] = 0
0053     else
0054         dP_dlam = 2*(lam-lamprv);
0055     end
0056 elseif parameterization == 3    %% pseudo arc length
0057     nb = length(V);
0058     dP_dV = z([pv; pq; nb+pq])';
0059     dP_dlam = z(2*nb+1);
0060 end

Generated on Mon 24-Jun-2019 15:58:45 by m2html © 2005