Thanks Ray,
It worked out fine. I have another question on the same topic of ramping constraints, this time with including load following ramping (wear and tear). I have read your previous response to a question that was asked on a similar question https://www.mail-archive.com/[email protected]/msg05829.html , but this is not clear to me as yet. I have included load following (wear and tear) in my MOST deterministic multi-period simulation and copied the code below. The expected generation values I get for the simulation "without " wear and tear and "with" wear and tear are below: Without wear and tear: p = 10.2124 6.6470 4.3459 0 0 0 0 0 0 0 52.0000 52.0000 52.0000 54.9467 55.0639 0 0 0 0 0 0 0 0 0 0 With wear and tear: p = 0 6.6470 4.3459 0 0 0 0 0 0 0 0 52.0000 52.0000 54.9467 55.0639 0 0 0 0 0 62.2124 0 0 0 0 I am trying to understand why the values in the first period are different in both cases. How does the wear and tear change these values? What is meant by expected ramp cost obtained from the output of MOST "mdo.results.ExpectedRampCost "? can you please explain a bit further. My code is below: clear all casefile = 'case5'; mpc = loadcase(casefile); %% nt = 5;% five periods for example ng = size(mpc.gen, 1); nb = size(mpc.bus, 1); %% extra gen parameters xgd_table.colnames = {'CommitKey','MinUp','MinDown','PositiveLoadFollowReservePrice',... 'NegativeLoadFollowReservePrice','RampWearCostCoeff'}; xgd_table.data = [ones(ng,1),ones(ng,1)*2,ones(ng,1),1e0*ones(ng,2),ones(ng,1)]; xgd = loadxgendata(xgd_table, mpc); %% reserve data mpc.reserves.zones = ones(1,ng); mpc.reserves.cost = [0.02;0.03;0.1;0.12; 0.1]; %mpc.reserves.cost = [0.07;0.03;0.05;0.12; 0.09]; mpc.reserves.qty = mpc.gen(1:ng,9).*0.4; mpc.reserves.req = sum(mpc.reserves.qty)*0.3; %% edit gencost & gen mpc.gencost(:,2) = [7.92;18.06;37.08;35.29;35.04]; %startup cost mpc.gencost(:,3) = [0.18;11.23;27.04;9.55;17.91]; %shutdown cost mpc.gencost(:,4) = ones(ng,1)*3; mpc.gencost(:,5) = [5.29;5.12;5.98;0.082;5.98]; mpc.gencost(:,6) = [8.61;0.83;15.38;9.36;5.17]; mpc.gencost(:,7) = [50.44;54.82;100.92;84.18;90.68]; % mpc.gen(:,18) = mpc.gen(:,9)*0.4; %generators can ramp up to 40% of max capacity in 10sec mpc.gen(:,19) = mpc.gen(:,9)*0.4; %%%%% edit generator Pmin mpc.gen(:,10) = (mpc.gen(:,9)*0.1); %% generate load values pd = mpc.bus(:,3)/11; pt = [175.19; 165.15; 158.67; 154.73; 155.06; 160.48; ... 173.39; 177.60; 186.81; 206.96; 228.61; 236.10; ... 242.18; 243.60; 248.86; 255.79; 256.00; 246.74; ... 245.97; 237.35; 237.31; 232.67; 195.93; 195.60;]; pt = (pt / max(pt)); pt = pt(1:nt); pdt = (pd*pt'); %% define_constants [CT_LABEL, CT_PROB, CT_TABLE, CT_TBUS, CT_TGEN, CT_TBRCH, CT_TAREABUS, ... CT_TAREAGEN, CT_TAREABRCH, CT_ROW, CT_COL, CT_CHGTYPE, CT_REP, ... CT_REL, CT_ADD, CT_NEWVAL, CT_TLOAD, CT_TAREALOAD, CT_LOAD_ALL_PQ, ... CT_LOAD_FIX_PQ, CT_LOAD_DIS_PQ, CT_LOAD_ALL_P, CT_LOAD_FIX_P, ... CT_LOAD_DIS_P, CT_TGENCOST, CT_TAREAGENCOST, CT_MODCOST_F, ... CT_MODCOST_X] = idx_ct; loadprofile = struct( ... 'type', 'mpcData', ... 'table', CT_TLOAD, ... 'rows', (mpc.bus(:,1))', ... 'col', CT_LOAD_FIX_P, ... 'chgtype', CT_REP, ... 'values', [] ); loadprofile.values(:, 1, :) = pdt'; profiles = getprofiles(loadprofile); mdi = loadmd(mpc,nt,xgd,[],[], profiles); for it=1:nt mdi.FixedReserves(it,1,1)=mpc.reserves; end mpopt = mpoption('most.dc_model', 1); mpopt = mpoption(mpopt,'most.fixed_res',1); mdo = most(mdi, mpopt); p = mdo.results.ExpectedDispatch; x = mdo.UC.CommitSched; ramp = mdo.results.ExpectedRampCost; for ig = 1:nt r(:,ig) = mdo.flow(ig).mpc.reserves.R;% reserve quantity end res = most_summary(mdo); %obj = res.f; obj = mdo.QP.c1 + mdo.QP.f; p ________________________________ From: [email protected] <[email protected]> on behalf of Ray Zimmerman <[email protected]> Sent: Tuesday, September 19, 2017 6:56:48 AM To: MATPOWER discussion forum Subject: Re: Ramping constraints Do you have non-zero values for PMIN for your generators? If not, they can be dispatched all the way down to zero without shutting them off. Since the cost is the same, nothing is gained (in terms of improvement to your objective) by changing the commitment variables to 0. I suspect that using non-zero PMIN values will clarify things. Ray On Sep 18, 2017, at 4:10 PM, Quarm JNR, Edward A <[email protected]<mailto:[email protected]>> wrote: Thank you for your help. I have another question regarding the results I obtained; I actually don't understand why I get x = mdo.UC.CommitSched x = 5×5 logical array 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 since in the output p = 15.9023 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 600.0000 580.6055 557.8242 543.9727 545.1328 Some generators are not generating any output. Why don't they appear as 0 (zero) in the UC decisions. Can you please help me understand this results? I also further reduce the load on the buses in my code using: pd = mpc.bus (:,3)/1000; I still get the same results for UC decisions even after doing this. I try other things like adding startup and shutdown costs.. Thanks in advance, Edward ________________________________ From: [email protected]<mailto:[email protected]> <[email protected]<mailto:[email protected]>> on behalf of Ray Zimmerman <[email protected]<mailto:[email protected]>> Sent: Thursday, September 14, 2017 6:57:33 AM To: MATPOWER discussion forum Subject: Re: Ramping constraints Hi Edward, When I run your code I get … p = 15.9023 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 600.0000 580.6055 557.8242 543.9727 545.1328 >> define_constants >> mpc.gen(:, RAMP_30) ans = 16 68 208 80 240 So, it doesn’t look to me like any ramp limits are being violated. It’s possible that you are looking at the values of the load following ramp reserves, which are meaningless unless you have a non-zero cost on them. Try changing the xgd data definition to … xgd_table.colnames = {'CommitKey','MinUp','MinDown','PositiveLoadFollowReservePrice','NegativeLoadFollowReservePrice'}; xgd_table.data = [ones(ng,1),ones(ng,1)*2,ones(ng,1),1e-9*ones(ng,2)]; … and see if the results make more sense. This is due to the fact that the delta_+ and delta_- variables in (4.26) and (4.27) in the manual are only “tight” against these constraints if they have a positive cost on them. Ray On Sep 14, 2017, at 1:40 AM, Quarm JNR, Edward A <[email protected]<mailto:[email protected]>> wrote: Hi community, I am running a multi-period simulation in MOST with the following constraints: 1. Zonal reserve requirement 2. Generator Minimum up time and down time I obtain output generation (P) but they violate ramp_30 on the last generator (which limits the period to period ramping). Can you please help me understand why this is so? Have I done something wrong somewhere? When I include 'loadfollow' ramping constraints the ramp_30 constraints are violated further. Thanks in advance. My code is below: clear all casefile = 'case5'; mpc = loadcase(casefile); ng = size(mpc.gen, 1); nb = size(mpc.bus, 1); TCL MERGE ERROR ( 09/14/2017 09:57:55 ): "invalid command name "reserve"" OutmailID: 121827745, List: 'matpower-l', MemberID: 79074127 SCRIPT: "reserve data mpc.reserves.zones = ones(1,ng); mpc.reserves.cost = [0.07;0.03;0.05;0.12; 0.09]; mpc.reserves.qty = mpc.gen(:,9).*0.4; mpc.reserves.req = sum(mpc.reserves.qty)*0.3; " cost1 = [0.35;0.83;0.58;0.54;0.91]; cost2 = [0.28;0.75;0.75;0.38;0.56]; % mpc.gen(:,18) = mpc.gen(:,9)*0.4; %generators can ramp up to 40% of max capacity in 10 sec mpc.gen(:,19) = mpc.gen(:,9)*0.4; %generators can ramp up to 40% of max capacity in 30sec xgd_table.colnames = {'CommitKey','MinUp','MinDown'}; xgd_table.data = [ones(ng,1),ones(ng,1)*2,ones(ng,1)]; xgd = loadxgendata(xgd_table, mpc); nt = 5;% five periods TCL MERGE ERROR ( 09/14/2017 09:57:55 ): "invalid command name "generate"" OutmailID: 121827745, List: 'matpower-l', MemberID: 79074127 SCRIPT: "generate load values pd = mpc.bus(:,3)*0.9; pt = [175.19; 165.15; 158.67; 154.73; 155.06; 160.48; ... 173.39; 177.60; 186.81; 206.96; 228.61; 236.10; ... 242.18; 243.60; 248.86; 255.79; 256.00; 246.74; ... 245.97; 237.35; 237.31; 232.67; 195.93; 195.60;]; pt = (pt / max(pt)); pt = pt(1:nt); pdt = (pd*pt'); " define_constants [CT_LABEL, CT_PROB, CT_TABLE, CT_TBUS, CT_TGEN, CT_TBRCH, CT_TAREABUS, ... CT_TAREAGEN, CT_TAREABRCH, CT_ROW, CT_COL, CT_CHGTYPE, CT_REP, ... CT_REL, CT_ADD, CT_NEWVAL, CT_TLOAD, CT_TAREALOAD, CT_LOAD_ALL_PQ, ... CT_LOAD_FIX_PQ, CT_LOAD_DIS_PQ, CT_LOAD_ALL_P, CT_LOAD_FIX_P, ... CT_LOAD_DIS_P, CT_TGENCOST, CT_TAREAGENCOST, CT_MODCOST_F, ... CT_MODCOST_X] = idx_ct; loadprofile = struct( ... 'type', 'mpcData', ... 'table', CT_TLOAD, ... 'rows', (mpc.bus(:,1))', ... 'col', CT_LOAD_FIX_P, ... 'chgtype', CT_REP, ... 'values', [] ); loadprofile.values(:, 1, :) = pdt'; profiles = getprofiles(loadprofile); mdi = loadmd(mpc,nt,xgd,[],[], profiles); for it=1:nt mdi.FixedReserves(it,1,1)=mpc.reserves; end mpopt = mpoption('most.dc_model', 1); mpopt = mpoption(mpopt,'most.fixed_res',1); mdo = most(mdi, mpopt); p = mdo.results.ExpectedDispatch;
