0001 function most_ex2_dcopf(quiet)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 define_constants;
0014 verbose = 0;
0015 casefile = 'ex_case3a';
0016 mpopt = mpoption('verbose', verbose);
0017 mpopt = mpoption(mpopt, 'out.gen', 1);
0018 mpopt = mpoption(mpopt, 'model', 'DC');
0019 mpopt = mpoption(mpopt, 'opf.dc.solver', 'MIPS');
0020 mpopt = mpoption(mpopt, 'most.solver', mpopt.opf.dc.solver);
0021 if ~verbose
0022 mpopt = mpoption(mpopt, 'out.all', 0);
0023 end
0024
0025
0026
0027 mpc = loadcase(casefile);
0028 r1 = rundcopf(mpc, mpopt);
0029 Pg1 = r1.gen(:, PG);
0030 lam1 = r1.bus(:, LAM_P);
0031
0032
0033 mpc = loadcase(casefile);
0034 mpopt = mpoption(mpopt, 'most.dc_model', 1);
0035 mdi = loadmd(mpc);
0036 mdo = most(mdi, mpopt);
0037 ms = most_summary(mdo);
0038 r2 = mdo.flow.mpc;
0039 Pg2 = r2.gen(:, PG);
0040 lam2 = r2.bus(:, LAM_P);
0041
0042
0043 Pg = [Pg1 Pg2]
0044 lam = [lam1 lam2]
0045
0046
0047
0048 mpc = loadcase(casefile);
0049 r1 = runopf_w_res(mpc, mpopt);
0050 Pg1 = r1.gen(:, PG);
0051 lam1 = r1.bus(:, LAM_P);
0052 R1 = r1.reserves.R;
0053 prc1 = r1.reserves.prc;
0054
0055
0056 mpc = loadcase(casefile);
0057 mpopt = mpoption(mpopt, 'most.dc_model', 1);
0058 mdi = loadmd(mpc);
0059 mdi.FixedReserves = mpc.reserves;
0060 mdo = most(mdi, mpopt);
0061 ms = most_summary(mdo);
0062 r2 = mdo.flow.mpc;
0063 Pg2 = r2.gen(:, PG);
0064 lam2 = r2.bus(:, LAM_P);
0065 R2 = r2.reserves.R;
0066 prc2 = r2.reserves.prc;
0067
0068
0069 Pg = [Pg1 Pg2]
0070 lam = [lam1 lam2]
0071 R = [R1 R2]
0072 prc = [prc1 prc2]