OpenDSS Level 2 Training
OpenDSS Level 2 Training
OpenDSS Level 2 Training
OpenDSS
Level 2 Training
1400
1200
1000
800
MWh
600
400
200
Jan
Feb
Mar
Apr
May
Jun
Jul
Aug
Sep
Oct
Nov
Dec
22
19
16
Hour
13
10
Month
27 April 2009
Roger Dugan
[email protected]
Getting Started:
Installation & Basic Usage
Program Files
OpenDSS.EXE
OpenDSSEngine.DLL
KLUSolve.DLL
DSSgraph.DLL
Standalone EXE
In-process COM server
Sparse matrix solver
DSS graphics output
10
GUID
11
Points to OpenDSSEngine.DLL
(In-process server, Apartment Threading
model)
12
In MATLAB:
DSSobj = actxserver(OpenDSSEngine.DSS);
In VBA:
Public DSSobj As OpenDSSEngine.DSS
Set DSSobj = New OpenDSSEngine.DSS
In PYTHON:
self.engine = win32com.client.Dispatch("OpenDSSEngine.DSS")
13
Multiple script
windows
14
15
DSS Structure
DSS Structure
Scripts
COM
Interface
Scripts,
Results
17
UserWritten
DLLs
Options
Circuit
Solution
V
PDElement
Line
Transformer
Capacitor
Reactor
PCElement
Load
Generator
Vsource
Isource
[Y]
Controls
Meters
General
RegControl
CapControl
Relay
Reclose
Fuse
Monitor
EnergyMeter
Sensor
LineCode
LineGeometry
WireData
LoadShape
GrowthShape
Spectrum
TCCcurve
18
Object 1
Property Definitions
Property Values
Methods
Yprim
States
Collection Manager
Object n
Property Values
Methods
Yprim
States
2009 Electric Power Research Institute, Inc. All rights reserved.
19
Metering Elements
Monitor
EnergyMeter
Sensor
General
LineCode
LineGeometry
Loadshape
Growthshape
Wiredata
Spectrum
TCC Curves
20
22
After Redefining
23
Plotting Scripts
Project Run window
24
25
26
2 3
28
1
Power Delivery
or Power Conversion
Element
29
Terminal 1
Power Delivery
Element
30
Terminal 2
F
V
Power Conversion
Element
31
BusX
Terminal 1
Power Delivery
Element
Terminal 2
Terminal 1
Power Delivery
Element
3
2
Iterm = [Yprim] Vterm
0
. . . Bus1 = BusX . . .
. . . Bus2 = BusX.2.1.3.0 . . .
DSS Convention: A Terminal can be connected to only one Bus. You can have any
number of Nodes at a bus.
2009 Electric Power Research Institute, Inc. All rights reserved.
32
Terminal 2
Transformer.Example1-ph
~ Xhl=2.04
Xht=2.04
~ Buses=[bus1.1
~ kVs=[7.2 .12
phases=1
Xlt=1.36
bus2.1.0
.12]
Windings=3
%noloadloss=.2
bus2.0.2]
! ratings of windings
~ kVAs=[25 25 25]
~ %Rs = [0.6
1.2
1.2]
Bus 1
! default
1
Bus 2
1
Wdg 2
Wdg 1
0
Wdg 3
0 or
2
33
3-Phase
Transformer
3 PHASES
2 WINDINGS
4 CONDS/TERMINAL*
2
2
3
3
(OPEN)
* MUST HAVE THE SAME NUMBER OF
CONDUCTORS FOR EACH TERMINAL
2009 Electric Power Research Institute, Inc. All rights reserved.
34
Load (a PC Element)
Compensation
Current
Yprim
(One-Line Diagram)
35
Phase 1
Yprim
Compensation
Current
Yprim
Compensation
Current
Phase 2
4 Conductors/Terminal
Yprim
Compensation
Current
Phase 3
1
2
4
2009 Electric Power Research Institute, Inc. All rights reserved.
36
Phase 1
Yprim
Compensation
Current
Yprim
Compensation
Current
Phase 2
Yprim
Compensation
Current
Phase 3
3 Conductors/Terminal
37
Yprim 2
Yprim 3
Yprim n
PC Elements
Comp. Currents
I1
I2
Iinj
Im
Iteration Loop
38
Node
Voltages
Solution Speed
Distribution systems generally converge quite rapidly with
this method.
The OpenDSS program seems to be on par with the
faster commercial programs or faster
It is set up to run annual simulations easily
Our recommendation:
Err on the side of running more power flow
simulations
That is, dont worry about the solution time until it
proves to be a problem
That reveals more information about the problem.
2009 Electric Power Research Institute, Inc. All rights reserved.
39
40
I1
I4
I2
I5
I3
I6
I1
I2
I3
I4
I5
I6
Yprim
(6 x 6)
41
V1
V2
V3
V4
V5
V6
Yprim
You can obtain the Primitive Y matrix for each element a
number of ways (after a Solve)
Dump command
Dump class.name debug
Or, Dump Class.* debug
Script
Show Yprim ! Of active element
Export Yprims ! All Yprims
COM Interface
V = DSSCircuit.ActiveElement.NumPhases
42
43
Advanced Topics
Plotting
Ways to Plot
Use the built-in plotting capabilities
Plot in an external program, such as Excel or MATLAB
Maximum of value for each hour over the month.
3000
2500
2000
From Excel
(See Example)
0
3
Sep
23
21
17
13
Mar
19
Hour
15
11
Jul
May
46
Jan
Month
From Matlab
Volts(pu)
1.01
1
0.99
0.98
0.97
phase A
phase B
phase C
0.96
0.95
0
4
6
8
Distance from Substation
47
10
12
From Excel
Voltage Profile Plot
1.06
1.05
1.04
1.03
1.02
V1
1.01
V2
V3
1
0.99
0.98
0.97
0
48
10
49
50
51
52
53
Set Genkw=100
set mode=autoadd
solve
Set nodewidth=7
plot Auto 3 dots=y labels=n subs=n C1=16711680 C2=8421376 C3=255 R3=0.95 R2=0.9
Possibly best
areas for adding
DG
54
Need 500
kW here
55
56
LoadShape Plot
(Special plot in EXE version only)
57
EnergyMeter Object
EnergyMeter
Perhaps the most complex object presently in the DSS
Emulates an actual energy meter
Except it can measure things elsewhere in the meter
zone.
Has multiple registers
Registers cleared on
reset meters (or reset)
set mode = .
Set year=
Two types: accumulators and drag hand
59
60
Meter Zone
Collection of circuit elements downline from meter.
Only element in DSS that knows about radial circuits
Zone is established first time solution is executed
May be more time-consuming than actual solving for
very large circuits.
Rebuilt whenever bus list is rebuilt
EnergyMeter and Monitor objects are installed in a branch
terminal
New Energymeter.example Element=Line.Line1 Terminal=1
61
METER ZONE
62
Zone dump
energymeter.metername.action=zonedump
Or
Edit energymeter.metername
action=zonedump
63
64
Monitor or Meter?
Monitor measures quantities only where it is located
Takes a sample of quantity
Voltage and current (several options)
Powers
Transformer taps
State vars
EnergyMeter measures power and integrates some,
samples others
Samples quantities throughout its zone
65
67
DSS Interface
68
End Sub
69
COM Interface
70
End Sub
71
Delay=15
.Command = "RegControl.creg2a.maxtapchange=1
Delay=30
.Command = "RegControl.creg3a.maxtapchange=1
Delay=30
.Command = "RegControl.creg4a.maxtapchange=1
Delay=30
.Command = "RegControl.creg3c.maxtapchange=1
Delay=30
.Command = "RegControl.creg4b.maxtapchange=1
Delay=30
.Command = "RegControl.creg4c.maxtapchange=1
Delay=30
72
Result Property
The Result property is a Read Only property that contains
any result messages the most recent command may have
issued.
Error messages
Requested values
Example: Query line length
DSSText.Command = ? Line.L1.Length
S = DSSText.Result
MsgBox S
73
Circuit Interface
74
Circuit Interface
V = DSSCircuit.AllBusVmagPu
VL =DSSCircuit.AllElementLosses
75
Solution Interface
76
Solution Interface
.LoadModel=dssAdmittance
.dblHour = 750.75
.solve
End With
77
CktElement Interface
78
Properties Interface
79