PyPSA and Python – Reservoir hydro optimization for one country over mulitple snapshots – issue with code specification

enter image description hereI want to optimize one hydro reservoir over multiple time snaphshots using PyPSA and Python.
On Pypsa support page, I used the Two chained reservoir example as a starting point, even if i want only one reservoir in my case.
text


import pypsa
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt



country = "South Africa"

network = pypsa.Network()


network.set_snapshots(pd.date_range("2016-01-01 00:00", "2016-01-01 03:00", freq="h"))

network.add("Bus", country, carrier="AC")  #  "Electrical" Bus is the country bidding zone


# Hydro system definition 
network.add("Carrier", "reservoir")
network.add("Carrier", "rain")


# network.add("Bus", "0", carrier="AC")   # Replaced by our country South Africa electrical Bus
network.add("Bus", "0 reservoir", carrier="reservoir")
# network.add("Bus", "1 reservoir", carrier="reservoir")



network.add(
    "Generator",
    "rain",
    bus="0 reservoir",
    carrier="rain",
    p_nom=500,
    p_max_pu=[0.1, 0.2, 0.6, 0.4],
)



network.add(
    "Link",
    "0 turbine",
    bus0="0 reservoir",
    bus1=country,
    # bus2="1 reservoir",
    efficiency=0.85,
    # efficiency2=0.8,
    capital_cost=0,
    p_nom_extendable=True,
)



network.add(
    "Store", "0 reservoir", bus="0 reservoir", e_cyclic=True, e_nom_extendable=True
)


# marginal costs in EUR/MWh
marginal_costs = {"Wind": 0, "Coal": 80, "Gas": 130, "Oil": 180}

# power plant capacities (nominal powers in MW) in each country (not necessarily realistic)
power_plant_p_nom = {
    "South Africa": {"Wind": 400, "Coal": 1000, "Gas": 1000, "Oil": 300}
}

[enter image description here](https://i.sstatic.net/jyV3kPIF.png)
# p_max_pu is variable for wind
for tech in power_plant_p_nom[country]:
    network.add(
        "Generator",
        "{} {}".format(country, tech),
        bus=country,
        p_nom=power_plant_p_nom[country][tech],
        marginal_cost=marginal_costs[tech],
        p_max_pu=([0.2, 0.8, 0.5, 0.7] if tech == "Wind" else 1),
    )
   


# country electrical loads in MW (not necessarily realistic)
loads = {"South Africa": 1500}


# load which varies over the snapshots
network.add(
    "Load",
    "{} load".format(country),
    bus=country,
    p_set=loads[country] + np.array([-700, 700, -1000, 1000])
)



network.optimize(network.snapshots)
# network.optimize()


print("Objective:", network.objective)


network.generators_t.p.plot.area(figsize=(9, 4))
plt.tight_layout()


network.links_t.p0.plot(figsize=(9, 4), lw=3)
plt.tight_layout()

# print the load active power (P) consumption
print(network.loads_t.p)

# print the generator active power (P) dispatch
print(network.generators_t.p)

# print the clearing price (corresponding to gas)
print("SMP :",network.buses_t.marginal_price)


network.buses_t.marginal_price.plot(figsize=(9, 4))


plt.show()

First, I did not find the way to specify in my code essential reservoir properties such as :

– Reservoir capacity in MWh

– Turbine Power output in MW

– Waters Inflows in MWh

Despite these missing properties, i generated a first example code below : as per the captures attached i see the turbine running but i do not see the generated Power output properly. I think something is missing regarding how hydro transfers into power generation. Rain is accounted as power generation in the chart as well which does not make sense. As you can see the turbine runs on rain numbers without respect to the turbine capacity that sould be in place.

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