Veda2.0 Released!


Tradeoff for user-defined objective function
#16
Dear Antti

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.

Thank you and kind regards,
Sandro
Reply
#17
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. 



Command window log for GDX2VEDA step:
--- GDX File : Symbols=1321 UELs=7801
--- VEDA Cube: Dimensions=8 Entries=63 Text=3 SubSets=27
*** Did not find GAMS name par_actl in GDX file
*** Did not find GAMS name par_actm in GDX file
*** Did not find GAMS name par_capl in GDX file
*** Did not find GAMS name par_pasti in GDX file
*** Did not find GAMS name par_capm in GDX file
*** Did not find GAMS name par_ncapl in GDX file
*** Did not find GAMS name par_ncapm in GDX file
*** Did not find GAMS name par_ncapr in GDX file
*** Did not find GAMS name f_in in GDX file
*** Did not find GAMS name f_out in GDX file
*** Did not find GAMS name agg_out in GDX file
*** Did not find GAMS name p_out in GDX file
*** Did not find GAMS name par_comprdl in GDX file
*** Did not find GAMS name par_comprdm in GDX file
*** Did not find GAMS name par_comnetl in GDX file
*** Did not find GAMS name par_comnetm in GDX file
*** Did not find GAMS name par_eout in GDX file
*** Did not find GAMS name par_cumcst in GDX file
*** Did not find GAMS name par_combalem in GDX file
*** Did not find GAMS name par_combalgm in GDX file
*** Did not find GAMS name par_peakm in GDX file
*** Did not find GAMS name par_cumflol in GDX file
*** Did not find GAMS name par_cumflom in GDX file
*** Did not find GAMS name par_caplo in GDX file
*** Did not find GAMS name par_capup in GDX file
*** Did not find GAMS name Cap_New in GDX file
*** Did not find GAMS name cst_invc in GDX file
*** Did not find GAMS name cst_invx in GDX file
*** Did not find GAMS name cst_salv in GDX file
*** Did not find GAMS name cst_decc in GDX file
*** Did not find GAMS name cst_fixc in GDX file
*** Did not find GAMS name cst_fixx in GDX file
*** Did not find GAMS name cst_actc in GDX file
*** Did not find GAMS name cst_floc in GDX file
*** Did not find GAMS name cst_flox in GDX file
*** Did not find GAMS name cst_comc in GDX file
*** Did not find GAMS name cst_comx in GDX file
*** Did not find GAMS name cst_come in GDX file
*** Did not find GAMS name cst_irec in GDX file
*** Did not find GAMS name cst_pvp in GDX file
*** Did not find GAMS name cst_pvc in GDX file
*** Did not find GAMS name cst_time in GDX file
*** Did not find GAMS name reg_irec in GDX file
*** Did not find GAMS name reg_acost in GDX file
*** Did not find GAMS name par_ucsl in GDX file
*** Did not find GAMS name par_ucsm in GDX file
*** Did not find GAMS name par_ucmrk in GDX file
*** Did not find GAMS name par_ucrtp in GDX file
*** Did not find GAMS name par_ucmax in GDX file
--- VEDA Cube: DataRecords=1108992
Microsoft Windows [Version 10.0.19042.1889]
© Microsoft Corporation. All rights reserved.

C:\veda\VEDA_FE\Gams_Wrk_SL_STEM_ModalShift>
Reply
#18
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.
Reply
#19
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.
Reply
#20
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?

Thanks and kind regards,
Sandro


Attached Files Thumbnail(s)
   
Reply
#21
> 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.

Could you thus describe what you tried?
Reply
#22
(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.
Reply
#23
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?
Reply
#24
(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)
Reply
#25
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

EXECUTION TIME      =      603.724 SECONDS 21,980 MB  31.1.1 r4b06116 LEX-LEG
-----------------------------
Reply
#26
Dear Antti

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?

Thanks in advance and kind regards,
Sandro


Attached Files Thumbnail(s)
   
Reply
#27
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.
Reply
#28
For answering explicitly to your question:

> 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?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)