Package: peext
pandaenergy-extensionLibrary for converting pandapower/pandapipes networks to a graph representation and extending controller functionality.InstallingThe peext-library is available as package on PyPi, therfore you can install it usingpip.pipinstallpeextHowever, as usual, it is recommended to install it in a virtual environment:pipinstallvirtualenv
virtualenvvenvsourcevenv/bin/activate
pipinstallpeextQuickstartIn peext you can execute a steady-state time series simulation coupled with mango-agents using pandapower/pandapipes.To setup the simulation you need to construct aMASWorldobject and start the asyncio based simulation.importasyncioimportpeext.scenario.networkaspnfrompeext.world.coreimportMASWorld# construct the world using a coroutine constructing the mango# container + agentsworld=MASWorld(create_mas,pn.create_small_test_multinet(),max_steps=10)# Start the simulation using asyncioloop=asyncio.get_event_loop()loop.run_until_complete(future=world.run())In this example aMASWorldis constructed using the mango setup routinecreate_masand the small multi energy test networkpn.create_small_test_multinet(). The mango setup routine could look like this.asyncdefcreate_mas(me_network:MENetwork):"""Create a multi agent system within a single container.:param me_network: the network:type me_network: network.MENetwork:return: container the agents live in:rtype: Container"""container=awaitContainer.factory(addr=('127.0.0.2',5555))agents=[]fornodeinme_network.nodes:a=RoleAgent(container)# random actionsa.add_role(RandomRegulatorRole(node))agents.append(a)returncontainer,agentsThis coroutine-function will setup a mango-agentContaineron port 5555 with the internal adress '127.0.0.2'. Also it creates an agent for every node in the multi-energy network. The network is represented by an instance of theMENetworkclass. For more information about defining roles, creating agents in mango, consult the mango documentation (https://mango-agents.readthedocs.io/en/latest/).Package documentationIn this section the important packages (and their important classes), their objective and capabilities are described.MASWorldAMASWorld(peext.world.core) is capable of coupling a mango-agents simulation with a multi-energy pandapipes controller simulation. It expects at least 2 object:the multineta coroutine-function, which setups mango-agents and containers.Besides executing the simulation the World will collect data every step and persist the collected data and the network itself for later usage (f.e. with dcnv).MENetworkTheMENetworkis the central network model when using peext components and resides in the packagepeext.network. While pandapower/pipes uses pandas dataframes to store all informations about the components and the simulation results, theMENetworkrepresents every component by a node or an edge. Nodes are f.e. generators, loads, while edges f.e. are lines, pipes and trafos. In this representation buses and junctions are omitted. If the data is needed it can be accessed using the methodsget_bus_junc_res_dataandget_bus_junc. Exception: empty junctions and buses will be represented as own nodes.Pandapipes/Pandapower ControllerThe peext-library implements a set of controller representing coupling points in the multi-energy network:NameDescriptionComponentsModesCHPControlMultiEnergyImplements a regulatable (heat and power/gas) CHP coupling point with an optional heat storageheat_exchanger, gen/sgen, sink, optional EnergyStoragePower driven/Gas drivenRegulatedG2PControlMultiEnergyImplements a regulatable G2P coupling point. Essentially equivalent to CHPControllMultiEnergy with heat_regulation = 0gen/sgen, sinkPower driven/Gas drivenRegulatedP2GControlMultiEnergyImplements a regulatable P2G coupling point.source, loadPower drivenFurthermore there are controllers to extend the capabilites of the MENetwork represenation and for collecting/plotting data:HistoryControllerCollecting data for historical timesteps, providing a bridge to this data in the MENetwork instancePlottingControllerImplements live plotting of a chosen set of components in matplotlib windowsStaticPlottingControllerCapable of collecting the network data every step. Used internally by the MASWorld for persisting the network results.