#-------------------------------------# # Model for the deterministic problem # #-------------------------------------# param T; # number of periods (time horizon) set TIME := 0..T; set TIME1:= 0..T-1; set TIME2:= 1..T; set TIME3:= {T}; set TIME4:= {0}; param x0 >= 0; # initial state param xTobj >= 0; # objective for the state param b {TIME1} >= 0; # bound for the control at each period param xi{TIME2} ; # perturbation var x {TIME} >= 0; # state of the system at each period var u {TIME} >= 0; # control for each period # Objective function minimize slack: sum{t in TIME3} (xTobj-x[t]); # System dynamics subject to timedynamics {t in TIME2}: x[t] = x[t-1] + u[t-1] - xi[t]; # Bound for the control variable subject to timebound {t in TIME1}: u[t] <= b[t]; # Initial state of the system subject to initial {t in TIME4} : x[t] = x0;