Sie sind auf Seite 1von 4

Scripting in PowerFactory with Python

Python is a powerful tool, which is integrated into the standard PowerFactory application. It
is commonly used to automate the execution of time-consuming simulations, but its application
extends far beyond that. It may be used to process results, or to implement a routine that applies
sequential changes to the network and calls PowerFactory s analysis functions in each step.
This seminar provides a compact and efficient introduction to the fundamental aspects of writing
a scripts inside of PowerFactory by using Python. The course includes basic concepts, syntax,
accessing and modification of objects from within the code, automation of a series of calculations and presentation of the results etc. Participants will be provided with numerous examples
of Python scripts, which they may use for ideas, or adapt to suit their particular requirements.
The number of participants is limited to 10. Each participant will have access to a workstation
which will be used for the completion of exercises. Each participant should be familiar with
the general handling of the PowerFactory software, acquired through our load flow and short
circuit seminar, a PowerFactory basic training course or through relevant experience in the use
of PowerFactory. Programming experience is a prerequisite.

Scripting in PowerFactory with Python


Time Schedule
2 Days Training. 19-20 November

Start of the training


1st Coffee break
Lunch break
2nd Coffee break
End of the training

Time

Duration

9:00
10:30
12:30
15:00
17:00

30 min
60 min
30 min
-

Contents

Introduction
Welcome
Presentation

1.

Basic of Python Scripting in PowerFactory


Basic of Python Scripting in PowerFactory
Creating a Python Script in PowerFactory
Python-PowerFactory Module

2.

PowerFactory Objects
PowerFactory Objects
Accessing Objects with Python
Presenting and Changing values of Object Attributes
Managing Scripts
Exercise: Object access
Object Attributes and Values
Object Methods and Functions

3.

Command Execution
Executing calculation commands
Exercise: Command Execution
Scripted Execution of the Load Flow
Accessing Result Variables
Reporting Results

4.

Python Subroutines
Python Exceptions and Subroutines
Python Selection and Methods
Using subroutines
Exercise: Load Flow Report
Using Subscripts
Reporting Results

5.

Results File
Result File Functions
Result File Handling
General Remarks about Result Files
Exercise: Short Circuit Sweep
Writing / Reading a Result File

6.

Graphical Representation
Graphical Representation
Virtual Instruments
Graphic Board
Exercise: Virtual Instrument
Creating a Virtual Instrument

7.

Python for GUI


Graphical user interface
3

Python tkinter Module in PowerFactory


Exercise: GUI
Use of tkinter Objects (widgets)
Use of PowerFactory Objects and Methods

8.

External Data Files


External Data Files
Writing Files
Reading Files
Exercise: File Access with Python
Writing an external Data File
Reading an external Data File

Das könnte Ihnen auch gefallen