7-Program Automation
7-Program Automation
en
m
Tab 7 – Program Automation
e
Si
© 2015 Siemens Industry, Inc. All rights reserved
Method for Operating PSS®E
s
1. Graphical User Interface
en
2. Command Line Input - Traditional “Activity” names
and data entries
3. Response File - batch commands
© 2015 Siemens Industry, Inc., Siemens Power Technologies International (Siemens PTI)
4. IPLAN - compiled program
5. Python - source code
e m
Si
Siemens Power Academy TD – NA - PSSC 500 PSS®E Introduction to Power Flow and Steady State Analysis 7-2
Command Line Input
s
Toggle on/off
en
© 2015 Siemens Industry, Inc., Siemens Power Technologies International (Siemens PTI)
e m
Si
s
Record User’s interactive input in a file:
1. Click on I/O Control>Start Recording. Supply file name to store
en
dialogue
2. Execute desired “Activities”
3. Click on I/O Control>Stop Recording
© 2015 Siemens Industry, Inc., Siemens Power Technologies International (Siemens PTI)
Run Program Automation File
n
n
n
e m
Use response files to automate procedures.
Essential for “batch mode” processing, such as running dynamics
simulations.
Buttons can be assigned to run Response files to provide “one-
Si
touch” execution of one or more Activities.
Siemens Power Academy TD – NA - PSSC 500 PSS®E Introduction to Power Flow and Steady State Analysis 7-4
Example of Recording Commands
s
User wants to automate the following actions:
n CASE in a power flow model.
en
n Solve using Fixed Slope Decoupled Newton Raphson (FDNS),
with taps, phase-shifters and area interchange controls enabled.
© 2015 Siemens Industry, Inc., Siemens Power Technologies International (Siemens PTI)
To create a response file of these actions:
m
n Click on I/O Control>Start Recording to open a response file,
e.g. soln.idv
n Click on File>Open to pick up a saved case.
e
n Click on Power Flow>Solution>Solve to solve.
n Click on I/O Control>Stop Recording to close response file.
Si
Siemens Power Academy TD – NA - PSSC 500 PSS®E Introduction to Power Flow and Steady State Analysis 7-5
Example of Recording Commands
(continued)
s
The response file soln.idv looks like:
en
BAT_CASE,'C:\savnw.sav'
BAT_FDNS,0,0,0,1,1,0,99,0
© 2015 Siemens Industry, Inc., Siemens Power Technologies International (Siemens PTI)
This file can then be executed by:
e m
I/O Control>Run Program Automation File
to reproduce the original actions.
Siemens Power Academy TD – NA - PSSC 500 PSS®E Introduction to Power Flow and Steady State Analysis 7-6
Response Files can be “nested” and
“chained”
s
@Commands Action
en
@Input file Initiate nested Response File operation
© 2015 Siemens Industry, Inc., Siemens Power Technologies International (Siemens PTI)
@End
@Pause
e
@Continue
m
Terminate operation of current Response File
Siemens Power Academy TD – NA - PSSC 500 PSS®E Introduction to Power Flow and Steady State Analysis 7-7
Example of Nesting Response Files
s
n Let’s suppose that the User needs the original Response File to
also modify Newton solution parameter for acceleration to 0.8 and
en
maximum iteration limit to 50 prior to executing FDNS.
n To do this, the User can first create a separate response file for
© 2015 Siemens Industry, Inc., Siemens Power Technologies International (Siemens PTI)
modifying the solution parameters:
m
- Click on I/O Control>Start Recording. Open file parm.idv
- Click on Power Flow>Solution>Parameters
- Click on I/O Control>Stop Recording. (Close file parm.idv)
e
The resulting Response File is:
Si
BAT_SOLUTION_PARAMETERS_4,,50,,,,,,,, 0.8,,,,,,,,,,,,,,,;
Siemens Power Academy TD – NA - PSSC 500 PSS®E Introduction to Power Flow and Steady State Analysis 7-8
Response Files Nesting
s
n The original Response File (soln.idv) can then be edited to include
the @input command.
en
n The Response File to modify the solution parameters (parm.idv) will
then be invoked using I/O Control>Run Program Automation File
to execute the original Response File (soln.idv).
© 2015 Siemens Industry, Inc., Siemens Power Technologies International (Siemens PTI)
e @input parm.idv m
BAT_CASE,'C:\savnw.sav'
BAT_FDNS,0,0,0,1,1,0,99,0
Si
Siemens Power Academy TD – NA - PSSC 500 PSS®E Introduction to Power Flow and Steady State Analysis 7-9
Response File Arguments
s
n Variables may be placed within a
en
Response File of the form %n%
where “n” is a number 1 through 15
n Values for the variables are specified
when a response file is activated.
© 2015 Siemens Industry, Inc., Siemens Power Technologies International (Siemens PTI)
n Arguments may be passed down
filename, ‘%1%’
e
BAT_CASE, %1%
m
more than one level; e.g. @input,
@input parm.idv
Si
BAT_FDNS,0,0,0,1,1,0,99,0
Siemens Power Academy TD – NA - PSSC 500 PSS®E Introduction to Power Flow and Steady State Analysis 7-10
Problem 7-1 Response Files
s
In this problem, we are going to use Response File techniques to “record” the changes
made to one case and then “playback” the changes on another case.
en
A. Apply all of the modeling changes to case EXER4-1.SAV as described in i, ii & iii
below. Use a Response File to “record” the changes made. Name the Response
File MOD1.IDV
i. Change the step-up transformer for the plant at bus 201 from an explicit
© 2015 Siemens Industry, Inc., Siemens Power Technologies International (Siemens PTI)
representation (branch from bus 200 to bus 201) to an implicit
e m
representation (i.e. modeled as part of the generator data on bus 200). See
the attached one-line diagram.
Remember that the implicit representation for the transformer requires the
reactance data to be in per unit on machine base. The new representation
should have a fixed high-side tap of 1.05 p.u.
ii. Remove the switched shunt representation at bus 150.
iii. Change the number of tap positions for the transformer on branch 150 -
Si
151 to 33.
After you have completed the changes, close the response file.
Siemens Power Academy TD – NA - PSSC 500 PSS®E Introduction to Power Flow and Steady State Analysis 7-11
Problem 7-1 Response Files (continued)
s
Solve the new setup using Full Newton-Raphson Solution with Tap Stepping
enabled. Do not include the power flow solution in the Response File. SAVE the
en
new case as EXER7-1A.SAV
Update one-line diagram (EXER2-3.sld) to reflect the changes made. Save the
new one-line diagram as EXER7-1A.sld
© 2015 Siemens Industry, Inc., Siemens Power Technologies International (Siemens PTI)
B. Use the Response File MOD1.IDV created in (A) to apply the changes to case
m
EXER4-3A.SAV Solve the case using Full Newton-Raphson Solution with Tap
Stepping enabled. SAVE the new case as EXER7-1B.SAV
e
Si
Siemens Power Academy TD – NA - PSSC 500 PSS®E Introduction to Power Flow and Steady State Analysis 7-12
Problem 7-1 Response Files (continued)
s
en
© 2015 Siemens Industry, Inc., Siemens Power Technologies International (Siemens PTI)
e m
Si
Siemens Power Academy TD – NA - PSSC 500 PSS®E Introduction to Power Flow and Steady State Analysis 7-13
PSEB: PSS®E Engineering Basic Power
Flow Command Language
s
Sample Dialogue:
en
RECOVER NETWORK FROM SAVNW.SAV
SET SOLUTION OPTIONS TO DIRECT-TAP,$
AREA-INT, SHUNT-LOCKED
TRIP BRANCH FROM BUS 153 TO BUS 154 CKT 2
© 2015 Siemens Industry, Inc., Siemens Power Technologies International (Siemens PTI)
SOLVE USING FDNS WITH VAR LIMITS APPLIED
AFTER 2 ITERATIONS
HOLD NETWORK IN SAVNEW.SAV
END
e m
n PSEB translates the English-like commands into a Response File
and then executes the Response File.
Si
n For a list of all available commands, see Program Operation
Manual, PSEB Ready Reference.
Siemens Power Academy TD – NA - PSSC 500 PSS®E Introduction to Power Flow and Steady State Analysis 7-14
s
en
m
IPLAN in PSS®E
e
Si
© 2015 Siemens Industry, Inc. All rights reserved
IPLAN: PSS®E Interface Programming
Language
s
n IPLAN is widely used to automate or customize study procedures.
en
n I/O Control>Run Program Automation File is used to execute IPLAN
program from within PSS®E.
n Three essential features of IPLAN for interacting with and driving PSS®E:
© 2015 Siemens Industry, Inc., Siemens Power Technologies International (Siemens PTI)
e m
1. Library of “CALL” statements for accessing all PSS®E working case data and
information.
3. Features for communicating interactively with the user from the IPLAN program
including terminal and file input/output.
Si
Siemens Power Academy TD – NA - PSSC 500 PSS®E Introduction to Power Flow and Steady State Analysis 7-16
IPLAN: PSS®E Interface Programming
Language (continued)
s
Creating an IPLAN program requires:
n Some knowledge of programming concepts (i.e., loops, subroutines, etc.).
en
n Knowledge of programming languages like Fortran useful but not
necessary.
© 2015 Siemens Industry, Inc., Siemens Power Technologies International (Siemens PTI)
Program Name
End
e Global variable_declarations
m
Program_body - executable statements (includes CALL and PUSH statements)
s
n Allows you to call Subroutines that retrieve data from the Working Case
into the IPLAN program.
en
Call Subroutine NAME (list of parameters)
© 2015 Siemens Industry, Inc., Siemens Power Technologies International (Siemens PTI)
Manual.
For Example:
e
IBUS
m
CALL BUSDAT ( IBUS, STRING, V, IERR )
= Bus Number (integer input)
STRING = 'BASE' or 'PU', or ‘KV’ (string input)
Si
V = Voltage (real output)
IERR = Error Code (integer output)
Siemens Power Academy TD – NA - PSSC 500 PSS®E Introduction to Power Flow and Steady State Analysis 7-18
PUSH Statement
s
Allows the user to transmit instructions to PSS®E
en
PUSH ‘command’
© 2015 Siemens Industry, Inc., Siemens Power Technologies International (Siemens PTI)
PUSH 'BAT_BRANCH_DATA,151,152,''1'',0,,,,,,,,,,,,,,,,,,,,,;'
e m
Si
Siemens Power Academy TD – NA - PSSC 500 PSS®E Introduction to Power Flow and Steady State Analysis 7-19
Creating an IPLAN Program
s
n May create with any ASCII text editor. Make sure file name has an .IPL extension.
en
enter: filename (the file that contains your program), or
filename -CRUN (compile and run)
© 2015 Siemens Industry, Inc., Siemens Power Technologies International (Siemens PTI)
.IRF extension will be created.
n To run stand-alone,
enter:
filename -RUN
e
n To run from within PSS®E, use:
(I/O Control > Run Program
m
Automation File) and select
Si
filename.
Siemens Power Academy TD – NA - PSSC 500 PSS®E Introduction to Power Flow and Steady State Analysis 7-20
Example of IPLAN Program - Losses
s
PROGRAM LOSSES
/*
/*
* Print tabular listing of line losses
en
* Loop through buses and branches using the single line index.
* Declare Variables... * Output branch losses
*/ */
INTEGER NBUS, I, IBUS, JBUS LOOP I = 1 TO NBUS ! Loop through buses...
INTEGER IERR, JERR CALL ORDBUS(I,IBUS,IERR)
CALL INIBRN(IBUS,1,IERR)
REAL FLOW1, FLOW2, LOSS, Q
© 2015 Siemens Industry, Inc., Siemens Power Technologies International (Siemens PTI)
STRING CKT LOOP ! Loop through branches on the bus...
/* CALL NXTBRN(IBUS,JBUS,CKT,JERR)
CALL BRNFLO(IBUS,JBUS,CKT,FLOW1,Q,IERR)
IF (IERR > 0) THEN NEXTLOOP ENDIF
CALL BRNFLO(JBUS,IBUS,CKT,FLOW2,Q,IERR)
LOSS = ABS(FLOW1+FLOW2)
PRINT
! No more
Si
ENDIF IBUS:5,TAB(10),JBUS:5,TAB(21),CKT,TAB(28),LOSS:8.2
OPEN ’LOSSES.DAT’ ON 1 FOR ’W’ WRITE 1;
IBUS:5,TAB(10),JBUS:5,TAB(21),CKT,TAB(28),LOSS:8.2
ON ERR(1) GOTO DONE UNTIL (JERR > 0)
PERFORM HEADINGS
ENDLOOP
Siemens Power Academy TD – NA - PSSC 500 PSS®E Introduction to Power Flow and Steady State Analysis 7-21
IPLAN Program Losses (continued)
s
PROCEDURE HEADINGS
/*
* Prints out the heading on the terminal and on the file
/*
en
* Terminal first
* Let user know program is done... */
*/ PRINT
DONE: CLOSE 1 PRINT
PRINT PRINT ’ FROM’,TAB(10),’ TO’
PRINT ’ BUS’, TAB(10),’ BUS’,
PRINT TAB(20),’CKT’,TAB(30),’LOSSES’
© 2015 Siemens Industry, Inc., Siemens Power Technologies International (Siemens PTI)
PUSH ’TEXT ***LOSSES PROGRAM PRINT ’-----’,TAB(10),’-----’,TAB(20),’---’,TAB(30),’----
COMPLETE***’ --’
eEND
m /*
* Now the file
*/
WRITE 1;
WRITE 1;
WRITE 1; ’ FROM’,TAB(10),’ TO’
WRITE 1; ’ BUS’, TAB(10),’ BUS’,
TAB(20),’CKT’,TAB(30),’LOSSES’
WRITE 1; ’-----’,TAB(10),’-----’,TAB(20),’---
’,TAB(30),’------’
Si
RETURN
END
Siemens Power Academy TD – NA - PSSC 500 PSS®E Introduction to Power Flow and Steady State Analysis 7-22
IPLAN Program Losses Output
s
FROM TO
BUS BUS CKT LOSSES
----- ----- --- ------
en
101 151 1 1.64
102 151 1 1.64
151 152 1 5.52
151 152 2 5.52
151 201 1 3.52
© 2015 Siemens Industry, Inc., Siemens Power Technologies International (Siemens PTI)
152 153 1 0.00
152 202 1 0.06
152
153
153
153
154
e
154
154
201
3004
154
154
3006
203
205
3008
202
m1
1
2
1
1
1
1
1
0.56
3.77
3.14
0.06
0.79
0.70
0.32
5.98
Si
201 204 1 11.23
201 211 1 2.33
202 203 1 1.68
203 205 1 0.42
Siemens Power Academy TD – NA - PSSC 500 PSS®E Introduction to Power Flow and Steady State Analysis 7-23
IPLAN also Includes
s
n Ability to call user-written external FORTRAN Subroutines.
en
n Graphic Subroutines.
© 2015 Siemens Industry, Inc., Siemens Power Technologies International (Siemens PTI)
e m
Si
Siemens Power Academy TD – NA - PSSC 500 PSS®E Introduction to Power Flow and Steady State Analysis 7-24
Problem 7-2 IPLAN Example
s
In this problem, we are going to compile IPLAN Program Losses (a simplified version)
and test it on a power flow case.
en
A. Create Shortcut for IPLAN compiler. Change properties of Shortcut to “Start In”
your own working folder. Also, append “-LOOP” to “Target” command of Shortcut.
The latter will prevent the IPLAN Window from closing automatically after it finishes
compiling.
© 2015 Siemens Industry, Inc., Siemens Power Technologies International (Siemens PTI)
B. Click on Shortcut to start IPLAN compiler. Enter name of IPLAN program:
C.
D.
E.
e m
“Losses”. If compilation is successful, hit <enter> to close window.
From within PSS®E, pick up saved case EXER7-1A.SAV
Start Program Automation and select IPLAN program LOSSES.IRF from your own
folder.
Observe output in progress window.
Si
Siemens Power Academy TD – NA - PSSC 500 PSS®E Introduction to Power Flow and Steady State Analysis 7-25
s
en
m
Python in PSS®E
e
Si
© 2015 Siemens Industry, Inc. All rights reserved
Python Features
s
n Similar to IPLAN
- PSS®E data fetching routines
en
- APIs to execute PSS®E activities
- Flow control
- Procedures
© 2015 Siemens Industry, Inc., Siemens Power Technologies International (Siemens PTI)
n Interpreted from
n
e - Command line (OS)
- In an application (PSS®E)
m
- Development environment (IDLE)
s
IPLAN Python
en
program busarea
psspy.case('savnw.sav')
integer ibus,ierr,ival
psspy.fnsl((0,0,0,1,1,0,99,0))
string strval
push 'case'
© 2015 Siemens Industry, Inc., Siemens Power Technologies International (Siemens PTI)
push 'savenw.sav' psspy.inibus(0)
push 'bat_fnsl, 0, 0, 0, 1, 1, 0, 99, 0 ;'
call inibus(0,ierr)
loop
call nxtbus(ibus,strval,ierr) m
if (ierr<>0) then exitloop endif
e
call busint(ibus,‘AREA',ival,ierr)
report ibus,ival
while (true)
while True:
ierr,busnum,busname = psspy.nxtbus()
if ierr!=0: break
ierr,busarea = psspy.busint(busnum,'AREA')
psspy.report('%s %s' % (busnum,busarea))
Si
end
Siemens Power Academy TD – NA - PSSC 500 PSS®E Introduction to Power Flow and Steady State Analysis 7-28
Can IPLAN Routines be Converted to
Python?
s
n Automatically? No.
en
n Manually? Yes.
© 2015 Siemens Industry, Inc., Siemens Power Technologies International (Siemens PTI)
but the unstructured nature of IPLAN makes automatic
conversion problematic.
e m
Si
Siemens Power Academy TD – NA - PSSC 500 PSS®E Introduction to Power Flow and Steady State Analysis 7-29
Ways to Control PSS®E
s
IPLAN
PSS®E
en
Source
GUI
IPLAN IPLAN
Executer Program
© 2015 Siemens Industry, Inc., Siemens Power Technologies International (Siemens PTI)
e
PSS®E Functions
m Python
Interpreter
and APIs
Python
Scripts
Si
Not shown: Batch files and command line interpreter.
Siemens Power Academy TD – NA - PSSC 500 PSS®E Introduction to Power Flow and Steady State Analysis 7-30
Running Python in PSS®E
s
n Run Python scripts from the main GUI
- As an "Automation File“
en
n Use the Command Line Interpreter (CLI) window
- Enter Python code interactively
- Run Python scripts
© 2015 Siemens Industry, Inc., Siemens Power Technologies International (Siemens PTI)
n Run Python scripts at PSS®E startup
- Via PSS®E arguments
Siemens Power Academy TD – NA - PSSC 500 PSS®E Introduction to Power Flow and Steady State Analysis 7-31
Problem 7-3 Python Interpreter in PSS®E
s
Write and test each of the following Python print statements:
en
print 5+3-7
x=5
print x
© 2015 Siemens Industry, Inc., Siemens Power Technologies International (Siemens PTI)
print "Wow, this is easy!"
n
n
n
e m
Start Command Line Input Session
Select command language as Python
Enter commands in lower text field
n View results in progress field
Si
Siemens Power Academy TD – NA - PSSC 500 PSS®E Introduction to Power Flow and Steady State Analysis 7-32
PSS®E's Python Extensions
s
n PSS®E functionality is exposed to Python via the “psspy”
module:
en
- PSS®E APIs (e.g. Batch commands)
- IPLAN "Fetch" routines
© 2015 Siemens Industry, Inc., Siemens Power Technologies International (Siemens PTI)
e m
- PSS®E Application Program Interface Documentation
- IPLAN Program Manual's (Appendix A)
Si
Siemens Power Academy TD – NA - PSSC 500 PSS®E Introduction to Power Flow and Steady State Analysis 7-33
Examples of APIs: CASE and FNSL
s
n Python calls for CASE and FNSL:
- Read a savecase into PSS®E :
en
ierr = psspy.case("savnw.sav")
- Solve a case that is in memory:
ierr = psspy.fnsl((0, 0, 0, 1, 1, 0, 99, 0))
© 2015 Siemens Industry, Inc., Siemens Power Technologies International (Siemens PTI)
m
n There are hundreds of API routines.
Siemens Power Academy TD – NA - PSSC 500 PSS®E Introduction to Power Flow and Steady State Analysis 7-34
Example of Data Fetching Routines
s
n IPLAN call:
en
CALL BUSDAT(BUS,STRING,V,IERR)
n Python call:
© 2015 Siemens Industry, Inc., Siemens Power Technologies International (Siemens PTI)
e Note:
- lower case
- outputs on left
m
ierr,v = psspy.busdat(bus,choice)
Siemens Power Academy TD – NA - PSSC 500 PSS®E Introduction to Power Flow and Steady State Analysis 7-35
Traditional Scripting Options:
Response Files and IPLAN Programs
s
Response File IPLAN
program busarea
en
CASE savnw integer ibus,ierr,ival
BAT_FNSL, 0, 0, 0, 1, 1, 0, 99, 0 ; string strval
BAT_ALPH 0 1
push 'case'
push 'savenw.sav'
© 2015 Siemens Industry, Inc., Siemens Power Technologies International (Siemens PTI)
push 'bat_fnsl, 0, 0, 0, 1, 1, 0, 99, 0 ;'
e m call inibus(0,ierr)
loop
call nxtbus(ibus,strval,ierr)
if (ierr<>0) then exitloop endif
call busint(ibus,‘AREA',ival,ierr)
report ibus,ival
while (true)
end
Si
Siemens Power Academy TD – NA - PSSC 500 PSS®E Introduction to Power Flow and Steady State Analysis 7-36
IPLAN vs. Python: Syntax
s
IPLAN program Python script
en
program busarea
integer ibus,ierr,ival
string strval psspy.case('savnw.sav')
© 2015 Siemens Industry, Inc., Siemens Power Technologies International (Siemens PTI)
push 'bat_fnsl, 0, 0, 0, 1, 1, 0, 99, 0 ;'
psspy.inibus(0)
call inibus(0,ierr)
loop
call nxtbus(ibus,strval,ierr)
m
if (ierr<>0) then exitloop endif
call busint(ibus,‘AREA',ival,ierr)
e
report ibus,ival
while (true)
end
while True:
ierr,busnum,busname = psspy.nxtbus()
if ierr != 0: break
ierr,busarea =
psspy.busint(busnum,'AREA')
psspy.report('%s %s' % (busnum,busarea))
Si
Siemens Power Academy TD – NA - PSSC 500 PSS®E Introduction to Power Flow and Steady State Analysis 7-37
IPLAN vs. Python: Development
s
IPLAN Python
en
1. Write Python code
1. If necessary, review how to compile 2. Run Python code
IPLAN and/or set up Windows 3. If errors, edit code and go to step 2
shortcut to compile this program
2. Edit IPLAN code
© 2015 Siemens Industry, Inc., Siemens Power Technologies International (Siemens PTI)
3. Compile IPLAN code
4.
5.
6.
e Run IPLAN code
m
If compile errors, go to step 2
Siemens Power Academy TD – NA - PSSC 500 PSS®E Introduction to Power Flow and Steady State Analysis 7-38
APIs – Driving PSS®E
s
n IPLAN's data fetching routines can “get” PSS®E data.
One has to use 'PUSH' commands to change data.
en
n PSS®E's API functions can, in addition to executing
the “activities,” change data and retrieve data.
© 2015 Siemens Industry, Inc., Siemens Power Technologies International (Siemens PTI)
e m
Si
Siemens Power Academy TD – NA - PSSC 500 PSS®E Introduction to Power Flow and Steady State Analysis 7-39
PSS®E APIs in Python
s
n PSS®E's APIs are available as functions in Python
n Defined in the psspy module
en
- Which is automatically loaded by PSS®E
n Same as the PSS®E Batch Commands
- Except: python-esque calling syntax
© 2015 Siemens Industry, Inc., Siemens Power Technologies International (Siemens PTI)
n General Rule: Where there's an Activity, there's an API.
e m
Si
Siemens Power Academy TD – NA - PSSC 500 PSS®E Introduction to Power Flow and Steady State Analysis 7-40
Example of API
s
n Using Response File to change line rating A to 1000 MVA:
en
BAT_BRANCH_DATA,151,152,'1',,,,,,,,,,1000.0,,,,,,,,,,,,;
n Using Python:
© 2015 Siemens Industry, Inc., Siemens Power Technologies International (Siemens PTI)
e
Note:
m
psspy.branch_data(151,152, ’’1’’, [_i,_i,_i,_i,_i,_i],
[_f,_f,_f, 1000.0,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f])
Siemens Power Academy TD – NA - PSSC 500 PSS®E Introduction to Power Flow and Steady State Analysis 7-41
PSS®E Command Recording
s
n PSS®E can "echo" commands into a file
- Batch, IDEV … and now Python!
en
n Make a "prototype" Python script by recording GUI
activities
© 2015 Siemens Industry, Inc., Siemens Power Technologies International (Siemens PTI)
- Provides basic syntax for psspy function calls and rough
e outline of code.
m
Si
Siemens Power Academy TD – NA - PSSC 500 PSS®E Introduction to Power Flow and Steady State Analysis 7-42
Problem 7-4 Creating a Python Program by
Recording
s
Want to create a Python file to:
n CASE in a power flow model.
en
n Solve using Full Newton-Raphson Solution, with taps, phase-shifters and area
interchange controls enabled.
© 2015 Siemens Industry, Inc., Siemens Power Technologies International (Siemens PTI)
n Click on File>Open to pick up saved case.
m
n Click on Power Flow>Solution>Solve to solve.
n Click on I/O Control>Stop Recoding to close Python file.
Siemens Power Academy TD – NA - PSSC 500 PSS®E Introduction to Power Flow and Steady State Analysis 7-43
Advanced Python Applications - Graphics
s
n No built-in plotting package for Python, but many 3rd-
party add-on modules.
en
- Some can do more than others
- Some are easier to use than others
- Many are wrappers around existing packages
© 2015 Siemens Industry, Inc., Siemens Power Technologies International (Siemens PTI)
e m
Si
Siemens Power Academy TD – NA - PSSC 500 PSS®E Introduction to Power Flow and Steady State Analysis 7-44
Windows Programming with Python
s
n Can connect to another computer program on the
Windows platform
en
n For example,
- Use a spreadsheet program for Input/Output
- Use a database program to store power system data
© 2015 Siemens Industry, Inc., Siemens Power Technologies International (Siemens PTI)
e m
Si
Siemens Power Academy TD – NA - PSSC 500 PSS®E Introduction to Power Flow and Steady State Analysis 7-45
s
en
m
Customizing Toolbars
e
Si
© 2015 Siemens Industry, Inc. All rights reserved
Customizing Toolbars
s
Tools>Configure Custom Toolbar Buttons …
n Can associate a button with batch command, IPLAN program or
en
Python file.
© 2015 Siemens Industry, Inc., Siemens Power Technologies International (Siemens PTI)
e m
File contains response file commands
or Python language or IPLAN Tooltip
displayed on
button
File name and
location
Si
Siemens Power Academy TD – NA - PSSC 500 PSS®E Introduction to Power Flow and Steady State Analysis 7-47