Home > matpower7.1 > most > lib > t > most_ex4_dcopf_ss.m

most_ex4_dcopf_ss

PURPOSE ^

MOST_EX4_DCOPF_SS Examples of secure and stochastic DC OPF problems.

SYNOPSIS ^

function most_ex4_dcopf_ss(quiet)

DESCRIPTION ^

MOST_EX4_DCOPF_SS  Examples of secure and stochastic DC OPF problems.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function most_ex4_dcopf_ss(quiet)
0002 %MOST_EX4_DCOPF_SS  Examples of secure and stochastic DC OPF problems.
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 https://github.com/MATPOWER/most for more info.
0011 
0012 %% set up options
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 casefile = 'ex_case3a';
0025 mpc = loadcase(casefile);
0026 xgd = loadxgendata('ex_xgd_res', mpc);
0027 
0028 %%-----  Secure DC OPF (w/cont,res,ramp)  -----
0029 %% most
0030 mdi = loadmd(mpc, [], xgd, [], 'ex_contab');
0031 mdo = most(mdi, mpopt);
0032 EPg1 = mdo.results.ExpectedDispatch;     % active generation
0033 Elam1 = mdo.results.GenPrices;           % nodal energy price
0034 if verbose
0035     most_summary(mdo);
0036 end
0037 
0038 
0039 %%-----  Stochastic DC OPF (w/wind,res)  -----
0040 [iwind, mpc, xgd] = addwind('ex_wind', mpc, xgd);
0041 transmat = {[0.158655253931457; 0.682689492137086; 0.158655253931457]};
0042 nt = 1;     % number of periods
0043 nj = 3;     % number of scenarios
0044 profiles = getprofiles(uniformwindprofile(nt, nj), iwind);
0045 
0046 %% most
0047 mdi = loadmd(mpc, transmat, xgd, [], [], profiles);
0048 mdo = most(mdi, mpopt);
0049 EPg2 = mdo.results.ExpectedDispatch;     % active generation
0050 Elam2 = mdo.results.GenPrices;           % nodal energy price
0051 if verbose
0052     most_summary(mdo);
0053 end
0054 
0055 %%-----  Secure Stochastic DC OPF (w/wind,cont,res,ramp)  -----
0056 %% most
0057 mdi = loadmd(mpc, transmat, xgd, [], 'ex_contab', profiles);
0058 mdo = most(mdi, mpopt);
0059 EPg3 = mdo.results.ExpectedDispatch;     % active generation
0060 Elam3 = mdo.results.GenPrices;           % nodal energy price
0061 if verbose
0062     most_summary(mdo);
0063 end
0064 
0065 %%-----  Secure Stochastic UC / DC OPF (w/wind,cont,res,ramp)  -----
0066 %% most
0067 casefile = 'ex_case3b';
0068 mpc = loadcase(casefile);
0069 xgd = loadxgendata('ex_xgd_uc', mpc);
0070 [iwind, mpc, xgd] = addwind('ex_wind_uc', mpc, xgd);
0071 mpc = scale_load(350, mpc, [], struct('scale', 'QUANTITY'));
0072 mpc.gencost(:, STARTUP) = 0;
0073 mpc.gencost(:, SHUTDOWN) = 0;
0074 mpc.reserves.zones = [mpc.reserves.zones 0];
0075 
0076 mdi = loadmd(mpc, transmat, xgd, [], 'ex_contab', profiles);
0077 mdo = most(mdi, mpopt);
0078 u = mdo.UC.CommitSched;                 % commitment status
0079 EPg4 = mdo.results.ExpectedDispatch;     % active generation
0080 Elam4 = mdo.results.GenPrices;           % nodal energy price
0081 if verbose
0082     most_summary(mdo);
0083 end
0084 
0085 EPg = [[EPg1; NaN] EPg2 EPg3 EPg4]
0086 Elam = [[Elam1; NaN] Elam2 Elam3 Elam4]

Generated on Fri 09-Oct-2020 11:21:31 by m2html © 2005