|
2 | 2 | EMB.variables_element(m, ℒˢᵘᵇ::Vector{<:CapacityCostLink}, 𝒯, modeltype::EnergyModel) |
3 | 3 |
|
4 | 4 | Creates the following additional variable for **ALL** capacity cost links: |
5 | | -- `ccl_max_cap_use[l, t]` is a continuous variable describing the maximum capacity |
| 5 | +- `ccl_cap_use_max[l, t]` is a continuous variable describing the maximum capacity |
6 | 6 | usage over sub periods for a [`CapacityCostLink`](@ref) `l` in operational period `t`. |
7 | | -- `ccl_cap_cost[l, t]` is a continuous variable describing the cost over sub periods |
| 7 | +- `ccl_cap_use_cost[l, t]` is a continuous variable describing the cost over sub periods |
8 | 8 | for a [`CapacityCostLink`](@ref) `l` in operational period `t`. |
9 | 9 | """ |
10 | 10 | function EMB.variables_element(m, ℒˢᵘᵇ::Vector{<:CapacityCostLink}, 𝒯, ::EnergyModel) |
11 | | - @variable(m, ccl_max_cap_use[ℒˢᵘᵇ, 𝒯] >= 0) |
12 | | - @variable(m, ccl_cap_cost[ℒˢᵘᵇ, 𝒯] >= 0) |
| 11 | + @variable(m, ccl_cap_use_max[ℒˢᵘᵇ, 𝒯] >= 0) |
| 12 | + @variable(m, ccl_cap_use_cost[ℒˢᵘᵇ, 𝒯] >= 0) |
13 | 13 | end |
14 | 14 |
|
15 | 15 | """ |
@@ -46,20 +46,25 @@ function EMB.create_link( |
46 | 46 |
|
47 | 47 | # Max capacity use constraints |
48 | 48 | @constraint(m, [t_sub ∈ 𝒯ˢᵘᵇ, t ∈ t_sub], |
49 | | - m[:link_in][l, t, p_cap] .≤ m[:ccl_max_cap_use][l, t_sub] |
| 49 | + m[:link_in][l, t, p_cap] .≤ m[:ccl_cap_use_max][l, t_sub] |
50 | 50 | ) |
51 | 51 |
|
52 | 52 | # Capacity cost constraint |
53 | 53 | @constraint(m, [t_sub ∈ 𝒯ˢᵘᵇ], |
54 | | - m[:ccl_cap_cost][l, t_sub[end]] == |
55 | | - m[:ccl_max_cap_use][l, t_sub[end]] * avg_cap_price(l, t_sub) |
| 54 | + m[:ccl_cap_use_cost][l, t_sub[end]] == |
| 55 | + m[:ccl_cap_use_max][l, t_sub[end]] * avg_cap_price(l, t_sub) |
56 | 56 | ) |
57 | 57 |
|
58 | 58 | # Sum up costs for each sub_period into the strategic period cost |
59 | 59 | @constraint(m, [t_inv ∈ 𝒯ᴵⁿᵛ], |
60 | 60 | m[:link_opex_var][l, t_inv] == |
61 | | - sum(m[:ccl_cap_cost][l, t] for t ∈ t_inv) |
| 61 | + sum(m[:ccl_cap_use_cost][l, t] for t ∈ t_inv) |
62 | 62 | ) |
| 63 | + |
| 64 | + # Fix the fixed OPEX to avoid unconstrainted variables |
| 65 | + for t_inv ∈ 𝒯ᴵⁿᵛ |
| 66 | + fix(m[:link_opex_fixed][l, t_inv], 0; force = true) |
| 67 | + end |
63 | 68 | end |
64 | 69 |
|
65 | 70 | """ |
|
0 commit comments