MATPOWER / most

MOST – MATPOWER Optimal Scheduling Tool, for steady-state power systems scheduling problems.
https://matpower.org/
Other
31 stars 11 forks source link

Extremely Slow to Construct SCUC using MOST #17

Closed xb00dx closed 4 years ago

xb00dx commented 4 years ago

I'm solving SCUC using MOST, but it was extremely slow to formulate the problem with contingency scenarios. For example, I'm running the following code (case_ACTIVSg200), it took more than 2 hours to formulate one instance of SCUC. Without contingencies, one SCUC is formulated in 3 seconds.

clear;

define_constants;
nt = 24; % 24 hours
area_ind = 2:7;
na = length(area_ind); % 6 areas

mpc = loadcase('case_ACTIVSg200');
mpc.bus(:, BUS_AREA) = mpc.bus(:, ZONE); 
ng = size(mpc.gen,1);

scenarios = scenarios_ACTIVSg200; % get a change table

xgd.colnames = {'CommitKey','CommitSched','MinUp','MinDown','InitialState'};
xgd.data = [ones(ng,1), ones(ng,1), ones(ng,1),ones(ng,1), zeros(ng,1)];
xgd = loadxgendata(xgd, mpc);

indices = (1:nt*na); % indices for the load scenarios of the first day
load_data = scenarios(indices, end); % last column: loads of 6 areas
area_load1 = reshape(load_data, na, nt)'; % nt-by-na matrix
profiles = struct( ...
    'type', 'mpcData', ...
    'table', CT_TAREALOAD, ...
    'rows', area_ind, ...
    'col', CT_LOAD_ALL_P, ...
    'chgtype', CT_REP, ...
    'values', [] );
profiles.values(:, 1, :) = area_load1;

%% perform UC regardless of mdo.UC.CommitKey, consider DC line flow constraints
mpopt = mpoption('most.uc.run',1,'most.dc_model', 1, 'most.skip_prices', 1); 

%% Construct MOST struct
mdi = loadmd(mpc, nt, xgd, [], [], profiles); % WITHOUT contingencies
% contab = contab_ACTIVSg200;
% mdi = loadmd(mpc, nt, xgd, [], contab, profiles); % WITH contingencies
mdo = most(mdi,mpopt);
rdzman commented 4 years ago

I am not surprised. By including 245 contingencies, you have made the problem 245 times larger. In general, given the problem formulation that MOST uses for handling contingencies, it is not practical to simply add a complete list of contingencies directly to the problem except for the very smallest systems. Effective use of MOST with contingencies requires a very careful selection of a limited subset of contingencies that “cover” in some sense the worst cases and are representative of the outages that can happen. This contingency selection process is itself a non-trivial problem.

I should also note that there have been improvements in the versions of MATPOWER and MOST available on GitHub since the release of version 7 that improve the performance of constructing very large cases. But that won’t change the fact that you constructing a very large case.