I would like to model the efficiency of a heat pump as a function of its load level, e.g., efficiency(T) = a*load_level(T)+b, where a and b are constants and T is time.
I have two variables "installed_capacity" and "power(T)", so the load_level(T) is defined as installed_capacity/power(T). But Gurobi does not accept this argument (division only allowed for constants).
Secondly, I also tried a piece-wise linear approximation for the part-load efficiency curve.
def part_load_eff(load_level, c1, c2, c3):
return c1 - c2/(2**(load_level/c3))
part_load_steps = np.linspace(0, 1, 5)
efficiency_steps = part_load_eff(part_load_steps, 3.8299, 3.8236, 0.14659)
v_load_level = m.addVar(lb=0, ub=1, vtype=GRB.CONTINUOUS)
v_efficiency = m.addVar(lb=0, ub=p_hp_cop_max, vtype=GRB.CONTINUOUS)
v_weights = m.addVars(len(part_load_steps), lb=0, ub=1, vtype=GRB.CONTINUOUS)
sos2 = m.addSOS(GRB.SOS_TYPE2, v_weights)
m.addConstr(quicksum(v_weights) == 1)
m.addConstr(quicksum([v_weights[i]*part_load_steps[i] for i in range(len(part_load_steps))]) == v_load_level)
m.addConstr(quicksum([v_weights[i]*efficiency_steps[i] for i in range(len(efficiency_steps))]) == v_efficiency)
But then in this way, the time dimension is not represented (because efficiency varies with time). Does any of you have any suggestion to make this constraint work properly?
Please sign in to leave a comment.