KHÓA ĐÀO TẠO TÍNH TOÁN ỔN ĐỊNH VÀ ỨNG DỤNG TRÊN PHẦN MỀM PSSE CHO KỸ SƯ HỆ THỐNG ĐIỆN (Sử dụng Ngôn ngữ lập trình Python trong Phần mềm PSSE): • Introduction• Application Program Interface• PSS®E Extension Modules• Power Flow Operation• Power Flow Data Changing • Subsystem Definition• Dynamics Simulation• Single Element and Subsystem Data Retrieval• Results Data Retrieval
Trang 1TRANSMISSION &
DISTRIBUTION
A Division of Global Power
POWER SYSTEM STABILITY CALCULATION TRAINING
D 14 15 A t ti i P th Day 14-15 - Automation using Python
December 5, 2013 Prepared by: Mohamed El Chehaly
Trang 22
OUTLINE
• Introduction
• Application Program Interface
• PSS®E Extension Modules
• Power Flow Operation
• Power Flow Data Changing
• Power Flow Data Changing
• Subsystem Definition
• Dynamics Simulation
• Single Element and Subsystem Data Retrieval
• Results Data Retrieval
Trang 3INTRODUCTION eBook for You
Trang 4Introduction to PSS®E Automation
4 INTRODUCTION
Introduction to PSS®E Automation
Response files or “idv”: Contains a set of
instructions and inputs emulating the
program operation manual
IPLAN programs:
Simple programming language designed forp p g g g g g
PSS®E
Created in a text editor and compiled
Limited capabilities compared to modern
programming languages
Trang 5Introduction to PSS®E Automation
In PSS®E since version 30
Faster development, flexibility, power data
processing and easy integration with other
applications and programming languages
Trang 6Recording an Automation File
6 INTRODUCTION
Recording an Automation File
Trang 7Running an Automation File
7 INTRODUCTION
Running an Automation File
Trang 9Controlling PSS®E Using the API
9 APPLICATION PROGRAM INTERFACE
Controlling PSS®E Using the API
Set of callable routines for building
software applications
API is the primary and recommended
method for accessing PSS®E functionality
method for accessing PSS®E functionality
for automation
API is described in manual PSS®E
API is described in manual PSS®E
Application Program Interface
Descriptions of the syntax for using each
Descriptions of the syntax for using each
API routine in each automation method
Siemens PTI support users who use batch
Siemens PTI support users who use batch
commands and Python programs only.
Trang 10Default Values
10 APPLICATION PROGRAM INTERFACE
Default Values
_i: Default integer value
_f: Default real value
Trang 11PSS®E EXTENSION MODULES
PSS®E EXTENSION MODULES eBook for You
Trang 12Modules for Python
12 PSS®E EXTENSION MODULES
Modules for Python
Psspy: Provides access to the PSS®E API
Pssarrays: Provides Python functions to
retrieve PSS®E solutions results
Pssexcel: Provides Python functions
export PSS®E data or solution results to
export PSS®E data or solution results to
Trang 13Modules for Python
13 PSS®E EXTENSION MODULES
Modules for Python
Excelpy: Provides Python functions to
interface with Excel (create, populate and
format workbooks)
Dyntools: Tools for processing channel
Dyntools: Tools for processing channel
output files
Trang 1414 PSS®E EXTENSION MODULES
PSSPY
Power Flow Operation
Power Flow Data Changing
Optimal Power Flow
Dynamic Simulation
Subsystem Definition
Diagram View APIs
Single Element Data Retrieval
Subsystem Data Retrieval
Trang 15POWER FLOW OPERATION eBook for You
Trang 1616 POWER FLOW OPERATION
CASE
Use this API to open a Saved Case (.sav)
Trang 1818 POWER FLOW OPERATION
SAVE
Use this API to save a Saved Case (.sav)
Trang 2121 POWER FLOW OPERATION
DSCN
Use this API to disconnect a bus
Trang 2222 POWER FLOW OPERATION
PURG
Use this API to delete an equipment
Trang 23Other Functions
23 POWER FLOW OPERATION
Other Functions
POUT: Print the power flow solution results
ANSI: Calculate fault currents according to
ANSI: Calculate fault currents according to
ANSI
ASCC2: Apply a series of fault at various
ASCC2: Apply a series of fault at various
Trang 24Other Functions
24 POWER FLOW OPERATION
Other Functions
PV_ENGINE3: Run PV analysis
QV ENGINE: Run QV analysis
CONG: Convert generators
CONL: Convert loads
ORDR: Calculate a sparsity preserving
ordering of buses
FACT: Factorize the network admittance
matrix
TYSL: Run switching study network solutions
Trang 25POWER FLOW DATA
POWER FLOW DATA
CHANGING
Trang 26Main Functions
26 POWER FLOW DATA CHANGING
Main Functions
The API routines that contain “_DATA” can
be used to add a new network element or
be used to add a new network element or
modify an existing one
Trang 27Main Functions
27 POWER FLOW DATA CHANGING
Main Functions
The “_CHNG” API routines can be used
only to modify the data of an existing
only to modify the data of an existing
network element (only in PSS®E 33)
Trang 28Main Functions
28 POWER FLOW DATA CHANGING
Main Functions
The “SEQ_” API routines are always used
to modify data of an existing element
Trang 29SUBSYSTEM DEFINITION eBook for You
Trang 30Types of Subsystems
30 SUBSYSTEM DEFINITION
Types of Subsystems
ASYS: Area subsystem
BSYS: Bus subsystem
OSYS: Owner subsystem
ZSYS: Zone subsystem
Trang 32DYNAMIC SIMULATION eBook for You
Trang 33Dynamic Simulation Function
33 DYNAMIC SIMULATION
Dynamic Simulation Function
DYRE_NEW
Clear dynamics working memory
Read a Dynamics Data file (.dyr)
Place the model references specified on its data
Place the model references specified on its data
records into dynamics working memory
Trang 34Dynamic Simulation Function
34 DYNAMIC SIMULATION
Dynamic Simulation Function
STRT
Initialize a dynamic simulation
Specify the Channel Output File (.out)
Verify that the initial condition are satisfactory
Trang 35Dynamic Simulation Function
Trang 36Dynamic Simulation Function
36 DYNAMIC SIMULATION
Dynamic Simulation Function
RUN
Calculate state-space dynamic simulation
Trang 37Output Channel API
37 DYNAMIC SIMULATION
Output Channel API
CHSB: General Output Channel Related
Function
Specify on a subsystem basis the simulation
variables to monitor during dynamic simulation
variables to monitor during dynamic simulation
Trang 38Output Channel API
38 DYNAMIC SIMULATION
Output Channel API
CHSB: General Output Channel Related
Monitor machine angle statistics
Trang 39Output Channel API
39 DYNAMIC SIMULATION
Output Channel API
Assign channels to monitor individual
quantities for one element
Machine Quantities
Branch Quantities (branch two winding
Branch Quantities (branch, two-winding
transformers, three-winding transformer)
Bus Quantities (voltage and angle)( g g )
Load Quantities (P and Q)
State Channel
Variable Channel
Trang 40Disturbance API
40 DYNAMIC SIMULATION
Disturbance API
Fault applying APIs
dist_branch_fault: Apply a fault at the IBUS end
of line or a two-winding transformer
dist bus fault: Apply a fault at a bus
dist_3wind_fault: Apply a fault at the IBUS end
of a three-winding transformer
dist_scmu_fault: Calculate an unbalanced fault
and apply the equivalent positive sequence fault
admittance at a bus
dist_spcb_fault_2: Calculate a branch unbalance
and apply the equivalent positive sequence pi
model at a branch
Trang 41Disturbance API
41 DYNAMIC SIMULATION
Disturbance API
Fault applying APIs
dist_clear_fault: Clear a fault
Tripping APIs
dist_branch_trip: Set a line or a two-winding
transformer to out-of-service
dist bus trip: Disconnect a bus
dist_3wind_trip: Set a three-winding transformer
Trang 42Dynamic Model API
42 DYNAMIC SIMULATION
Dynamic Model API
Add a new dynamic model
Modify the CON, ICON, or VAR of an
List or remove from dynamic working
memory models that are not present in the
current power flow case
current power flow case
Trang 43Dynamic Model API
43 DYNAMIC SIMULATION
Dynamic Model API
Type of models include:
Induction machine (only in PSS®E 33)
Trang 44SINGLE ELEMENT AND
SINGLE ELEMENT AND
SUBSYSTEM DATA
RETRIEVAL
Trang 45Data Retrieval
45 SINGLE ELEMENT AND SUBSYSTEM DATA RETRIEVAL
Data Retrieval
Type of retrieved data:
Return an array of one or a set of integer data
Return an array of one or a set of integer data
values (number, area, zone, owner, status, …)
Return an array of one or a set of real data values
(bus voltage, bus angle, PGEN, QGEN, branch
reactance, PLOAD, …)
Return an array of one or a set of complex data
Return an array of one or a set of complex data
values (voltage and angle, real and reactive
power, …)
Return an array of one or a set of character data
values (name, ID, …)
Return the number of elements in a subsystem
Return the number of elements in a subsystem
(count)
Trang 46RESULTS DATA RETRIEVAL
RESULTS DATA RETRIEVAL
MODULE
Trang 47Results Data Retrieval
47 RESULTS DATA RETRIEVAL MODULE
Results Data Retrieval
API routines used as to retrieve results
from the solutions/calculations in the form
of arrays
Produce customized reports or exported
to a text file or an Excel spreadsheet
Cannot be recorded
Not part of the psspy module
Trang 4848 RESULTS DATA RETRIEVAL MODULE
PSSARRAYS
AC Contingency (ACCC)
ACCC summary: Return AC Contingency
monitored elements labels, contingency labels
ACCC solution: Return ACCC post-contingency,
post-tripping or post-corrective action solution
monitored MVA flows, ampere flows and bus p
voltages for each contingency
ACCC summary report, ACCC solution report,
ACCC violation report: Generate text report for
ACCC violation report: Generate text report for
each ACCC module
Trang 4949 RESULTS DATA RETRIEVAL MODULE
PSSARRAYS
Short-circuit studies
ASCC currents: Return short-circuit currents and
Thevenin impedance in three-phase ac systems
from ASCC 2 API Results are returned for bus
from ASCC_2 API Results are returned for bus
faults only
IECS currents: Return short-circuit currents and
Thevenin impedance in three-phase ac systems
according to IEC 60909 standard Results are
returned for bus faults only
Trang 5050 RESULTS DATA RETRIEVAL MODULE
PSSARRAYS
Short-circuit studies
ASCC currents: Return short-circuit currents and
Thevenin impedance in three-phase ac systems
from ASCC 2 API Results are returned for bus
from ASCC_2 API Results are returned for bus
faults only
IECS currents: Return short-circuit currents and
Thevenin impedance in three-phase ac systems
according to IEC 60909 standard Results are
returned for bus faults only
Trang 5151 RESULTS DATA RETRIEVAL MODULE
PSSARRAYS
PV analysis
PV summary: Return PV analysis summary
PV solution: Return PV analysis monitored flows
and bus voltages for each defined case
and bus voltages for each defined case
PV summary report, PV solution report: Generate
text report for each PV module
QV analysis
QV summary: Return QV analysis summary
QV solution: Return QV analysis monitored flows
and bus voltages for each defined case
QV summary report QV solution report:
QV summary report, QV solution report:
Generate text report for each QV module
Trang 52 IEC data file
pssexcel iec data file
Trang 53QUESTIONS?
Trang 54WE CARE embodies SNC-Lavalin’s key corporate values and y p beliefs It is the cornerstone of everything we do as a company
Health and safety, employees, the environment, communities and quality: these values all influence the decisions we make
every day And importantly, they guide us in how we serve our clients and therefore affect how we are perceived by our external
partners WE CARE is integral to the way we perform on a daily
b i It i b th ibilit d f ti f ti d basis It is both a responsibility and a source of satisfaction and pride by providing such important standards to all we do.
WE CARE about the health and safety of our employees, of those who work under our care, and
of the people our projects serve.
WE CARE about our employees, their personal growth, career development and general
well-WE CARE about our employees, their personal growth, career development and general well
being.
WE CARE about the communities where we live and work and their sustainable development, and we commit to
fulfilling our responsibilities as a global citizen.
fulfilling our responsibilities as a global citizen.
WE CARE about the environment and about conducting our business in an environmentally responsible manner.
WE CARE about the quality of our work.