Home > matpower7.0 > extras > maxloadlim > examples > example_ieee39.m

example_ieee39

PURPOSE ^

EXAMPLE_IEEE39 Examples of using maximum loadability limit (MLL) search with

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

EXAMPLE_IEEE39 Examples of using maximum loadability limit (MLL) search with 
   the IEEE 39

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 %EXAMPLE_IEEE39 Examples of using maximum loadability limit (MLL) search with
0002 %   the IEEE 39
0003 
0004 %   MATPOWER
0005 %   Copyright (c) 2015-2016, Power Systems Engineering Research Center (PSERC)
0006 %   by Camille Hamon
0007 %
0008 %   This file is part of MATPOWER/mx-maxloadlim.
0009 %   Covered by the 3-clause BSD License (see LICENSE file for details).
0010 %   See https://github.com/MATPOWER/mx-maxloadlim/ for more info.
0011 
0012 %addpath('../');
0013 %clear,clc;
0014 
0015 % Loading the system and defining parameters
0016 mpc = loadcase('case39'); % load ieee9
0017 dir_mll = zeros(39,1); % define direction of load increase
0018 dir_mll(9) = 1;
0019 
0020 %% First, run a CPF
0021 define_constants;
0022 mpc_target = mpc;
0023 nonzero_loads = mpc_target.bus(:,PD) ~= 0;
0024 Q_P = mpc_target.bus(nonzero_loads,QD)./mpc_target.bus(nonzero_loads,PD);
0025 mpc_target.bus(:,PD) = mpc_target.bus(:,PD)+2*dir_mll*mpc_target.baseMVA;
0026 mpc_target.bus(nonzero_loads,QD) = Q_P.*mpc_target.bus(nonzero_loads,PD);
0027 % Run the CPF with matpower
0028 [results,~] = runcpf(mpc,mpc_target);
0029 
0030 %% Without enforcement of the reactive power limits.
0031 % The reactive power limits are not enforced in the following example.
0032 results_mll = maxloadlim(mpc,dir_mll,'verbose',1,'use_qlim',0);
0033 mpopt = mpoption('out.lim.all',1,'out.lim.v',1,...
0034     'out.lim.line',1,'out.lim.pg',1,'out.lim.qg',1);
0035 printpf(results_mll,1,mpopt);
0036 
0037 % Try to increase the load a bit at bus 9
0038 % results_mll.bus(9,PD) = 1.1*results_mll.bus(9,PD);
0039 % results_mll.bus(nonzero_loads,QD) = Q_P.*results_mll.bus(nonzero_loads,PD);
0040 % results_pf = runpf(results_mll);
0041 % mpc_pf.version = results_pf.version;
0042 % mpc_pf.baseMVA = results_pf.baseMVA;
0043 % mpc_pf.bus = results_pf.bus;
0044 % mpc_pf.gen = results_pf.gen(:,1:21);
0045 % mpc_pf.branch = results_pf.branch;
0046 % mpc_pf.gencost = results_pf.gencost;
0047 % results_mll = maxloadlim(mpc_pf,dir_mll,'verbose',1,'use_qlim',0);

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