Discounting
For multi-year investment optimization models it is common practice 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 TimeStructjulia> 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.37688948287300034 0.23137744865585777 0.1420456823002776julia> df_avg = [discount(t, ts, 0.05; type = "avg") for t in ts]5-element Vector{Float64}: 0.7913208595045712 0.4858023634531209 0.29824050952529607 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.
We also provide a method in which the average discount factor is calculated for the beginning of the years within a strategic period:
julia> using TimeStructjulia> ts = TwoLevel(5, 10, SimpleTimes(5,1));julia> sps = strategic_periods(ts)TimeStruct.StratPers{Int64, Int64, SimpleTimes{Int64}}(TwoLevel{Int64, Int64, SimpleTimes{Int64}}(5, [10, 10, 10, 10, 10], SimpleTimes{Int64}[SimpleTimes{Int64}(5, [1, 1, 1, 1, 1]), SimpleTimes{Int64}(5, [1, 1, 1, 1, 1]), SimpleTimes{Int64}(5, [1, 1, 1, 1, 1]), SimpleTimes{Int64}(5, [1, 1, 1, 1, 1]), SimpleTimes{Int64}(5, [1, 1, 1, 1, 1])], 1.0))julia> df_start = [discount(sp, ts, 0.05; type = "avg") for sp in sps]5-element Vector{Float64}: 0.7913208595045712 0.4858023634531209 0.29824050952529607 0.18309380154032812 0.11240371140676893julia> df_avg = [discount(sp, ts, 0.05; type = "avg_year") for sp in sps]5-element Vector{Float64}: 0.8107821675644052 0.4977499184022928 0.30557527185599886 0.18759670934671827 0.1151681061885839
This approach results in a slighly higher discount factor.
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.