Home > matpower6.0 > most > t > most_ex1_ed.m

most_ex1_ed

PURPOSE ^

MOST_EX1_ED Examples of deterministic economic dispatch.

SYNOPSIS ^

function most_ex1_ed(quiet)

DESCRIPTION ^

MOST_EX1_ED  Examples of deterministic economic dispatch.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function most_ex1_ed(quiet)
0002 %MOST_EX1_ED  Examples of deterministic economic dispatch.
0003 
0004 %   MOST
0005 %   Copyright (c) 2015-2016, Power Systems Engineering Research Center (PSERC)
0006 %   by Ray Zimmerman, PSERC Cornell
0007 %
0008 %   This file is part of MOST.
0009 %   Covered by the 3-clause BSD License (see LICENSE file for details).
0010 %   See http://www.pserc.cornell.edu/matpower/ for more info.
0011 
0012 %% set up options
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 %%-----  economic dispatch (no network)  -----
0026 %% runopf
0027 mpc = loadcase(casefile);
0028 mpc.branch(:, RATE_A) = 0;  % disable line flow limits (mimic no network case)
0029 r1 = rundcopf(mpc, mpopt);
0030 Pg1 = r1.gen(:, PG);        % active generation
0031 lam1 = r1.bus(:, LAM_P);    % nodal energy price
0032 
0033 %% most
0034 mpc = loadcase(casefile);
0035 mpopt = mpoption(mpopt, 'most.dc_model', 0);    % use model with no network
0036 mdi = loadmd(mpc);
0037 mdo = most(mdi, mpopt);
0038 ms = most_summary(mdo);
0039 r2 = mdo.flow.mpc;
0040 Pg2 = r2.gen(:, PG);        % active generation
0041 lam2 = r2.bus(:, LAM_P);    % nodal energy price
0042 
0043 %% comparison
0044 Pg = [Pg1 Pg2]
0045 lam = [lam1 lam2]
0046 
0047 %%-----  economic dispatch (w/reserves)  -----
0048 %% runopf_w_res
0049 mpc = loadcase(casefile);
0050 mpc.branch(:, RATE_A) = 0;  % disable line flow limits (mimic no network case)
0051 r1 = runopf_w_res(mpc, mpopt);
0052 Pg1 = r1.gen(:, PG);        % active generation
0053 lam1 = r1.bus(:, LAM_P);    % nodal energy price
0054 R1 = r1.reserves.R;         % reserve quantity
0055 prc1 = r1.reserves.prc;     % reserve price
0056 
0057 %% most
0058 mpc = loadcase(casefile);
0059 mpopt = mpoption(mpopt, 'most.dc_model', 0);    % use model with no network
0060 mdi = loadmd(mpc);
0061 mdi.FixedReserves = mpc.reserves;   % include fixed zonal reserves
0062 mdo = most(mdi, mpopt);
0063 ms = most_summary(mdo);
0064 r2 = mdo.flow.mpc;
0065 Pg2 = r2.gen(:, PG);        % active generation
0066 lam2 = r2.bus(:, LAM_P);    % nodal energy price
0067 R2 = r2.reserves.R;         % reserve quantity
0068 prc2 = r2.reserves.prc;     % reserve price
0069 
0070 %% comparison
0071 Pg = [Pg1 Pg2]
0072 lam = [lam1 lam2]
0073 R = [R1 R2]
0074 prc = [prc1 prc2]

Generated on Fri 16-Dec-2016 12:45:37 by m2html © 2005