Home > matpower5.0 > 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 %
0004 %   [DP_DV, DP_DLAM ] = CPF_P_JAC(PARAMETERIZATION, Z, V, LAM, ...
0005 %                                                   VPRV, LAMPRV, PV, PQ)
0006 %
0007 %   Computes the partial derivatives of the continuation power flow
0008 %   parameterization function w.r.t. bus voltages and the continuation
0009 %   parameter lambda.
0010 %
0011 %   Inputs:
0012 %       PARAMETERIZATION : Value of cpf.parameterization option.
0013 %       Z : normalized tangent prediction vector from previous step
0014 %       V : complex bus voltage vector at current solution
0015 %       LAM : scalar lambda value at current solution
0016 %       VPRV : complex bus voltage vector at previous solution
0017 %       LAMPRV : scalar lambda value at previous solution
0018 %       PV : vector of indices of PV buses
0019 %       PQ : vector of indices of PQ buses
0020 %
0021 %   Outputs:
0022 %       DP_DV : partial of parameterization function w.r.t. voltages
0023 %       DP_DLAM : partial of parameterization function w.r.t. lambda
0024 %
0025 %   See also CPF_PREDICTOR, CPF_CORRECTOR.
0026 
0027 %   MATPOWER
0028 %   $Id: cpf_p_jac.m 2235 2013-12-11 13:44:13Z ray $
0029 %   by Shrirang Abhyankar, Argonne National Laboratory
0030 %   and Ray Zimmerman, PSERC Cornell
0031 %   Copyright (c) 1996-2013 by Power System Engineering Research Center (PSERC)
0032 %
0033 %   This file is part of MATPOWER.
0034 %   See http://www.pserc.cornell.edu/matpower/ for more info.
0035 %
0036 %   MATPOWER is free software: you can redistribute it and/or modify
0037 %   it under the terms of the GNU General Public License as published
0038 %   by the Free Software Foundation, either version 3 of the License,
0039 %   or (at your option) any later version.
0040 %
0041 %   MATPOWER is distributed in the hope that it will be useful,
0042 %   but WITHOUT ANY WARRANTY; without even the implied warranty of
0043 %   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
0044 %   GNU General Public License for more details.
0045 %
0046 %   You should have received a copy of the GNU General Public License
0047 %   along with MATPOWER. If not, see <http://www.gnu.org/licenses/>.
0048 %
0049 %   Additional permission under GNU GPL version 3 section 7
0050 %
0051 %   If you modify MATPOWER, or any covered work, to interface with
0052 %   other modules (such as MATLAB code and MEX-files) available in a
0053 %   MATLAB(R) or comparable environment containing parts covered
0054 %   under other licensing terms, the licensors of MATPOWER grant
0055 %   you additional permission to convey the resulting work.
0056 
0057 if parameterization == 1        %% natural
0058     npv = length(pv);
0059     npq = length(pq);
0060     dP_dV = zeros(1, npv+2*npq);
0061     if lam >= lamprv
0062         dP_dlam = 1.0;
0063     else
0064         dP_dlam = -1.0;
0065     end
0066 elseif parameterization == 2    %% arc length
0067     Va = angle(V);
0068     Vm = abs(V);
0069     Vaprv = angle(Vprv);
0070     Vmprv = abs(Vprv);
0071     dP_dV = 2*([Va([pv; pq]); Vm(pq)] - [Vaprv([pv; pq]); Vmprv(pq)])';
0072     if lam == lamprv    %% first step
0073         dP_dlam = 1.0;  %% avoid singular Jacobian that would result
0074                         %% from [dP_dV, dP_dlam] = 0
0075     else
0076         dP_dlam = 2*(lam-lamprv);
0077     end
0078 elseif parameterization == 3    %% pseudo arc length
0079     nb = length(V);
0080     dP_dV = z([pv; pq; nb+pq])';
0081     dP_dlam = z(2*nb+1);
0082 end

Generated on Mon 26-Jan-2015 15:21:31 by m2html © 2005