Thanks for your quick reply, as always! Your indications of the underlying reasons were already very beneficial to me.
I will contact my PSI colleagues to ask for their support in fixing this issue. If necessary, I will get back to you.
13-09-2022, 06:54 PM (This post was last modified: 13-09-2022, 06:56 PM by Sandro_Luh.)
Dear Antti
Thanks to your helpful insight, we managed to fix the PSI TIMES extension. Now, the model is running smooth with the tradeoff function activated.
However, while the simulation is going smoothly, there is now an error at the GDX2VEDA step, as you can see in the text below copied from the command window. What appears odd to me is that such errors didn't occur when I used a small test model even though I used the identical TIMES Source code.
As far as I understand from the TIMES extension documentation for the tradeoff option, many parameters receive the prefix "S" with the stochastic TIMES version (e.g., SF_IN instead of F_IN). This is also what I see in the .gdx: for instance, it contains SF_IN but not F_IN. However, it seems to me that the GDX2VEDA step is searching for the non-stochastic parameters (e.g., F_IN) in the .gdx file and reports such errors as it can't find such parameters.
Do you have any indication of what might lead to this problem? Perhaps, I missed activating any specific setting when switching from the testmodel to my larger model or similar? Alternatively, might the problem be related to a too large .gdx file (1.5 GB)?
I have not uploaded the .lst-file or .gdx-file as they are quite large, but I can provide them if necessary.
I hope you also upgraded now from TIMES v4.4.1 to v4.6.5?
Concerning the GDX2VEDA, it just needs the correct directive file for the stochastic variant.
Are you running the model from within VEDA (by hitting Solve), or "manually"?
If from within VEDA, then it is a VEDA issue. If manually, then you just need to use the *_stc.vdd file.
Antti, thanks again for your help. I am running the model "manually" and, indeed, using the *_stc.vdd file solved this issue. I wasn't aware of this change in the VTRUN file, because when I was previously applying the tradeoff function in my testmodel, I did run the model within VEDA by hitting "Solve".
Admittedly, I have not (yet) upgraded to TIMES v4.6.5 in order to ensure consistency with an older version of the model. However, it is planned to make the upgrade to the latest TIMES version with this model soon.
Antti, thanks to your help regarding the tradeoff multi-objective function some time ago, its application works as envisaged.
Now, I was wondering if it is possible to let the model maximize for a certain parameter instead of minimizing it. I tried already a few approaches but they did not lead to the desired outcome. That's why I would like to ask you if that would be possible, and if yes, how to achieve that?
For instance, let's take the attached example that you posted once here: Could I let the model maximize for the attribute of the GHGOBJ UC, i.e., maximize the total cumulative GHG emissions?
23-01-2023, 04:00 PM (This post was last modified: 23-01-2023, 06:23 PM by Antti-L.)
>I tried already a few approaches but they did not lead to the desired outcome.
Could you describe what you tried? In general, to turn mininization of OBJz = cTx into maximization, just minimize the negative of cTx, as explained in the documentation, Part I. The signs of the S_UCOBJ coefficients can thus be used for choosing the direction.
24-01-2023, 12:39 AM (This post was last modified: 24-01-2023, 12:46 AM by Sandro_Luh.)
(23-01-2023, 04:00 PM)Antti-L Wrote: >I tried already a few approaches but they did not lead to the desired outcome.
Could you describe what you tried? In general, to turn mininization of OBJz = cTx into maximization, just minimize the negative of cTx, as explained in the documentation, Part I. The S_UCOBJ coefficients can be used for that.
Could you thus describe what you tried?
Minimizing the negative of cTX with the S_UCOBJ coefficient is exactly what I intended to do. Given the previous example, I adjusted S_UCOBJ(GHGOBJ,SOW=2)=1 to S_UCOBJ(GHGOBJ,SOW=2)=-1. However, with this approach my model became infeasible in SOW=2. Still, would the "-1" be what you mean?
Meanwhile, I will give it a try to let my model maximize a different commodity to exclude that it might be due to a problem with the specific commodity.
PS: another option I tried is the following: In the previously posted example, the model optimizes in SOW=2 the UC GHGOBJ. I adjusted the value in the "UC_RHS" column from -1 to 1.
24-01-2023, 12:45 AM (This post was last modified: 24-01-2023, 12:56 AM by Antti-L.)
Can you post the listing file (zipped) from the run where your "model became infeasible in SOW=2" ?
I can well imagine that the model might easily be unbounded if maximising emissions (unless you have bounded the objective function), and I have seen that the solvers may not be able to distinguish well between infeasible and unbounded conditions. Perhaps you can confirm whether you indeed have an upper bound on the GHGOBJ objective function?
24-01-2023, 01:06 AM (This post was last modified: 24-01-2023, 01:15 AM by Sandro_Luh.
Edit Reason: Answering to the edit in your post
)
(24-01-2023, 12:45 AM)Antti-L Wrote: Can you post the listing file (zipped) from the run where your "model became infeasible in SOW=2" ?
I can well imagine that the model might easily be unbounded if maximising emissions (unless you have bounded the objective function), and I have seen that the solvers may not be able to distinguish well between infeasible and unbounded conditions. Perhaps you can confirm whether you indeed have an upper bound on the GHGOBJ objective function?
You can download the .zip File here: https://we.tl/t-A627BZx71L
Please consider that I tried to optimize (maximize) in SOW=2 the UC_N OBJ_COMFORT
Edit: I am trying to maximize the UC_COMNET of the commodity "COMFORT". There are technologies that do not have such a commodity. Thus, in SOW=2, the model should in some cases select the technologies that lead to comfort maximization, while it has free range to select between some other technology options (of other sectors of the energy system where the COMFORT commodity is not implemented). I would expect that in SOW=3, when the model optimizes again for costs, the model keeps the technologies that lead to maximum Comfort, but then chooses in the other sectors the technologies that lead to cost minimization (assuming the simplified case that the cost tradeoff in SOW=3 is large enough that the model can keep the technologies with maximum comfort)
The listing file you provided did not include the solution report from SOW=2. The file ended in the model statistics written for SOW=2, just before sending it to the solver, but the solution report is missing (it was included for SOW=1). Why did you not include the solution report for SOW=2?
Apart from that,I can see that you are using TIMES v4.4.1. No technical support can be given for such an old version, sorry. Please upgrade.
The file was ending as shown below (solution report missing): -----------------------------
Model Statistics SOLVE TIMES Using LP From line 2244292
LOOPS ALLSOW 2
MODEL STATISTICS
BLOCKS OF EQUATIONS 135 SINGLE EQUATIONS 20,059,980
BLOCKS OF VARIABLES 26 SINGLE VARIABLES 25,338,523 8,355 projected
NON ZERO ELEMENTS 115,493,101
GENERATION TIME = 593.793 SECONDS 21,980 MB 31.1.1 r4b06116 LEX-LEG
I have a question on interpreting the results in the various SOWs: In the original example (see attached image), SOW=1 optimizes the costs, SOW=2 optimizes the GHG emissions, and SOW=3 optimizes again the costs.
As far as I know, the dual variable value of EQ_combalM usually refers to the shadow costs of the commodity, i.e. the additional costs for an additional unit of a certain commodity. I assume this is how the value of EQ_combalM can also be interpreted in SOW=1 and SOW=3.
But how do I interpret this EQ_combalM value in SOW=2? Does it reflect the additional GHG emissions for an additional unit of a certain commodity? Or does it still reflect the marginal costs?
13-02-2023, 05:57 PM (This post was last modified: 13-02-2023, 06:00 PM by Antti-L.)
The marginals of equations and variables (duals and reduced prices) are obtained from the solver. The marginals measure how much the objective function would change if the equation or bound would be relaxed (tightened) by one unit.
The only thing that TIMES does to these marginals is undiscounting, and thereby it is assumed that the marginals are related to the standard TIMES objective function.
Therefore, the marginals reported from the intermediate steps of a multiphase tradeoff analysis may not be very meaningful. But that may equally hold also to many other results of such intermediate steps. The purpose of the intermediate steps may often be just to find some metric for further analysis, such as the maximum emission reductions achievable at a given maximum reduction in the consumers and producers surplus.
And that is why there is an option to suppress the reporting from the intermediate steps, by setting a negative value for S_UCOBJ('OBJ1',SOW). I suggest to consider this option to avoid any confusion about the marginals of the intermediate steps.
>But how do I interpret this EQ_combalM value in SOW=2? Does it reflect the additional GHG emissions for an additional unit of a certain commodity? Or does it still reflect the marginal costs?
The EQ_combalM values for SOW=2 are related to the objective function of SOW=2, so cumulative GHG emissions if that was the objective function. But they are also undiscounted by TIMES, using the undiscounting coefficients related to the standard objective function, and therefore the values may not be very meaningful as such.
Having the marginals reported with a correct undiscounting method for any user-defined objective function would require notable additional considerations and has not been included in the design for the functionality, as having such is apparently usually not needed. I hope that knowing the standard undiscounting method is being applied can nonetheless be of some help to you?