Hello,
I have a attached a production cost model for a large power system below (Trial2.gms). The syntax seems alright as it compiles fine. However after looking at the .lst file post compilation I have a doubt about why GAMS is formulating the equations associated with a particular constraint as it is now. The equations of interest in the .lst file have been copied in the Trial2_lst.txt file attached.
The equation of interest is the objective function, line 322 of Trial2.gms which defines the total production cost as the sum of production cost across each interval. The formulation is : PRODCOST =E= SUM(INTERVAL, PRODCOST_BY_INTERVAL(INTERVAL)). So after compiling the .lst file should report back the constraint as PRODCOST - SUM(INTERVAL, PRODCOST_BY_INTERVAL(INTERVAL)) = 0. However if we take a look at line 3 in Trial2_lst.txt the formulation in the .lst file seems to be missing a -ve sign. As a result the production cost calculated is also turning out to be negative. Any help would be really appreciated.
Thanks,
Missing -ve sign during equation formulation in .lst file
Missing -ve sign during equation formulation in .lst file
- Attachments
-
- Trial2_lst.txt
- .lst file equations of interest
- (122.39 KiB) Downloaded 206 times
-
- Trial2.gms
- production cost model
- (9.86 KiB) Downloaded 199 times
Re: Missing -ve sign during equation formulation in .lst file
Hi,
Could you share the GDX files such that one could actually run the gms file to reproduce this?
Best,
Fred
Could you share the GDX files such that one could actually run the gms file to reproduce this?
Best,
Fred
Re: Missing -ve sign during equation formulation in .lst file
Please find the GDX files currently used attached below.
- Attachments
-
- GENERAL_MODEL_INPUT.gdx
- (32.45 KiB) Downloaded 209 times
-
- DASCUCINPUT2.gdx
- (114.98 KiB) Downloaded 198 times
-
- DASCUCINPUT1.gdx
- (104.12 KiB) Downloaded 206 times
Re: Missing -ve sign during equation formulation in .lst file
Please use this attached version of the .gms file
while using the GDX files.Re: Missing -ve sign during equation formulation in .lst file
Hi,
I cannot reproduce your findings. The equation listing shows
Are you sure that the lst excerpt Trial2_lst.txt from your initial post was generated with Trial2.gms? Maybe you can share the full lst.
Best,
Fred
I cannot reproduce your findings. The equation listing shows
Code: Select all
---- OBJECTIVE =E=
OBJECTIVE.. PRODCOST - PRODCOST_BY_INTERVAL(7) - PRODCOST_BY_INTERVAL(1) - [...] - PRODCOST_BY_INTERVAL(167) - PRODCOST_BY_INTERVAL(168) =E= 0 ; (LHS = 0)
Best,
Fred
Re: Missing -ve sign during equation formulation in .lst file
Hello,
Attached the full lst file below. I rechecked the equation listings and they appear fine for me too. However the next question I guess is figuring out why my objective function is negative when all its constituents bear a positive value.
Anyways thanks a lot for the help.
Regards,
Attached the full lst file below. I rechecked the equation listings and they appear fine for me too. However the next question I guess is figuring out why my objective function is negative when all its constituents bear a positive value.
Anyways thanks a lot for the help.
Regards,
Re: Missing -ve sign during equation formulation in .lst file
lst file
- Attachments
-
- full_lst.zip
- (7.88 MiB) Downloaded 186 times