Hey everyone,
currently I try to model a two-stage mixed-integer stochastic problem and I despair on translating two constraint equations in AMPL syntax.
I hope anyone has an idea, how to solve this tinny problems. As followed I present the necessary backround information about the variable that I want to model. I
#Parameter#
param T; #Index of time periods, running from 1 to T
param J; #Index of CPP production blocks, running from 1 to J
param P; #Index of day-ahead market price scenarios, running from 1 to P
param suc_CPP; #Start-up-costs of plant 1 (Euro)
param lambda_pt {1..P, 1..T}; #Electricity price in the day-ahead market in time period t and day-ahead market price scenario p (Euro/MW h)
param psi_r_down {1..T}; #Down-regulation price ratio in time period t
param psi_r_up {1..T}; #Up-regulation price ratio in time period t
#Variable#
var bm_wptdown {1..P, 1..T} >= 0; #Power sold in the balancing market (MW)
var bm_wptup {1..P, 1..T} >= 0; #Power purchased in the balancing market (MW)
var C_wpt_CPP {1..P, 1..T}>= 0; #Total cost of the CPP electricity production (Euro)
var G_wpt {1..P, 1..T+1}>= 0; #Power sold (if positive) or purchased (if negative) in the day-ahead market (MW)
var v_wp_CPP {1..P, 1..T} binary; #Binary variable equal to 1 if the CPP is started up at the beginning of the time period, and 0 otherwise
maximize Profit {p in 1..P}: sum {t in 1..T} (lambda_pt[p,t] * (G_wpt[p,t] + bm_wptdown[p,t] * psi_r_down[t] - bm_wptup[p,t] * psi_r_up[t]) - C_wpt_CPP[p,t] - suc_CPP * v_wp_CPP[p,t]);
And now the two concerning constraints 1t and 1 u. I hope there are easily to understand, but I attached my attempt as well as the explanation for that contraint, given additionally to the model. So far, it's the only thing I have
Eq. (1t) are non-anticipativity constraints and reflect the fact that information on stochastic parameters cannot be anticipated.
In other words, these constraints are necessary to model the fact that only one bidding curve can be submitted to the day-ahead market for each hour,
irrespective of the WPP output.
Constraints (1u) ensure that the VPP bidding curve is monotonously nondecreasing. Op(t) denotes the order of price scenario p in each hour t.
The price scenarios are ordered in each hour from the lowest price value to the highest one.
My attempt was:
subject to 1t {t in 1..T}: G_wpt[t] = G_wpt[2,p,t] = .. = G_wpt[w,p,t];
subject to 1u {t in 1..T, p in 1..P, pp in 1..P: O_pt[p,t]+1 = O_pp[t]}: G_wpt[w,p,t] - G_wpt[w,pp,t] <= 0;
I would be very grateful for every hint.
Best regards,
Niklas