0001 function most_ex1_ed(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 mpc.branch(:, RATE_A) = 0;
0029 r1 = rundcopf(mpc, mpopt);
0030 Pg1 = r1.gen(:, PG);
0031 lam1 = r1.bus(:, LAM_P);
0032
0033
0034 mpc = loadcase(casefile);
0035 mpopt = mpoption(mpopt, 'most.dc_model', 0);
0036 mdi = loadmd(mpc);
0037 mdo = most(mdi, mpopt);
0038 ms = most_summary(mdo);
0039 r2 = mdo.flow.mpc;
0040 Pg2 = r2.gen(:, PG);
0041 lam2 = r2.bus(:, LAM_P);
0042
0043
0044 Pg = [Pg1 Pg2]
0045 lam = [lam1 lam2]
0046
0047
0048
0049 mpc = loadcase(casefile);
0050 mpc.branch(:, RATE_A) = 0;
0051 r1 = runopf_w_res(mpc, mpopt);
0052 Pg1 = r1.gen(:, PG);
0053 lam1 = r1.bus(:, LAM_P);
0054 R1 = r1.reserves.R;
0055 prc1 = r1.reserves.prc;
0056
0057
0058 mpc = loadcase(casefile);
0059 mpopt = mpoption(mpopt, 'most.dc_model', 0);
0060 mdi = loadmd(mpc);
0061 mdi.FixedReserves = mpc.reserves;
0062 mdo = most(mdi, mpopt);
0063 ms = most_summary(mdo);
0064 r2 = mdo.flow.mpc;
0065 Pg2 = r2.gen(:, PG);
0066 lam2 = r2.bus(:, LAM_P);
0067 R2 = r2.reserves.R;
0068 prc2 = r2.reserves.prc;
0069
0070
0071 Pg = [Pg1 Pg2]
0072 lam = [lam1 lam2]
0073 R = [R1 R2]
0074 prc = [prc1 prc2]