Home > matpower6.0 > extras > maxloadlim > maxloadlim.m

maxloadlim

PURPOSE ^

MAXLOADLIM computes the maximum loadability limit in one direction. It

SYNOPSIS ^

function results = maxloadlim(mpc,dir_mll,varargin)

DESCRIPTION ^

 MAXLOADLIM computes the maximum loadability limit in one direction. It
 uses dispatchable loads in MATPOWER
   RESULTS = MAXLOADLIM(MPC,DIR_MLL) returns the results from the
   optimization problem looking for the maximum loadability limit in
   the direction of load increase DIR_MLL. DIR_MLL defines the directions
   of load increases for all buses. For buses with zero loads, the
   direction of load increases must be zero. RESULTS contains all fields
   returned from the runopf MATPOWER function. It also contains the 
   following additional fields:
   * dir_mll: the direction of load increase used as input.
   * stab_marg: the stability margin to the maximum loadability point from
   the base case defined in the input MPC.
   * bif: information about the bifurcation at the MLL point.
   
   RESULTS = MAXLOADLIM(MPC,DIR_MLL,NAME,VALUE) uses the options defined
   by the pair NAME,VALUE. The currently supported options are 
     * 'verbose': 1 or 0 (Default). If set to 1, a summary of the results
     at the maximum loadability limit is printed. 
     * 'use_qlim': 1 (Default) or 0. Enforces or not the reactive power
     limits of the generators.
     * 'Vlims_bus_nb': [] (Default) or array of integers. By default, the
     bus voltage limits are not enforced. This option allows for defining
     a set of buses at which the voltage limits are enforced.

   See also PREPARE_MAXLOADLIM, POSTPROC_MAXLOADLIM, PRINT_MAXLOADLIM,
   RUNOPF.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function results = maxloadlim(mpc,dir_mll,varargin)
0002 % MAXLOADLIM computes the maximum loadability limit in one direction. It
0003 % uses dispatchable loads in MATPOWER
0004 %   RESULTS = MAXLOADLIM(MPC,DIR_MLL) returns the results from the
0005 %   optimization problem looking for the maximum loadability limit in
0006 %   the direction of load increase DIR_MLL. DIR_MLL defines the directions
0007 %   of load increases for all buses. For buses with zero loads, the
0008 %   direction of load increases must be zero. RESULTS contains all fields
0009 %   returned from the runopf MATPOWER function. It also contains the
0010 %   following additional fields:
0011 %   * dir_mll: the direction of load increase used as input.
0012 %   * stab_marg: the stability margin to the maximum loadability point from
0013 %   the base case defined in the input MPC.
0014 %   * bif: information about the bifurcation at the MLL point.
0015 %
0016 %   RESULTS = MAXLOADLIM(MPC,DIR_MLL,NAME,VALUE) uses the options defined
0017 %   by the pair NAME,VALUE. The currently supported options are
0018 %     * 'verbose': 1 or 0 (Default). If set to 1, a summary of the results
0019 %     at the maximum loadability limit is printed.
0020 %     * 'use_qlim': 1 (Default) or 0. Enforces or not the reactive power
0021 %     limits of the generators.
0022 %     * 'Vlims_bus_nb': [] (Default) or array of integers. By default, the
0023 %     bus voltage limits are not enforced. This option allows for defining
0024 %     a set of buses at which the voltage limits are enforced.
0025 %
0026 %   See also PREPARE_MAXLOADLIM, POSTPROC_MAXLOADLIM, PRINT_MAXLOADLIM,
0027 %   RUNOPF.
0028 
0029 %   MATPOWER
0030 %   Copyright (c) 2015-2016, Power Systems Engineering Research Center (PSERC)
0031 %   by Camille Hamon
0032 %
0033 %   This file is part of MATPOWER.
0034 %   Covered by the 3-clause BSD License (see LICENSE file for details).
0035 %   See http://www.pserc.cornell.edu/matpower/ for more info.
0036 
0037 define_constants;
0038 
0039 %% Checking the options, if any
0040 input_checker = inputParser;
0041 
0042 default_verbose = 0;
0043 verbose_levels = [0;1];
0044 check_verbose = @(x)(isnumeric(x) && isscalar(x) && any(x == verbose_levels));
0045 addParameter(input_checker,'verbose',default_verbose,check_verbose);
0046 
0047 input_checker.KeepUnmatched = true;
0048 parse(input_checker,varargin{:});
0049 
0050 options = input_checker.Results;
0051 
0052 %% Prepare the matpower case for the maximum loadability limit problem
0053 mpc_vl = prepare_maxloadlim(mpc,dir_mll,varargin{:});
0054 
0055 %% Run opf
0056 % Turning off the printing and initializing from the base case
0057 mpopt = mpoption('verbose',options.verbose,'opf.init_from_mpc',1);
0058 mpopt = mpoption(mpopt,'out.all',0);
0059 % Decreasing the threshold for the relative complementarity constraints
0060 mpopt = mpoption(mpopt,'mips.comptol',1e-8);
0061 % Change solver
0062 mpopt = mpoption(mpopt, 'opf.ac.solver', 'MIPS');
0063 % Execute opf
0064 results = runopf(mpc_vl,mpopt);
0065 
0066 %% Post-processing
0067 results = postproc_maxloadlim(results,dir_mll);
0068 
0069 %% Printing
0070 if options.verbose
0071     print_maxloadlim(mpc,results);
0072 end

Generated on Fri 16-Dec-2016 12:45:37 by m2html © 2005