Pscad Manual PDF
Pscad Manual PDF
Pscad Manual PDF
PSCAD
Power Systems Computer Aided Design
Microsoft Windows XP, Windows 7, Vista, Developer Studio are the registered
trademarks or trademarks of Microsoft Corporation in the United States and other
countries.
UNIX is a registered trademark in the United States and other countries licensed
exclusively through X/Open Company.
Compaq and the names of Compaq products referenced herein, are either
trademarks and/or service marks or registered trademarks and/or service marks
of the Compaq Computer Corporation.
Print history:
I would not be truthful if I said I expected it to evolve as it had. The time and
energy needed for this fundamental change far exceeds anyone’s expectations.
One of the traits that keeps the faith is the belief the solution is just around the
corner. The road winds and bumps, the wind pushes back, but every wayside
along the way bears fruit and reinforces the promise of the “road less traveled.”
Of the many goals of the original vision for “neXus,” most have been delivered on
the promise and have been brought to the table here. The techniques and ideas
have been realized into a whole. Every part has been revisited and refined to
share and interact with an all new smooth backbone of information. This intimacy
of form and function is a new place; a new sunny beachfront with which a re-
freshing start is made.
The best part is that this is only the beginning of a whole new exciting series of
changes to come that could never be done in the past. Tools and methods that
were not possible before are now possible and in fact, very close at hand. It will
be an exciting time ahead, and we are happy to share in the experience.
Table of Contents
About This Guide.......................................................................... xxv
Organization............................................................................... xxv
Toolbar Buttons................................................................. 45
Workspace and Output Windows........................................... 45
Loading a Case Project.......................................................... 46
Running a Simulation............................................................. 48
Printing the Circuit.................................................................. 49
The Workspace........................................................................... 49
Moving and Resizing the Workspace Window....................... 50
The Primary Window.............................................................. 51
The Files Branch............................................................... 51
Module Folders............................................................ 52
Transmission Lines and Cable Files............................ 52
RTP/COMTRADE Recorder Files................................ 53
Active Project.................................................................... 53
The Master Library............................................................ 53
The Secondary Window......................................................... 54
Module/TLine/Cable Hierarchy Branch............................. 54
Definitions Branch............................................................. 55
Runtime Objects in the Definitions Branch....................... 59
Transmission Lines and Cables................................... 61
Observers.................................................................... 62
Group Name Based Sorting.............................................. 63
The Output Window..................................................................... 64
Moving and Resizing the Output Window.............................. 64
Errors and Warnings.............................................................. 65
Build Messages................................................................. 65
Runtime Messages........................................................... 65
Locating the Problem Source................................................. 66
Search............................................................................... 66
The Definition Editor.................................................................... 67
Viewing Windows................................................................... 67
Circuit................................................................................ 67
Graphic............................................................................. 67
Parameters....................................................................... 67
Script................................................................................. 67
Fortran.............................................................................. 68
Data.................................................................................. 68
Other Important Features............................................................ 68
Menus.................................................................................... 68
Main Menu Bar.................................................................. 68
Right-Click Pop-Up Menus................................................ 69
Library Pop-Up Menus...................................................... 69
Grouping of Components within the Menu.................. 69
Toolbars.................................................................................. 70
Main Toolbar..................................................................... 70
Status Bar......................................................................... 71
Rotation Bar...................................................................... 71
Runtime Bar...................................................................... 71
Electrical Palette............................................................... 72
Control Palette.................................................................. 73
Graphic/Script Bar............................................................. 74
Graphic Filter Bar.............................................................. 75
Keyboard Shortcuts................................................................ 76
General............................................................................. 76
Wires................................................................................. 77
Plotting.............................................................................. 78
PSCAD Temporary Directories.................................................... 79
PSCAD On-line Help System...................................................... 79
Look and Feel........................................................................ 80
The Help Toolbar.................................................................... 80
The Navigation Pane.............................................................. 81
Contents............................................................................ 81
Index................................................................................. 81
Search............................................................................... 82
Favourites......................................................................... 82
The Main Viewer.................................................................... 83
Tutorial Projects.......................................................................... 83
Voltage Divider....................................................................... 83
Fast Fourier Analysis.............................................................. 83
Simple AC System with a Transmission Line......................... 83
Use of Control Arrays............................................................. 84
Use of Slider, Switch, Button, and Dial................................... 84
Interpolation........................................................................... 84
Generating a Legend and using PSCAD Macros................... 84
Chatter Elimination................................................................. 84
Multiple Run........................................................................... 84
Model-Data..................................................................... 373
Matrix-Fill........................................................................ 374
T-Lines............................................................................ 376
Undo and Redo.................................................................... 377
Segment Display Settings.................................................... 377
Internal Output Variables........................................................... 378
Outputting EMTDC Measured Voltages and Currents ........ 378
CBR................................................................................ 378
VDC................................................................................ 379
Adding A Reference To A Source File........................................ 379
Interfacing To C Language Source............................................ 379
Calling C Procedures Directly.............................................. 380
Compaq Visual Fortran 6................................................ 382
Calling C Procedures through a Fortran Interface Routine.. 382
Tutorial: Creating A New Component....................................... 383
Adding Graphics................................................................... 384
Adding a User Interface....................................................... 385
Adding Conditional Statements to the Graphic Objects....... 387
Defining the Electrical Branch.............................................. 389
Adding Code to Define the Source....................................... 390
The #BEGIN Block.......................................................... 391
Storage and Dynamics Script......................................... 391
Sanity Checks...................................................................... 392
Testing Your New Component.............................................. 393
Adding Internal Output Variables......................................... 393
Running With Your Component............................................ 395
#WINDINGS......................................................................... 423
~ Line Continuation Operator.................................................... 423
Expression Evaluation............................................................... 425
Mathematical Functions....................................................... 425
Arithmetic Operators............................................................ 426
Ternary Operator.................................................................. 428
Index.............................................................................................. 489
Organization
The PSCAD User’s Guide is organized in the following manner:
Chapter 1:
What is PSCAD?
PSCAD (Power Systems Computer Aided Design) is a powerful and
flexible graphical user interface to the world-renowned, EMTDC
electromagnetic transient simulation engine. PSCAD enables the
user to schematically construct a circuit, run a simulation, analyze
the results, and manage the data in a completely integrated,
graphical environment. Online plotting functions, controls and
meters are also included, enabling the user to alter system
parameters during a simulation run, and thereby view the effects
while the simulation is in progress.
The following are some common models found in the PSCAD master
library:
A Paradigm Shift
As with many software products, the need to continually improve
PSCAD creates pressure to add newer and better features that make
the users’ experience an enjoyable one. Continuous development
over time however, can lead to a situation where the application
code body becomes a complicated mess of patch work and shoe-
horned feature implementations. Further development of the product
becomes more and more difficult as new mechanisms are put in
place that perhaps do not fit well in the overall architecture. A smart
development team will recognize when its software reaches this
juncture and take effective action. In 2006, this time came when the
PSCAD user base began to demand a simulation environment where
they could perform studies of different types, such as load flow, in
addition to EMTDC-based electromagnetic transients studies.
There are other important issues to consider both before and after
importing older projects into PSCAD X4. For more details on this,
please see Converting PSCAD v4.1 and v4.2 Projects to X4 in
Chapter 13 of this manual.
Graphic Name
Saturable Reactor
Spark Gap
X to the Power Y
Force to DSDYN
Force to DSOUT
XY Table
C-Type Filter
• Enhanced Log File Output: The *.log file format for the
Frequency Dependent (Phase) model has been updated to
make it more readable.
Contact your local PSCAD representative first for fast and efficient
service. If you do not have their contact address from the time you
purchased PSCAD, you can get it either from the PSCAD Web Site
(www.pscad.com) or by contacting the Centre directly. To make the
best use of our technical support and sales facilities you should have
a maintenance contract arranged through your local PSCAD supplier.
E-mail: [email protected]
Phone: +1 (204) 989-1240
Fax: +1 (204) 989-1277
Web Site: www.pscad.com
Address: PSCAD Support Services
Manitoba HVDC Research Centre Inc.
211 Commerce Drive
Winnipeg, Manitoba R3P 1A3 CANADA
To send a support query, go to the Main Menu bar and select Help |
Support Request...
This will bring-up the Support Request dialog window. Simply add
your comments in the space provided. Please ensure that you
select a Description of the Problem from the drop list, which most
adequately describes your problem type. When finished, press the
Send button. An email will be sent directly to the PSCAD Support
Desk.
Membership
To become a member of the PSCAD Community Forum, you must
have a passion for PSCAD/EMTDC! To add your name to the
forum’s worldwide member list, simply access the site (details below)
and register online. There is no membership fee.
Forum Details
The PSCAD
Users can submit their questions/comments/examples regarding
PSCAD or related software by posting under the appropriate
Community Forum forum. Your post will immediately be viewable to all registered
should not be used as members. If you are responding to an existing topic, the forum will
a support medium. If
you have queries automatically send an email to the member who posted the topic.
regarding problems
simulating with
PSCAD, bug reports,
etc., please contact the PSCAD Community Forum: bb.pscad.com
PSCAD Support desk
at support@pscad.
com. Contacting PSCAD Sales
the support desk For sales related inquiries (i.e. quotations, etc.), we can be reached
will ensure a prompt
response to your at:
query.
E-mail: [email protected]
Phone: +1 (204) 989-1240
Fax: +1 (204) 989-1277
Web Site: www.pscad.com
Address: PSCAD Sales
Manitoba HVDC Research Centre Inc.
211 Commerce Drive
Winnipeg, Manitoba R3P 1A3 CANADA
Chapter 2:
License Management
All PSCAD software editions, except the Student Edition, must
be licensed. Licensing is organized and controlled using License
Manager software, which can exist either as a separate, standalone
program, or embedded within PSCAD itself.
Multi-User Licensing
The multi-user licensing (MUL) method was first introduced with
The license manager
can only license
PSCAD V3, and was then the only licensing option available. With PSCAD clients that
this configuration, the license manager software is installed as a are on the same
standalone program, which can be accessed by any computer (in- network as itself, and
where the network
cluding the host), on a Local Area Network (LAN). is constrained by
its network class
(the term ‘network
A multi-user set-up is capable of providing multiple users on multiple class’ is defined by
machines the ability to run multiple combinations of various licens- RFC-960, which is
able editions of PSCAD. In other words, if a user is sufficiently li- part of the Internet
Protocol Standards).
censed, this method has the potential to afford a lot of freedom when The subnet masks
operating over a LAN, and should be used if there will be several on the PSCAD and
license manager
PSCAD users. machines may need
to be adjusted, so that
In multi-user licensing, the license manager is used in conjunc- PSCAD can contact
the license manager
tion with a hardware lock (also known as a dongle), which contains machine
licensing information for the purpose of validation. When an instance
of PSCAD is started somewhere on the LAN, a license will be re-
quested from the license manager. The license manager determines
whether a license is available, and checks the information on the
dongle for verification.
Single-User Licensing
Single-user licensing (SUL) still involves the use of a dongle, but a
standalone license manager program is not required. Here, an em-
bedded license manager, within the PSCAD program itself, manages
the licenses.
Trial Licensing
In order to simplify the evaluation process, and to provide access to
full PSCAD functionality, trial licensing is available for the educational
and professional editions. A trial license is a special type of single-
user license, where a time limit is mandatory and the user may only
possess a single trial license. V4.3 is used
With trial licensing, neither the license manager nor the dongle is re-
quired. However, the user must request a trial license after PSCAD
is installed. Note that until the trial license is approved and sent
by the Manitoba HVDC Research Centre Inc., the installed copy of
PSCAD will function as a Student Edition (SE), with all SE limitations
Do not upgrade your
imposed (i.e. 15 electrical nodes maximum). operating system,
hard drive, or network
card during the
Trial licenses are locked to the hardware and registry of a particular duration of the trial
machine and are therefore not transferable from one machine to license period. Any
one of these changes
another. The latest installed trial license will overwrite any previously will cause your
existing trial licenses. trial license to be
invalidated.
License Key
The license key is an ASCII text file named ‘license.txt,’ which usually
exists as an electronic file, is required for both the PSCAD profes-
sional and educational editions. This file contains encrypted informa-
tion designed to act as a ‘Key’ to adding or upgrading licenses (both
single-user and standalone) to the license database file, which is
used directly by the license manager.
lha, Pro, Remote, 7327, 177, Mon Aug 22 10:45:42 2005, Mon Aug 22 10:48:39 2005
lha, Pro, Remote, 7328, 176, Mon Aug 22 10:46:21 2005, Mon Aug 22 10:49:17 2005
Description:
If you generated your
trial license request
8. PSCAD will then open a new email form from your default file at an earlier time,
you do not need to
email tool. The body of the email will contain the information add the text to the
given in Step 4 and the sending address is set to PSCAD body of the email, as
this is contained within
Sales ([email protected]). your trial license
request file anyway.
Do not upgrade your
operating system,
9. Remember to manually attach the trial license request file to change your system
email in Step 8 (the file will located in the directory specified clock, or change any
hardware configura-
in Step 3). Send the email to PSCAD Sales (sales@pscad. tion (i.e. hard drives,
com). You should receive a response within the next couple motherboard, etc.)
while waiting for your
of days. See the next section entitled Installing a Trial trial license Key
License upon receipt of your trial license key.
4. In the trial license area of this dialog, enter the filename and
path to your ‘Trial.txt’ file in the input field entitled Install
Trial License or press the Browse button to navigate to the
file. Once entered, press the Install button directly to the
right of this field.
If the license does
not install correctly,
please contact us
5. If trial license is installed correctly, a trial license installation at PSCAD Support
dialog will appear confirming this, along with the expiry date Services (support@
pscad.com).
of the Trial License. Click the OK button.
When you run this program, a DOS based window should appear
similar to that shown above.
A text file will also be created at the same time called ‘getinfo.txt’ (as
indicated above). This is an important file to include when contacting
PSCAD Support Services by email ([email protected]).
Windows XP/Vista/7
• Right-click on your My Computer desktop icon and select
Manage.
• Double-click on the Services and Applications entry and
then double-click Services.
• Highlight HVDC License Manager, right-click and select
Start.
Windows XP/Vista/7
Chapter 3:
Workspace Settings
• Projects
• Runtime
• Fortran
• Matlab
• License
• Associations
Graphics Settings
• Options
• Diagnostics
Workspace Options
Environment
The environment section contains a variety of user preferences per-
taining to the working environment.
Projects
The projects section contains a variety of user preferences related
specifically to projects.
You can either enter the path directly, or use the browse
button to select the directory. This path may be changed at
any time.
• Update parameter keys: This option is important for
ensuring that component parameters are kept up to date
when new versions of the associated component definition
become available. Component parameters may be added or
subtracted between versions of a component definition (ex.
master library components). PSCAD cannot automatically
detect and update these changes, so this option forces
PSCAD to scan each component on load to synchronize the
parameters. If you are sure there are no changes to any
components used in your project, you can set this option to
No action.
Build
The build section is used to adjust compiler check settings and mes-
sages.
Runtime
The runtime section is used to adjust compiler check settings and
messages related to system memory and runtime related issues.
Dependencies
This area contains settings related to dependent files and folders:
External Tools
This area contains settings related to external software tools:
Graphics Diagnostics
This area contains settings related to the painting of graphics in
PSCAD:
System Settings
FORTRAN
The FORTRAN section is used to set-up FORTRAN related settings.
MATLAB
The MATLAB section is used to set-up MATLAB/Simulink interface
related settings.
Interface Settings
The interface settings area is used to set-up a directory path to the
MATLAB installation libraries.
Associations
The associations section is used to set-up file association settings.
All file associations specified here, will enable the user to start-up ex-
ternal applications from within PSCAD, by using the File Reference
component.
Enter the file extension (without the period) and press Enter. Either
double left-click the box directly to the right of the new extension, or
press the Browse (...) button to enter a path to the corresponding
Browse Button
Removing an Association
Simply select the association to be removed and then press the
Remove button.
That's all there is to it! The next time the File Reference component
is double-clicked, it will start the associated application and open the
specified file.
License
The License section is devoted to license manager and other
licensing preferences and features.
License Host
The hostname of the license manager server machine on your
network.
Trial License
The Trial License area is used only when requesting and installing a
trial license.
Available License(s)
The Available License(s) area is used for switching between avail-
able licenses.
Active License
The Active License area is used only when requesting and installing
a trial license.
Chapter 4:
Terminology
The following comprises the most popular terms used when
discussing the PSCAD environment. It is important to become
familiar with this terminology, as it will help greatly in the
comprehension of topics discussed hereafter.
Definitions
A definition is the underlying ‘blueprint’ of a component or module,
and is where all design aspects of the associated model are defined.
This may include graphical appearance, port connections, input
parameters and model code and/or circuit layout. Only one definition
can exist for every unique component or module.
Instances
An instance is a graphical ‘copy’ of the definition, and is normally
what is seen and manipulated by the user. An instance is not exactly
a copy; each instance is its own entity, and may have different input
parameter settings, or even appear graphically different from other
instances.
Projects
Everything involved in a particular simulation (except output files) is
harboured within a single file called a project. Projects can contain
stored definitions, on-line plots and controls, and of course the
schematically constructed system itself. There are two types of
projects in PSCAD: Library and Case projects.
Case
Case projects (or simply ‘cases’) are where most work is performed
in PSCAD. In addition to performing the functions of a library project,
cases may be compiled, built and run. Simulated results can be
Library
Library projects are used primarily to store definitions. Instances
of definitions stored in a library, can be used within any case
project. Library projects are saved with the file extension ‘*.pslx.’
If you can successfully run the example project at the end of this
chapter, it will also mean that your installation was successful. So
let’s begin!
Starting PSCAD
Go to Start | All Programs | PSCAD in the Windows Start menu,
and select the PSCAD application to start it. You will see the main
PSCAD environment, as shown below.
There is a list of items across the top of the environment (File, Edit,
etc.), which are part of the main menu. The buttons directly below
the main menu are part of the main toolbar.
To select an item from this list, first move the pointer onto that item
and then left click. The following menu shows how to load a project
using the File menu from main menu bar.
Toolbar Buttons
The row of buttons directly below the main menu bar comprises the
main toolbar.
After you become more familiar with the program, you may also
begin to use the many keyboard shortcuts available. See Keyboard
Shortcuts for more details.
The workspace gives you an overall view of any library and/or case
projects loaded. You can use it to perform a wide variety of activities,
such as navigation or accessing files for example.
To load an existing case project, click on File in the main menu bar
and select Load Project... You can also either press Ctrl + O or
click the Load button in the main toolbar.
You should see the Load Project dialog appear on your screen. By
default, the selected file type is All Projects (*.pscx, .pslx) at the
bottom of the dialog.
The workspace window will now list an additional project entitled vdiv
- vdiv (Single Phase Voltage Divider) directly under the master library
project. Double-click on the project title (or right-click and select
Open) in the workspace window to open and view the main canvas
of the project in the Circuit window.
Running a Simulation
Before we run the simulation we will do a simple calculation to
find out what load current and mid-point voltage we should be
expecting. Double-click on the source component to open and view
its properties - note that the source voltage magnitude is 70.71 kV
RMS (or 100 kV peak). Close this dialog by clicking on the Cancel
button at the bottom of the dialog and left-click anywhere in an empty
space on the page, to de-select the selected source component. For
a 100 kV source voltage, we know that the mid-point voltage
should then be 50 kV peak, and the load current should be 50 kA
peak. Now let us run the simulation and actually verify the current
and voltage waveforms.
Watch the graphs as the simulation progresses. If you look near the
bottom-right corner of the environment, you will see a message xx%
complete where xx represents the percentage of the total simulation
length. To the right of it you will also see the current simulation
time, which changes with the simulation. Once again, depending
on the speed of your computer, the simulation may finish almost
instantaneously.
This tutorial case is set up to run for 0.2 seconds. At the end of the
run you will see the message EMTDC run completed in the status
bar. Your plots should look similar to the following, depending on
your plot settings:
Make sure that your simulation produces the same result as shown
here. This is one step towards ensuring that your PSCAD is installed
correctly.
Click again on the Run button to see the run once again. PSCAD
will go through all three stages (i.e. compile, build and run); however,
you may not be able to detect the first two stages, as they pass by
very quickly. This is because PSCAD performs them only if changes
have been made to the circuit.
This should bring up either the Print dialog or the Print Preview
Viewer. The contents of the Print dialog depend on what you are
printing - click the OK button to proceed.
The Workspace
The master library
is always the first
The workspace is a central project database for PSCAD. It not project loaded into
only provides an overview of all projects currently loaded, but also the workspace. The
master library cannot
organizes data files, signals, controls, transmission line and cable be unloaded.
objects, display devices, etc. within an easily navigable environment.
or
Click and hold the left mouse button and drag the mouse pointer to
resize in either the horizontal or vertical direction as shown above.
Icons are included for visual differentiation between case and library
projects. These are listed below:
• Library Project
• Inactive Case Project
• Active Case Project
To view the Files branch, left-click the [+] box beside the project
name:
Note the files will only be visible if you compile the project first (see
Compiling and Building a Project in the next chapter).
The files shown on the main trunk are the map (*.map) and
make (*.mak) files associated with the project. A simple double-
click on any file will open that file in the main viewing area of the
environment. Right-clicking on the file will invoke a pop-up menu:
Module Folders
Most folders in the Files branch represent a module definition. All
files within a particular folder pertain only to the associated module
definition (i.e. data (*.dta) and FORTRAN (*.f) files). It is possible to
navigate to the definition of a module by right-clicking on the folder
and selecting Navigate to....
Active Project
As mentioned earlier, multiple projects may be listed in the
workspace primary window. If a case project is to be compiled and
run, the application needs to know which one. This is accomplished
by selecting an Active case project (right-click on the project and
select Set as Active).
See Setting the Active Project in the next chapter for more details.
users may find this format allows for easier navigation to the correct
Component definitions
component.
stored in the master
library can be viewed, If you want to add any of these components to your own case, simply
but not directly copy the instance directly from the master library and paste into your
modified. If you wish
to modify one of these
own project. You can also use the Library Pop-up Menu system.
definitions, copy the
definition into another The Secondary Window
library project and
rename it first. The secondary window displays data in a project context. That is to
say that its contents are based on whatever project that happens to
be selected in the primary window. The secondary window also acts
as an intra-project navigation tool.
You can expand and detract each branch by clicking on either the [+]
or the [-] symbols respectively.
For example, the case project above (with namespace name test)
contains a main page with two modules called net1 and net2. The
module net1 contains another called sub1. The display format of the
names in this branch is as follows:
<namespace_name>:<definition_name>.<instance_name>
• Module Instance
Definitions Branch
The definitions branch contains a list of all definitions that are stored
within that particular project: Definitions for component or module
instances that exist in a project, but are stored in other projects (ex.
master library components), will not appear in this local definitions
branch.
The image below shows the list of component definitions for the
same case project discussed in the previous section. In addition
to the definitions of each module, the existence of a component
definition (called user_comp) is also indicated.
It is not usually a
good idea to store
component definitions
within case projects.
All component
definitions should
exist exclusively
in library projects
to avoid having to
maintain multiple
versions of the same
definitions.
Right-clicking directly over the definitions branch will bring up a menu
as shown below:
• Component Definition
• Module Definition
• Transmission Line or Cable Definition
Each module definition branch can contain a list of all runtime objects
that exist in that module. Whenever a runtime object is added, a
record of it is immediately added under the appropriate module
definition in the workspace.
• Controls
• Recorders
• Display Devices
• Named Signals
• Radio Links
• TLines/Cables
A left double-click on any runtime object in the list will highlight that
object directly in the corresponding module definition canvas. For
example, double-clicking on the Modulation Index object in the above
diagram will result in the following in Circuit view:
Controls:
Recorders:
Display Devices:
• PolyMeter Instance
• PhasorMeter Instance
• Oscilloscope Instance
Named Signals:
Radio Links:
• Transmitter
• Receiver
TLines/Cables:
• TLine
• Cable
Observers
Output channels and control objects can exist in a project without
being associated with a curve, meter or control interface (i.e. the
data is not plotted or monitored). If any of these objects are added
as a curve to a graph, meter to a control panel, or added directly
to a PolyMeter, PhasorMeter or Oscilloscope, an entry referred to
as an observer will be added as a sub-branch to the corresponding
recorder or control branch. If the object is displayed in more than
one display device, an observer will be added for each occurrence.
The figure below shows the existing controls and recorders in the
Network #1 module definition for a test project. The module contains
a slider component called Slider 1, a two-state switch component
called Switch 1, as well as two output channels entitled Ea and
Switch 1. Each object possesses an observer to indicate that the
output of the objects is being sent to a display device.
Icons are included for all observer types. These are listed below:
Recorders:
• Curve
• Meter
• PolyMeter
• PhasorMeter
• Oscilloscope
Controls:
• Slider
• Dial
• Push Button
The output window will also provide the results of a project search,
using the Search utility, placed under the Search Results tab.
The output window can be resized by moving the mouse pointer over
one of the four window edges until the pointer changes that shown
below:
or
Click and hold the left mouse button, and drag the mouse pointer to
resize in either the horizontal or vertical direction.
• Warning (yellow)
• Error (red)
Build Messages
Build messages are errors and warnings related to the
compilation and building of FORTRAN, data and map files for the
project. PSCAD has the capability of detecting a number of different
types of system inconsistencies related to this. See Common Output
Window Messages for more information.
Runtime Messages
Runtime messages provide error and warning messages related
to the simulation run -that is, messages from sourced from
EMTDC. Runtime messages are usually more serious in nature and
can involve numerical instabilities and other problems of this type.
Search
If a message indicates that the problem is arising at a particular
subsystem and node, then you can utilize the Search utility to
search for this exact location. Simply invoke the Search dialog
(ctrl + f) and in the select Node, enter the Subsystem and Node
indicated in the output window message and select the Search
button.
Viewing Windows
The definition editor is divided into six sub-windows. Each of the
sub-windows can be accessed by simply clicking on the specific
tab on bar at the bottom of the editor window. The tab bar is shown
below for reference:
As you can see, the Script tab is initially disabled (greyed-out). This
tab is used exclusively for non-module component design, and will
not be enabled unless editing a non-module component definition.
See Editing a Component or Module Definition in Chapter 9 for
details on this.
Circuit
The Circuit tab is always the default view when a project is first
opened. This is where all control and electrical circuits are
constructed.
While the Circuit window is open, the Control Palette and Electrical
Palette toolbars are enabled.
Graphic
This Graphic tab is used for editing the graphics of a definition.
Parameters
This Parameters tab is used for editing the parameters of a definition.
Script
This Script tab is used for editing non-module component definition
code.
Fortran
The Fortran tab is a simple text viewer that allows easy access to the
EMTDC Fortran file corresponding to the module definition currently
being viewed. For example, if you are viewing the main page of a
project in Circuit view, the Fortran window (click the Fortran tab) will
show the EMTDC Fortran file corresponding to the main page.
Data
The Data window is a simple text viewer that allows easy access
to the EMTDC input data for any existing electric network,
corresponding to the module being viewed in the Circuit window. For
example, if you are viewing the main page of a project in Circuit view,
the Data window (click the Data tab) will show the EMTDC input data
for the main page.
The main menu bar This bar may appear differently depending on what section of the
contains only some
of the standard
environment you are currently in.
functions. There are
many others available To select a menu item, move the mouse pointer onto that item and
using right-click pop-
up menus.
then click the left mouse button. The following menu shows how to
create a new project using the Build menu.
Toolbars
Toolbars are useful in any program to provide a quick and easy
method to access menu functions. The application includes multiple
toolbars, which contain the most commonly used menu tasks.
The drawing related toolbars allow you to add the most common
drawing objects and components by simply using the left mouse
button: A single click on the toolbar to select an object, and a single
click to add the object to the drawing canvas.
Main Toolbar
The main toolbar resides near the top of the environment. This
bar primarily contains tasks found in the main menu bar, but also
includes others, as well. The individual toolbar buttons are listed
below with a short description:
Button Description
Zoom rectangle
Zoom extents
Pan mode
Navigate backward (select the down arrow for
history)
Navigate forward (select the down arrow for
history)
Up to parent canvas
Status Bar
The status bar is located at the very bottom of the application, and is
not actually a toolbar, but used for the purpose of display only (does
not contain any command buttons). Most of the time, the status bar
is used to monitor the status of a simulation build, link and run, and
will display the percentage complete and the simulation time during
a run.
Rotation Bar
The individual rotation bar buttons are listed below with a short
description:
Button Description
Runtime Bar
The individual runtime bar buttons are listed below with a short
description:
Button Description
Electrical Palette
The electrical palette contains common electrical components used
when building circuits in Circuit view. Most of these button functions
can also be found under the Add Component menu item in the
Circuit view pop-up menu. The individual toolbar buttons are listed
below with a short description:
Button Description
Add wire
Add resistor
Add inductor
Add capacitor
Add ground
Add breakout
Add pin
Add voltmeter
Add multimeter
Control Palette
The control palette contains common control components used when
building circuits in Circuit view. Most of these button functions can
also be found under the Add Component menu item in the Circuit
view pop-up menu. The individual toolbar buttons are listed below
with a short description:
Button Description
Add import
Add export
Add slider
Add switch
Add dial
Add pushbutton
Add xy plot
Add divider
Graphic/Script Bar
The graphic/script toolbar contains functions used only when editing
a definition in either the Graphic section or the Script section. The
individual toolbar buttons are listed below with a short description:
Button Description
Set layers
Add line
Add rectangle
Add ellipse
Add connection
Button Description
Show/hide ellipses
Show/hide arcs
Show/hide lines
Show/hide rectangles
Show/hide text
Show/hide connections
Keyboard Shortcuts
There are many keyboard shortcuts (or hotkeys) available. Hotkeys
help to reduce the ‘amount of clicks’ required for performing a
specific task.
General
Note that the Ctrl key may be dropped where indicated (i.e. [Ctrl +]) if
Cut/Copy/Paste keys in the Workspace Options is set to x,c,v. See
Environment in Chapter 3 of this manual for more.
Shortcut Description
m Mirror selection
f Flip selection
Set component sequence. Note that Assign
s Sequence Numbers Automatically must be
enabled in the Canvas Settings dialog.
Ctrl + a Sellect all
Ctrl + z Undo
Ctrl + y Redo
+ Zoom in
- Zoom out
Ctrl + Shift + Left
Pan (dynamic scroll)
Mouse Hold
Ctrl + Left Double Edit definition of selected component or
Click module
Ctrl + Right Click Invoke the library pop-up menu system
Edit properties of selected component or
Left Double Click
module
Backspace Navigate backwards
F5 Refresh canvas
Wires
To apply any of the following shortcuts, simply move your mouse
pointer over a Wire.
Shortcut Description
d Decompose wire
Plotting
To apply any of the following shortcuts, simply move your mouse
pointer over a plot area. Note that in some instances, the graph
must be selected.
Shortcut Description
w Show y-intercept
c Show cross-hairs (follows curve traces)
Space Bar Switch curves while in cross-hair mode
← → Graph frame dynamic aperture adjustment
There are three main sections of the help system. Across the top is
the help toolbar, and below this are the navigation pane on the left,
and the main viewing window on the right.
Button Description
Contents
The contents tab contains the help system TOC. Left-click on the
corresponding [+] or [-] icons (directly to the left of each branch
respectively) to expand or collapse any branch of the tree.
Index
The index contains a large list of keywords, in alphabetical order,
that have been associated with various topics within the help system.
You have the choice of either scrolling through this list directly, or you
may type in a word into the input field near the top of the index pane,
in order to directly look up a word.
Search
The search section allows you to enter in a single word or a text
string, and then list the topics that contain the word or string. Simply
enter the text string and click the List Topics button. Any topics
containing the string will be displayed in the output field, as shown
below.
The help system
search engine will
search all text in each
topic. Text that exists
within embedded
images will not be
considered.
To bring up a listed topic into the main viewer, simply left double-
click, or select it and click the Display button.
Favourites
The Favourites section allows users to bookmark their favourite help
pages. To add a favourite topic to the favourites list, simply left click
the Add button. To remove a topic from Favourites, select it and left
click the Remove button. To display a topic from the favourites list,
select it and left click the Display button.
Tutorial Projects
The PSCAD software package is installed complete with a directory
of tutorial projects, which contains a variety of simple cases to
illustrate various features. This directory is located within the
installation directory under ...\examples\tutorial.
Once you are familiar with these projects, have a look at the
more detailed projects contained within the main examples
directory. These include a variety of practical examples ranging in
topics from machines to FACTS devices.
Voltage Divider
vdiv_1.psc A simple voltage divider circuit with a resistor
and a resistive source. Demonstrates how
to assemble a circuit, monitor voltage and
current, and run the simulation.
Interpolation
interpolation.psc A simple case illustrating the use of
interpolation.
Multiple Run
multirun.psc A simple example to demonstrate the use
multirun_sld.psc of multiple run features to find the maximum
overvoltage due to a fault in a 3-phase power
system. The point on wave and type of
fault is varied to determine the worst-case
overvoltage.
Chapter 5:
Projects
The following topics focus on the usage and manipulation of case
and library projects.
Select the desired project type to open the Create New Project
dialog.
Enter a unique name for the project in the Name field. A new project
entitled <name> - <name> will appear in the workspace window. You
can also invoke the Create New Project dialog by simply pressing
the New Project button in the main toolbar, or by pressing Ctrl + N
on your keyboard.
Importing a Project
Click the left mouse button on the File item in the main menu bar
and select Import Project....
The Import Project dialog window will open with a default Files of
type as All v4.1 or v4.2 Projects (*.psc, *.psl). Navigate to the
desired project and select it so that its name appears in the File
name field. Click the Open button to import the project. The project
should appear in the workspace window, indicating that the project
was imported.
Loading a Project
Click the left mouse button on the File item in the main menu bar
and select Load Project....
The Load Project dialog window will open with a default Files of type
as All Projects (*.pscx, *.pslx). Navigate to the desired project and
select it so that its name appears in the File name field. Click the
Open button to open the project. The project name should appear in
the workspace window, indicating that the project was loaded.
You can also bring up the Load Project dialog by simply pressing the
Load Project button in the main toolbar, or by pressing Ctrl + O on
your keyboard.
Recent Files
You can load projects that have been loaded previously by accessing
the Files | Recent Files sub-menu. Hold the mouse pointer over the
Recent Files item in the File menu and a list of previously loaded
and saved projects will appear. Select the desired project from the
list to load it.
Once opened, the last page viewed when the project was saved will
appear in the definition editor (Circuit window).
Scroll Bars
Standard vertical and horizontal scroll bars are available in all
windows. These are located at the right-most and bottom-most
edges of the open window respectively.
Arrow Keys
You can use the arrow buttons on your keyboard to scroll both
horizontally and vertically while in Circuit view.
• On a blank portion of the page, press and hold the Ctrl and
Shift keys at the same time, then click and hold the left
mouse button (Ctrl + Shift + left mouse hold). Moving the
mouse will then allow panning though the page.
You may also perform the same operation by double-clicking the left
mouse button. However, this functionality is dependent on a setting
called Navigate into a module (under the Environment category of
the Workspace Options dialog) as follows:
To move out of the current module (i.e. move back one level), press
the Up to parent canvas button on the main toolbar.
Instead of the Up to parent canvas button, you can also use the
workspace secondary window to specifically select a module to
navigate to. See The Secondary Window in chapter 4 for more.
Forward/Back Buttons
PSCAD maintains a navigational history of the user’s module canvas
navigation for each session. When a project is unloaded, or when a
session is ended, all navigation history is lost.
Tabs
Tabs allow you to jump from one viewing area to another. There is a
tab bar included at the bottom of some windows (as shown below),
including the Output Window and others.
Zoom
Zoom features are available when working within either the Circuit
or the Graphic windows. There are a few different methods
available:
• From the main menu bar, select View | Zoom. You then
have a choice to select either In, Out or a specified zoom
percentage.
Zoom Rectangle
The Zoom Rectangle button is located in the main toolbar. Click
this button to enter zoom rectangle mode. On the Circuit canvas,
hold down the left-mouse button and drag the pointer to create the
desired rectangle. Release the mouse button to zoom.
Zoom Extents
The Zoom Extents button is located in the main toolbar. Click this
button to zoom to the extents of the currently viewed Circuit canvas.
Refresh
You can refresh the page view in either the Circuit or Graphic
windows by one of the following methods:
Compile
Compiling refers to the creation of the FORTRAN, data, and map
files required for the building of a project executable file. You may
choose to compile the entire project, or only modules that have been
modified since a previous compile. The latter choice comes in handy
for very large projects, which may take minutes to compile in their
entirety.
To compile the entire project from scratch, select the Compile all
modules button in the main toolbar:
Make
Making the project refers to the assembly of the associated
executable file (*.exe) to be run by EMTDC. To make your project,
press the Make button.
Output window messages are divided into three main groups: Build,
Runtime and Information. Compilation messages will appear as
Build, while EMTDC runtime messages will appear as Runtime.
The Search Results area is used to view results from a search (see
Searching later in this chapter).
In the example image below, it can be seen that the voltmeter ‘Vmid’
has been shifted and is not measuring a specific node voltage.
Running a Simulation
Before running a simulation, ensure that the desired project is the
Active Project in the workspace window.
Also, you can right-click over a blank area of any project page in
Circuit view and select Project Settings... from the pop-up menu.
The plot step may also be varied through the Plot Step drop list
in the runtime bar. Plot step can be changed at any point during a
simulation.
Taking a Snapshot
Taking a snapshot of a simulation run is presently the only way
to start an EMTDC simulation from an initialized condition. See
Initialization and Initial Conditions in Chapter 2 of the EMTDC
manual for more details on snapshot files.
Manual
You can take a snapshot manually by either pressing the Snapshot
button on the main toolbar, or selecting Build | Snapshot from the
main menu bar (while the simulation is running).
Pre-Defined
Pre-defined snapshots are set before the run is started. There are a
couple of different snapshot of this type available.
Make sure that the
Enter a name for the snapshot file in the Snapshot File field, and the
exact time at which to take the snapshot during the next run in the
run duration is greater Time field.
than the snapshot
time, or no snapshot
file will be created!
Click the OK button to exit the Project Settings dialog and save
changes. Run the project to completion.
Click the OK button to exit the dialog and save changes. Run the
project and it should start initialized from the snapshot time. See
Initialization and Initial Conditions in Chapter 2 of the EMTDC
manual for more details on snapshot files.
Click the OK button to exit the Project Settings dialog and save
changes. Run the case to create the output file (see Running a
Simulation above). See EMTDC Output Files later in this chapter for
more details on output file format.
You can also save the active project by pressing the Save Active
Project button in the main toolbar, or by pressing Ctrl + S on your
keyboard.
In either case, the Save As... dialog window will open with a default
Save as type as Project File (*.pscx) or Project File (*.pslx) for
case or library project respectively. Change the file name of the
project in the File name field.
Click the Save button to save the project under a different file
name. The project name should then change in the workspace
window, indicating that the project was indeed renamed.
Unloading a Project
In the workspace window, select the project that is to be
unloaded. Click File in the main menu bar and select Unload
Project.
Selecting Objects
Select an individual object with a left-click on the object
graphic. Select a group of objects by one of the following methods:
• Press and hold the Ctrl key and then separately select (left-
click) all objects to be grouped into one selection.
• Press and hold the left mouse button and then drag the
mouse pointer so that a box outline appears. Encompass
all objects to be selected and then release the left mouse
button.
To ungroup any objects, hold the Ctrl key and then select (left-click)
all objects to be ungrouped.
Control Palette
Once cut or copied, you can paste the object by right-clicking over a
blank area of the Circuit canvas and selecting Paste (or press Ctrl +
v).
Rotate/Mirror/Flip
Once added, single or multiple objects can be rotated, flipped or
mirrored:
Deleting Objects
Select the object (or objects) and press the Delete key.
See Valid
Connections in the
Wire help page for
more on connecting
objects.
Not Connected Connected
Invalid Connection
Wires are universal in that they assume the signal type of the nodes
they are connected to. If a wire is connected to an electrical node, it
will become an electrical wire, for example.
Original Circuit
• Port Connections
• Input Parameters
• Radio Link Components
!
SUBROUTINE DSDyn(X)
! . . .
!
SUBROUTINE DSDyn()
!
. . .
!
X = STOF(ISTOF + 1)
EXAMPLE 5-1:
A user wants to bring the firing pulse output signal back out to the
main page using an output port connection. The first step is to
define an Export component and connect it to the firing pulse output
signal. The user names the export signal out. The final step is to
define an output port connection in the module definition Graphic
section.
The user may now input this new output signal to any other
component on the main page.
Also note that parameters may only be used for porting into the
module. Porting data signals out of the module is supported only
through port connections or Radio Links.
EXAMPLE 5-2:
This time, instead of using a port connection, the user wants to port
the Input Data Signal through an input parameter on the module.
The data wire leading into the module needs to be named; this
is accomplished by using a Data Label. Then define an input
parameter in the module definition Parameters section.
EXAMPLE 5-3:
EXAMPLE 5-4:
Main Canvas
Containing a Graphic View of Circuit Canvas
Module and Module Definition View of Module
Source
Here are a few important factors to remember when porting electrical
signals into and out of modules:
Overlays
These options are related to the page display.
• Grids: Set this option to view the major grid points on the
module page.
• Signals: When this option set, PSCAD will use icons placed
on data signal wires and connections, so as to allow for
easy, graphical differentiation between feed-forward and
feedback signals.
• Z-Order: When this option is set, PSCAD will label each
component/module instance within this specific module with
a sequence number. This sequence number represents the
sequential placement of the component/module code in the
EMTDC system dynamics.
• Virtual Wires: Use this option to virtually connect signals
on a canvas that are connected by Data Labels, or sourced
internally from components. For more on this, see Virtual
Control Wires in chapter 11 of this manual.
The Oversize (34x44)
Paper paper is included
These options are related to the page settings (size and layout). for compatibility
with the PSCAD
V2 large canvas
• Size: Select a standard paper size for this module canvas. size. However, it can
• Orientation: Select the module canvas orientation. still be used as a valid
paper size.
Sequence
These options are related to the way in which system dynamics code
is ordered. For more on this option, see Component Ordering in
chapter 11 of this manual.
Dialogs for other components will differ, but all include the same
basic features and most contain multiple pages: At the top of the
dialog is a drop list, which contains a list all of the dialog pages
(called categories). In this example, the first page is entitled
Configuration. To move through or view any other pages, left-click
the down arrow on the field as shown below:
If there are too many items in the list, you will need to scroll to see all
the category names. To do this, click the left mouse button on the list
to expand it, and then select a particular category with another left
click. Or, press the up or down arrow on your keyboard while the list
is expanded.
Some parameter fields will contain a unit (i.e. [MVA], [sec], [m/sec],
etc.), displayed next to the parameter value. See Unit System in this
chapter for more details.
Once you are finished editing, click on the OK button to accept the
edited values and to exit the dialog (all edited parameter fields will
appear in bold). Clicking on the Cancel button will exit the form and
ignore all changes made.
Link List
All definitions that share the same name in any loaded project in
the workspace will appear in the link list. For example, a user has
loaded the master library and a custom library in the workspace,
where a custom component definition called resistor is stored. Of
course, a definition called resistor also exists in the master library.
The user wants to switch freely between these two definitions while
working in a case project.
Resource Link
If a component instance is not currently linked to a definition, or if
you want to point to a specific definition of a different name, then use
Resource Link.... This will invoke the Resource Link dialog in which
you can adjust both the namespace and definition name.
Category Descriptions
The properties listed in each tabbed section are organized into
columns.
Layers Tab
Layers:
Ports Tab
Ports:
Parameters Tab
Parameters:
Computations Tab
Computations:
Failures Tab
Failures:
Enter a name for the file and press the Save button. Once saved,
PSCAD will open the file automatically for viewing.
The following topics describe the steps involved when navigating the
component wizard. For more on component design, see the chapter
entitled Component Design in this manual.
Step 1
Enter all parameters required according to the descriptions
below. When finished, click the Next > button. If no port
connections are specified, skip to Step 4.
Step 2
Enter the parameters required according to the descriptions
below. This dialog page will be repeated for each port connection
specified in Step 1, starting with the left side of the component
graphic. The text box at the top of the dialog will indicate which port
connections are currently being defined.
When finished each page, click the Next > button. If Page Module
was not selected in Step 1, skip to Step 4. If a mistake is made,
press the < Back button at any time.
Step 3
When finished, click the Next > button. If a mistake is made, press
the < Back button at any time. Step 3 will appear only if the Page
Module input was selected in Step 1.
Step 4
Step 4 is simply a confirmation step. Press the Finish button if you
are satisfied that everything is correct. Press the < Back button to
go back to the previous step. Press Cancel to cancel the whole
process.
See the next section for instructions on how to create the first
instance of the new definition.
Lock/Unlock Modules
To lock a module component Circuit canvas from being viewed:
Right-click on the module definition list and select Lock. You will
be prompted to enter a password. Enter it (and do not lose it!) and
press OK.
Importing/Exporting Definitions
Definitions may be imported or exported to and from projects, or
exchanged between users, by saving the definition as a Definition
(*.psdx) file. A definition file contains the XML data elements defining
Import a Definition
In the workspace secondary window, left-click on the [+] box beside
the definitions branch to expand the definitions list. Right-click on
the definitions branch itself and select Import Definition(s)....
Export a Definition
To export a definition (i.e. save the definition to a Definition (*.psdx)
file), left-click on the [+] box beside the definitions branch. Right-click
on the desired definition from the list and select Export As....
Then, simply paste the copied selection into a report program of your
choice.
If the workspace
Enter a name for the project, as discussed in the section entitled
Creating a New Project previously in this chapeter. A new project will
window is not appear in the workspace window.
visible, select View
| Workspace in the
main menu. Right-click on the project name and select Project Settings....
This action will open the Project Settings dialog. Click the General
tab at the top of the dialog, left-click inside the Description field and
type a description for the case, say, ‘Voltage Divider’.
Click the Runtime tab and get familiar with the inputs displayed
therein (see Runtime for details on parameters).
Use the buttons at the top of this dialog to navigate to where you
want to save the project file. Type the name of the file (say vdiv.pscx)
in the File name field. Click the Save button. The project icon in the
workspace primary window will turn to blue and the new filename will
appear.
The namespace name will not be utilized in this tutorial. For more
details on what the namespace is and what it is used for, see Linking
and Re-Linking Definitions in this chapter and Duplicate Definition
Linking Priority in chapter 13.
An empty canvas should open in the Circuit window. This is the main
canvas of your new project, on which you will draw the circuit.
Once you find it, add it to your new project main page using one
of the techniques outlined in Adding Components to a Project in
this chapter: Move the source component to an appropriate place
on the page. Left double-click on the component to bring up the
component parameters dialog (see Editing Component Parameters
in this chapter). On the Configuration page, change the Source
Impedance Type Choice List to ‘R’ (for purely resistive).
Plotting Results
In order to view any results from our voltage divider circuit, we must
add a Graph Frame and set it up to display the waveforms. The
following sections describe only those aspects of plotting needed for
this exercise. See Preparing Data for Control or Display in chapter 6
of this manual for further reading.
This will create a new Graph Frame, Overlay Graph and a Curve
simultaneously as shown below:
Right-click on the graph frame title bar (top bar on the plot labelled
‘Main : Graphs’) and select Graph Frame Properties... from the
pop-up menu.
This will bring-up the Graph Frame Properties dialog window. In the
Caption field, change the title to Currents and Voltages. See Graph
Frames in chapter 6 for more details on the options in this dialog.
To resize the graph frame at any time, left click on the frame title bar
so that grips appear. Left-click and hold on a corner grip and drag
mouse outwards. Resize the graph frame to approximately 8 x 8
centimetres.
A new Overlay Graph will appear within the frame directly below the
existing graph (see Graphs in chapter 6 for more).
Add a curve to this graph to monitor load current: Hold down the
Ctrl key and click and hold the left mouse button while over the
Output Channel with title Load Current. Drag the mouse pointer over
the new graph and release the mouse button. A curve will appear.
Select the
Output
Drag the Mouse
Channel Release the Mouse
Pointer Over the New
(Ctrl + left Button
Graph
mouse
hold)
For example, change the Y-Axis Title input field to display Voltage
on the voltage graph, and Current on the current graph. You may
also want to turn on/off Grid Lines and adjust the scaling. The graph
frame should appear similar to that shown below once completed.
It may be necessary
This is the last step, assuming there are no errors. If there are
any, they will be logged in the Output Window. See Error and
to readjust your x Warning Messages in chapter 11 for more details. Your simulated
and y-axes, as well
as zoom and time results should look similar to the following once the simulation has
frame. See Chapter completed.
6 – Online Plotting
and Control for more
details.
Input Parameters
With the establishment of multiple instance module capabilities in
PSCAD, it was also a prudent time to introduce input parameter
functionality as well. As veteran users know, module components did
not support input parameters in the past, and relied purely on port
connections to transfer data signals into and out of the canvas. Input
parameter dialogs can now be designed for module components in
the exact same manner as they are for standard components, and
every instance of a module component may possess unique input
parameter values.
Import Connection
Module Input Parameters
Components on Canvas
within a module, say for example a breaker control signal, and is not
influenced in any way by signal values external to the module, then
the signal value will be identical in all module instances based on
that definition. However, if the signal value is based or influenced
by an external signal, such as an imported parameter, then the
signal value may change depending on the module instance (or
context), and in such cases may be considered an instance-based
signal. This means that although the curve colour or thickness of
a curve is a definition-based setting —and will be identical in every
instance— the actual data signal values are unique from one module
instance to another. This allows us to visualize the concept of a
definition canvas and instance context, as a base layer canvas,
with a transparent overlay representing the context of each module
instance.
The image below shows the subtle differences between data signal
values in two, separate instances of a module –both are based
on the same definition. Notice that the graph and curve settings
are identical (i.e. colour, glyphs, etc.), but their values are slightly
different. This is because the data signals plotted are sourced from
outside the module canvas, and are ported in through an input
parameter or port connection.
Since the converter bridges are all identical, it makes sense that
a bridge unit only be defined once, and used multiple times. This
helps to alleviate maintenance headaches and to ensure that
changes made to one unit are applied to all. Veteran PSCAD
users will understand that this concept has been utilized since
the beginnings of the application; up until recently however, this
has been accomplished only through the use of standard (non-
1. Valve Group
2. 6-Pulse Bridge
0: 6-Pulse Bridge
0: Valve Group
1: Valve Group
2: Valve Group
3: Valve Group
4: Valve Group
5: Valve Group
1. Valve Group
2. 6-Pulse Bridge
3. Main
0: Main
0: 6-Pulse Bridge
0:Valve Group
1:Valve Group
2:Valve Group
3:Valve Group
4:Valve Group
5:Valve Group
1: 6-Pulse Bridge
0:Valve Group
1:Valve Group
2:Valve Group
3:Valve Group
4:Valve Group
5:Valve Group
2: 6-Pulse Bridge
0:Valve Group
1:Valve Group
2:Valve Group
3:Valve Group
4:Valve Group
5:Valve Group
3: 6-Pulse Bridge
0:Valve Group
1:Valve Group
2:Valve Group
3:Valve Group
4:Valve Group
5:Valve Group
Coding Analogies
The ability to instantiate module definitions fits perfectly into how a
typical structured program is created. PSCAD is a structured code
generator (presently Fortran that may include C), which combines
components and modules in a project to construct and build an
executable program. The project itself can be compared to a coded
program in its entirety, where regular components represent snippets
of inline code and modules represent subroutines.
Port Connections/Input
Subroutine Arguments
Parameters
When the project is built, a separate Fortran file called A.f is created
to represent the definition of A. The code within it (i.e. the inline
code) is constructed using the non-module components placed
on the canvas of A. An instance of A exists within the canvas of
Main, so therefore it contributes to defining the subroutine for Main
–in other words, the instance of A is part of the definition of Main.
Conceptually then, this project contains two module definitions,
where an instance of module A is set within the canvas of Main.
In the above example, there are two module definitions (one for Main
and one for A). What would happen then if A was instantiated again
so that there are two instances of it on the Main canvas? Well a new
definition is not required; only an additional call statement to A within
the Main subroutine is needed.
Instances Calls
Main 1 1
A 2 2
B 2 4
Subroutine Arguments
Up until now, we have not mentioned the arguments shown in
both the SUBROUTINE and CALL statements above. Subroutine
arguments exist whenever the module definition possesses either
input parameters or port connections. In fact, this is yet another
coding analogy: Input parameters and port connections are a means
to transfer data defined external to the module, for use inside the
module. This is exactly what subroutine arguments are used for
when coding.
Say for example that our module A above has two connection ports
X and Y. The connection ports are defined as part of the module
definition, and are therefore also part of the subroutine file definition.
Although the ports are named X and Y in the definition, the actual
signal connected to the port can be any other pre-defined signal; be
it a literal value or another variable signal.
Notice above that input arguments in each call statement for A can
be literal numbers or signal values. Each argument defined in the
SUBROUTINE statement is represented by an Import or Export
component on the module canvas.
Inter-Project
To copy a module definition with its dependent from one project to
another: Select the source project in the workspace primary window
and expand the definitions list in the secondary window. Right-click
on the definition and select Copy with Dependents from the popup
menu.
Intra-Project
The same process as described above can also be used for copying
and pasting a module definition within the same project, except the
source and destination projects are the same.
Import Notes
There are some important issues to consider when using the Copy
with Dependents feature: As you may know, it is illegal for two
definitions of the same name to exist in the same project. This
complicates matters, as when you perform a copy with dependents,
you are attempting to add a group of definitions (by pasting) into
an existing list of definitions. What if one or all of these existing
definitions shares a name with one or all of the definitions being
pasted? No two definitions of the same name can exist, which
means that the pasted definitions must be renamed if needed.
All definitions that require a renaming retain their links to the original
definitions. What this means is that when the parent module (or top
module) is instantiated on the Circuit canvas, all module instances
based on definitions that were renamed, will still be linked back to
the original.
Wire Mode
PSCAD includes a special wire drawing feature called Wire Mode,
which enables the user to quickly draw interconnecting Wires
between components.
To invoke wire mode, click the Wire Mode button in the main toolbar
or press Ctrl + W on your keyboard. With the project open in Circuit
view, move the mouse pointer onto the project canvas. The mouse
pointer will have turned into a pencil.
To draw a wire, move the cursor to the node where you want the line
to start and left-click. Move the cursor to where you want the line to
end and left-click again to complete the wire. Multi-segment Wires
may be built by continuing to left click at different points.
To turn-off Wire Mode, either press the Esc key, press Ctrl + W, or
click the Wire Mode button again.
The drag and drop feature uses mouse pointer icons to indicate
whether or not a dragged object may be placed under the current
mouse position:
1. Hold down the Ctrl key (use the Shift key if Use shift key to
create controls & curves is enabled in the Graphic Settings
dialog).
2. Move the mouse pointer over the desired Output Channel
component instance.
3. Select and hold with your left mouse button.
4. Drag the mouse pointer to the desired graph and release the
mouse button to paste.
1. Hold down the Ctrl key (use the Shift key if Use shift key to
create controls & curves is enabled in the Graphic Settings
dialog).
2. Move the mouse pointer over the desired Output Channel
component instance.
3. Select and hold with your left mouse button.
4. Drag the mouse pointer over the desired control panel title
bar and release the mouse button to paste.
1. Hold down the Ctrl key (use the Shift key if Use shift key to
create controls & curves is enabled in the Graphic Settings
dialog).
2. Move the mouse pointer over the desired control component
instance.
3. Select and hold with your left mouse button.
4. Drag the mouse pointer over the desired control panel title
bar and release the mouse button to paste.
You may also bring up the online help by simply pressing the F1 key.
Tool Tips
Tool tip windows (otherwise known as flybys) are especially designed
for obtaining dynamic circuit information ‘on the fly’. Tool tips are
available both for providing pop-up help on component instances,
and for monitoring electrical or data quantities during a simulation.
Searching
If it is necessary to search a project for a signal name, port
connection name, node number, etc., the Search feature may be
used. To bring up the search dialog window, either:
Component Table
The component table lists all component instances existing in a
particular module. Along with the component name and type, some
other important information is also summarized to help users when
debugging or understanding their project.
Signal Tables
The signal table viewers summarize all control and electrical
signals in a particular module. Information is given, such as the
EMTDC control signal variable name and from where the signal is
sourced. For electrical signals, node name and index is given.
Control Signals:
Electrical Signals:
Scenarios are saved as part of the project file, so when a project with
scenarios is loaded, any saved set of settings can be immediately
reinstated by selecting the desired scenario. It is possible to store
multiple scenarios so that the user can easily switch between them,
without having to manually reset all the control components. In fact,
scenarios can be changed during a simulation!
If this tool bar is not visible, go to the main menu and select View |
Runtime Bar.
Scenario Viewer
The application provides a scenario viewer so that the dynamic
control settings in each scenario can be easily viewed and
verified. To bring-up the scenario viewer, select View All Scenarios
from the scenario pop-up menu as shown below:
Values in the Value, Min and Max columns may be modified and
saved directly from the Scenario Viewer. Simply double-click on the
field and enter a number.
Global Substitutions
Global substitutions provide a mechanism to use (i.e. substitute)
pre-defined, constant values globally throughout a project. A global
value can be substituted within any module at any level in the
project hierarchy, and are normally done so via component input
parameters.
$(<Key>)
For more details on adding and editing input parameters, see The
Parameters Section in Chapter 9 – Component Design.
Entering length in
Entering f in Single-Phase
Transmission Line
Transformer Parameters Dialog
Configuration Dialog
Unit System
Component parameter units perform limited conversion and scaling,
depending on the unit entered and the defined default (or Target)
unit for that particular input parameter. The unit system includes
base units for time, length, weight and speed (both translational and
rotational), as well as electrical units, such as voltage, current and
power.
Unit Format
Units are entered exclusively into component input parameter fields
and may only be associated with literal input data. That is, units are
invalid when using input variables or global substitutions. All entered
units must be separated at least one space from the entered value.
For example:
Base Units
The foundation of the unit system is the base unit. Base units
represent all units that are recognized by the unit system. Use of
units in an input field is optional, and if the input does not have a
unit specification included with it, then the unit will assume that of
the Target Unit for the input parameter. If units are specified, then
the unit conversion is strict and will evaluate an input parameter field
as indeterminate (#NaN) if it does not recognize the unit or fails to
process a compound unit. All the base units, except a few noted
exceptions, conform to the International System of Units (SI).
Electrical conductance
Siemens S
1
Electrical conductance
Siemens mho
2
Electrical conductance
Siemens mhos
3
1 day = 86400
Day day Time in days
s
Cycles per
Frequency Hz Cycles per second
Second
1 yd = 0.9144
Yard yd Length in yards
m
1 mi =
Mile mi Length in miles
1609.344 m
1 deg = π/180
Degree deg Angle in degrees
rad
Prefixes
The unit system utilizes a limited list of SI prefixes in order to allow
for scaling of base units. Prefixes must precede a valid base unit,
and may be inserted anywhere within compound units.
Target units are not limited to the base units alone, and may include
prefixes by default (i.e. kA): In instances such as these, any prefixes
in the target unit will be considered if further scaling is performed
later on. In fact, this is quite common in the master library, where
many target units are specified in [kA], [kV] or [uF].
EXAMPLE 5-5:
A user enters data into the Winding 1 Line to Line Voltage (RMS)
field as 0.153 [MV]. Given that the target unit contains the prefix
k, the application will understand that any quantity entered in this
parameter field must be converted back to kilovolts (not the base unit
of volts [V]). Therefore in this case, the quantity will be multiplied by a
scale factor of 1000 to convert it from 0.153 [MV] back to 153.0 [kV].
Unit Conversions
The most useful aspect of the unit system is the ability to convert
one unit to another, be it an imperial/metric conversion or simply
converting from one form to another, such as radians to degrees.
EXAMPLE 5-6:
Compound Units
The unit system will recognize three types of arithmetic operator
within the unit brackets, in order to allow for combining (or
compounding) units together. These are:
Arithmetic Description
Operator
* Multiply
/ Divide
^ Exponent
Entered Target
Correct: [hp*min/MVA]
[MW*s/MVA]
Incorrect: [hp/MVA*min]
Entered Target
Correct: [ft*ft]
[m*m]
Incorrect: [ft^2]
Entered Target
Correct: [lb*ft/s]
[kg*m/s]
Incorrect: [lb/s/ft]
EXAMPLE 5-7:
A user enters data into this parameter as 60.0 [Hz]. This is a valid
unit in this case as both Hz and rad/s are essentially the same type
of measure, where 2π [rad/s] = 1 [rev/s] = 1 Hz (see Base Units
above).
EXAMPLE 5-8:
The project description is written as the first row of text at the top of
the file. The first column of data is always the EMTDC simulation
time. The subsequent columns are not labelled –see Column
Identification and the Information File below for more details on this.
third column from the left in the output file. This column can then
be identified using the corresponding output channel name (i.e.
Desc). In this case, output channel 2 happens to be 2nd harm -
mag.
Chapter 6:
Output channel
components cannot
be directly connected
to an electrical wire.
The control objects
cannot be manually
adjusted (as they
appear above) until
they are linked to a
control interface. See
Online Controls and
Meters in this chapter
for details.
Graph Frames
A Graph Frame is a special runtime object used for encapsulating
Overlay or PolyGraphs, and can be placed anywhere on the Circuit
canvas. Once a graph frame has been added, you may then
proceed to add as many Graphs to it as you wish.
Graph frames are used exclusively for plotting curves versus time.
That is, the graph frame horizontal axis is always the EMTDC
simulation time. If you need to a plot a curve as a function of another
variable, see XY Plots.
If you cannot see the Control Palette, go to the View menu and
ensure Control Palette is selected.
To resize, move the mouse pointer over the title bar and left-click to
select the graph frame. Grips should then appear around the outer
edge as shown below.
Move the mouse pointer over one of the grips. Left-click, hold and
then drag, then move the pointer to resize.
Cut/Copy Frames
Right-click over the graph frame title bar and select Cut Frame or
Copy Frame respectively.
Once a graph frame has been cut or copied it may then be pasted
into another location in the project (along with its contents).
Paste Frame
Cut or copy a graph frame as described above. Right-click over a
blank area of the project page in Circuit view and select Paste. A
graph frame may be pasted multiple times.
• Caption: Enter a title for the graph frame (this text will
appear in the graph frame title bar). The default text may
appear a bit cryptic: This syntax is used as a naming
convention for grouping objects in the workspace. For more
information on this syntax, see Grouping of Runtime Objects.
Preferences:
Adjusting the
horizontal axis
properties will affect
all graphs in the
frame.
Axis:
• Title: Enter a title for the x-axis. This text will appear in the
bottom-left corner of the frame, directly beside the x-axis.
• Snap Aperture to Grid: Select this feature so that when
using dynamic aperture adjustment, the aperture view will
snap to the major grid while scrolling.
• Dynamic Aperture Adjustment: Select this option to
enable dynamic aperture adjustment (i.e. horizontal scroll).
• Enable Minor Grids: When selected, minor grid ticks will
appear on the frame horizontal axis. Minor grids will always
show the halfway point between major grid points, and are
not labelled.
• Max: Sets the maximum time of the viewed range.
• Min: Sets the minimum time of the viewed range.
• Grid: Sets the time between the axis major grid points.
Major grid points are labelled on the graph frame horizontal
axis.
Markers:
Graphs
A Graph is a special runtime object, which can reside only inside a
graph frame. There are two types of graphs available: Overlay and
PolyGraphs. A single graph may hold and display multiple Curves,
where all curves in a graph are based on the same y-axis scale.
can also add an overlay graph directly by pressing the Insert key on
your keyboard with your mouse pointer over the graph frame.
Graph Order
Once multiple graphs have been added to a frame, you may change
the order in which they appear. Right-click over the graph to be
moved and select one of the following:
• Move Graph Up
• Move Graph Down
• Move Graph to Top
• Move Graph to Bottom
Cut/Copy Graphs
Right-click over the graph to be cut (removed)/copied and select Cut
Graph/Copy Graph respectively.
Once a graph has been cut or copied it may then be pasted into the
same or another graph frame.
Paste Graph
Cut or copy a graph as described above. Right-click on the graph
frame title bar and select Paste Graph. A graph may be pasted
multiple times, where each paste will replicate the entire graph.
Overlay Graphs
Overlay graphs are the most common and familiar type of online
plotting tool in PSCAD. These graphs display measured data as a
function of time, where multiple curves may be added (or overlaid on
top of each other) onto a single graph.
Preferences:
Y-Axis:
• Title: Enter text for display as the graph title (located on the
left side of the graph).
• Grid: Specifies the y-axis grid interval. To view the y-axis
grid lines, select the option Show Grid described above.
• Ymin: Specifies the minimum y-axis viewing limit on the
graph.
• Ymax: Specifies the maximum y-axis viewing limit on the
graph.
• Y-Intercept: Specifies the y-axis location of the y-intercept
line. This line is only visible if Show Y-Intercept is selected
(see above).
• Manual Scaling Only: Select this feature to lock the y-axis
limits set in Ymin and Ymax above. The y-axis will remain
locked during any subsequent zoom operations.
Poly Graphs
Poly graphs are used specifically to display plotted curves in a
‘stacked’ format. That is, each curve is contained within its own
viewing space, and is stacked one atop the other. A poly graph may
be chosen over a standard overlay graph if the user needs to either
view many single-curve plots in a compact space, or to make use of
the curve digital style functions to create a logic transition diagram:
Preferences:
Curves
A curve is a special runtime object best described as a graphical
representation of a string of data points, where each point is
associated with a simulation time step. Curves are created by
linking to an Output Channel component, to which a scalar or array
set of data signals have been input. As such, curves can be multi-
dimensional; that is a single curve may possess many sub-curves or
Traces, where each trace corresponds to a single array value.
1. Drag and Drop Method: Hold down the Ctrl key. Left-click
and hold over the Output Channel component from which
you would like to extract the curve. Drag the mouse pointer
over a graph and release the mouse button. See Drag and
Drop for more details on this.
Curve Legends
Once a curve has been added to a graph, the curve title will appear
in the curve legend.
Curve Order
Once multiple curves have been added to a graph, you may
change the order in which they appear. Ordering curves can be
accomplished in one of two ways:
1. Drag and Drop: Left-click and hold over the curve in the
curve legend. Drag the mouse pointer to a new position in
the curve legend and release the mouse button. See Drag
and Drop for more details on this.
Active Trace
The following list describes the parameters in this section:
Style
The following list describes the parameters in this section:
Digital Style
These options are only considered if the curve is part of a poly
graph. Digital style controls the properties the curve traces when
they are in digital mode. The following list describes the parameters
in this section:
Traces
Array signal curves can be plotted online as a single entity, where
each array element or ‘sub-curve’ is referred to as a Trace. Each
trace may be enabled or disabled separately (i.e. shown or hidden).
Polymeters
A polymeter is a special runtime object used specifically for
monitoring a single, multiple-trace curve. The polymeter dynamically
displays the magnitude of each trace in bar type format (called
gauges), which results in an overall appearance similar to a
spectrum analyzer. The power of this device lies in its ability to
compress a large amount of data into a small viewing area, which is
particularly helpful when viewing harmonic spectrums, such as data
output from the On-Line Frequency Scanner (FFT) component.
Adding a PolyMeter
To add a polymeter, right-click on an Output Channel component
within the Circuit canvas and select Graphs/Meters/Controls | Add
as PolyMeter.
The polymeter will appear attached to the mouse pointer. Move the
pointer to wherever you wish the new meter to reside and then left-
click to place it on the Circuit canvas.
To resize, move the mouse pointer over the title bar and left-click to
select the polymeter. Grips should then appear around the outer
edge as shown below.
Move the mouse pointer over one of the grips. Left-click, hold and
drag, then move the pointer to resize.
Cut/Copy PolyMeter
Right-click over the polymeter and select Cut or Copy respectively.
Paste PolyMeter
Cut or copy a polymeter as described above. Right-click over a
blank area in Circuit view and select Paste. A polymeter may be
pasted multiple times.
Navigate to Channel
You can navigate directly to the associated Output Channel
component by selecting this option. Right-click over the polymeter
and select Navigate to Channel. PSCAD will automatically find the
output channel and highlight it.
PhasorMeters
A PhasorMeter is a special runtime object that can be used to display
up to six, separate phasor quantities. The phasormeter displays
phasors in a polar graph, where the magnitude and phase of each
phasor responds dynamically during a simulation run. This device
is perfect for visually representing phasor quantities, such as output
from the On-Line Frequency Scanner (FFT) component.
X∠φ
The phasormeter always assumes that the elements of the array are
in the above displayed order. That is element 1 is the magnitude and
element 2 is the phase angle.
Adding a PhasorMeter
To add a phasormeter, right-click on an Output Channel component
within the Circuit canvas and select Graphs/Meters/Controls | Add
as PhasorMeter.
To resize, move the mouse pointer over the title bar and left-click to
select the meter. Grips should then appear around the outer edge as
shown below.
Move the mouse pointer over one of the grips. Left-click, hold and
drag the pointer to resize.
Cut/Copy PhasorMeter
Right-click over the meter and select Cut or Copy respectively.
Paste PhasorMeter
Cut or copy a phasormeter as described above. Right-click over a
blank area of the project page in Circuit view and select Paste. A
phasormeter may be pasted multiple times.
Navigate to Channel
You can navigate directly to the associated Output Channel
component by selecting this option. Right-click over the phasormeter
and select Navigate to Channel. PSCAD will automatically find the
output channel and highlight it.
• D: Degrees
• R: Radians
Oscilloscopes
An Oscilloscope is a special runtime object that is used to mimic
the triggering effects of a real-world oscilloscope on a time varying,
cyclical signal like an AC voltage or current. Given a base frequency,
the oscilloscope will follow the signal during a simulation (like a
moving window), refreshing its display at the rate given by the base
frequency. This gives the illusion that the oscilloscope is transfixed
on the signals being displayed, resulting in a triggering effect.
Adding an Oscilloscope
To add an oscilloscope, right-click on an Output Channel component
within the Circuit canvas and select Graphs/Meters/Controls | Add
as Oscilloscope.
To resize, move the mouse pointer over the title bar and left-click to
select the meter. Grips should then appear around the outer edge as
shown below.
Move the mouse pointer over one of the grips. Left-click, hold and
drag the pointer to resize.
Cut/Copy Oscilloscope
Right-click over the oscilloscope and select Cut or Copy
respectively.
Paste Oscilloscope
Cut or copy an oscilloscope as described above. Right-click over a
blank area of the project page in Circuit view and select Paste. A
scope may be pasted multiple times.
Navigate to Channel
You can navigate directly to the associated Output Channel
component by selecting this option. Right-click over the oscilloscope
and select Navigate to Channel: PSCAD will automatically find the
output channel and highlight it.
XY Plots
The XY Plot is comprised of both a graph frame and a single,
specialized graph window for the purpose of plotting one curve
versus another. An xy plot can accommodate multiple curves on
each of the x and y-axes, and includes dynamic zoom and polar grid
features.
Although the xy plot is used to plot one signal versus another, each
of these signals is based on the same time scale. It is therefore
possible to scroll through the data in the time domain. The xy plot
Adding an XY Plot
Open the project in the Circuit view. Right-click on a blank portion
of the page and select Add Component | XY Plot, or press the XY
Plot button in the Control Palette bar.
To resize the frame, move the mouse pointer over the title bar and
left-click to select it. Grips should then appear around the outer edge
as shown below.
Move the mouse pointer over one of the grips. Left-click, hold and
drag the pointer to resize.
• Name: Enter a title for the xy plot (this text will appear in the
frame title bar). The default text may appear a bit cryptic:
This syntax is used as a naming convention for grouping
objects in the workspace. For more information on this
syntax, see Grouping of Runtime Objects.
Preferences:
Markers:
Display Preferences:
• Show Grid: Select this option to display grid lines for the
x-axis and y-axis major grids.
• Show Ticks: Select this option to show major grid tick
marks along the x and y-axis intercept lines.
• Show Intercepts: Select this option to display both intercept
lines (horizontal and vertical). The intercepts are always at
zero, and cannot be adjusted.
Trace Style:
Polar Grid
The default cartesian (xy) grid display can be switched to a polar grid
by simply toggling the xy/polar display button at the top-left of the
plot frame.
The polar and xy grids are simply overlaid on top of the plotted data:
Existing tool tips, such as cross-hair and min/max curve are also
standardized to 12 significant digits. The following images show the
locations of other tool tips in the plotting environment:
As can be seen from the graph, the fault occurs around 0.25 s and
lasts for about 0.07 s. Dynamic aperture adjustment can be used
to close the viewing window to a smaller time width, so that the fault
waveforms can be more easily studied. To do this, move your mouse
pointer over the horizontal scroll bar at the far right so that the mouse
pointer turns into a double-headed arrow.
Click and hold the left mouse button and drag the scroll bar aperture
slowly to the left.
Release the left mouse button and move the pointer over the scroll
bar aperture, click and hold the left mouse button again – the mouse
pointer should become a ‘hand.’ Drag the mouse so as to scroll
across the time frame of the graph.
If desired, you can shrink the aperture further for even more
detail. An aperture will also be created automatically when you zoom
into a certain data range.
This exercise is for the
You may also use either the left and right arrow buttons at each end
purpose of describing of the scroll bar, or the arrow keys on your keyboard to scroll through
dynamic aperture
adjustment. A more
data: To scroll in small increments, simply left-click either arrow; for
efficient way to zoom larger increments hold down the Ctrl key and then left-click. When
into this aperture using the arrow keys, make sure that the focus is on the graph frame
window is to use
horizontal zoom. being viewed, as these keys can also function as a scroll mechanism
for the Circuit canvas.
If the aperture Width is a fraction of the total time scale for the plot,
then the aperture indicator scroll bar will reflect this by showing a
smaller aperture window:
You may now move the aperture window along the time axis,
maintaining its set width. To do this, move your mouse pointer over
the aperture indicator in the scroll bar and left-click and hold. Your
mouse pointer should become a ‘hand’ symbol. Move the mouse left
or right along the axis.
Markers
Markers are a special feature included in both graph frames and
xy plot frames to help users with the analysis of their online data.
Specifically, they are used to delineate the data so as to focus
analysis to that specific range. Depending on marker positions,
legend displays will indicate the difference between the two markers
in both the x and y directions.
Markers are used only on the x-axis (time axis) and will appear as
two adjustable tabs. The marker tabs are labelled as X and O and
the combination of the two set the specified boundaries. Once
markers are set, analysis can be performed on the data contained
within them.
Show/Hide Markers
There are a few ways to show or hide markers:
If you are working with a graph frame, two tabs should appear along
the horizontal axis. Each marker tab, labelled X and O, correspond
to an x-axis (time) position.
If you are working with an xy plot, an extra display bar will appear at
the bottom of the plot frame as shown below:
Marker Display in
Aperture Control Bar
Graph
Graph Frame Marker Legends
Once markers are enabled (shown) in a graph frame, legends will
appear on the right hand side of the frame itself.
Each graph in the graph frame will have a legend directly to the right
of the graph. The values displayed are specific to each graph and
are described as follows:
The x-axis will also have its own legend where the values displayed
are similar to those described above, but for the x-axis.
When using xy plots, you must select the desired curve in the graph
legend, as the Space Bar function is not available.
• When using xy plots, right-click over the plot title bar and
select Plot Frame Properties... to bring up the Plot Frame
Properties dialog. Select the Show Markers selection box
and then set the time-axis values of each marker directly in
the input fields provided.
Locking/Unlocking Markers
Locking will force the two markers to maintain a constant distance
between each other when they are moved along the x-axis. Left
double-click the graph frame horizontal axis to bring up the Axis
Properties dialog and select Lock Markers, or right-click over the
horizontal axis and select Toggle Marker Lock-Step (or press the
L key on your keyboard) to lock the markers. Perform the same
operation again to unlock.
Instead of pressing the above keys, you can also use the time
axis pop-up menu. Left-click on the graph frame time axis at the
approximate position where you wish to place a marker, then select
the appropriate menu function.
Preferences
Plotting preferences can be adjusted from either the graph or xy plot
pop-up menus (depending on which one you are using). Simply right
click over a graph or xy plot to bring up the corresponding pop-up
menu. Then, select Preferences.
Many of the above preferences can be set within the various dialog
windows involved with graphs and xy plots.
Zoom Features
Once a simulation has been run and output data has been collected,
there are several ways to zoom in and out of the data displayed. The
following are some of the more common methods.
Box Zoom
Select the desired graph with a left-click on the graph display area.
Click and hold the left mouse button and drag the mouse pointer to
create a boxed region. Release the left mouse button to zoom to
that region.
You can also zoom
along a single axis by
drawing out a narrow
box. The zoom will
ignore the narrow side
of the box.
Vertical Zoom
Select the desired graph with a left-click on the graph display area.
Press Shift + left mouse hold and drag the mouse pointer in a
vertical direction (i.e. up or down along the y-axis) to create a vertical
zoom region. Release the left mouse button to zoom to that region.
Horizontal Zoom
Select the desired graph with a left-click on the graph display
area. Press Ctrl + left mouse hold and drag the mouse pointer in
a horizontal direction (i.e. left or right along the x-axis) to create a
horizontal zoom region. Release the left mouse button to zoom to
that region.
Zoom Previous/Next
Select the desired graph with a left-click on the graph display area.
Right-click over the graph to generate a pop-up menu and select
Zoom | Previous or Zoom | Next.
Zoom Extents
The Zoom Extents feature allows the user to zoom to the extents of
the plotted data. The data ‘extents’ refers to the absolute maximum
and minimum values that exist during the entire simulation run, in
either the x or y direction.
Select the desired graph with a left-click on the graph display area.
Right-click over the graph to generate a pop-up menu and select
either Zoom | X Extents or Zoom | Y Extents.
Zoom Limits
The Zoom Limits feature allows the user to zoom to predefined limits
in either the x or y direction. The y-axis limits are set based on the
Default Display Limits parameters in the corresponding Output
Channels for the curves. In the event of multiple curves, the limits
are based on the largest and smallest Default Display Limits among
all relevant output channels. The x-axis limits are based on the
desired duration of the simulation.
Select the desired graph with a left-click on the graph display area.
Right-click over the graph to generate a pop-up menu and select
either Zoom | X Limits or Zoom | Y Limits.
With a left click, your mouse pointer should become an open ‘hand.’
Hold down the left mouse button and move the hand down to zoom
in, or up to zoom out.
Once invoked, cross hair mode will remain on until it is turned off.
While in cross-hair mode, the mouse pointer becomes a ‘cross-hair’
while over top the graph:
Once cross hair mode is enabled, move the mouse pointer over the
graph and left-click and hold. Drag the mouse along the graph. If
multiple curves exist in the graph, then you can move the cross
hair from curve to curve by simply pressing the Space Bar on your
keyboard.
As shown above, the curve xy data will be displayed beside the cross
hair. When your left mouse button is released, the cross hair will
disappear, but cross hair mode will remain invoked until you press
the C key again (or select Preferences | Show Cross Hair).
In xy plots, the cross hair will follow the mouse pointer only.
Graph PolyMeter
Graphs:
Button Description
Zoom In
Zoom Out
Zoom horizontal extents
Zoom vertical extents
Reset all extents
Previous zoom
Next zoom
Toggle Cross-Hair Mode
Toggle Auto-Pan of X-Axis
Toggle Markers
PolyMeters:
Button Description
Control Panels
A Control Panel is a special component used for accommodating
control or meter interfaces and can be placed anywhere on a Circuit
canvas. Once a control panel has been added, you may then
proceed to add as many control or meter interfaces to it as you wish.
To resize, move the mouse pointer over the title bar and left-click to
select the panel. Grips should then appear around the outer edge as
shown below.
Move the mouse pointer over one of the grips. Left-click, hold and
then drag, then move the pointer to resize.
Cut/Copy Panel
Right-click over the control panel title bar and select Cut or Copy
respectively. You can also use the standard Ctrl + X or Ctrl + C
shortcuts.
Once a control panel has been cut or copied, it may then be pasted
into another location in the project (along with its contents).
Paste Panel
Cut or copy a control panel as described above. Right-click over a
blank area of the Circuit canvas and select Paste. A control panel
may be pasted multiple times.
• Caption: Enter a title for the control panel (this text will
appear in the panel title bar). The default text may appear
a bit cryptic: This syntax is used as a naming convention for
grouping objects in the workspace. For more information on
this syntax, see Grouping of Runtime Objects.
Control Interfaces
A Control Interface is a user interface object, which allows manual
adjustment of input data signals dynamically. A control interface
must first be linked with one of the runtime control objects available
in the master library (i.e. Slider, Two State Switch, Rotary Switch,
and Push Button). The control interface will then control the output
of the linked control component. For example, the following image
shows a Slider component linked to a control interface in a control
panel.
• Drag and Drop: Hold down the Ctrl key, left-click and hold
the associated control component and drag and release over
the control panel. See Drag and Drop for more details.
• Right-click on the associated control component and select
Graphs/Meters/Controls | Add as Control. Right-click
over the desired control panel title bar and select Paste.
• Drag and Drop: Press Ctrl and then left-click and hold
over the title bar of a particular control interface and then
drag the mouse pointer over the control panel title bar. A
downward arrow will appear between existing interfaces
depending on the position of the mouse pointer. Release the
left button to drop the interface.
Left-Click and
Drag Release Button
Hold
• Right-click over the control interface and select Set Control
Order. Choose one of the options given.
Navigate to Control
You can navigate directly to the control component associated with
a particular interface, by selecting this option. Right-click over the
interface and select Navigate to Control. PSCAD will automatically
find the associated output channel and highlight it.
Slider Component:
The Slider interface also allows you to enter an exact value (up to six
significant digits) directly into its display window. Simple left double-
click on the display window and then enter the data. Press the Enter
button to exit and save the entered data, or press Esc to exit without
saving changes.
Meters
A meter is similar to a graph, in that it is used for displaying an output
signal and is linked to a corresponding Output Channel. Instead
of displaying the signal as a curve (as a graph would), the signal
is used to operate a realistic meter display, with a pointer position
proportional to the signal magnitude. For example, the following
image shows an Output Channel component linked to a meter in a
control panel.
• Drag and Drop: Hold down the Ctrl key, left-click and hold
the associated Output Channel component and drag and
release over the control panel. See Drag and Drop for more
details.
• Right-click on the associated Output Channel component
and select Graphs/Meters/Controls | Add as Meter. Right-
click on the desired control panel title bar and select Paste.
Meter Order
Once multiple meter interfaces have been added to a particular
control panel, you may change the order in which they appear.
• Drag and Drop: Press Ctrl and then left-click and hold
over the title bar of a particular meter interface and then
drag the mouse pointer over the control panel title bar. A
downward arrow will appear between existing interfaces
depending on the position of the mouse pointer. Release the
left button to drop the interface.
Left-Click and
Drag Release Button
Hold
• Right-click over the meter interface and select Set Control
Order. Choose one of the options given.
Cut/Copy Meter
Right-click over the meter title bar and select Cut or Copy
respectively.
Once a meter has been cut or copied, it may then be pasted into any
control panel in the project.
Paste Meter
Cut or copy a meter as described above. Right-click over a control
panel title bar and select Paste. A meter may be pasted multiple
times.
Navigate to Channel/Control
You can navigate directly to the Output Channel or I/O Control
component associated with a particular meter interface, by selecting
this option. Right-click over the meter interface and select Navigate
to Channel/Control. PSCAD will automatically find the associated
Output Channel or I/O Control component and highlight it.
PSCAD Highlights
Select Navigate to Channel/Control
Object
Adjusting Meter Properties
Meter properties and the corresponding Output Channel parameters
are one and the same. Therefore, you can either adjust these
properties through the Output Channel directly, or through the meter
as follows: Left double-click the meter title bar, or right-click over the
title bar and select Channel Settings....
For example, consider the following project circuit canvas, where the
user wishes to group existing control objects according to function:
Both the Firing Angle slider and Enable/Disable switch controls are
grouped under the name Firing Control, whereas the two output
channels Volts and Amps are grouped under the name Monitoring.
$(GROUP)
EXAMPLE 6-1:
Frame/Panel Minimization
All graph frames, control panels, polymeters and xy plot frames can
be minimized in order to reduce clutter and save space when viewing
data.
Icons appear at the left of the minimized objects so that the different
types of the frame/panels can be identified. A summary of these
icons is given below:
• Graph Frame
• Control Panel
• PolyMeter
• PhasorMeter
• XY Plot
• Oscilloscope
You may then go directly to a report document and paste the image,
while it is still in the Windows clipboard.
Chapter 7:
Project Settings
Most features and settings related to simulation control in PSCAD
are contained within the Project Settings dialog. Important param-
eters, such as total simulation time and time step, are included here
along with more advanced, project specific PSCAD and EMTDC
features and processes.
General
The properties contained within this section are related to the project
file and version tracking.
Namespace
The namespace is the project attribute through which all component
definitions are linked to a project. As a project attribute, it can only
be changed from this project setting field.
Description
This field allows for the entry of a single-line description of the proj-
ect. This description will be displayed beside the project filename in
the workspace window. Do not use quotations (“) or apostrophes (‘)
in this field.
Full Path
Full Path displays the path and filename information for the project
file. This field is for display only and cannot be changed through the
Project Settings dialog.
Relative Path
Relative path displays the project filename only. This field is for dis-
play only and cannot be changed through the Project Settings dialog.
Revision Tracking
These settings display particular information regarding the project file
revision history.
File Version
The PSCAD release version used to create the project.
First Created
The date and time at which the project was first created.
Last Modified
The date and time at which the project was last modified.
Author
The name (userid) of the person who created and/or modified the
project.
Runtime
The properties contained within the Runtime section are the most
commonly accessed project parameters.
Time Settings
These settings are very important and are used quite often in every
day simulation studies.
The plot step can be
A trap that even the most experienced engineers can readily fall into
is the setting of plot step too broad with respect to the level and peri-
modified during a run od of noise in the signal. If a signal is periodic at a frequency similar
(or after starting from
a snapshot). You can to the plot step interval, the perceived output may be quite different
change the value from to the actual signal. As a basic rule, if you are puzzled by the results
the Project Settings
dialog or from the
observed from a plotted simulation output, run the case with the plot
Runtime bar. step equal to the EMTDC time step and compare the results.
Start-up Method
There are two ways to start a simulation in PSCAD: The standard
method (i.e. from time = 0.0 seconds) or from a snapshot file.
Standard
The standard method to start an EMTDC simulation run is to simply
start from an un-initialized state (i.e. from time t = 0.0). This is how
simulations are started most of the time.
Timed Snapshot
There are two ways to utilize a snapshot file: Single and incremental
snapshots.
base_name_##.snp
You are required to provide only the ‘base_name’ (in the Snapshot
File field). The extension will be added automatically.
Multiple Run
There are currently two methods for performing multiple runs in
PSCAD – this one is the more basic of the two. This method is used
in conjunction with the Current Run Number and Total Number of
Multiple Runs components, which are available in the master library.
The other multiple
run method involves
the Multiple Run
component, which is
available in the master Another field is included directly beside the Multiple Run field called
library. DO NOT
enable this multiple Output File. Enter a name for the multiple run output file here.
run feature when Another input field is included called # runs. Enter the total number
using the Multiple Run
component.
of runs here (this value is used to set the Total Number of Multiple
Runs component).
EXAMPLE 7-1:
In this case, the comparator output is set to go low (0) when input A
is less than or equal to 1.0 (i.e. the last two runs).
Miscellaneous
The remaining Runtime parameters are outlined below:
EXAMPLE 7-2:
A user runs a case project to steady state, and then takes a snap-
shot at 0.5 seconds. The user then re-starts the simulation from the
snapshot file created, and sets the Duration of Run parameter to
0.05 s.
snapshot, the breaker logic must indicate 0.51 seconds (not 0.01
seconds).
Unused output chan-
Send Only the Output Channels that are in Use
nel data will still be Selecting this option will turn off all output channels that are not be-
written to EMTDC ing plotted in graphs, or monitored in meters. Enabling this option
output files if Save
Channels to Disk? is
has the potential to greatly reduce the amount of storage for the
enabled. simulation, as well as a slight simulation speed improvement.
Simulation
The properties contained within the Simulation section provide some
control over EMTDC operation.
Process Communication
The input parameters involved here are outlined below.
With this option enabled, you can create an infinite bus by either
entering a value less than the threshold (set in the threshold field
directly to the right of this check box) or 0.0 Ω for the source resis-
tance. Similarly, for a zero resistance branch, enter a value less than
the threshold or 0.0 Ω for the ON resistance of a diode, close resis-
tance of a breaker, etc.
Diagnostic Information
The following input parameters are important during the debugging
process of your simulation project and are recommended for more
advanced users. The information generated by these settings will
appear under the Non-Standard Messages branch in the Runtime
tab window.
Dynamics
The properties contained within the Dynamics section are related to
the EMTDC system dynamics. These are explained below.
Signal Storage
The input parameters involved here are outlined below.
In smaller projects, toggling this control will have very little effect on
the simulation speed. As projects become larger and contain many
control signals, this feature may help to speed things up.
EXAMPLE 7-3:
In the simple control system shown below, there will be a total of four
type REAL variables declared in the project FORTRAN file, when this
project is compiled: In1, error, Out and In2. Three are feed-forward
variables (indicated by the O symbol), and one is a feedback vari-
able (indicated by the X symbol).
Users can display
these symbols at
any time by enabling
the Show Signal
Locations parameter
in the Module Settings
dialog. For a more
detailed description
of these symbols,
see Show Signal
If Store Feed Forward Signals for Viewing is enabled, all four of
Locations in Chapter the above variables will be stored every time step, as indicated in the
11 of this manual. following excerpt from the project FORTRAN file:
!================================================
SUBROUTINE DSDyn()
.
.
.
!---------------------------------------
! Transfers from storage arrays
!---------------------------------------
In2 = STOF(ISTOF + 1)
In1 = STOF(ISTOF + 2)
error = STOF(ISTOF + 3)
Out = STOF(ISTOF + 4)
.
.
.
!---------------------------------------
! Feedbacks and transfers to storage
!---------------------------------------
STOF(ISTOF + 1) = In2
STOF(ISTOF + 2) = In1
STOF(ISTOF + 3) = error
STOF(ISTOF + 4) = Out
!================================================
SUBROUTINE DSDyn()
.
.
.
!---------------------------------------
! Transfers from storage arrays
!---------------------------------------
Out = STOF(ISTOF + 4)
.
.
.
!---------------------------------------
! Feedbacks and transfers to storage
!---------------------------------------
STOF(ISTOF + 4) = Out
Signal Flow
The input parameters involved here are outlined below.
Buses
The input parameters involved here are outlined below.
Unit System
The input parameters involved here are illustrated below:
Mapping
The properties contained within the Mapping section are related to
EMTDC network solution conductance matrix optimization.
Network Splitting
The input parameters involved here are outlined below.
Once the main electric network has been split into subsystems, each
subsystem can be solved independently. Say for example a large
FACTS device (with many frequently switched branches) is located
within its own subsystem, but part of a much larger network. By
splitting the main network into subsystems, only the local subsystem,
harbouring the FACTS device, need be resolved when a switching
event occurs. The speed benefits here can be tremendous.
Matrix Optimizations
The input parameters involved here are outlined below.
Fortran
The parameters contained within the FORTRAN section are used
for the control of compiler based error and warning messages. Also,
any additional source files, required for the compilation of the project,
are indicated here as well.
If only the filename is entered, PSCAD will assume that the source
file is located in the same directory as the project file itself, and will
append this path to the filename. You may also use standard direc-
tory navigational features when working with relative paths. For ex-
ample, if a source file called test.f is located in the directory directly
above the project file, then the file entry would appear as follows:
This input field will only accept the following source file types:
Runtime Debugging
The input parameters involved here are outlined below.
Checks
The input parameters involved here are outlined below.
This option should be used when testing your new models. It will
slow down the simulation and the speed penalty will vary from ma-
chine to machine – you can disable this option if speed is a concern.
Please read your FORTRAN compiler documentation you are using
for more details.
Integer Overflow
This option is useful for debugging but has a speed penalty that is
again architecture dependent. Please read your FORTRAN compiler
documentation for more details.
Argument Mismatch
The FORTRAN compiler issues a warning if the argument type
(REAL, INTEGER, etc.) of the CALL statement does not match with
the subroutine statement (this is applicable to functions as well).
Uncalled Routines
The FORTRAN compiler issues a warning if a routine is not called in
the program.
Uninitialized Variables
A warning is issued if a variable is used before it is assigned a value.
Normally, the cause of this is a typographical mistake in the source
code.
Link
The parameters contained within the Links section are used for the
linking of pre-compiled libraries (including MATLAB related libraries)
and object files.
Object and library files provide a way to avoid the compilation of user
written subroutines every time they are used in different projects.
They are also useful for sharing custom models with others, where
you do not want to share the source code itself.
Any library or object files required should be created with both com-
pilers, and then added to the corresponding sub-directory.
If only the filename is entered, PSCAD will assume that the library
or object file is located in the specified sub-directory in the User
Library Path directory. For example, if a user specifies C:\my_libs
as the User Library Path and is using the Intel Visual Fortran compil-
er, entering test.obj as shown below would indicate that the specified
file is located at C:\my_libs\if9\test.obj.
Although it is not
Absolute Path Method
a necessity, the
Files may also be referenced by either an absolute or relative path
absolute path should specification. If this method is chosen, then the directory specified
appear within quotes. in the User Library Path directory will be overridden. For example, a
This will ensure that if
any spaces exist in a file referenced with an absolute path may appear as follows:
path directory or the
filename itself, it will
be parsed properly.
Matlab
The input parameters involved here are outlined below.
Chapter 8:
• Bergeron
• Frequency Dependent (Mode)
• Frequency Dependent (Phase)
An Underground Cable
These components
do not need to be
in proximity to one
another. As long as
they are connected
by name, each
component can be
located anywhere in
the project, including
different modules. Cable Interface Specifying Cable Set-up in Cable Interface
Component Parameters Dialog
The main section tab is entitled Editor, and is the default section
view when the editor is invoked. The four remaining sections are
for viewing files related to the segment. Note that these files will not
exist unless either the segment has been solved manually, or the
project has been compiled.
The editor will open within the main window. As shown below, the
default view is the Editor section, where the transmission line is
graphically defined.
You can also copy and paste tower components directly from any
library project. Open the library in Circuit view. Select a tower
component, then right-click on the component and select Copy (or
press Ctrl + c). Open the Editor tab, right-click over a blank area
and select Paste (or press Ctrl + v).
The graphical
location of the tower
component does not
affect the results.
However, the tower
(or towers) should be
positioned to allow for
ease in readability.
That is, directly on top
of the Ground Plane
component.
In either case, the editor will then open within the main window. As
shown below, the default view is the Editor section, where the cable
system is graphically defined.
You can also copy and paste cable components directly from any
library project. Open the library in Circuit view. Select a cable cross-
section, then right-click on the component and select Copy (or press
Ctrl + c). Open the Editor tab, right-click over a blank area and
select Paste (or press Ctrl + v).
The location of the
Cable Cross-Section
component does not
affect the results.
However, the cross-
section (or cross-
sections) should be
positioned to allow for
ease in readability.
That is, directly below
the Ground Plane
component.
You can also copy and paste model components directly from any
library project. Open the library in Circuit view and select a line
model component, right-click on the component and select Copy
(or press Ctrl + C). Open the Editor section (tab), right-click over a
blank area and select Paste (or press Ctrl + V).
Modules are compiled only once no matter how many times the
component has been instantiated in the project. This is because a
module component does not depend on any of its input parameter
(or connection port) values, to define its definition. A transmission
segment however, is highly dependent on its length (i.e. the length
affects the definition), and since this is an instance-based parameter,
each transmission segment instance must be compiled separately.
Surely the segment length could easily be made part of the definition,
instead of existing as an instance-based parameter, but then a new
segment definition would need to be created whenever the length
changed. This would mean that for the same tower configuration,
a new definition would need to be created if one segment was 15.0
km and the other was 15.001 km. It seems to make more sense
to instead allow a single definition to represent a single tower
configuration, and this configuration can be multiply instanced.
You may however, forego the use of the component wizard and
instead create a definition directly. Right-click on the definitions
If four instances from above are given unique names, they would
appear as follows on the Circuit canvas:
When these line instances (all based on the definition TLine) are
connected as a valid circuit in the project, each line will be solved
individually when the project is compiled.
EXAMPLE 8-1:
Although the above system contains six calls to the transmission line
within the module, it is only actually solved once, as it is part of the
module definition.
When manually
solving a transmission
segment, check the
Solving the Transmission Segment Constants Manually Log file (by clicking
To manually solve a specific transmission line or cable segment in the Log tab) to
ensure that the line
your project, first open the Transmission Segment Definition Editor was properly solved.
(see previous section for instructions, if needed). Along with other
logged text, any errors
issued by the LCP
Right-click over a blank area of the canvas and select Solve will be displayed in
Constants: this file.
Line Summary:
{
Line Name = FLAT230
Line Length = 100.0
Steady State Frequency = 60.0
Number of Conductors = 3
}
Constants File
The constants file is a LCP output file, which is used as input for
EMTDC to set up the transmission line interface to the greater
electric network. This file contains all the information necessary for
EMTDC to represent the transmission segment in the time domain,
and is for the most part, of no concern to the user.
Log File
The log file is a collection of messages sequentially output by the
LCP while it runs its course. This is an important file when initially
debugging and tuning a transmission line or cable segment. It is
recommended that the user scan through this file to ensure that no
problems occurred while the line constants were being solved.
If questions arise regarding the output in this file, please contact the
PSCAD Support Desk ([email protected]).
Output File
Output files are created by the LCP and are used to display
important transmission segment data in a convenient format for
the user. This can include impedance and admittance matrix
information, sequence data and travel times.
The format of the output file will change slightly depending on the
model used. See the Additional Options component for details on
formatting data in this file.
Phase Data
The phase data section displays relevant line constants at a specific
frequency, where all quantities are in the phase domain. The term
‘phase domain’ refers to quantities that have not been transformed
into the modal domain. Phase data represents the ‘real life’
characteristics of the line.
All elements in this matrix are complex and are given in Cartesian
format:
Sequence Data
The sequence data section displays relevant line parameters at a
specific frequency, where all quantities are sequence quantities. The
sequence data is calculated directly, through the use of a sequence
transform matrix T:
Transformation Matrix
If all 3-phase circuits in the Z matrix are ideally transposed, then the
sequence impedance matrix Zsq will be a diagonal matrix, where
the diagonal terms are the equivalent zero, positive and negative
sequence components.
Mutual Coupling
Mutual coupling of transmission system segments enables the user
to couple (or parallel) multiple transmission segments together,
provided their lengths are all identical. In the past, this was possible
only by manually combining two or more separate systems of towers
(or cable cross-sections) into the same transmission segment. Now
PSCAD can be programmed to perform this task automatically, and
even toggle between coupled and non-coupled states, all the while
maintaining the individuality of each segment.
Let us assume however that in the real, physical system, lines L1-3
and L3-1 are indeed close enough to each other (perhaps routed
through the same ROW) to allow coupling effects to play a more
significant role in the solution. To provide this full representation in
PSCAD, the two segments must be combined into a single ROW.
Creating a ROW
First of all, ensure that all transmission segments possess the same
length. Also keep in mind that it is not possible to combine overhead
lines and underground cables within the same ROW. Next, decide
which of the segments will be the reference segment. Right-click
on the reference segment and select Edit Parameters…. The
Configuration dialog will appear.
Graphical Indicators
Additional graphics are provided in order to help distinguish between
stand-alone segments, and those coupled within a ROW. For
example, if lines L1-3 and L3-1 are coupled into a ROW called L1L3,
where L1-3 is the reference segment, then the circuit on the project
canvas would appear as follows:
What occurs instead with sequence data entry is that PSCAD will
construct Y and Z matrices for the entire coupled system; these
matrices are based on information from both the individual Manual
Entry of Y,Z components in each segment involved, as well as
additional 0-sequence mutual data. The 0-sequence mutual data
must be provided separately by the user, in the same data format as
that data entered in the Manual Entry of Y,Z components.
This will enable the second category page in the dialog called
Manual Entry of 0-Sequence Mutual Data.
The Input Data in this dialog is entered in matrix format, where each
row/column of the matrix represents a 3-phase system. Each input
data parameter can hold information for up to 10, 3-phase coupled
segments.
EXAMPLE 8-2:
The local data from each segment forms two, individual 3x3 matrices
each representing both Y and Z. If we just concentrate on Z (Y
is treated in an identical manner), then the two segments will be
represented by two unique Z matrices called Z1 and Z2. When two,
3-phase systems are coupled to form a single 6-phase system, Z1
and Z2 become the diagonals of the coupled 6x6 matrix as follows:
Once this data is entered, PSCAD will solve these two lines as one
coupled system.
For more details on how conductor positions are calculated, see the
section entitled The PSCAD Line Constants Program in Chapter 9 –
Transmission Lines and Cables in the EMTDC Manual.
See the section entitled The File Tree in Chapter 4 for more details.
Cautionary Measures
There are some precautions that should be taken when utilizing the
mutual coupling algorithm that may not appear obvious at first.
Maximum Conductors/Cables
Keep in mind that the maximum number of conductors and/or cables
in a right-of-way must still be adhered to. See the section entitled
Scoping Boundaries in Chapter 1 for details.
The viewer supports both matrices and vectors, in that any element
of any output matrix can be plotted individually. Some examples of
what data is available for plotting are:
• Series Impedance
• Shunt Admittance
• Eigenvectors/Eigenvalues
• Curve Fitting Output
The plotting tools used in the viewer are based on those used for
online plotting in PSCAD, including features, such as markers,
zoom and cross-hairs. Data may be written to file or copied to the
clipboard just as it can be in the online plotting tools.
For more details on solving the constants, see the section entitled
Although mutually
Solving the Transmission Segment Constants Manually in this
coupled ROW
chapter.
detailed output files
can be generated, Invoking the Detailed Output Viewer
the Detailed Output
Viewer does not
The Detailed Output Viewer can be opened from within the
currently support Transmission Segment Definition Editor pop-up menu.
viewing of these files.
Detailed output is not available for the Bergeron model, as this model
solves at only one frequency. See the section entitled Segment
Output (*.out) File in this chapter for more on viewing Bergeron
model output.
Column Organization
Depending on the output parameter being viewed, the data may exist
as either matrix or array, or whether curve fitting results are included.
Matrix:
etc...
Array:
etc...
Calculated/Fitted Quantities:
etc...
When curve fitting results are included, the calculated and fitted
quantities are staggered, as indicated by the ‘C’ and ‘F’ respectively.
Button Description
Access help
Curve Viewer
The Curve Viewer is a simple utility used for viewing the line
For detailed
constants detailed output data graphically. The utility uses the information on using
same online plotting facilities that are provided in the main PSCAD these plotting tools,
environment, tailored to this specific use. There are two Curve View see Chapter 6 - Online
Plotting and Control.
utilities: View Single Graph and View All Graphs.
Element Identification
The Curve Viewer makes use of the multi-trace Curve feature
available in the PSCAD online plotting tools, in order to allow plotting
of 2-dimensional parameters, such as matrices. For example, if
plotting a 3x3 matrix, such as the Y or Z matrix magnitudes, the
matrix elements are organized according to Curve and Trace, where
each multi-trace Curve represents an entire matrix column, and the
respective Traces represent the elements of that column.
A 3x3 Matrix
In the diagram above, the column 1 Curve has been expanded
to reveal the three Traces representing the 3-elements of the
column. That is, elements (1,1), (2,1) and (3,1). For more on multi-
trace Curves, see the section entitled Curves and Traces in Chapter
6 - Online Plotting and Control.
Array items, such as the eigenvalue array, are organized such that
all elements are included within a single Curve. For example, the
magnitudes of a 3-element array would appear as follows:
A 3-Element Array
Chapter 9:
Component Design
One of the features that make PSCAD such a powerful simulation
tool is its allowance for the design of custom models. Users can
develop models from the very simple, to the very complex, limited
only by their skills and knowledge of the subject. Many seasoned
users continue to amaze us (the developers of PSCAD) with what
they have managed to accomplish with the software over the years.
• Hold down the Ctrl key and then left double-click on the
component.
Scroll Bars
Vertical and horizontal scroll bars are available in all environment
windows. These are located at the right-most and bottom-most
edges of the open window respectively.
Arrow Keys
You can use the arrow buttons on your keyboard to scroll both
horizontally and vertically.
• On a blank portion of the page, press and hold the Ctrl and
Shift keys, then click and hold the left mouse button (Ctrl +
Shift + left mouse hold). Moving the mouse will then allow
panning through the page.
• Press the Pan button in the main toolbar to invoke panning
mode. To indicate that you are in panning mode, the mouse
pointer will change into a hand shape. Press Esc to cancel
pan mode.
Zooming
There are a few different methods for zooming available:
• Select the object with a left mouse click. Click the Cut or
Copy buttons from the main toolbar. Click the Paste button
main toolbar to paste.
• Right-click the object and select Cut or Copy from the
pop-up menu. Right-click over a blank area of the Graphic
window and select Paste from the pop-up menu.
• Select the object with a left mouse click so that grips
appear. Press Ctrl + x or Ctrl + c to cut or copy the label
respectively. Press Ctrl + v to paste.
Graphic Objects
There are several types of purely graphic objects available. These
include:
• ¼ Arc
• ½ Arc
• Ellipse
• Line
• Rectangle
Object properties, such as colour, fill and size can be changed to
suit the component graphical needs. A good graphical design can
enhance user understanding of the purpose of the component and
what its primary function is.
Inserting Graphics
Graphic objects may also be inserted by importing a previously
defined Scalable Vector Graphics (*.svg) file. To do so, move the
mouse pointer over a blank area of the Graphic window. Right-click
and select Insert Graphics….
If you would like to insert a specific graphics file, select From a file…
and point directly to the file.
graphics files that have been previously saved from within PSCAD
(See section entitled Saving Graphics to File below.). Any files
stored in this folder will be listed in the sub-menu, as shown above.
Note that the format of the file must be very specific in order to be
imported into the Graphics section. Presently, only minimal support
has been implemented (i.e. basic PSCAD graphic objects), and so
this feature should be used as a way to transfer graphics from one
component to another. In fact, it is best that you only use the Save
Graphics feature described below to create the files from within
PSCAD, and avoid using external programs. A partial *.svg file,
created by PSCAD, is shown below as an example:
Place the mouse pointer over a selected grip, press and hold the left
mouse button, and move the mouse. Note that the corner grips will
allow resizing in both directions, while the mid-point grips will only
allow movement in either the horizontal or vertical directions.
If you cannot see this tool bar, select View | Rotation Bar from the
main menu. Select the object with a left-click of your mouse. Then,
click one of the four buttons shown above.
You can also use the right-click pop-up menus: Right-click over the
object and select Rotate. Choose one of the options given.
Line:
• Fill: Select the down arrow to bring up the fill palette shown
below. With the mouse pointer over the Transparent, Solid
Fill or Pattern buttons, left click the down arrow to bring
up the respective sub-palettes shown below. This input is
disabled for Line objects!
In addition to the Format Graphic Object dialog, you can change the
line/border colour, weight and style, as well as fill properties directly
from the Graphic Palette. First, select the object with a left-click
(grips appear). Then adjust any of the above properties by using the
appropriate buttons.
Line:
The properties within the Line area (i.e. Colour, Weight and Style)
function exactly as described for graphic objects. See Changing
Graphic Object Properties above.
Other:
Text Labels
Text can be displayed on component graphics by using a Text Label
object. Text labels can be one line of text only, and the user may
select alignment and size.
Simply left-click the New Text Label button, drag the label to where
you want it placed and left-click again. Another method is to use the
right-click menu: Move the mouse pointer over a blank area of the
Graphic window. Right-click and select New Graphic | Text.
A Text Label will appear attached to your mouse pointer. With your
mouse, move the label (left-click and hold) to the desired location
within the Graphic canvas.
EXAMPLE 9-1:
A user wants to display the value of an input field with Symbol name
timec, which represents the component time constant. The user
adds a text label to the component graphic and adds the following to
the Text input field in the Format Text Label dialog:
If the % prefix is
If the timec input field has a value of say 10.0 [s], then the resulting
display on the Circuit canvas would be similar to:
replaced by the $
prefix, the units will
not be displayed.
Port Connections
Port Connections are used to provide graphical access to signals
defined within the Circuit canvas where the component instance
resides. They provide a means to either read signals from, or output
signals to the external system each simulation time step. These
ports play an essential part in the construction of circuits in PSCAD,
and are the graphical signal communication avenue between
models.
Simply left-click the New Connection button on the toolbar, drag the
connection to where you want it placed and left-click again. Another
method is to use the right-click menu: Move the mouse pointer over
a blank area of the Graphic window. Right-click and select New
Graphic | Connection.
You may notice that
port connections are
always snapped to
the Graphic canvas
drawing grid. This is
to ensure that when
other components
are connected to
A port connection should appear attached to your mouse pointer. yours, their respective
connection points will
With your mouse, move the node to the desired location within the overlap.
Graphic window and left-click to place the object.
When you first create Categories
a new component,
a default category Within the Parameters section, you may include several category
called General will pages, each containing inputs pertaining to a similar function, or
be created for you.
This category will
you may place all inputs in a single category page. There are four
possess a single types of input parameter fields that may be added categories. These
default parameter field include:
called Name. Name is
used for display in the
workspace secondary • Choice List
window, specifically
for the identification of
• Integer
module components • Real
with multiple • Text
instances. See The
Secondary Window • Table
in Chapter 4 of this • Toggle
manual for details.
In either case, a new category page will appear with default name
Untitled as shown below.
Ordering Categories
Once you have added more than one category, there may be a need
to re-order the sequence of the category pages. Select a category
page and then click the up or down arrow on the tool bar as shown
below:
Duplicating a Category
Category pages are duplicated by simply copying and pasting them
in the Categories tree. Select the desired category in the tree, right-
click and select Copy (or press Ctrl + c). Paste the category. Right-
click on the Categories tree and select Paste (or press Ctrl + v).
Copy Paste
A new category page will appear in the tree with a number appended
to the copied category name. You may rename the category as
described in Changing Category Properties above.
Deleting a Category
To delete a particular category, select it in the Categories tree and
then click the Delete Category button in the toolbar (or press the
Delete key).
You may also right-click on the category page itself and select
Delete.
Text Fields
Text fields are used primarily to add descriptive comments as input,
or to define signals to be used as internal output variables within the
component. See Internal Output Variables for more details.
Input Fields
Input fields allow the user to import numerical or signal input into the
component. Input fields include the following numerical sub-types:
• Real
• Integer
A brief definition and example is given below for each data type:
Choice Lists
The purpose of a choice list is to allow the user to set conditions
according to a selected choice, which will possess an associated
integer number for use internally in conditional statements.
The Drop List Editor will appear. To add choices to the list, click the
Add button.
The contents of any choice in the list can be modified in the editor
window to the right: Within the Members list, left-click on the choice
name to select it. To edit the properties of the selected choice, left-
click either the Description and/or the Value field.
Note that when adding choices to the choice box, the most important
thing to remember is that a unique integer must be assigned to each
entry in the Members choice list. This is accomplished by modifying
the Value field as described above. It is this assigned number
that will be associated with the Symbol name of this choice list,
depending on the setting.
Table fields can
Table Fields
Table fields are specially designed to allow the user to enter data in
currently be used only vector or matrix form directly as a component parameter. Table fields
in standard, non- include the following numerical sub-types:
module components.
• Real
• Integer
Toggle Fields
Toggle fields are Boolean parameters designed for simple on/off or
yes/no parameters.
• Right-click on the field and select Cut or Copy from the pop-
up menu. Right-click over a blank area of the input fields list
and select Paste from the pop-up menu.
• Left-click on a field and press Ctrl + x to cut, Ctrl + c to copy
and Ctrl + v to paste.
To delete a field, select it and press the Delete key, or right-click and
select Delete.
Conditional Statements
The primary purpose of conditional statements is to either enable or
disable an object (such as an input field), or to make an object visible
or invisible (such as a graphic object).
EXAMPLE 9-2:
In the properties dialog for the graphic objects, the following text is
added to the respective Conditional Statement input fields:
If a user selects Ellipse in the choice list, only the ellipse object will
appear in the component graphic. If Rectangle is chosen, only the
rectangle will appear.
The above states: If Type equals 0 and Type2 equals 3, then make
the ellipse visible.
Layers
Be sure when adding
As component graphics become larger and more complicated, the
graphical working environment can become quite unruly – especially
conditional statements when many conditional statements are used.
that the statements
themselves are
identical in format, as Fortunately, there is a way to avoid the potential clutter by utilizing
well as logical truth. If the graphical layers available in the Graphic section. Layers are
the statements vary
slightly in format, a based solely on conditional statements, in that whenever a unique
separate layer will be conditional statement is entered into an object or field, a new
created, even though
the statements may
graphical layer is created. Any other graphic object, which utilizes an
indicate the same identical conditional statement, will also be visible in that particular
thing.
layer.
Viewing Layers
By default, only the layers visible on the graphic of a particular
component instance will be initially visible in the Graphic canvas
when the component definition is edited. Although a component
definition may have several instances, only the layers present on the
instance used to access the definition will be visible by default. If the
definition is accessed from the definition itself in the Workspace, then
the layers will be based on the component default conditions.
To adjust the layer visibility, move the mouse pointer over a blank
area of the Graphic canvas. Right-click and select Layers. The
resulting sub-menu will list all of the available layers (or conditional
statements) that currently exist in the component graphics.
Base Layer
The base layer contains any graphical objects and port connections
that do not possess a defined conditional statement (i.e. are not part
of a defined layer). The base layer may be toggled on and off using
the pop-up menu: Move the mouse pointer over a blank area of the
Graphic canvas. Right-click and select Base Layer.
Setting Layers
Instead of turning layers on and off through the right-click menu
(which can become cumbersome as the number of layers increases),
you can set and test the visible layers directly using the component
parameters dialog.
Object Filters
In addition to graphical layers, you may also use Object Filters to
help alleviate graphical clutter. Object filters allow the user to view
objects based on the graphic object type (i.e. port connections, text
labels, etc.).
This section of the definition is used primarily for lower level code
entry, and consists of a variety of Segments, each performing a
specific function. Not all segments need to exist in every component,
but the most commonly used segments are Fortran, Computations
and Branch, and these are included by default in every newly created
definition.
Segments
Segments are ordered similar to pages in a book. Each segment is
itself a simple text editor, where data, script and other code is added
to perform a specific task. Segments may be added or deleted at
will, but must follow a strict naming convention.
Managing Segments
The Segment Manager enables users to add or remove segments
from within a simple dialog. To invoke the segment manager, the
most straightforward method is to use the script bar:
The list on the left-side of the dialog displays the segments available
to add to this definition, while the right-side lists are the segments
already in the definition. To add or remove segments to/from the
definition, simply select the Add-> or <-Remove buttons. Once
satisfied with the selection, click the OK button. If you chose to
remove any existing segments, a dialog will appear asking you
Although this section
does provide an
assortment of simple
examples, there
is a huge wealth
Segment Types
of examples in the There are several segment types available. Each exists for a
master library project specific purpose, but are only required if that specific function
itself. Simply edit
any master library is needed as part of the component design. Most of the time, a
definition (right-click definition will only require two or three segments.
on the component
and select Edit
Definition...) to study Computations
its contents. The Computations segment is an environment provided for the pre-
processing of component input data, as well as creating new internal
variables. Although component parameter input may be in the most
convenient form for the user, it may not be so convenient for the
definition itself. For example, the definition may require the system
frequency in radians per second, but the input data field may ask the
user for the same quantity in Hertz.
All script The Computations segment is the first segment considered by the
processed within compiler when the component is compiled. Due to this fact, any
the Computations
segment is done so quantities defined here may be substituted elsewhere in any of the
before any Fortran other segments. This segment allows both mathematical and logical
code is constructed
for EMTDC, and only
expression evaluation.
considered once.
Therefore, quantities A typical Computations Segment entry must have the following
defined here are static
for the remainder of standard format:
the simulation.
<DataType> <Name> = <Expression>
Where,
EXAMPLE 9-3:
Branch
The Branch segment is primarily for the provision of electric branch
information to the EMTDC Electric Network Conductance Matrix: It
is essentially an input portal for control of the EMTDC Equivalent
Conductance (GEQ) Interface. Branch design is accomplished by
[<Branchname> = ] $<TO>
$<FROM> [<Keyword>] [$]<R> [$][<L>] [$][<C>]
Where,
If a branch does not
• <Branchname> = may be used to give the branch a
name, which can be used to refer to the branch (instead
contain all three types of its nodes) in other sections. Note that many EMTDC
of elements, simply subroutines require the branch name as an argument.
substitute 0.0 for the
value of the element • <Keyword> can be either SOURCE or BREAKER and is
that is not present. explained in the following sections.
• $ is the Substitution Prefix Operator ($).
EXAMPLE 9-4:
and BRN2 are defined. The designer modifies the above branch
If BRN1 and BRN2
statements as follows:
are used in other
segments, they must BRN1 = $N1 $N2 $R 0.0 $C
be preceded by the BRN2 = $N1 $N2 0.0 0.001 0.0
Substitution Prefix
Operator ($).
EXAMPLE 9-5:
Where,
Fortran
The Fortran segment is where any Fortran code, defining what the
component is to model, is placed. Code entered in this segment
should either exist in the form of standard Fortran 90, or Definition
Script (or a combination of these two). It is also possible to define a
function, or call an external subroutine from this segment.
EXAMPLE 9-6:
Note that the above two examples have been simplified slightly.
Generally speaking, the value for the 2πft function should never
be allowed to simply grow larger and larger as the simulation
progresses. It should be reset to zero whenever 2πft = 2π is
reached.
There are pros and cons to adding inline Fortran code directly into
the segment, as opposed to calling a subroutine or function. Here
are some key points to consider:
DSDYN
This segment is identical to the Fortran segment, except that all
code will be forced into the DSDYN section of the EMTDC System
Dynamics.
DSOUT
This Segment is identical to the Fortran section, except that all
code will be forced into the DSOUT section of the EMTDC System
Dynamics.
Checks
The Checks segment is used to ensure that data entered into the
component input parameters by the user is reasonable. If a specific
condition is true, then a given warning or error message can be
made to appear in the Output Window when the case is compiled.
EXAMPLE 9-7:
Help
The Help segment is useful when the user wants to provide
an external HTML based help file for a particular user-defined
component. For example, If the user has created an HTML
document entitled help.html, then all that is required is that the name
and extension be added to the Help segment as shown below:
help.html
Comments
Add your comments / reminders / notes about the design of this
component here. Do not use this segment as a means of providing
help to users. This segment is ignored by the application and is
accessible only when editing the definition.
FlyBy
The FlyBy segment provides an avenue for the designer to apply
fly-by (or pop-up) help to a component. Fly-by windows can help
to provide users with a quick description of the model itself, or even
individual port connections on the component.
EXAMPLE 9-8:
If the mouse pointer is now moved over the component while on the
Circuit canvas, the following fly-by windows will appear:
Transformers
The Transformers segment is used both to define data for any
existing mutual impedance matrices, as well as to provide
dimensioning information to EMTDC regarding transformers
and windings. A single component may contain multiple mutual
impedance matrices.
Note that only the diagonal and the data below the diagonal need to
be entered. The matrix is assumed to be symmetrical.
EXAMPLE 9-9:
#TRANSFORMERS 1
!
2 /
$A1 $B1 $R11 $L11 /
$A2 $B2 $R12 $L12 $R22 $L22 /
!
EXAMPLE 9-10:
#TRANSFORMERS 2
!
2 /
$A1 $B1 $R11 $L11 /
$A2 $B2 $R12 $L12 $R22 $L22 /
!
888 /
!
$A3 $B3 /
$A4 $B4 /
Model-Data
The Model-Data segment is used as a way to bring input data into a
user-defined subroutine, without having to declare an argument for
each bit of data. There is no specific format for text in this segment,
as this format depends on READ statements within the user code.
When the project is compiled, PSCAD will include all text in this
segment within the corresponding module Data File (*.dta), under
the headings DATADSD or DATADSO. If the subroutine is called
from DSDYN, the Model-Data contents will appear in the DATADSD
section; and DATADSO otherwise.
!
! Add include file to define IUNIT
!
INCLUDE ‘fnames.h’
!
! ...
!
READ(IUNIT,*) ...
!
Matrix-Fill
When a project is initially compiled, PSCAD will construct a
temporary logical matrix for the purpose of indicating how the
electrical system is connected (i.e. how nodes and branches are
put together). The Optimize Node Ordering algorithm in PSCAD
then uses this information to optimize node placement in the actual
system conductance matrix. However, only electrical nodes and
branches, defined within the Branch segments of each component
present in the system, are considered.
EXAMPLE 9-11:
The logical matrix for the Optimize Node Ordering algorithm would
appear as follows, where X indicates a known connection:
The matrix above does not contain all of the connection information
required however. We know through the Transformers segment
in the transformer component, that nodes N2, N3, N5 and N6 are
all part of a mutual impedance matrix and hence are all connected
together, as shown below:
$A1 $B2
$A2 $B1
T-Lines
The T-Lines segment is used to specify any electrical port
connections that are to be used as sending or receiving end port
connections for a transmission line or cable. The T-Lines segment
This Segment is used only within the Transmission Line and Cable
Interface components in the master library.
CBR
CBR is a special substitution operator that will output the current
measured in a specified branch. A special syntax is used for this –
see the example below.
EXAMPLE 9-12:
VDC
VDC is a special substitution operator that will take the voltage
difference between two different electrical nodes. A special syntax is
used for this – see the example below.
EXAMPLE 9-13:
Prior to compilation of the project, ensure that any source (*.c) files
are referenced in the Additional Source Files project setting (under
the Fortran tab). Alternatively, object files (*.obj) or a library file (*.lib)
should be referenced in the Additional Library (*.lib) and Object
(*.obj) Files project setting (under the Link tab).
INCLUDE ‘nd.h’
INCLUDE ‘emtconst.h’
INCLUDE ‘emtstor.h’
INCLUDE ‘s0.h’
INCLUDE ‘s1.h’
INCLUDE ‘s2.h’
INCLUDE ‘s4.h’
INCLUDE ‘branches.h’
INCLUDE ‘pscadv3.h’
INCLUDE ‘fnames.h’
INCLUDE ‘radiolinks.h’
INCLUDE ‘matlab.h’
INCLUDE ‘rtconfig.h’
EXAMPLE 9-14:
CALL TEST_CSUB($IN,$OUT)
Where $IN and $OUT are input and output port connections on the
component respectively.
EXAMPLE 9-15:
Where $IN and $OUT are input and output port connections on the
component respectively.
EXAMPLE 9-16:
CALL AUX_CSUB($IN,$OUT)
Where $IN and $OUT are input and output port connections on the
component respectively.
Adding Graphics
Edit the component definition and in the Graphic section, draw the
following diagram (minus the sticky notes!); where $R is a text label,
and NA and NB are port connections.
Make sure the
graphics are of a
reasonable size
in relation to other
components in the
master library.
Now add a choice list to the category with the Description Is This
Source Grounded?. Give it an appropriate Symbol name (say, gnd)
and then add two choices: 1=Yes and 0=No.
Edit the component definition and in the Graphic section, modify the
component graphics, as shown in the diagram below, where G is a
port connection configured as an electrical ground node.
You may be wondering at this point about the placement of the port
connections G and NB in the Graphic section diagram above. When
placing your port connections within your component graphic, it is
important to consider where the most intuitive position for the port
connection is. That is, it would be best to place NB at the end of the
line object, as this would be an obvious connection point.
#IF gnd == 1
BRN = $NA $G SOURCE 1.0 0.0 0.0
#ELSE
BRN = $NA $NB SOURCE 1.0 0.0 0.0
#ENDIF
Add the following script to the segment (you may copy directly from
this document):
#BEGIN
CALL E_BRANCH_CFG($BRN,$SS,1,0,0,$R,0.0,0.0)
CALL E_1PVSRC_CFG(1,0,1,$Vrms,$f,0.0,$R,0.0,0.0,0.0,0.0,$tr)
#ENDBEGIN
#STORAGE LOGICAL:1 INTEGER:6 REAL:8 RTCF:4
#LOCAL REAL RVD1_1
#LOCAL REAL RVD1_2
#LOCAL REAL RVD1_3
#LOCAL REAL RVD1_4
! Single Phase AC source: Type: R
RVD1_1 = RTCF(NRTCF)
RVD1_2 = RTCF(NRTCF+1)
RVD1_3 = RTCF(NRTCF+2)
RVD1_4 = RTCF(NRTCF+3)
NRTCF = NRTCF + 4
CALL EMTDC_1PVSRC($SS,$BRN,RVD1_4,TRUE.,RVD1_1,RVD1_2,RVD1_3)
E_BRANCH_CFG(NBR,M,ER,EL,EC,RO,HL,FC)
Argument List:
E_1PVSRC_CFG(AC,SPEC,TYP,VM,F,PH,R,L,RP_C,P,Q,TC)
Argument List:
• AC : AC or DC source (1 or 0 respectively).
• SPEC: Internal values or at source terminal (0 or 1
respectively).
• TYP: Impedance type (R = 1).
• VM: RMS voltage [kV].
• F: Frequency [Hz].
• PH: Phase angle [deg]
• R: Resistance value [Ω]
• L: Inductance value [H]
• RP_C: Capacitance value [µF]
• P: Active Power output
• Q: Reactive power output
• TC: Ramp-up time [s].
The last bit is the actual call to the subroutine that controls the
source throughout the simulation: EMTDC_1PVSRC.
EMTDC_1PVSRC(M,NBR,RT,AC,VP, W, A)
Argument List:
Sanity Checks
It is always a good idea to apply sanity checks to the users input,
so as to avoid erroneous results. This is accomplished by using the
Checks segment.
Edit the component definition and in the Script section, add a new
Checks segment by using the segment manager. Add a statement,
which will give an error if the entered source resistance (i.e. R) is
less than or equal to 0.0. Note that you must use negative logic in
this section, and so this statement should appear as follows:
Edit the component definition and in the Parameters section, add two
text fields: One with Symbol name Isource and Description Source
Current; the other with Symbol name Vsource and Description
Source Terminal Voltage.
Your Fortran segment should then look similar to the following when
completed:
#BEGIN
CALL E_BRANCH_CFG($BRN,$SS,1,0,0,$R,0.0,0.0)
CALL E_1PVSRC_CFG(1,0,1,$Vrms,$f,0.0,$R,0.0,0.0,0.0,0.0,$tr)
#ENDBEGIN
#STORAGE LOGICAL:1 INTEGER:6 REAL:8 RTCF:4
#LOCAL REAL RVD1_1
#LOCAL REAL RVD1_2
#LOCAL REAL RVD1_3
#LOCAL REAL RVD1_4
! Single Phase AC source: Type: R
RVD1_1 = RTCF(NRTCF)
RVD1_2 = RTCF(NRTCF+1)
RVD1_3 = RTCF(NRTCF+2)
RVD1_4 = RTCF(NRTCF+3)
NRTCF = NRTCF + 4
CALL EMTDC_1PVSRC($SS,$BRN,RVD1_4,.TRUE.,RVD1_1,RVD1_2,RVD1_3)
!
#OUTPUT REAL Isource {$CBR:BRN}
#IF gnd == 1
#OUTPUT REAL Vsource {$VDC:NA:G}
#ELSE
#OUTPUT REAL Vsource {$VDC:NA:NB}
#ENDIF
Any text field with a Symbol name identical to those defined above
(i.e. Isource and Vsource), will act as internal output variable ports
for the component. Any variable name entered into either the Source
Current or Source Terminal Voltage text fields will create signals
which, when connected to an Output Channel, can be plotted.
Run the case again. You should see identical results as before in
Testing Your New Component.
Chapter 10:
Definition Script
The PSCAD definition script language is used extensively in
the design of component definitions. It serves mainly as a
communication interface between the designer and the application,
providing instruction on how to incorporate a component into the
greater project. This communication occurs at compile time, when
each definition segment is considered sequentially, and its script
parsed into information meaningful to the compiler.
Although there are some segments that allow for the direct inclusion
of source code (i.e. code that does not require parsing), such as
Fortran, DSDYN and DSOUT, exploiting definition script ensures
that code source remain current, as well as compiler and language
independent. Definition script is given the highest priority during
the compilation process; it is considered first before any direct
source code, and is consequently used in expression evaluation,
substitutions, and for the provision of compiler directives.
Substitutions
Substitutions are fundamental script operators that can appear in
all parts of a definition. They provide a means to communicate
information between definition sections and segments, bring a
dynamic aspect to component graphics, and to help in formatting
code and comments.
Substitution Description
$ Value Substitution Prefix Operator
% Data Substitution Prefix Operator
{} Enfolding Operators (Braces)
! Comment Operator
EXAMPLE 10-1:
!
REAL RT_1 ! EMTDC variable to represent ‘freq’
The input parameter
REAL OUT value substituted for
freq is the resulting
RT_1 = STOF(ISTOF + 2) ! EMTDC extracts parameter value value following unit
! from stored data array processing. See the
OUT = 2.0*PI*RT_1 section entitled Unit
! System in Chapter
5 – Operations and
Feature Overview for
Actual Fortran Code Following Compile more details on units.
EXAMPLE 10-2:
RT_1 = 2.0*PI*60.0
EXAMPLE 10-3:
!
REAL PH_CON ! Phase Angle Converter
!
REAL RT_1, RT_2
EXAMPLE 10-4:
freq, value 60.0 and units in Hz, and Voltage with Symbol name
volts, value 120.0 and units in kV. Note that both freq and volts are
local variables and so the local context short form is used.
EXAMPLE 10-5:
In the component Graphic Section, the user adds two new text labels
(positioned accordingly) and enters $Vprim and $Vsec as shown
below:
$(<Context>:<Key>)
The following table lists all valid context names that may be used in
place of <Context> and <Key> as described above (both Context
and Key names are case sensitive):
EXAMPLE 10-6:
EXAMPLE 10-7:
Consider Example 10-4 above, but replace the $ operator with the
% operator. The following comments could then appear in either the
Fortran, DSDYN or DSOUT segments:
EXAMPLE 10-8:
Consider Example 10-5 above, but replace the $ operator with the
% operator in the new text labels. When the component instance
is now viewed on the Circuit canvas, values of the input parameters
Vprim and Vsec will appear on the component graphic as follows:
[$]{<Expression>}
Where:
Although simple examples are provided here, you can find more
examples by studying the definitions of master library components.
EXAMPLE 10-9:
EXAMPLE 10-10:
! Comment Operator
The exclamation point is used throughout the component definition
Commented code that
segments to indicate that a particular line of code is a comment. All is written to the data
file, requires that the
lines of script preceded by this operator will be considered source Comment Indicator
comments for inclusion in the project Fortran and Data files. be in the first column
from the left.
EXAMPLE 10-11:
Script Directives
Script directives are used to facilitate the creation of source code,
which will ultimately be used in the building of an executable program
representing the project. Each directive type has a specific purpose,
as explained in the following sections. Script directives always begin
with a pound # symbol prefix, where spaces preceding and following
the # symbol are allowed.
#IF <Logic>
...script...
#ELSEIF <Logic>
#IF <Logic>
... script...
#ELSE
... script...
#ENDIF
#ELSE <Logic>
... script...
#ENDIF
EXAMPLE 10-12:
!
! Signal Generator
!
#IF Type == 1
$OUT = SIN(TWO_PI*$F)
#ELSE
$OUT = COS(TWO_PI*$F)
#ENDIF
!
Type == 1 in the above
Where F is a pre-defined variable (perhaps an input parameter code is a Logical
Expression. See
or Computations segment variable) and OUT is an output port Expression Evaluation
connection in the Graphic section. for more details.
!
! Signal Generator
!
#IF Type == 1 { $OUT = SIN(TWO_PI*$F)}
#IF Type != 1 { $OUT = COS(TWO_PI*$F)}
!
EXAMPLE 10-13:
#IF Type == 1
$N1 $N2 $R 0.0 0.0
#ELSEIF Type==2
$N1 $N2 0.0 $L 0.0
#ELSE
$N1 $N2 0.0 0.0 $C
#ENDIF
!
#IF Type == 1 {$N1 $N2 $R 0.0 0.0}
#IF Type == 2 {$N1 $N2 0.0 $L 0.0}
#IF Type == 3 {$N1 $N2 0.0 0.0 $C}
!
#CASE
The #CASE directive is a short-form notation method, which can
be used in place of #IF, #ELSEIF, #ELSE, #ENDIF directives. It is
normally used in conjunction with the ~ Line Continuation Operator to
provide a space saving alternative, especially when a great number
of #IF, #ELSEIF, #ELSE, #ENDIF directives are required.
EXAMPLE 10-14:
!
! Signal Generator
!
#IF Type == 1
$OUT = SIN(TWO_PI*$F)
#ELSE
$OUT = COS(TWO_PI*$F)
#ENDIF
!
!
! Signal Generator
!
$OUT = ~
#CASE Type {~COS~} {~SIN~}
~(TWO_PI*$F)
!
EXAMPLE 10-15:
Here, YD1 and Lead are both component input parameters. YD1
can equal either 0 or 1 and Lead either 1 or 2. Multiplying these
two integers can result in 0, 1 or 2, and this information is used to
determine which clause to select:
!
#CASE YD1*Lead {$A1 $G1~} {$A1 $B1~} {$A1 $C1~}
!
#STORAGE
This directive is required only if a definition is utilizing EMTDC
Storage Arrays. Its purpose is to define the manner in which
memory is used – specifically the type and amount of EMTDC
storage to be allocated. The #STORAGE directive acts as a direct
interface to the storage arrays; which provide time step to time step
data transfer capability, as well as data transfer between BEGIN
and corresponding DSDYN or DSOUT sections. EMTDC array
usage must be specified with a #STORAGE directive to ensure that
memory is properly dimensioned by PSCAD at compile time.
#STORAGE <TYPE>:<Number>
The following storage examples are all valid when using the $
Substitution Prefix Operator with this directive:
#STORAGE REAL:$(X) INTEGER:$(Y) // X and Y are literal parameters
#STORAGE REAL:$#DIM(N1) INTEGER:$#DIM(N2) // N1 & N2 are electrical ports
#STORAGE INTEGER:$#DIM(N1) LOGICAL:7
#STORAGE REAL:${X+Y}
This array is
left over from
PSCAD V2 and is
STOR STOR(NEXC)
deprecated. Do
not use this array if
possible.
For floating point
Inter Time REAL STORF(NSTORF) (REAL) storage
Step Data only.
Transfer
For INTEGER
INTEGER STORI(NSTORI)
storage only.
For LOGICAL
LOGICAL STORL(NSTORL)
storage only.
For COMPLEX
COMPLEX STORC(NSTORC)
storage only.
For COMPLEX
RTCC RTCC(NRTCC)
storage only.
EXAMPLE 10-16:
#IF NL==0
#STORAGE INTEGER:2 REAL:110
#ELSEIF NL==1
#STORAGE INTEGER:2 REAL:1100
#ELSEIF NL==2
#STORAGE INTEGER:2 REAL:11000
#ENDIF
#FUNCTION REAL XYZFUNC XYZ-Transfer function
! File name: $FILE
$Z = XYZFUNC($X,$Y,$MODE,$Xoff,$Yoff,$Zoff,$Kx,$Ky,$Kz)
#LOCAL
This directive is used to declare local variables directly within
definition script. Quite often it is necessary to declare local variables
in order to define a dummy variable for an unused subroutine
argument, or perhaps as an intermediary value in a set of equations.
The following storage examples are all valid when using the $
Substitution Prefix Operator with this directive:
EXAMPLE 10-17:
#BEGIN/#ENDBEGIN
This directive block provides a portal to the BEGIN outer process
layer in EMTDC, which is essentially a module based, subroutine
that is called prior to both DSDYN and DSOUT at time zero.
#BEGIN
...
#ENDBEGIN
EXAMPLE 10-18:
y = A � eB·x or y = A · 10B·x
#BEGIN
RTCF(NRTCF) = $A
RTCF(NRTCF+1) = $B
NRTCF = NRTCF + 2
#ENDBEGIN
#STORAGE RTCF:2
!
$OUT = RTCF(NRTCF) * EXP(RTCF(NRTCF+1) * $IN)
NRTCF = NRTCF + 2
!
#FUNCTION
This directive is used to declare the existence of a function, and the
argument type it returns. #FUNCTION is mandatory if a function
is used within a component definition: It will ensure that a function
declaration statement is placed within any source subroutine where
the component code is placed.
EXAMPLE 10-19:
#SUBROUTINE
This directive is used to provide a description for a subroutine that
is being called from the component. #SUBROUTINE is used simply
for cosmetic purposes, and is not mandatory (although its use is
recommended anyway).
EXAMPLE 10-20:
#OUTPUT
This directive extracts specified data values so that they may
be monitored, plotted, or used externally by other components.
#OUTPUT performs two tasks; it defines a new variable according
to a specified name, and then assigns it a value according to an
expression.
EXAMPLE 10-21:
#TRANSFORMERS
This directive should be included whenever mutually coupled
windings are to be represented in a component definition. It
is normally used in conjunction with the #WINDINGS directive
(described below). Examples of master library components that
utilize this directive are (of course) the transformers and the
π-section components.
#TRANSFORMERS <Number>
EXAMPLE 10-22:
#TRANSFORMERS 3
#WINDINGS 2
#WINDINGS
This directive is used to assign the number of coupled windings
in a transformer, and is normally used in conjunction with the
#TRANSFORMERS directive. PSCAD will look for the highest
number associated with all existing #WINDINGS directives and then
assigns that number (as the maximum number of windings) to the
Map file.
#WINDINGS <Number>
Line continuations are used in definition script mostly for clarity. That
is, PSCAD will automatically break segment lines that exceed the
Fortran standard of 72 columns anyway, and so the user does not
normally need to worry about this. However, to ensure that code is
easily readable to everyone, line continuations should be used.
EXAMPLE 10-23:
!
! Signal Generator
!
#IF Type == 1
$OUT = SIN(TWO_PI*$F)
#ELSE
$OUT = COS(TWO_PI*$F)
#ENDIF
!
!
! Signal Generator
!
$OUT = ~
#IF Type==1
~SIN~
#ELSE
~COS~
#ENDIF
~(TWO_PI*$F)
!
!
! Signal Generator
!
$OUT = COS(TWO_PI*$F)
!
Expression Evaluation
All intrinsic Fortran functions are available through direct coding in
the Fortran, DSDYN or DSOUT segments. However in segments
such as Computations, some mathematical and logical functionality
is also required: PSCAD possesses a limited set of its own intrinsic
mathematical functions and logical operators for use within segments
where direct access Fortran functions is not available.
Mathematical Functions
Mathematical computations can be performed on input parameters,
input signals, or on results of other computations.
Function Description
SIN(x) Sine function
COS(x) Cosine function
TAN(x) Tangent function
ASIN(x) Inverse sine function
ACOS(x) Inverse cosine function
ATAN(x) Inverse tangent function
SINH(x) Hyperbolic sine function
COSH(x) Hyperbolic cosine function
TANH(x) Hyperbolic tangent function
LOG(x) Natural logarithm
EXP(x) Exponential
LOG10(x) Base 10 logarithm
SQRT(x) Square root
Arithmetic Operators
Function Description
+ Add
- Subtract
* Multiply
/ Divide
% Remainder
** Raise to power
\ Parallel (xy) / (x +y)
Logical Operators
Listed below are the logical operators available in PSCAD. Logical
Logical expressions
expressions are primarily used in conjunction with #IF, #ELSEIF, will return a value of 1
#ELSE, #ENDIF directives and the Ternary Operator. They are also if true, and a value of
0 if false.
used in the Checks segment.
Function Description
== Equal to
!= Not equal to
! Not
< Less than
> Greater than
<= Less than or equal to
>= Greater than or equal to
|| OR
&& AND
EXAMPLE 10-24:
!
! ...with #IF, #ELSEIF, #ELSE, #ENDIF Directives
!
#IF F >= 60.0
Fout = 60.0
#ENDIF
!
! ...with a Ternary Operator in the Computations
! segment
!
REAL L = X == 0.0 ? Y*2.0 : Y/3
!
! ...in the Checks segment
!
ERROR Value too small : R > 0.001
!
Ternary Operator
Care must be taken
The ternary operator is yet another short form method offered in
definition script for representing an IF-ELSE-ENDIF type expression.
when designing It allows the user to define a variable, according to certain conditions,
components with in a single line.
ternary operators:
Ensure that variables
used within the The ternary operator is used only in the Computations segment, and
ternary expression
will not be disabled
should appear as follows:
under otherwise valid
conditions. In other <Logic> ? <Value_if_True> : <Value_if_False>
words, unrelated logic
may disable one or
more of the variables <Logic> is a logical expression using logical operators. <Value_if_
used within the True> and <Value_if_False> can either be a single constant, or a
ternary expression,
which may render the mathematical expression.
ternary result invalid.
Input variables are
enabled/disabled by
way of Conditional EXAMPLE 10-25:
Statements, Layers
and Filters.
A user wants to define a REAL variable X in the Computations
segment of a component definition. The value of X is to be 1.0
if an input parameter N is 2 or 3, and defined by a mathematical
expression otherwise.
EXAMPLE 10-26:
Chapter 11:
There was not problem building the simpleac project. Any warning or
error messages that may have occurred would have been indicated
in the column at the far left. See The Output Window in Chapter 4 of
this manual for details.
Runtime Messaging
Upon the completion of the build process, the runtime process
will begin. Runtime messaging is organized into the following
categories:
Searching
If the user wishes to search a project for a particular object, the
search utility may be utilized. To invoke the Search dialog window,
simply select Edit | Search... from the main menu bar, press the
Search button in the main toolbar or press Ctrl + f on your keyboard,
while viewing the Circuit canvas.
Find What
Enter the character string that you would like to search for. Note that
if you are performing a Node search, this input is disabled.
Type
It is possible to narrow a search to a certain type of object in the
project:
Parameter/Node
The Parameter and Node radio buttons toggle the search utility
between a parameter-type lookup (i.e. search of string or sub-
string), with that of a node number search. A node number search
is a different animal, in that it requires the project be compiled first,
thereby generating the node numbers (See Node Number below).
Parameter Options
The options available in this section are specifically for searching
XML parameter nodes. Note that these options will appear disabled
when Type is set to either All or Sequence Number.
For example, say you are searching for a specific output channel
component with a Title parameter as ‘DC Current.’ The XML node
for this component instance appears as follows in the project file:
Note that most of the time you will not know what the parameter
Name is (only its Value) -- you can leave the Name field blank and
just search for the Value parameter as DC Current.
Node Number
A node number search is a special type, where you can look directly
for an electrical node, by node and subsystem number, as opposed
to a character string. Note that project must be compiled first in
order to get any node search results!
Find Options
There are a few options available to help focus your search:
Each entry in the list represents an XML node. Simply left double-
click on a particular list entry (or right-click and select Navigate To...)
and PSCAD will automatically highlight the source in the Circuit
canvas.
Note that the Log file is a simple file created by the compiler to log
the compilation process.
Component Ordering
PSCAD includes a smart algorithm, which will automatically
sequence (or order) all components involved in the EMTDC System
Component ordering
Dynamics. This is carried out automatically in order to ensure that
functions are
variables are calculated in their proper sequence, and that time
performed by PSCAD step delays are minimized: The algorithm iteratively scans the
on a per module entire project and then assigns sequence numbers to all existing
basis. By default, the
Assign Sequence components. In general, input constants are moved to the top of the
Numbers option in sequence, whereas outputs are moved to the bottom.
the Canvas Settings
dialog is enabled in
all new and existing This algorithm should be left on by default at all times; however there
modules. This option may be instances where it is desirable to turn it off and manually
may be disabled by
the user in selected order the components during the debugging process. This may
modules, and yet still be the case if you wish to manually control the feedback points.
maintain automatic
ordering in others.
Alternatively, a feedback can be introduced by inserting a Feedback
Loop Selector component in the signal path.
There are two possible locations within the system dynamics (i.e.
DSDYN or DSOUT) where the code for a particular component can
reside. As a result, the sequence numbers are colour coded so that
the user can graphically determine where code is. These colours are
listed below:
Colour Legend:
Enter the desired sequence number and click the OK button. Repeat
this process for the remaining components and modules.
Colour Legend:
The dashed
connections are
purely visual, that To enable this feature, right-click on a blank part of the module
is you cannot use canvas and select Canvas Settings... to bring up the Canvas
them as physical
connections for data Settings dialog. Select the Virtual Wires option and change it to
sources or sinks. You Show.
must compile the case
first before you can
view the control wires. The colour of the virtual control wire indicates the data type of the
data label it is connecting. The colour legend is provided below:
The indicators are
orientated by default
according to the Wire To enable this feature, bring up the Project Settings dialog (right-click
component direction on the project in the Workspace and select Project Settings...).
(i.e. towards the end
point of the Wire), Click the Dynamics tab and select Compute and Display Signal
not the actual control Pathways on Control Wires.
signal flow. If a flow
indicator appears
reversed, simply The indicator colour will appear according to the legend below:
reverse the vertexes
of the Wire. You must
compile the case first Colour Legend:
before you can view
the flow indicators. • Green: Indicates a signal of type REAL
If you are using the free GFortran compiler supplied with PSCAD,
there are debugging tools available. See http://sources.redhat.com/
insight/index.php.
Next, navigate to the Fortran section of the dialog and enable the
Enable addition of runtime debugging information option in the
Runtime Debugging area.
Ensure that any user source files are referenced in the Additional
Source (.f) files field as well. If you fail to do this, your source files
will not be included when the project is compiled, and you will not be
able to debug your code.
Jot down the four-digit number at the end of the command line
so as not to forget it (you will need it soon).
Please note that it is assumed that the user is familiar with the
debugging software and can continue from here. Also, the above
steps must be repeated during subsequent runs, as the four-digit link
number will change each time.
source routines into a single file. This process can also be tedious,
and may create problems in the on-going development of the source
code.
Step 1:
Step 2:
• Location of the *.dll File: The dynamic link library file must
be placed either in the same folder as the project executable,
or preferably in a directory pointed to by a PATH variable.
For example, create a directory called C:\temp\my_dlls and
place your *.dll files within it. Then add a PATH environment
Module Locking
Starting in PSCAD X4, it is possible to lock the canvas of any module
from being viewed. The locking mechanism uses a sophisticated
algorithm to encrypt the XML data, describing the contents of the
module canvas in the project (*.pscx) file. Once locked, the module
definition can then be unlocked by means of a password, which is a
required user input at the time of locking the module. For details on
how to lock or unlock a module, see Lock/Unlock Modules in chapter
5 of this manual.
Chapter 12:
Arguments
Inputs
Argument Type Description
Outputs
Argument Type Description
EXAMPLE 12-1:
EXAMPLE 12-2:
Arguments
Inputs
Argument Type Description
EXAMPLE 12-3:
Component Design
Any number of signals or parameters can be passed to or from a
MATLAB component. The Fortran code inserted into the Fortran
segment of the component definition should perform four tasks:
EXAMPLE 12-4:
The following code should then appear in the Fortran segment of the
component definition:
#STORAGE REAL:3
STORF(NSTORF) = $A
STORF(NSTORF+1) = $B
!
CALL MLAB _ INT(“$Path”, “$Name”, “R R”, “R”)
!
$C = STORF(NSTORF+2)
NSTORF = NSTORF + 3
!
The component definition will need to define at least two input fields
in a Parameters section category page. In this case for example,
$Path is a text field symbol name expecting the pathname to where
the *.m files are located. $Name is also a text field symbol name
expecting the name of the MATLAB module. For example, if the
MATLAB function is called ‘TEST1,’ contained within a file called
‘TEST1.m,’ then the $Name parameter should then be entered as
‘TEST1.’
EXAMPLE 12-5:
The following code should then appear in the Fortran segment of the
component definition:
#STORAGE REAL:33
#LOCAL INTEGER I _ CNT
!
! First Input Array (REAL(31))
!
DO I _ CNT = 1,31,1
STORF(NSTORF+I _ CNT-1) = $INPUT(I _ CNT)
ENDDO
!
CALL MLAB _ INT(“$Path”,”$Name”,”R(31)”,”R(2)”)
!
! First Output Array (REAL(2))
!
DO I _ CNT=1,2,1
$OUTPUT(I _ CNT) = STORF(NSTORF+31+I _ CNT-1)
ENDDO
!
! Increment STORF pointer
!
NSTORF = NSTORF + 33
!
Note that when the output variables are extracted from the STORF
array, the offset 31 must be added, as 31 input variables were
already used to put the INPUT variables into the STORF array. In
the entire routine, 33 STORF locations were used (31 inputs, 2
outputs).
EXAMPLE 12-6:
#STORAGE REAL:12
#LOCAL INTEGER I _ CNT, M _ CNT
!
! PSCAD MATLAB INTERFACE
! MODULE: Matlab Interface with Simulink
!
I _ CNT = 1
M _ CNT = 0
!
! Call *.m files in order to initialize the
! environment...
!
IF (TIMEZERO) THEN
#IF “$mName1” != “”
CALL MLAB _ INT(“$Path”, “$mName1”, “”, “”)
#ENDIF
#IF “$mName2” != “”
CALL MLAB_INT(“$Path”,”$mName2”,”” , “”)
#ENDIF
ENDIF
!
! TIME info to run either *.m or *.mdl module
!
#IF ($OPTSEC == 0 )
STORF(NSTORF) = TIME
STORF(NSTORF + 1) = DELT
M_CNT = 2
#ELSE
STORF(NSTORF) = TIME
M_CNT = 1
#ENDIF
!
! Transfer inputs to EMTDC STORF array
!
DO I _ CNT = 1, $#DIM(sig _ in)
STORF(NSTORF + M _ CNT + I _ CNT-1) = $sig _ in(I _ CNT)
END DO
M _ CNT = M _ CNT + I _ CNT - 1
!
! CALL PSCAD MATLAB INTERFACE
!
#IF $OPTSEC == 0
CALL MLAB _ INT(“$Path”,”$mfile”,”R(6)”,”R($#DIM(sig _
out))”)
#ELSE
CALL SIMULINK _ INT(“$Path”,”$simfile”,”R(5)”)
#ENDIF
!
! Transfer MATLAB output variables
!
I _ CNT = 1
DO WHILE (I _ CNT .LE. $#DIM(sig _ out))
$sig _ out(I _ CNT) = STORF(NSTORF + M _ CNT + I _ CNT -
1)
I _ CNT = I _ CNT + 1
END DO
!
! Update storage array
!
NSTORF = NSTORF + M _ CNT + I _ CNT - 1
Interfacing Notes
The MATLAB engine performs operations very slowly, compared with
the same equivalent operation hard-coded directly into a PSCAD
component. The MATLAB source code is interpreted each time it is
called, allowing users to dynamically edit the ‘*.m’ file in the middle
of a run and see its effect immediately. This inter-activity is also
possible in PSCAD through the use of on-line sliders, switches,
dials and buttons. Any combination of the two methods can be used
simultaneously.
Simulation Speed
To try and speed up the MATLAB solution, it is often a good idea to
try and use a larger time step when invoking MATLAB components
(wherever possible or practical). An enable/disable switch can also
be implemented, so as to allow PSCAD to operate at close to full
speed.
EXAMPLE 12-7:
Conversion to C
It should also be possible to convert ‘*.m’ source code directly to ‘C’
code using the MATLAB ‘C’ compiler, and then directly compile and
link the ‘C’ source code into the EMTDC executable. This has not
been tested thoroughly, but no obvious technical reasons exist as to
why it should not. With this ‘hard-compiled’ approach, you lose the
ability to edit the MATLAB ‘*.m’ interpreted file during simulations.
The ‘hard-compiled’ approach also may not work with any MATLAB
graphical functions.
Plotting Enhancements
The MATLAB graphics functions are a very powerful addition to the
PSCAD plots and graphical interface. Three-dimensional plots, active
graphics and rotating images are possible and integrate seamlessly
with the PSCAD graphical libraries.
Chapter 13:
Upon import, PSCAD will create a new file and convert your original
project to the new file format. Your original project will be left
untouched. Project files are converted as follows:
If all goes well, the above procedure is all that is needed to upgrade
your PSCAD v4.1 or v4.2 projects to X4. During the import process
however, there may have been compatibility issues in migrating your
project over to the new format. These issues may not arise until you
attempt to compile and run the new project.
In v4.2 New in X4
Master Library Local Project
Other Library Projects Master Library
Local Project Other Library Projects
Problems to be Aware of
If you have duplicate definitions in your workspace, you may
experience problems when compiling imported project files. These
problems may manifest themselves in many ways, but the most
common problem arises when your project contains a local definition
(or many) that shares the same name as a definition residing
externally in either a user library project, or the master library.
EXAMPLE 13-1:
This will most likely result in compilation errors and other problems,
or it may even go undetected.
Upon import of existing projects into X4 (i.e. *.psc and *.psl files),
these characters will be replaced automatically (when used in certain
situations), as their presence is detrimental to the structure of the
project file under the new XML standard.
• Project Description
Component Definitions:
• Descriptions
• Symbol Names
• Default Values
• Default Units
• Parameter Values
EXAMPLE 13-2:
Original New
Symbol Name Symbol Name
Xd’’ Xd__
Since the Xd’’ symbol name was not replaced, if left as is, PSCAD
will issue a build error message similar to the following upon compile
of the project:
The user must therefore modify the script section (in this case the
Checks segment) as follows:
There are a few new sections that have been added to the manual
documentation that describe this issue. They are listed below:
PSCAD Manual:
EMTDC Manual:
Conversion Issues
As is normal when software is updated, there are changes made to
existing features, which may or may not affect your case. There are
a few important issues to be aware of before starting to use your
V3 projects in PSCAD V4. These are described in the following
sections.
Flyby Windows
A new feature was added to PSCAD V4, which optimizes variable
storage between time steps during a simulation. Unfortunately, when
this optimization algorithm is enabled, it also disables Flyby window
functionality. To enable Flyby windows while debugging your project,
the optimize storage feature must be turned off.
V4 format (multi-subsystem):
Can be migrated:
•
•
Draft circuit files (*.dft and *.dfx)
Runtime batch files (*.rtb)
If you have EMTDC
source code written
• Draft component definitions (for example in xdraft_lib) in C, then you must
• EMTDC Fortran source code upgrade this code
manually.
• Line constants solved data (*.tlb or tlines files)
Cannot be migrated:
Conversion Issues
The following sections describe a general overview and background
of some important conversion issues. Please review these sections
first before attempting to upgrade to PSCAD V4.
V2 Component Libraries
Since V2, PSCAD has allowed users to create their own components
to represent custom models. In V2, this was accomplished by
editing a text file, where graphical information, parameter form data,
and Data/Fortran output code were entered. Each component was
contained within its own file, which resided in either the user’s library
(~/PSCAD/xdraft_lib), or in a Group Library (only two libraries were
allowed).
When PSCAD V4 loads a project, it knows not only the name of the
component, but that it came from a library project. This allows users
to copy a component definition from any other library, customize
it, and then place it in their own library. Whenever either of these
components is used, PSCAD will keep track of which library each is
from. PSCAD V4 also allows components to be kept directly in case
projects (*.psc), so that a temporary component can be developed
for a specific case, without having to clog up a library with the test
code.
Component Definitions
If a required component definition cannot be found when a V2 draft
project is loaded into PSCAD V4 (i.e. the definition is not included
in any loaded V4 library project or the specific V2 draft project), the
draft project will still load successfully. However, any component
instances based on the missing definition will be displayed with a
‘placeholder’ component. To rectify this situation, ensure that a V4
library project already containing the required component definition is
loaded before the draft project, or that draft project itself was saved
in V2 as a transfer file (*.dfx).
Warnings:
Errors:
Once steps 1 to 4 above have been completed (i.e. the draft file has
been successfully imported into PSCAD V4), right-click on the case
filename in the Workspace and select Import Runtime Module....
This will bring up the Import Runtime Module dialog window. Select
the *.rtb file you wish to import and click the Open button.
Make sure that any
the actual component library.
2. Select the desired user library file from the Load User Library
dialog and then press the PROCEED button.
5. Select one or more files, and then click on the Open button.
The new definition(s) should appear within the Definitions
branch in the Workspace window.
module will also be included, which contains all information from the
associated runtime batch (*.rtb) file.
To find out if there are any more connection errors for a particular
module, compile the module manually (i.e. right-click on the module
and select Compile Module). This will force PSCAD to generate the
data and Fortran files for this module alone, and any error or warning
messages should appear in the Output window.
Runtime Module
The Runtime module represents the contents of the V2 runtime
batch file. This module may require some ‘house cleaning’ and
re-organization (i.e. re-size graph frames, etc.). Control panels
are used to contain sliders, dials, switches and meters. Grouped
Index
Symbols Segments 360
Substitutions 397
~ 423 Syntax colouring 377
#CASE directive 412 Text field 339
#IF, #ELSEIF, #ELSE, #ENDIF Text label 330
directives 410 Component instance 42
Component ordering 438
A
Components
Absolute value 425 Adding to a project 100
Active project 44 Connecting 103
Aperture 221 Creating new 123
Arc 323 Cut/copy/paste 102
Drag and drop 139,157,158
B Editing a definition 320
Editing parameters 114
Bus 263 Moving 102
C Printing 128
Rotate/mirror/flip 103
C 379 Selecting 99
Cables Viewing parameters/computations
Constructing 277 118
Cross-sections 283 Computations 118
Editing properties 277,280 Conditional statements 118,353
Migrating V2 487 Connections 118,333
Model selection 286 Contact information 11
Output data 296 Control groups 63,246
Case project 42 Control panels 236
Categories 336 Displaying in reports 250
CBR 378 Grouping 246
Chatter 260 Minimizing 248
Choice box 345 Preparing data for display 183
Component definition 42,320 Settings 165
Categories 336 Control settings 165
Conditional statements 354 Cosine 425
Connections 333 Cross-hairs 234
Creating first instance 126 Curve fitting 315
Cut/copy/paste 56
Editing properties 116,117 D
Graphic objects 323 Data files 437
Import/export 56,127 Debugging 267
Input field 341 Delete 103
Layers 356
Tangent 425
Temporary directory 79,98,179
Ternary operator 425
Text field 339
Text labels 330
Time offset 257
Time step
Changing 94
Toolbars 70
Tool tips 161
Towers 281
Traces 200
Transmission lines
Constructing 85,274
Editing properties 85,275,280
Migrating V2 487
Model selection 286
Output data 296
Towers 281
Trial licensing 17
Troubleshooting 66
U
Undo 103
Units 118,170
Upgrading 470
Issues with pscad V2
474,476,480,484
USB port 18
User library path 269