You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to model an hourly electric dispatch. I consider a full year of 365 nodes, one node per day with 24 hours within. Renewable production being uncertain, I model their production through stochastic variables that take their values at the beginning of each day. Moreover, I model disruption that can occur on gas import routes via a Markov chain, i.e. either we can import gas to burn it into the turbines, either we cannot.
With this being said, I try to find the optimal gas storage capacity to invest in, in order to hedge against the risk of gas supply disruption. The idea being that a storage asset can help to handle a crisis situation when gas imports are no longer available.
This is how I tried to handle this problem (I only write the code section of interest) :
# The first node is deterministic and here to decide the investment level in UHSif t ==1@constraint(sp, CAPA_STORAGE.out >= CAPA_STORAGE.in) # we allow the investment in gas storagefor i in1:24
JuMP.fix(ξ_wind[i], Ω[1][1][(t-1)*24+ i]; force =true)
JuMP.fix(ξ_pv[i], Ω[1][2][(t-1)*24+ i]; force =true)
JuMP.fix(ξ_load[i], Ω[1][3][(t-1)*24+ i]; force =true)
end# here the electric generation from renewables is forced deterministically for the 24 hours of the first node@stageobjective(sp,
sum( all generating costs at hour i, for i in1:24) # pseudo code to keep it short+ CAPA_STORAGE.out * INV_COST_STOCK_H2 # investment cost
)
# Otherwise, the investment is prohibitedelse@constraint(sp, CAPA_STORAGE.out == CAPA_STORAGE.in) # storage capacity can't change anymore
SDDP.parameterize(sp, Ω) do ω
for i in1:24
JuMP.fix(ξ_wind[i], ω[1][(t-1)*24+ i]; force =true)
JuMP.fix(ξ_pv[i], ω[2][(t-1)*24+ i]; force =true)
JuMP.fix(ξ_load[i], ω[3][(t-1)*24+ i]; force =true)
end@stageobjective(sp,
sum( all generating costs at hour i, for i in1:24)
)
end
My problem is: even though I eventually get policies of rather good quality (2% discrepancy with the lower bound after 100 iterations), the level of investment is not stable at all and when I train the model with a low investment cost in gas storage (sensitivity analysis) I sometimes get policies that invest less than in cases whereby costs are higher ! Which is nonsense obviously.
Do you have any idea of what's happening ? Is it just that I need more iterations ? Or is there a better alternative to model investment in this case ?
Thanks a lot,
Ange
PS: how do you manage to get the code in markdown with all the colors ? Even with ``` it does not seem to work for me ?
The text was updated successfully, but these errors were encountered:
Do you have any idea of what's happening ? Is it just that I need more iterations ?
Yes. This is a pretty common issue in the literature that is often overlooked: just because the costs are converging, does not mean that the primal policy has converged 😄.
Well, then I guess I'll have to start the training phase and go to chill outside for hours haha.
Thanks for your help and the provided links ! I close.
Ange
Hi Oscar,
I'm trying to model an hourly electric dispatch. I consider a full year of 365 nodes, one node per day with 24 hours within. Renewable production being uncertain, I model their production through stochastic variables that take their values at the beginning of each day. Moreover, I model disruption that can occur on gas import routes via a Markov chain, i.e. either we can import gas to burn it into the turbines, either we cannot.
With this being said, I try to find the optimal gas storage capacity to invest in, in order to hedge against the risk of gas supply disruption. The idea being that a storage asset can help to handle a crisis situation when gas imports are no longer available.
This is how I tried to handle this problem (I only write the code section of interest) :
My problem is: even though I eventually get policies of rather good quality (2% discrepancy with the lower bound after 100 iterations), the level of investment is not stable at all and when I train the model with a low investment cost in gas storage (sensitivity analysis) I sometimes get policies that invest less than in cases whereby costs are higher ! Which is nonsense obviously.
Do you have any idea of what's happening ? Is it just that I need more iterations ? Or is there a better alternative to model investment in this case ?
Thanks a lot,
Ange
PS: how do you manage to get the code in markdown with all the colors ? Even with ``` it does not seem to work for me ?
The text was updated successfully, but these errors were encountered: