I am trying to include a python "max" command inside a quicksum command using gurobi with python. There is obviously an error with doing so, under LinExpr limitations as it is not accepted.
shutdowncost = quicksum(quicksum(shutdown_cost[i] * max((v[hour -1, i] - v[hour, i]),0) for i in num_gen) for hour in hour_range)
V is a binary variable in the model, while the remainder are fixed variables. The issue is around shutdowncost being negative in the scenario where v[hour - 1, i] is 0, and v[hour, i] is 1.
Is there another command that can be used to replace the max command inside the quicksum?