Veda2.0 Released!


User Constraint
#1
Hello Everyone,

I am expanding my model from a 16 timeslice configuration to a 32 timeslice configuration. So I would like to know if there is any possibility of defining a User constraint to all ts without specifying it for each ts as shown in the figure attached to this message (my original 16TS configuration). I wanna write something simpler as it’s written as the example following, in a way that my restriccion will be respected for each ts.

                                                                                                                                                        
                                                             ~UC_T                              
UC_N                     Pset_PN                 Cset_CN         Top_Check      LimType         Year      UC_FLO        UC_RHSRTS      UC_RHSRTS~0
SUC-Nuc-Consum    EPCONSUMNUC00   ELCHIGG        I                    FX                 2017       1                  0                 5         
                             ENUC*                    ELCHIG         O                   FX                 2017       -0.045          
 
         
Thanks for your attention and help 


Attached Files Thumbnail(s)
   
Reply
#2
Sure, you can either use the timeslice-dynamic UC feature of TIMES, or the VEDA feature which automatically generates the parameters for all timeslices (I recall that such is available under VEDA).

I think the timeslice-dynamic feature would be easy to use: just define UC_ATTR(FLO,DAYNITE) on the LHS side. Then the constraint is "pseudo-dynamic" only.  That's all you need. Then you don't need to define UC_RHSRTS for each timeslice (the default is ANNUAL). However, you can only use UC_RHSRTS, not UC_RHSRT or UC_RHST.  But you are already using UC_RHSRTS and so it should go easy for you.

Please note also that you never need to define UC_FLO, UC_ACT etc. for each timeslice anyway: They are always levelized. It is only the RHS constant that would need to be specified for each ts, because the RHS constants are not levelized unless you use UC_RHSRTS with a timeslice-dynamic UC.
Reply
#3
(03-06-2021, 11:54 PM)Antti-L Wrote: Sure, you can either use the timeslice-dynamic UC feature of TIMES, or the VEDA feature which automatically generates the parameters for all timeslices (I recall that such is available under VEDA).

I think the timeslice-dynamic feature would be easy to use: just define UC_ATTR(FLO,DAYNITE) on the LHS side. Then the constraint is "pseudo-dynamic" only.  That's all you need. Then you don't need to define UC_RHSRTS for each timeslice (the default is ANNUAL). However, you can only use UC_RHSRTS, not UC_RHSRT or UC_RHST.  But you are already using UC_RHSRTS and so it should go easy for you.

Please note also that you never need to define UC_FLO, UC_ACT etc. for each timeslice anyway: They are always levelized. It is only the RHS constant that would need to be specified for each ts, because the RHS constants are not levelized unless you use UC_RHSRTS with a timeslice-dynamic UC.

Thanks a lot Antti, I did as you told me (how I wrote it is attached) but it does not work and show as following. I checked up but I did not find what is wrong. The new UC file syncronized without any problem, so I supposed it was working fine. 

               S O L V E      S U M M A R Y

     MODEL   TIMES               OBJECTIVE  OBJZ
     TYPE    LP                  DIRECTION  MINIMIZE
     SOLVER  CPLEX               FROM LINE  111777

**** SOLVER STATUS     4 Terminated By Solver      
**** MODEL STATUS      14 No Solution Returned     
**** OBJECTIVE VALUE               NA

 RESOURCE USAGE, LIMIT         NA         50000.000
 ITERATION COUNT, LIMIT        NA        999999

**** Reading with SOLVEOPT=REPLACE (0) ****

IBM ILOG CPLEX   Feb 14, 2013 24.0.2 WEX 38380.38394 WEI x86_64/MS Windows    
--- GAMS/Cplex licensed for continuous and discrete problems.
Cplex 12.5.0.0

Reading parameter(s) from "C:\VEDA\Veda\GAMS_WrkTIMES\32TS_UCLNOVA\cplex.opt"
>>  scaind 1
>>  rerun yes
>>  iis yes
>>  lpmethod 4
>>  baralg 1
>>  barcrossalg 0
>>  barorder 3
>>  THREADS=7
>>  advind=0
>>  names no
Finished reading from "C:\VEDA\Veda\GAMS_WrkTIMES\32TS_UCLNOVA\cplex.opt"
LP status(22): dual objective limit exceeded
Cplex Time: 15.66sec (det. 11287.31 ticks)
Solution aborted due to dual objective limit.
CPLEX Error  1707: Infeasibility Finder requires a basic solution.
*** Out of memory.

No solution returned
---- 111777 Solve Read TIMES         0.000     0.000 SECS     81 Mb 
GAMS Rev 240  WEX-WEI 24.0.2 x86_64/MS Windows                                                                                                                                                                                        06/03/21 16:21:30 Page 17
TIMES -- VERSION 4.5.2 -- Restart (v4.5)
E x e c u t i o n


Attached Files Thumbnail(s)
   
Reply
#4
No, you did not do at all as I told you.  How can you possibly say so?   Sad

