Is possible a multiperiod optimization using pyomo network? #1277
Unanswered
juanbaquero4
asked this question in
Q&A
Replies: 1 comment 1 reply
-
@juanbaquero4 This question looks like it would be better asked on the Pyomo forums as it appears to be solely related to Pyomo code. However, I think in this case I think your first attempt was close - instead of
Also note that IDAES models are Pyomo models, so we can only do things that are possible in Pyomo. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, I hope you can help me to solve this optimization problem:
Is it possible to work pyomo network with multiperiod optimization, I am trying to propose a renewable network with process optimization, however it was not possible for me to define correctly the ports. Is possible to declare it on IDAES?
Firstly I declared a block with certain variables for the whole m.date, afterward (here comes the issue) I am trying to declare an extensive port (because I am splitting the stream later in the problem), but it is not possible for me to define correctly the port, here is the code:
This is what I am doing:
m.date = Set(initialize=output.index, ordered = True) # is a 120 periods time
#block of 3 variables:
#1st attempt. I declared the port as follows but the output is a list of the same first period date variable:
this is the output and it is not correct:
The output should be:
2019-12-31 19:00:00 : fxCSP : 1 : fxCSP_block[2019-12-31 19:00:00].fxCSP
2019-12-31 20:00:00 : fxCSP : 1 : fxCSP_block[2019-12-31 20:00:00].fxCSP
2019-12-31 21:00:00 : fxCSP : 1 : fxCSP_block[2019-12-31 21:00:00].fxCSP
2019-12-31 22:00:00 : fxCSP : 1 : fxCSP_block[2019-12-31 22:00:00].fxCSP
#2nd attempt: I declared the port and later the function add, but it replaces all the data therefore the output is a 1 output size port:
Output:
port_fxCSP : Size=1, Index=None
Key : Name : Size : Variable
None : <function Port.Extensive at 0x00000165C26A65F0> : 1 : fxCSP_block[2020-01-05 18:00:00].fxCSP
#3rd attempt: I declare a function for the port for each m.date as an iterable, however the error indicates not iterable
TypeError: 'function' object is not iterable
Any suggestions are highly appreciated!
Beta Was this translation helpful? Give feedback.
All reactions