Mosaik-Powerfactory provides an interface for Mosaik co-simulation framework.
Mosaik-Powerfactory requires Python >= 3.3. Use pip to install it, preferably into a virtualenv
pip install -e git+https://github.com/hesstobi/mosaik-powerfactory.git#egg=mosaik-powerfacotry
This is small example how tho use mosiak-powerfacotory to run a load flow simulation with mosaik.
import mosiak_powerfacotry
import mosaik
SIM_CONFIG = {
'PFSim': { 'python': 'mosaik_powerfactory:PowerFactoryLDFSimulator' }
}
world = mosaik.world(SIM-CONFIG)
pfsim = world.start('PFSim', project_name='PROJECTNAME',options={})
Netz = pfsim.ElmNet(loc_name='Netz')
world.run(unit=1800)
The main steps to use PowerFactory with mosaik are:
- Add the desired Powerfactory Simulator to your simulation config. Avaible simulators are:
- PowerFactoryLDFSimulator: Load flow simulations
- PowerFactoryRMSSimulator: RMS simulations
You can use the simulator as python module or as cmd:
'python': 'mosaik_powerfactory:PowerFactoryLDFSimulator'
'cmd': 'mosaik-powerfactory-ldf %(addr)s'
- Start the simulator with world.start which cals the init method of the simulator: :py:meth:`mosaik_powerfactory.PowerFactoryLDFSimulator.init` or :py:meth:`mosaik_powerfactory.PowerFactoryRMSSimulator.init`. Define the desierd project in the attribute :py:attr:`project_name`
- Connect your PowerFoctory
ElmNet
with mosaik by creating it with itsloc_name
, e.g:pfsim.ElmNet(loc_name='Netz')
- Connecting Grid elements with other simulators in mosaik. To get the desierd elements you can use this methods:
Last = Netz.child_with_eid('Netz\\Last1.ElmLod')
: get the element with the given Pathterminals = Netz.children_of_model('ElmTerm')
: get the elements of the given model
- Run the simulation!
A detailed documentation of mosaik is avaible here: Mosiak documentation.
To read the full documentation of this project follow these steps:
git clone https://github.com/hesstobi/mosaik-powerfactory.git
cd mosaik-powerfactory/docs
make html
Open the file :file:`.\_build\html\index.html` in your browser