First, as you should well know, UC_ATTR requires both UC_GRPTYPE and UC_NAME, but you have specified only UC_GRPTYPE, even though I told you very clearly which pair (UC_GRPTYPE, UC_NAME) you should specify: FLO,DAYNITE. Moreover, you have added a "tslvl" column to the table, which as far as I know is not supported at all, and I never suggested doing anything like that...  

I am not at all surprised that your constraint does not work.  Confused
Reply
#5
(04-06-2021, 02:49 AM)Antti-L Wrote: No, you did not do at all as I told you.  How can you possibly say so?   Sad

First, as you should well know, UC_ATTR requires both UC_GRPTYPE and UC_NAME, but you have specified only UC_GRPTYPE, even though I told you very clearly which pair (UC_GRPTYPE, UC_NAME) you should specify: FLO,DAYNITE. Moreover, you have added a "tslvl" column to the table, which as far as I know is not supported at all, and I never suggested doing anything like that...  

I am not at all surprised that your constraint does not work.  Confused

Cry I see myself totally confused... I am sorry. Of course it would not work.

I checked on the manual about timeslice-dynamic UC to understand better what you explained me, but I could not find any example on how to enter the definitions... So, I thought as you said to define the FLO and DAYNITE, you were refering to define the timeslice level and the attribute group, that is the reason I add the Tslvl column with DAYNITE and UC_ATTR column with FLO. 

Do you any example of how to define the entries for a dynamic table using UC_ATTR ? It is the first time I am using it.
Reply
#6
Just put FLO,DAYNITE under UC_ATTR (in one row only).  And remove the Tslvl column. Then it should work as I told you.  Whether your model is then feasible or not will depend on the rest of your model. For example, if you have also used ACT_BND for bounding the EPCONSUMNUC00 activity, the constraint and the bound would likely to be inconsistent.

Additional comment:
If the sole purpose of the constraint is to model the power plants' own consumption explicitly, why not just put ELCHIGG as an auxiliary input to the power plant and use INPUT (or FLO_EFF) for defining the coefficient 0.045?  I think it would be more efficient and transparent that way...  (of course unless you have some specific reason for modeling it with an additional constraint and an additional process).
Reply
#7
(10-06-2021, 08:30 PM)Antti-L Wrote: Just put FLO,DAYNITE under UC_ATTR (in one row only).  And remove the Tslvl column. Then it should work as I told you.  Whether your model is then feasible or not will depend on the rest of your model. For example, if you have also used ACT_BND for bounding the EPCONSUMNUC00 activity, the constraint and the bound would likely to be inconsistent.

Additional comment:
If the sole purpose of the constraint is to model the power plants' own consumption explicitly, why not just put ELCHIGG as an auxiliary input to the power plant and use INPUT (or FLO_EFF) for defining the coefficient 0.045?  I think it would be more efficient and transparent that way...  (of course unless you have some specific reason for modeling it with an additional constraint and an additional process).

Hi Antti-L,

Thank you very much for the clarification. Back that day, I had came back here to thank you but some how my post was not available. After your insights and read more material about it, I understood it and solved my problem.

About your additional comment, there is another constraint defined to the own consumption of the power plants, and for that reason they decided to put it that way. 

A big thanks.
Reply
#8
Thanks!  Smile

And very sorry for not being able to help much about your G_CYCLE question (which you deleted), except that I hope it was made clear that you should use TS_CYCLE instead, to avoid problems that may be caused by changing G_CYCLE.
Reply
#9
(03-07-2021, 11:15 PM)Antti-L Wrote: Thanks!  Smile

And very sorry for not being able to help much about your G_CYCLE question (which you deleted), except that I hope it was made clear that you should use TS_CYCLE instead, to avoid problems that may be caused by changing G_CYCLE.

Hello Antti, 

Yeah, I deleted the post because I saw that I was not so clear about my question. 

Thank you very much for your clarifications about TS_CYCLE.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  User SETs janis 7 933 31-03-2025, 02:55 PM
Last Post: janis
  User Constraint not Binding slevinson 31 8,715 24-03-2025, 07:32 PM
Last Post: AKanudia
Bug user constraint nukelucas 4 380 13-03-2025, 09:07 PM
Last Post: nukelucas
  Power output constraint - EV battery Kristina.Haaskjold 5 622 23-01-2025, 07:19 PM
Last Post: Kristina.Haaskjold
  Making annual vehicle sale constraint for different period length BSR 3 319 17-01-2025, 05:33 PM
Last Post: Antti-L
  User cosnstrain on aggregated commodity (emission) Lukas 1 324 26-08-2024, 09:15 PM
Last Post: Antti-L
  A question about User Constraint Lee 2 1,032 11-06-2024, 12:14 PM
Last Post: Lee
  Batteries input capacity constraint [email protected] 5 1,717 05-04-2024, 06:00 PM
Last Post: Antti-L
Question User define commodity group anik 3 1,236 14-03-2024, 06:52 PM
Last Post: AKanudia
  TIAM - GHG constraint srchlela 19 9,533 17-08-2023, 06:49 PM
Last Post: Antti-L

Forum Jump:


Users browsing this thread: 1 Guest(s)