I'm trying to solve a unit commitment/economic dispatch problem for a power system (an MILP with binary unit commitment
I'm solving the problem with an hourly time resolution, where each optimization problem is for a single day. The values of
certain variables at the solution for one day are passed into constraints for the next day (which is a separate
optimization problem). I formulate the model as an AbstractModel with mutable parameters, then instantiate it, then
overwrite parameter values if they change from one day to the next.
binary unit_commitment variable == 0 each hour), across days. For example, if a generator has to be off for a minimum of 5
hours once it's turned off, and it's off for 2 hours at the end of the current day, it has to be off for at least 3 hours
at the beginning of the next day.
constraint is not satisfied (solve_case is the main function). If I put a breakpoint after line 69 and look at 'inst_with_solutions' (the current model
instance with results inserted), the 'init_time_periods_offline' value for the Wind generator is 3 hours (which is correct
- Wind should be off for the first 3 hours, given the initial conditions I've fed it). However, the values of the
unit_commitment variable show that the Wind generator is on for the first 3 hours (unit_commitment['Wind',t] = 1 for t in
{1,2,3}). The constraint defined by minimum_downtime_initial_rule (starting line 336) is what should enforce this, but it
appears the constraint is being skipped.
default=0), it enforces the constraint with the new default values. It appears the model is picking up the
default parameter value no matter what. The correct (non-default) parameter value appears in the model instance when I look
at it in the debugger, but it seems the problem is solved with the default value instead. That is, the updated instance of
the model ignores the new parameter values that result from the solution to the initial instance of the model (or the
assumed parameter value, if it's the first optimization problem of the sequence). I update other mutable parameters - in
this example, the hourly electricity demand - and that works fine.
--
You received this message because you are subscribed to the Google Groups "Pyomo Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyomo-forum...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
<model_definition_minimal_bug.py>
I suspect that this has to do with the fact that my constraints refer to value(mdl.init_time_periods_offline) but to mdl.load_power (the parameter itself - not the value). I tried referring to mdl.init_time_periods_offline and not its value in the constraint rule, but it returned an error. Is that on the right track, or is there a different explanation? (And more broadly, can anyone point me towards a thorough explanation of when to use my_param vs. my_param.value? I haven't been able to find one).