Pyomo cannot find any solution to my optimization problem

A solar plant is supplying power to three water pumps, and other appliances and I want to find when should I run my water pumps to make the most of the solar plant (since its production through days is not constant).

I tried to implement such an optimization problem on Pyomo, but he provides me 0 solution, which is quite surprising since it doesn’t appear to be a very complex problem.

My modelisation follows these rules :

  • power_m_pyomo contains the average yield power of the solar panel per month (indexed by m) and per hour between 8 and 17 (indexed by Id),
  • base_demand contains the electricity demand of the appliances, which is equals to 90 kW every hour between 8 and 17,
  • model.P contains the number of water pumps that should be running each hour. So it’s an integer smaller or equal to 3. I only need 9 “equivalent hour of water pump running per day”, which means that the sum of model.P[i] should be equal to 9.

My code is :

# Importation of the supplied power
df = pd.read_csv('test_power.csv', header=0, names=["Hour", "Power [kW]"])
power_supplied = df['Power [kW]'].tolist()

# Creation of the average monthly yield power 
power_m = monthly_profile_creation(power_supplied)

# Conversion of the power supplied into something that can be used by Pyomo
power_m_pyomo = {}
for m in range(1,13):
    for h in range(8, 18):
        power_m_pyomo[(m,h)] = power_m[m][h]
    

# Creation of the model (now empty)
model = pyomo.ConcreteModel()

# Creation of index for the peak demand
model.M = pyomo.Set(initialize = range(1, 13))
model.Id = pyomo.Set(initialize = range(8, 18))

# Parameters 
base_demand = list_to_dico([90]*10, 8)
model.base_demand = pyomo.Param(model.Id, initialize=base_demand)
model.power_supplied = pyomo.Param(model.M, model.Id, initialize=power_m_pyomo)

# Variables
model.P = pyomo.Var(model.Id, domain=pyomo.Integers)

# Objective function

def objective_func(model):
    power_stored = 0
    for m in model.M:
        for i in model.Id:
            power_stored += model.power_supplied[m,i] - model.base_demand[i] - 24*model.P[i]
    return power_stored
model.objective = pyomo.Objective(rule = objective_func, sense=pyomo.minimize)

# Constraints

def constraint_pump_1(model, i):
    return model.P[i] <= 3
model.constraint_pump_1 = pyomo.Constraint(model.Id, rule=constraint_pump_1)

def constraint_pump_2(model):
    return sum([model.P[i] for i in model.Id]) == 9
model.constraint_pump_2 = pyomo.Constraint(rule=constraint_pump_2)

solver = pyomo.SolverFactory("cbc")
results = solver.solve(model, keepfiles=False, logfile="solve.log")
print(results)

Can someone please help me ?

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật