0001 function most_ex7_suc(quiet)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 define_constants;
0014 verbose = 1;
0015 mpopt = mpoption('verbose', verbose);
0016 mpopt = mpoption(mpopt, 'out.gen', 1);
0017 mpopt = mpoption(mpopt, 'model', 'DC');
0018 mpopt = mpoption(mpopt, 'most.solver', 'DEFAULT');
0019 if ~verbose
0020 mpopt = mpoption(mpopt, 'out.all', 0);
0021 end
0022 mpopt = mpoption(mpopt, 'most.price_stage_warn_tol', 10);
0023
0024
0025 if have_fcn('cplex')
0026
0027
0028 mpopt = mpoption(mpopt, 'cplex.lpmethod', 2);
0029
0030
0031 mpopt = mpoption(mpopt, 'cplex.opts.mip.tolerances.mipgap', 0);
0032 mpopt = mpoption(mpopt, 'cplex.opts.mip.tolerances.absmipgap', 0);
0033 mpopt = mpoption(mpopt, 'cplex.opts.threads', 2);
0034 end
0035 if have_fcn('glpk')
0036 mpopt = mpoption(mpopt, 'glpk.opts.mipgap', 0);
0037 mpopt = mpoption(mpopt, 'glpk.opts.tolint', 1e-10);
0038 mpopt = mpoption(mpopt, 'glpk.opts.tolobj', 1e-10);
0039 end
0040 if have_fcn('gurobi')
0041
0042
0043 mpopt = mpoption(mpopt, 'gurobi.method', 1);
0044
0045 mpopt = mpoption(mpopt, 'gurobi.threads', 2);
0046 mpopt = mpoption(mpopt, 'gurobi.opts.MIPGap', 0);
0047 mpopt = mpoption(mpopt, 'gurobi.opts.MIPGapAbs', 0);
0048 end
0049 if have_fcn('mosek')
0050 sc = mosek_symbcon;
0051
0052
0053
0054 mpopt = mpoption(mpopt, 'mosek.lp_alg', sc.MSK_OPTIMIZER_DUAL_SIMPLEX);
0055
0056
0057 mpopt = mpoption(mpopt, 'mosek.opts.MSK_IPAR_MIO_NODE_OPTIMIZER', sc.MSK_OPTIMIZER_DUAL_SIMPLEX);
0058 mpopt = mpoption(mpopt, 'mosek.opts.MSK_IPAR_MIO_ROOT_OPTIMIZER', sc.MSK_OPTIMIZER_DUAL_SIMPLEX);
0059 mpopt = mpoption(mpopt, 'mosek.opts.MSK_DPAR_MIO_TOL_ABS_RELAX_INT', 1e-9);
0060
0061 mpopt = mpoption(mpopt, 'mosek.opts.MSK_DPAR_MIO_TOL_REL_GAP', 0);
0062 mpopt = mpoption(mpopt, 'mosek.opts.MSK_DPAR_MIO_TOL_ABS_GAP', 0);
0063 end
0064 if have_fcn('intlinprog')
0065
0066
0067
0068 mpopt = mpoption(mpopt, 'linprog.Algorithm', 'dual-simplex');
0069
0070 mpopt = mpoption(mpopt, 'intlinprog.RootLPAlgorithm', 'dual-simplex');
0071 mpopt = mpoption(mpopt, 'intlinprog.TolCon', 1e-9);
0072 mpopt = mpoption(mpopt, 'intlinprog.TolGapAbs', 0);
0073 mpopt = mpoption(mpopt, 'intlinprog.TolGapRel', 0);
0074 mpopt = mpoption(mpopt, 'intlinprog.TolInteger', 1e-6);
0075
0076
0077 mpopt = mpoption(mpopt, 'intlinprog.LPPreprocess', 'none');
0078 end
0079
0080 casefile = 'ex_case3b';
0081 mpc = loadcase(casefile);
0082 xgd = loadxgendata('ex_xgd_uc', mpc);
0083 [iwind, mpc, xgd] = addwind('ex_wind_uc', mpc, xgd);
0084 profiles = getprofiles('ex_wind_profile', iwind);
0085 profiles = getprofiles('ex_load_profile', profiles);
0086 nt = size(profiles(1).values, 1);
0087
0088
0089 transmat_s = cell(1, nt);
0090 I = speye(3);
0091 [transmat_s{:}] = deal(I);
0092 transmat_s{1} = [ 0.158655253931457; 0.682689492137086; 0.158655253931457 ];
0093 mdi = loadmd(mpc, transmat_s, xgd, [], [], profiles);
0094 mdi = filter_ramp_transitions(mdi, 0.1);
0095 mdo = most(mdi, mpopt);
0096 if verbose
0097 ms = most_summary(mdo);
0098 end
0099
0100
0101 transmat = ex_transmat(nt);
0102 mdi = loadmd(mpc, transmat, xgd, [], [], profiles);
0103 mdo = most(mdi, mpopt);
0104 if verbose
0105 ms = most_summary(mdo);
0106 end
0107
0108
0109 mdi = loadmd(mpc, transmat, xgd, [], 'ex_contab', profiles);
0110 mdo = most(mdi, mpopt);
0111 if verbose
0112 ms = most_summary(mdo);
0113 end
0114
0115
0116 [iess, mpc, xgd, sd] = addstorage('ex_storage', mpc, xgd);
0117 mdi = loadmd(mpc, transmat, xgd, sd, 'ex_contab', profiles);
0118 mdo = most(mdi, mpopt);
0119 if verbose
0120 ms = most_summary(mdo);
0121 end