Discounting

For multi-year investment optimization models it is common pratice to use an objective that is discounted to get the net present value of the investment. Since investment decisions usually are done on a strategic level, discount factors are also calculated based on strategic periods.

The discount factor for a time period t is found by the discount function. There are two strategies for calculating the discount factor, either all discounting is calculated based on the start of the strategic period or it is based on finding an approximation of the average value over the strategic period. The following example shows how these two types will differ for a planning period of 50 years, consisting of 5 periods of 10 years:

julia> using TimeStruct
julia> ts = TwoLevel(5, 10, SimpleTimes(1,1));
julia> df_start = [discount(t, ts, 0.05; type = "start") for t in ts]5-element Vector{Float64}: 1.0 0.613913253540759 0.3768894828730003 0.23137744865585777 0.1420456823002776
julia> df_avg = [discount(t, ts, 0.05; type = "avg") for t in ts]5-element Vector{Float64}: 0.7913208595045712 0.485802363453121 0.2982405095252959 0.18309380154032812 0.11240371140676893

While it is often normal to assume investments at the start of each strategic period, it can be more correct to average the discount factor for operational costs that are accrued throughout the strategic period.

To help setting up the objective function in a typical optimization problem, there is a utility function objective_weight that returns the weight to give a time period in the objective, considering both discount factor, probability and possible multiplicity.