0001 function most_ex3_dcopf_w_uc(quiet)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 define_constants;
0014 verbose = 0;
0015 mpopt = mpoption('verbose', verbose);
0016 mpopt = mpoption(mpopt, 'out.gen', 1);
0017 mpopt = mpoption(mpopt, 'model', 'DC');
0018 mpopt = mpoption(mpopt, 'opf.dc.solver', 'MIPS');
0019 mpopt = mpoption(mpopt, 'most.solver', 'DEFAULT');
0020 if ~verbose
0021 mpopt = mpoption(mpopt, 'out.all', 0);
0022 end
0023
0024
0025 casefile = 'ex_case3b';
0026 mpc = loadcase(casefile);
0027 xgd_table.colnames = { 'CommitKey' };
0028 xgd_table.data = [
0029 1;
0030 1;
0031 1;
0032 2;
0033 ];
0034 xgd = loadxgendata(xgd_table, mpc);
0035 [iwind, mpc, xgd] = addwind('ex_wind_uc', mpc, xgd);
0036 mpc = scale_load(499, mpc, [], struct('scale', 'QUANTITY'));
0037 mpc.gencost(:, STARTUP) = 0;
0038 mpc.gencost(:, SHUTDOWN) = 0;
0039 mpc.reserves.zones = [mpc.reserves.zones 0];
0040 mpc0 = mpc;
0041 xgd0 = xgd;
0042
0043
0044 mpc = mpc0;
0045 r1 = runuopf(mpc, mpopt);
0046 u1 = r1.gen(:, GEN_STATUS);
0047 Pg1 = r1.gen(:, PG);
0048 lam1 = r1.bus(:, LAM_P);
0049
0050
0051 mdi = loadmd(mpc, [], xgd);
0052 mdo = most(mdi, mpopt);
0053 r2 = mdo.flow.mpc;
0054 u2 = r2.gen(:, GEN_STATUS);
0055 u2 = mdo.UC.CommitSched;
0056 Pg2 = r2.gen(:, PG);
0057 lam2 = r2.bus(:, LAM_P);
0058 if verbose
0059 printpf(r2, [], mpopt);
0060 most_summary(mdo);
0061 end
0062
0063
0064 u = [u1 u2]
0065 Pg = [Pg1 Pg2]
0066 lam = [lam1 lam2]