Skip to content

Quickstart Guide PowerFactory

CVLenerginet edited this page Mar 6, 2023 · 6 revisions

System Requirements

Developed with PowerFactory 2022 SP3 with Python 3.8.8. Dependencies are listed in requirements.txt and can be installed with the command:

python –m pip install –r requirements.txt

Preperation

  • Extract or copy all test bench files and your model into a common folder on your PC and make a subfolder for Results used later on.


  • Fill in the model-specific information of the ‘Input’ sheet in the ‘TestCases.xlsx’ file.

Model Setup in PowerFactory

  • Right-click the Network Data folder in your PowerFactory model and Import PP-MTB.pfd from the common folder.

NOTE: The project must be inactive to import using this method.


  • Activate the PP-MTB grid.


  • Replace the external grid with PP-MTB.

Deactivate the existing external grid, as well as any linked dynamic control used for the external grid, by leaving it Out of Service. Do this by selecting the elements and marking them as Out of Service.

Connect the cubicle at POC, formerly used for the external grid, to the element ”meas.ElmSind”. Copy the cubicle from the busbar used for the external grid (Ctrl+C) and then paste the cubicle to the element ”meas.ElmSind”, Terminal j.


  • Define a path in the scripts to point to the actual python scripts in the common folder with the matching name (e.g. execute.ComPython = execute.py).

When referring to the scripts, it is the following three under the PP-MTB folder.

The complete filepath must be defined in the field ‘Script file’ then click the ‘…’ button and navitage to the execute.py script you copied or extracted to a common folder earlier and repeat for the other two scripts as well.


  • Setup the execute.ComPython script Basic Options.

Script Execution

  • Pressing Execute, the script does both simulation and plotting of results automatically.

NOTE: When executing the script, active variations are consolidated, meaning all changes recorded in the active varitions will be applied to the Network Data Folder. If you are executing the script with active variations, we suggest you always make use of the scripts functionality to create a backup via the parameter 'backup'. This is one of the reasons the backup-functionality is implemeneted, enabling you to roll back to the version of your model, created prior to the changes made by the test bench.

Script Execution Finished

  • When the script is finished the output window should look like the snapshot below, with the text ”Python Script ‘execute’ succesfully executed” at the bottom.


  • All results from the simulations are exported to the 'Results' folder as seen below, each with a unique ID to match the study case, for a total of 32 if all cases are run. All simulations can also be reviewed in PowerFactory through the 32 study cases created by the test bench.

  • The test bench also creates a set of '.csv'-files that can be used with the PP-MTB Plotter to plot the results and optionally compare them with the results from PSCAD. These can also be found in the 'Results' folder.

Rerunning Cases without new Setup

If you need to run the simulations again, it is possible to do it quickly without setup of each individual plot again. Simply set the script parameter "setup" to 0 and execute the script again. Other parameters can also be set to change the run, for example, the parameter "export" toggles whether or not the plots are exported, the parameter "backup" toggles if a PowerFactory backup will be made and so on.