Storage Unit Behavior and Marginal Prices

33 views
Skip to first unread message

Andy Boomer

unread,
Jun 5, 2024, 7:21:04 PMJun 5
to pypsa
Hi,

I am trying to understand how to best model market participation of grid scale batteries.

A battery operator should be able to both control the price at which it charges and the price at which it discharges.

I have been able to test out that the marginal cost works to control the price at which a battery discharges power, just like other generators, but I am having trouble figuring out how to control this on the charging side.

I am not immediately sure what the best way to implement this would be, but I would expect to be able to specify one or more sets of marginal costs (or bids/offers for a battery, but could be the same theoretically).

- The battery is willing to charge if the resulting bus marginal price is less than or equal to to the submitted cost/bid/offer (and physical constraints are satisfied)
- The battery is willing to discharging if the resulting bus marginal price is greater than or equal to the submitted cost/bid/offer (and physical constraints are satisfied)

I am working with this toy network adapted from one of the docs examples. I can't seem to figure out how to control the load side of the battery. Thanks!

network = pypsa.Network()

network.set_snapshots(range(5))

network.add("Bus", "A")
network.add("Bus", "B")
network.add("Bus", "C")

network.add("Line", "a_b", bus0="A", bus1="B", s_nom=100000, r=0.01, x=0.01)
network.add("Line", "a_c", bus0="A", bus1="C", s_nom=100000, r=0.01, x=0.01)
network.add(
"Load",
"load_a",
bus="A",
p_set=np.array([40000, 40000, 44000, 46000, 50000]),
)

network.add(
"Generator",
"gen_coal",
bus="B",
p_nom=50000,
marginal_cost=30,
p_max_pu=1,
)


network.add(
"Generator",
"gen_solar",
bus="C",
p_nom=40100,
marginal_cost=0,
p_max_pu=[1.0, 1.0, 0.0, 0.0, 0.0]
)

network.add(
"StorageUnit",
f"Pumped hydro",
bus="C",
p_nom=50,
p_min_pu=-1,
p_max_pu=1,
max_hours=6,
marginal_cost=[5, 5, 0, 0, 0],
state_of_charge_initial=0.0,
)

network.optimize()








 
Reply all
Reply to author
Forward
0 new messages