I've been trying to recreate the objective function from the TIMES outputs. My question is about the interpretation of the Cost_Fom outputs.
The model base year is 2010 and the periods are 2010, 2011, 2012, 2013-2017, 2018-2022, 2023-2027.
The technology I'm using to illustrate my queries has TLIFE=ELIFE=12 and ILED=0. I'm looking at investments in 2011, 2012 and 2015 vintages. See the attached workbook for details (I cant see how to paste images or tables here).
The 2011 vintage covers the 2011, 2012, 2015 and 2020 periods exactly, and multiplying undiscounted levelised Cost_Fom by TIME_NPV gives the objective function cost.
The 2012 vintage covers the 2012, 2015 and 2020 periods in full, and the first year of the 2025 period. Yet no Cost_Fom (nor Cost_Inv) is output for the 2025 period (marked by an empty red box on the output table). Is there a reason why?
The 2015 vintage covers the 2015 and 2020 periods in full, and the two years of the 2025 period. The output Cost_Fom in the 2025 period (coloured red) is 40% of the Cost_Fom in the other periods, presumably as the technology is active for only 40% of the period. This suggests that multiplying all of the Cost_Fom values by TIME_NPV would give the discounted objective function cost. However, this is incorrect. In reality, it is necessary to consider only the discount rates in first two years of the 2025 period, meaning the TIME_NPV multiplier for this technology in this period is 3.14 (coloured red) rather than 2.99. I find the current outputs misleading, as they suggest that the discounted cost can be calculated by multiplying by TIME_NPV in the final period in the same way as for the earlier periods, when this is not the case.
One option would be to output the same undiscounted annual cost in the final period as for the earlier periods. This would at least be clear about the meaning of the data. The disadvantage would be an even more estimate of the objective function calculation from the output data.
A better option might be to output the undiscounted cost that when calculated by the TIME_NPV factor would give the objective function cost (i.e. 1931 instead of 1836, in this case).
I'm interested to hear your thoughts. As things stand, calculating the contribution to the objective function from each technology appears extremely time-consuming if it has to be carried out on a process-by-process basis.

Indeed you are right that calculating the contribution to the objective function from each technology is very time-consuming. But TIMES does all that for you, and therefore I don't actually understand why you are trying to do the same calculations again by yourself?
I am myself not going to look at your example in detail without seeing all the TIMES switches that have been used. But anyway, you

should be able to reproduce the objective function easily, by using the following switches:
$SET OBLONG YES
$SET ANNCOST LEV
And then, use Time_NPV for discounting the undiscounted annual cost results (of course excluding salvage and implied trade costs). Admittedly, I have never tested it under time-dependent general discount rates, though. But I suspect that you have not been using $SET ANNCOST LEV, and if so, then you can only expect to see the annual costs reported as they occur in the

milestone years.
See also the following threads for quite similar questions:

http://forum.kanors-emr.org/showthread.php?tid=578
http://forum.kanors-emr.org/showthread.php?tid=614
Small Follow-up:
I noticed now that you have referred to "undiscounted levelised Cost_Fom" in your post, as if you had been using $SET ANNCOST LEV. Therefore, I checked with a small test model whether I can reproduce the numbers in your Excel file. But I could NOT reproduce them under the levelised annual cost option. However, I was able to reproduce your numbers by running without the levelised annual cost option! Hence, my test appears to confirm my suspicion that you have not been using the levelised annual cost option, even though you refer to "levelised Cost_Fom" in your post.
When using the levelized annual cost option ($SET ANNCOST LEV), I was able to reproduce the value of the objective function of my test model with a relative accuracy of 10^-14 (0.0000000000003%), just by multiplying the reported annual costs with the reported Time_NPV.

Thanks, Antti. You're absolutely correct - I was using the OBLONG switch but not the ANNCOST switch, and this was the problem. I had read the section in Part 3 of the documentation on the ANNCOST switch but hadn't quite understood all of it until reading it again now.
I still don't understand why TIMES doesn't output a Cost_Fom in the 2025 period for the 2012 vintage when the ANNCOST switch is not chosen? The vintage is still operational in the first year of the 2025 period. When the $ANNCOST = 'LEV', TIMES produces the correct output in 2025.
Also, from the documentation Part 3 p55, I believe the UserConstraint output should be set to "COST" or "LEVCOST", depending on whether ANNCOST is chosen or not, but in VEDA-BE for me it is set to "-" in both cases. I'm using TIMES v4.3.2.

Thanks for confirming the switch issue.

pauldodds Wrote:I still don't understand why TIMES doesn't output a Cost_Fom in the 2025 period for the 2012 vintage when the ANNCOST switch is not chosen? The vintage is still operational in the first year of the 2025 period.

I don't understand either. As already stated, and also said in the documentation, by default the values reported for each of these annual cost components are calculated strictly for the associated Milestone year of a period. If the vintage is operational in the first year of a five-year period 2025, how could there be a cost reported for the milestone year?
At this point, the issue about missing COST/LEVCOST labels seems mysterious to me. Possibly a VEDA-BE issue...

Hi Antti,
The COST/LEVCOST labels issue was my misunderstanding – I didn’t realise the information was included only in TIME_NPV.
I think I understand the results output now. 2012 is defined as a single-year period so the 2012 vintage all takes place in 2012. The final year is 2023, which does not cover the milestone year of the 2023–2027.
2015, on the other hand, is the milestone year of a 5-year period from 2013–2017. Investment follows case 1.a so takes place over 5 years from 2011 to 2015. In 2025, the milestone year of the 2023–2027 period, 40% of the original investment is repaid, which I think is why the Cost_Fom output is 40% of the Cost_Fom outputs in the previous periods.
I've attached an updated workbook with a few fixes to avoid confusion, in case people are interested in the calculation.