i have a rtuc.gms code working for a single run unit commitment covering 6 intervals. I want to call this gms code consecutively. The first run, rtuc.gms read the initial condition from the excel file read by the main.gms through an input_initial.gdx file. the rtuc.gms ran for interval t1-t6, reports back the dispatch and commitment for t1, which will be used as the initial condition for the second rtuc.gms run covering t2-t7.
Hi,
it would be easier to help if you could share code/data such that other forum users can provide target oriented help. It is unclear how main.gms and rtuc.gms interact.
Fred
Hi Fred, thank you! I am a new user and cannot attach files. can i paste my code here?
You can just drag files into the text field to attach them. When pasting code, please make sure to use code tags </> for proper formatting. Thanks!
**************************************
*here is the main2.gms which will call the rtuc_model.gms to solve one run over six time intervals. *
*======================================================================
* RTUC_MainDriver.gms
* Rolling Real-Time Unit Commitment – Global-Time Index
*======================================================================
$ontext
- Forecast.xlsx contains three columns:
*IntervalID RunID LoadForecast_MW*
- Gen_data.xlsx contains generator parameters.
- rtuc_model.gms performs single-run optimization.
- Only the first interval’s dispatch in each run is binding.
$offtext
*----------------------------------------------------------------------
* 1) SETS & CONFIGURATION
*----------------------------------------------------------------------
Set
sSupply “Generators” / g1*g8 /
sTime_full “Global intervals” / t1*t200 /
r “Run IDs” / 1*200 /;
Alias (sTime_full,t);
Scalar nRuns “number of active forecast runs”;
*----------------------------------------------------------------------
* 2) READ FORECAST FILE
*----------------------------------------------------------------------
Parameter demand_data(sTime_full,r);
$call GDXXRW forecast.xlsx par=demand_data rng=A1:C999 cdim=1 rdim=1 trace=2
$GDXIN forecast.gdx
$LOAD demand_data
$GDXIN
Set rActive(r);
rActive(r) = yes$(sum(t, demand_data(t,r)) <> 0);
nRuns = card(rActive);
*----------------------------------------------------------------------
* 3) READ GENERATOR DATA
*----------------------------------------------------------------------
Parameter gen_data(sSupply,*);
$call GDXXRW gen_data.xlsx par=gen_data rng=A1:O99 cdim=1 rdim=1 trace=2
$GDXIN gen_data.gdx
$LOAD gen_data
$GDXIN
*----------------------------------------------------------------------
* 4) INITIAL CONDITIONS (First Run reading the initial condition)
*----------------------------------------------------------------------
Parameter
initMW(sSupply)
timeOn0(sSupply)
timeOff0(sSupply);
initMW(sSupply) = gen_data(sSupply,‘initialMW’);
timeOn0(sSupply) = gen_data(sSupply,‘TimeBeenOn’);
timeOff0(sSupply)= gen_data(sSupply,‘TimeBeenOff’);
*----------------------------------------------------------------------
* 5) RESULT HOLDER
*----------------------------------------------------------------------
Parameter
res_dispatch(sSupply,sTime_full,r)
res_prodCostFirst(r)
res_initMW_next(sSupply,r)
res_timeOn_next(sSupply,r)
res_timeOff_next(sSupply,r);
*----------------------------------------------------------------------
* 6) MAIN ROLLING LOOP
*----------------------------------------------------------------------
Parameter demand_run(sTime_full);
*outputs in each loop will be given value
Parameter
dispatch_first(sSupply)
prodCostFirst
initMW_next(sSupply)
timeOn_next(sSupply)
timeOff_next(sSupply);
Loop(rActive(r),
* Read demand vector for this run
demand_run(t) = demand_data(t,r);
* Write input GDX for single rtuc to run
Execute_Unload ‘rtuc_input_current.gdx’,
gen_data, demand_run, initMW, timeOn0, timeOff0;
* Execute single-run RTUC (unique working folder)
execute ‘gams rtuc_model.gms lo=2 --runName=’ r.tl ’ pw=process_run’ r.tl;
*prepare to output the results for next horizon
Execute_Load ‘rtuc_output_current.gdx’
dispatch_first=dispatch_first,
prodCostFirst=prodCostFirst,
initMW_next=initMW_next,
timeOn_next=timeOn_next,
timeOff_next=timeOff_next;
* Store results
res_dispatch(sSupply,'t1',r) = dispatch_first(sSupply);
res_prodCostFirst(r) = prodCostFirst;
res_initMW_next(sSupply,r) = initMW_next(sSupply);
res_timeOn_next(sSupply,r) = timeOn_next(sSupply);
res_timeOff_next(sSupply,r) = timeOff_next(sSupply);
* Prepare ICs for next run
initMW(sSupply) = initMW_next(sSupply);
timeOn0(sSupply) = timeOn_next(sSupply);
timeOff0(sSupply)= timeOff_next(sSupply);
put_utility ‘log’ / 'Completed Run ’ r.tl / ’ First-interval cost: ’ prodCostFirst:10:2;
);
*----------------------------------------------------------------------
* 7) SAVE AGGREGATED RESULTS
*----------------------------------------------------------------------
Execute_Unload ‘RTUC_AllRunsResults.gdx’,
res_dispatch, res_prodCostFirst,
res_initMW_next, res_timeOn_next, res_timeOff_next;
*******************************End of main2.gms
*****************Start of rtuc_model.gms*
************
$ontext
====================================================================
Real-Time Unit Commitment (RTUC)
Includes:
*• Startup ramp (startFrac) that begins immediately and stays at 1 after ramp*
*• Per-unit minimum run / down times (MU(i), MD(i))*
*• No-load cost during startup + min-run window (nlFlag)*
*• Rolling state updates (time_on_next, time_off_next)*
Reserve equations (headroom, startup/offline reserves) unchanged.
====================================================================
$offtext
* ---------- Sets ----------
Set sSupply / g1*g8 /;
Set sTime_full, sTime,r;
Alias (sTime_full,t,tp);
*----------------------------------------------------------------------
Set
sSupply / g1*g8 /
sTime_full / t1*t200 /;
Alias (sTime_full,t);
*----------------------------------------------------------------------
* 2) LOAD INPUTS
*----------------------------------------------------------------------
Parameter
gen_data(sSupply,*),
demand_run(sTime_full),
initMW(sSupply),
timeOn0(sSupply),
timeOff0(sSupply);
$GDXIN rtuc_input_current.gdx
$LOAD gen_data, demand_run, initMW, timeOn0, timeOff0
$GDXIN
*----------------------------------------------------------------------
* 3) ACTIVE TIME RANGE (non-zero demand)
*----------------------------------------------------------------------
Set active_t(t);
active_t(t) = yes$(demand_run(t) <> 0);
Parameter demand(t);
demand(t) = demand_run(t);
* ---------- Parameters ----------
Parameter
pmin(sSupply), pmax(sSupply), rr(sSupply),
c10(sSupply), c30(sSupply), suMin(sSupply),
Offer(sSupply), initMW(sSupply),
SC(sSupply), NC(sSupply),
timeOn0(sSupply), timeOff0(sSupply),
MU(sSupply), MD(sSupply);
pmin(sSupply) = gen_data(sSupply,‘pmin’);
pmax(sSupply) = gen_data(sSupply,‘pmax’);
rr(sSupply) = gen_data(sSupply,‘rr’);
c10(sSupply) = gen_data(sSupply,‘C10’);
c30(sSupply) = gen_data(sSupply,‘C30’);
suMin(sSupply) = gen_data(sSupply,‘sutime’);
Offer(sSupply) = gen_data(sSupply,‘Offer’);
initMW(sSupply) = gen_data(sSupply,‘initialMW’);
SC(sSupply) = gen_data(sSupply,‘SC’);
NC(sSupply) = gen_data(sSupply,‘NC’);
timeOn0(sSupply) = gen_data(sSupply,‘TimeBeenOn’);
timeOff0(sSupply) = gen_data(sSupply,‘TimeBeenOff’);
MU(sSupply) = gen_data(sSupply,‘MU’);
MD(sSupply) = gen_data(sSupply,‘MD’);
Scalar dt /15/;
* interval length in minutes
Parameter RU(sSupply), RD(sSupply);
RU(sSupply) = rr(sSupply)*dt;
RD(sSupply) = rr(sSupply)*dt;
* ---------- Startup window length (in intervals, ≥1) ----------
Parameter K(sSupply);
K(sSupply) = max(1, ceil(suMin(sSupply)/15));
Parameter u0(sSupply);
u0(sSupply) = 1$(initMW(sSupply) > 0);
* ---------- Cost factors offered hourly value into 15min granularity ----------
Parameter noLoadCost_interval(sSupply);
noLoadCost_interval(sSupply) = NC(sSupply)/4;
* Exogenous reserve requirements (set to 0 here; change freely)
*Parameter Req10(sTime) / t1*t6 250 /;
*Parameter Req30(sTime) / t1*t6 350 /;
*Parameter Req90(sTime) / t1*t6 450 /;
* ---------- Penalties ----------
Scalar pES /1e8/, PF10 /1500/, PF30 /1000/, PF90 /250/;
*----------------------------------------------------------------------
* 4. INITIAL CONDITIONS
*----------------------------------------------------------------------
Parameter initMW_curr(sSupply), timeOn_curr(sSupply), timeOff_curr(sSupply);
initMW_curr(sSupply) = initMW(sSupply);
timeOn_curr(sSupply) = timeOn0(sSupply);
timeOff_curr(sSupply)= timeOff0(sSupply);
*----------------------------------------------------------------------
* 5. RESULTS STORAGE
*----------------------------------------------------------------------
Parameter
res_dispatch(sSupply,sTime,r)
res_lmp(sTime,r)
res_prodCostFirst(r)
res_timeOn_next(sSupply,r)
res_timeOff_next(sSupply,r)
res_initMW_next(sSupply,r);
* 6. MAIN ROLLING LOOP
*----------------------------------------------------------------------
Set rActive(r); rActive(r)=yes$(sum(t,demand_data(t,r))<>0);
Loop(rActive(r),
* ---- Build local demand horizon (6 intervals) ----
Parameter demand(sTime);
Scalar startOrd; startOrd = smin(t$(demand_data(t,r)<>0),ord(t));
demand(sTime) = sum(t$(ord(t)=startOrd+ord(sTime)-1), demand_data(t,r));
* ---------- Variables ----------
Variable vObj;
Positive Variables
p(sSupply,sTime), ES(sTime),
r10_on(sSupply,sTime), r30_on(sSupply,sTime), r90_on(sSupply,sTime),
r10_off(sSupply,sTime), r30_off(sSupply,sTime), r90_off(sSupply,sTime),
s10(sTime), s30(sTime), s90(sTime);
Binary Variables
u(sSupply,sTime), y(sSupply,sTime), z(sSupply,sTime);
* ================================================================
* ===== PER-UNIT MU / MD SECTION =====
* Enforces minimum run and down times using per-unit parameters.
* ================================================================
Equations
OnOff1(sSupply,sTime), OnOff2(sSupply,sTime),
MinUpRun(sSupply,sTime), MinDownRun(sSupply,sTime);
OnOff1(sSupply,sTime)$(ord(sTime)=1)..
u(sSupply,sTime) - u0(sSupply) =e= y(sSupply,sTime) - z(sSupply,sTime);
OnOff2(sSupply,sTime)$(ord(sTime)>1)..
u(sSupply,sTime) - u(sSupply,sTime-1) =e= y(sSupply,sTime) - z(sSupply,sTime);
MinUpRun(sSupply,sTime)$(ord(sTime)>1)..
u(sSupply,sTime) =g=
sum(tp$(ord(tp)+K(sSupply) >= ord(sTime)-MU(sSupply)+1
and ord(tp)+K(sSupply) <= ord(sTime)), y(sSupply,tp));
* - (timeOn0(sSupply)-MU(sSupply))$(ord(sTime)=1 and timeOn0(sSupply)<MU(sSupply));
u.up(sSupply,‘t1’)=1;
u.lo(sSupply,‘t1’)=0;
MinDownRun(sSupply,sTime)$(ord(sTime)>1)..
(1 - u(sSupply,sTime)) =g=
sum(tp$(ord(tp) >= ord(sTime)-MD(sSupply) and ord(tp) <= ord(sTime)), z(sSupply,tp));
* - (timeOff0(sSupply)-MD(sSupply))$(ord(sTime)=1 and timeOff0(sSupply)<MD(sSupply));
* ================================================================
* Defines fractional ramp progress startFrac(i,t) that begins in the
* commitment interval and remains 1 after startup completion.
* Used in MinOut_mod: p >= pmin * startFrac.
* ================================================================
Positive Variable startFrac(sSupply,sTime);
startFrac.up(sSupply,sTime) = 1;
Equation DefStartFrac(sSupply,sTime), MinOut_mod(sSupply,sTime),MaxOut(sSupply,sTime);
DefStartFrac(sSupply,sTime)..
startFrac(sSupply,sTime) =e=
sum(tp$(ord(tp) <= ord(sTime) and ord(sTime) < ord(tp)+K(sSupply)),
(**ord**(sTime)-**ord**(tp)+1)/K(sSupply) \* y(sSupply,tp))
+ **sum**(tp$(**ord**(tp)+K(sSupply) <= **ord**(sTime)), y(sSupply,tp));
* ================================================================
* Startup gate (1 during startup window, 0 otherwise)
* ================================================================
Positive Variable Sgate(sSupply,sTime);
Sgate.up(sSupply,sTime) =1;
Equation DefSgate(sSupply,sTime);
DefSgate(sSupply,sTime)..
Sgate(sSupply,sTime) =e=
sum(tp$(ord(tp)>= ord(sTime)-K(sSupply)+1 and ord(tp)<=ord(sTime)),y(sSupply,tp));
Parameter Mru(sSupply);
Mru(sSupply)=pmax(sSupply);
* Minimum output requirement with ramp fraction
MinOut_mod(sSupply,sTime)..
p(sSupply,sTime) =g= pmin(sSupply) * startFrac(sSupply,sTime);
*max output
MaxOut(sSupply,sTime)..
p(sSupply,sTime) =l= u(sSupply,sTime)*pmax(sSupply);
* ================================================================
* ===== NO-LOAD COST SECTION =====
* Defines nlFlag(i,t)=1 during startup+min-run window; 0 otherwise.
* Applies no-load cost ($/hour ÷4) during these intervals.
* ================================================================
Positive Variable nlFlag(sSupply,sTime);
nlFlag.up(sSupply,sTime) = 1;
Equation DefNoLoadFlag(sSupply,sTime);
DefNoLoadFlag(sSupply,sTime)..
nlFlag(sSupply,sTime) =e=
sum(tp$(ord(tp) <= ord(sTime) and ord(sTime) < ord(tp)+K(sSupply)+MU(sSupply)),
y(sSupply,tp));
* ================================================================
* ===== OBJECTIVE FUNCTION =====
* Includes energy, startup, no-load, and penalty costs.
* ================================================================
Equation Obj;
Obj..
vObj =e=
sum((sSupply,sTime), Offer(sSupply)*p(sSupply,sTime))
-
sum((sSupply,sTime), SC(sSupply)*y(sSupply,sTime))
-
sum((sSupply,sTime), noLoadCost_interval(sSupply)*nlFlag(sSupply,sTime))
-
sum(sTime, pES*ES(sTime) + PF90*s90(sTime) + PF30*s30(sTime) + PF10*s10(sTime));
* ================================================================
* ===== ENERGY BALANCE =====
* ================================================================
Equation EnergyBalance(sTime);
EnergyBalance(sTime)..
sum(sSupply, p(sSupply,sTime)) + ES(sTime) =e= demand(sTime);
* ================================================================
* ===== RESERVE REQUIREMENTS (unchanged) =====
* Ordered reserve requirement constraints with slacks.
* ================================================================
Equation Total90Req(sTime), Total30Req(sTime), Total10Req(sTime);
Total90Req(sTime)..
sum(sSupply, r10_on(sSupply,sTime)+r10_off(sSupply,sTime)
+r30_on(sSupply,sTime)+r30_off(sSupply,sTime)
+r90_on(sSupply,sTime)+r90_off(sSupply,sTime))
- s90(sTime) =g= Req90(sTime);
Total30Req(sTime)..
sum(sSupply, r10_on(sSupply,sTime)+r10_off(sSupply,sTime)
+r30_on(sSupply,sTime)+r30_off(sSupply,sTime))
- s30(sTime) =g= Req30(sTime);
Total10Req(sTime)..
sum(sSupply, r10_on(sSupply,sTime)+r10_off(sSupply,sTime))
- s10(sTime) =g= Req10(sTime);
* ================================================================
* ===== RAMP CONSTRAINTS (unchanged) =====
* ================================================================
Equation RampUp1(sSupply,sTime), RampDn1(sSupply,sTime),RampUp2(sSupply,sTime), RampDn2(sSupply,sTime);
*if unit is starting up in first interval, Sgate =1, relax ramping since it needs to reach ecomin or linearly ramping
RampUp1(sSupply,sTime)$(ord(sTime)=1)..
p(sSupply,sTime) - initMW(sSupply)
=l= RU(sSupply)*u0(sSupply) + Mru(sSupply)*Sgate(sSupply,sTime);
RampUp2(sSupply,sTime)$(ord(sTime)>1)..
p(sSupply,sTime) - p(sSupply,sTime-1)
=l= RU(sSupply)*u(sSupply,sTime-1) + Mru(sSupply)*Sgate(sSupply,sTime);
RampDn1(sSupply,sTime)$(ord(sTime)=1)..
initMW(sSupply) - p(sSupply,sTime)
=l= RD(sSupply)*u(sSupply,sTime) + RD(sSupply)*z(sSupply,sTime);
RampDn2(sSupply,sTime)$(ord(sTime)>1)..
p(sSupply,sTime-1) - p(sSupply,sTime)
=l= RD(sSupply)*u(sSupply,sTime) + RD(sSupply)*z(sSupply,sTime);
* ================================================================
* ===== RESERVE BLOCKING, HEADROOM, OFFLINE RESERVES (unchanged) =====
* Keep your original Headroom_mod, StartupBlockP_conv, Rxx_on/off, etc.
* Below are placeholders; paste your original reserve equations here.
* ================================================================
Equations R10_on_cap(sSupply,sTime), R30_on_cap(sSupply,sTime), R90_on_cap(sSupply,sTime)
R10_off_cap(sSupply,sTime), R30_off_cap(sSupply,sTime)
R10_off_zero(sSupply,sTime), R30_off_zero(sSupply,sTime)
R90_off_fast(sSupply,sTime), R90_off_slow(sSupply,sTime)
OfflineCapacityBudget(sSupply,sTime),OnlineCapacityBudget(sSupply,sTime);
* ---------- Online reserve deliverability ----------
R10_on_cap(sSupply,sTime).. r10_on(sSupply,sTime) =l= rr(sSupply)*10 * u(sSupply,sTime);
R30_on_cap(sSupply,sTime).. r30_on(sSupply,sTime) =l= rr(sSupply)*20 * u(sSupply,sTime);
R90_on_cap(sSupply,sTime).. r90_on(sSupply,sTime) =l= rr(sSupply)*60 * u(sSupply,sTime);
* ---------- Offline reserve availability ----------
R10_off_cap(sSupply,sTime)$(suMin(sSupply) <= 15)..
r10_off(sSupply,sTime) =l= (1 - u(sSupply,sTime)) * c10(sSupply);
R30_off_cap(sSupply,sTime)$(suMin(sSupply) <= 30)..
r30_off(sSupply,sTime) =l= (1 - u(sSupply,sTime)) * max(0, c30(sSupply) - c10(sSupply));
R10_off_zero(sSupply,sTime)$(suMin(sSupply) >15).. r10_off(sSupply,sTime) =l= 0;
R30_off_zero(sSupply,sTime)$(suMin(sSupply) > 30).. r30_off(sSupply,sTime) =l= 0;
R90_off_fast(sSupply,sTime)$(c10(sSupply)*c30(sSupply) > 0)..
r90_off(sSupply,sTime) =l= (1 - u(sSupply,sTime))
* min( rr(sSupply)*60, max(0, pmax(sSupply) - c30(sSupply)) );
R90_off_slow(sSupply,sTime)$(c10(sSupply)*c30(sSupply) = 0)..
r90_off(sSupply,sTime) =l= (1 - u(sSupply,sTime))
* max(0, (90 - suMin(sSupply)) * rr(sSupply));
OfflineCapacityBudget(sSupply,sTime)..
r10_off(sSupply,sTime) + r30_off(sSupply,sTime) + r90_off(sSupply,sTime)
=l= (1 - u(sSupply,sTime)) * pmax(sSupply);
OnlineCapacityBudget(sSupply,sTime)..
p(sSupply,stime)+ r10_on(sSupply,sTime) + r30_on(sSupply,sTime) + r90_on(sSupply,sTime)
=l= u(sSupply,sTime) * pmax(sSupply);
* ================================================================
* ===== MODEL DEFINITION =====
* ================================================================
Model RTUC_Extended /all
/;
* ---------- exclue g1,g2 from providing reserve ----------
r10_on.fx(‘g2’,sTime) = 0;
r30_on.fx(‘g2’,sTime) = 0;
r90_on.fx(‘g2’,sTime) = 0;
r10_off.fx(‘g2’,sTime) = 0;
r30_off.fx(‘g2’,sTime) = 0;
r90_off.fx(‘g2’,sTime) = 0;
r10_on.fx(‘g1’,sTime) = 0;
r30_on.fx(‘g1’,sTime) = 0;
r90_on.fx(‘g1’,sTime) = 0;
r10_off.fx(‘g1’,sTime) = 0;
r30_off.fx(‘g1’,sTime) = 0;
r90_off.fx(‘g1’,sTime) = 0;
Solve RTUC_Extended using MIP minimizing vObj;
* ---- Rolling updates ----
Parameter time_on_next(sSupply), time_off_next(sSupply), initMW_next(sSupply);
Loop(sSupply,
If(u.l(sSupply,‘t1’)=1,
If(p.l(sSupply,‘t1’)<pmin(sSupply),
time_on_next(sSupply)=-**max**(1,K(sSupply)-1);
initMW_next(sSupply)=p.l(sSupply,'t1');
Else
time_on_next(sSupply)=timeOn_curr(sSupply)+1;
initMW_next(sSupply)=p.l(sSupply,'t1');
);
time_off_next(sSupply)=0;
Else
time_on_next(sSupply)=0;
time_off_next(sSupply)=timeOff_curr(sSupply)+1;
initMW_next(sSupply)=0;
);
);
Parameter energyCost_t1(sSupply), noLoadCost_t1(sSupply), startCost_t1(sSupply), totalProdCost_t1;
energyCost_t1(sSupply)=Offer(sSupply)*p.l(sSupply,‘t1’);
noLoadCost_t1(sSupply)=noLoadCost_interval(sSupply)*nlFlag.l(sSupply,‘t1’);
startCost_t1(sSupply)=SC(sSupply)*y.l(sSupply,‘t1’);
totalProdCost_t1=sum(sSupply,energyCost_t1(sSupply)+noLoadCost_t1(sSupply)+startCost_t1(sSupply));
* ---- Store results ----
res_dispatch(sSupply,sTime,r)=p.l(sSupply,sTime);
res_lmp(sTime,r)=EnergyBalance.m(sTime);
res_prodCostFirst(r)=totalProdCost_t1;
res_timeOn_next(sSupply,r)=time_on_next(sSupply);
res_timeOff_next(sSupply,r)=time_off_next(sSupply);
res_initMW_next(sSupply,r)=initMW_next(sSupply);
* ---- Prepare next-run IC ----
initMW_curr(sSupply)=initMW_next(sSupply);
timeOn_curr(sSupply)=time_on_next(sSupply);
timeOff_curr(sSupply)=time_off_next(sSupply);
);
*----------------------------------------------------------------------
* 7. WRITE AGGREGATED RESULTS
*----------------------------------------------------------------------
Execute_Unload “RTUC_AllRunsResults.gdx”,
res_dispatch, res_lmp, res_prodCostFirst,
res_timeOn_next, res_timeOff_next, res_initMW_next;
Display res_prodCostFirst, res_lmp;
Hi,
I guess the core logic is what you try to implement in the following lines.
Loop(rActive(r),
* Read demand vector for this run
demand_run(t) = demand_data(t,r);
* Write input GDX for single rtuc to run
Execute_Unload ‘rtuc_input_current.gdx’,
gen_data, demand_run, initMW, timeOn0, timeOff0;
* Execute single-run RTUC (unique working folder)
execute ‘gams rtuc_model.gms lo=2 --runName=’ r.tl ’ pw=process_run’ r.tl;
*prepare to output the results for next horizon
Execute_Load ‘rtuc_output_current.gdx’
...
);
So I would assume that
- in each iteration you write the data that should be used by
rtuc_model.gmsto filertuc_input_current.gdx? rtuc_model.gmsshould always read filertuc_input_current.gdx?rtuc_model.gmsshould always write filertuc_output_current.gdx?
Then the problematic line is probably
execute ‘gams rtuc_model.gms lo=2 --runName=’ r.tl ’ pw=process_run’ r.tl;
If you want to use r.tl in the execute command, you need to use
put_utility 'exec' / `gams rtuc_model.gms ...
The pw argument is also problematic the way it is currently used. This sets the pageWidth of the lst file and expects numeric input (I would not know why you want to set this at all here).
I hope this helps.
In general, to get the most out of your interaction with the forum community, I recommend to put some effort into describing your question well and to provide some small executable example that demonstrates the problem you are facing.
Hi Fred, thank you for looking into my question and messy codes.
I am trying to use rtuc.gms to solve a MIP problem for unit commitment and dispatch over 6 time intervals for generators’ commitment and dispatch. The time horizon will be rolling forward. Run 1 will cover t1to t6 and Run2 covers t2 to t7. For the same time interval in different run, it will have different load forecast for the system. After each run, only the first interval’s result will be binding, and stored into rtuc_input_current.gdx and pass as the initial condition for the next run of rtuc.gms. The output of each rtuc run will be stored in rtuc_output_current.gdx so I can view the results for all the 6 intervals.
@Fada Thanks for the explanation.
But what is it exactly that you are asking for? Do you have a specific question? Or does something not work as intended (then please share all code/data such that allows other forum users can reproduce)?
Best,
Fred