Dynamic model
Answered-
Hi Bahar,
based on the description you provided it is difficult to understand what exactly is the difficulty you are dealing with. Could you please provide us with a minimal reproducible example of the problem you are facing? We will then be able to help you further.
Best regards
Jonasz0 -
Hi Bahar,
I agree with Jonasz, it is a little difficult to precisely understand the intent but I think it may be worth you looking at our multiple objective functionality. This is a convenience feature we provide to make modeling easier for our customers, and it may be a good fit for your problem. If it is a good fit then then this python example will provide a good guide for implementation (analogous implementations can be found for the other languages we support). This excerpt from the documentation linked above may help you decide if our multiple objective functionality will work for your problem:
A hierarchical or lexicographic approach assigns a priority to each objective, and optimizes for the objectives in decreasing priority order. At each step, it finds the best solution for the current objective, but only from among those that would not degrade the solution quality for higher-priority objectives.
Note that this approach does not fix variables as it proceeds. It will not solve and fix for time period 1, then solve and fix for time period 2 and so on.. But it will find solutions that are universally valid for every step of the hierarchy, and the objective function optimized at a particular step will not be any worse in subsequent steps (using default settings).
I'm sure Jonasz and I will be keen to hear if this approach suits your problem.
Kind Regards,
Riley0 -
0
-
Dear Bahar,
as far as I can see, you are solving five models. You do that in a sequential fashion, so you can't properly define all of them upfront - you can most likely only properly define the first one.
One way to go would be to store the values of your variables in a dictionary after each of the optimization runs.
Then, when building the model for the consecutive t, you could retrieve these values from that dictionary and "plug them in" wherever you need them.
Does that make sense?
Best regards
Jonasz0
Please sign in to leave a comment.
Comments
4 comments