Does pandapower (via midas-powergrid) correctly aggregate the active
power (p_mw) of multiple Load elements connected to the same bus
into net.res_bus.p_mw?
A minimal pandapower network was created with two buses connected by a line. An external grid was attached to bus 1, and two loads (0.5 MW and 0.3 MW) were attached to bus 2. A power flow calculation was run and the result was inspected.
import pandapower as pp
net = pp.create_empty_network()
b1 = pp.create_bus(net, vn_kv=20.0, name="Bus_1")
b2 = pp.create_bus(net, vn_kv=20.0, name="Bus_2")
pp.create_line(net, b1, b2, length_km=1.0, std_type="NAYY 4x50 SE")
pp.create_ext_grid(net, b1)
pp.create_load(net, b2, p_mw=0.5, name="Load_A")
pp.create_load(net, b2, p_mw=0.3, name="Load_B")
pp.runpp(net)
total_load = 0.5 + 0.3
bus_p_mw = net.res_bus.loc[b2, "p_mw"]
assert abs(total_load - bus_p_mw) < 0.001Bus 1 (Bus_2):
Loads at bus: 2
Sum of load p_mw: 0.800000
res_bus p_mw: 0.800000
Match: True
pandapower aggregates multiple loads at the same bus correctly.
res_bus.p_mw equals the sum of all connected load.p_mw values.
In PandapowerSimulator.step(), when multiple mosaik entities send
inputs to the same Load entity, the simulator sums all source values
before calling grid.set_inputs():
for src_id, val in src_ids.items():
if val is not None:
setpoint += float(val)This means multiple EV agents connected to the same Load entity will
have their p_mw contributions summed automatically.
midas-powergrid creates all grid entities (buses, loads, lines, etc.)
in PandapowerGrid.__init__ during create(). The entity map is
fixed at setup time. New Load entities cannot be created at
runtime — all loads must exist when the grid is initialised.
- Native aggregation works: pandapower sums multiple loads at
the same bus. No generic
PowerAggregatorsimulator is needed. - Runtime load creation is not supported: all loads must be defined at grid setup time.
- The LoadRouter approach is still needed — not for aggregation,
but because mosaik's topology is static: an EV agent cannot
dynamically reconnect to a different
Loadentity at runtime. TheLoadRouterSimulatorsolves this by routing power to the correct load based on the agent's currentbus_id.