0001 function t_cpf_case9(quiet)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 if nargin < 1
0014 quiet = 0;
0015 end
0016 define_constants;
0017
0018 mpc = loadcase('case9');
0019
0020 dir_all = [0 0 0 0 1 0 0 0 0;
0021 0 0 0 0 0 0 1 0 0;
0022 0 0 0 0 0 0 0 0 1;
0023 0 0 0 0 1 0 1 0 1;
0024 0 0 0 0 1 0 1 0 0;
0025 0 0 0 0 1 0 0 0 1;
0026 0 0 0 0 0 0 1 0 1];
0027
0028 nb_dir = size(dir_all,1);
0029
0030 t0 = 'case9: ';
0031
0032 num_tests = nb_dir;
0033 t_begin(num_tests, quiet);
0034 for i = 1:nb_dir
0035
0036 dir = dir_all(i,:)';
0037 mpc_target = mpc;
0038 nonzero_loads = mpc_target.bus(:,PD) ~= 0;
0039 Q_P = mpc_target.bus(nonzero_loads,QD)./mpc_target.bus(nonzero_loads,PD);
0040 mpc_target.bus(:,PD) = mpc_target.bus(:,PD)+2*dir*mpc_target.baseMVA;
0041 mpc_target.bus(nonzero_loads,QD) = Q_P.*mpc_target.bus(nonzero_loads,PD);
0042
0043 [results,~] = runcpf(mpc,mpc_target,mpoption('out.all',0,'verbose',0));
0044
0045 max_loads_cpf = results.bus(:,PD);
0046
0047
0048 results_mll = maxloadlim(mpc,dir,'use_qlim',0,'verbose',0);
0049
0050 max_loads_mll = results_mll.bus(:,PD);
0051
0052 t = sprintf('%sdirection: %s',t0,mat2str(dir));
0053 t_is(max_loads_cpf,max_loads_mll,0,t);
0054 end
0055 t_end