Professional Documents
Culture Documents
TheOpenDSS Application
RogerC.Dugan
Sr.TechnicalExecutive rdugan@epri.com Knoxville,Tennessee37934USA
Conference Sponsors
Associate Sponsors
Introduction
WhatisOpenDSS?
EPRIs DistributionSystemSimulator(DSS)
Releasedasopensource CalledOpenDSS
Canbefoundat:
WWW.SOURCEFORGE.NET
(SearchforOpenDSS)
WhywasDSSDeveloped?
Forspecialdistributionanalysisapplications suchasDGanalysis. Toprovideaveryflexibleresearchplatform. Fillsgapsleftbyotherdistributionsystem analysistools. Studynewapproachestodistributionsystem analysis.
WhyOpenSource?
EPRIhasmadetheDSSopensourceto:
CooperatewithvariousSmartGridopensource efforts
GridlabD(fromPNL),forexample
DSSBackground
Underdevelopmentformorethan13Years
StartedatElectrotek Conceptsin1997 PurchasedbyEPRIin2004
Objectivesin1997
Supportalldistributionplanningaspectsofdistributedgeneration Implementaflexibleresearchplatform Incorporateobjectorienteddataideas
KeyFuturework
SmartGridresearchanddemonstrations DSEforNorthAmericanSystems Denseurbannetworks Reliabilitymethodsresearch
6
DistributionSystemSimulator(DSS)
Designedtosimulateutilitydistributionsystems
Inarbitrarydetail Formosttypesofanalysesrelatedtodistributionplanning.
Itperformsitsanalysistypesinthefrequency domain,
Powerflow, Harmonics,and Dynamics.
ItdoesNOTperformelectromagnetictransients(timedomain) studies.
4th International Conference on Integration of Renewable and Distributed Energy Resources
Time andLocationDependentBenefits
TheOpenDSSwasdesignedfromthebeginningto captureboth
Timespecificbenefits and Locationspecificbenefits
Neededfor
DGanalysis Renewablegeneration Energyefficiencyanalysis PHEVandEVimpacts Otherproposedcapacityenhancementsthatdontfollow typicalloadshapes
8
Time andLocationDependentBenefits
Mosttraditionaldistributionsystemanalysisprograms
Designedtostudypeakloadingconditions Capturemostlylocationspecificbenefits Ignorestime;Assumesresourceisavailable ThisgetsthewronganswerformanyDG,energyefficiency, andSmartGridanalyses
Mustdotimesequenceanalysistogettherightanswer
Overdistributionplanningarea
OverallModelConcept
Comm Msg Queue 1 Power Conversion Element ("Black Box") Control Center
Control
10
ExamplesofAdvancedOpenDSSApplications (otherthanbasicmultiphasepowerflow)
Neutraltoearth(stray)voltage simulations. Lossevaluationsdueto unbalancedloading. DevelopmentofDGmodelsfor theIEEERadialTestFeeders. Highfrequencyharmonicand interharmonic interference. Losses,impedance,and circulatingcurrentsinunusual transformerbankconfigurations. Transformerfrequencyresponse analysis.
4th International Conference on Integration of Renewable and Distributed Energy Resources
Distributionautomationcontrol algorithmassessment. Impactoftankless waterheaters onflickeranddistribution transformers. Windfarmcollectorsimulation. Windfarmimpactonlocal transmission. WindgenerationandotherDG impactonswitchedcapacitors andvoltageregulators. Openconductorfaultconditions withavarietyofsinglephaseand threephasetransformer connections.
11
ComputingAnnualLosses
Peakloadlossesarenotnecessarilyindicativeof annuallosses
70 60
25000 20000 15000 kWh 10000 5000 5 9 0 21 Apr Jul Oct Month 17
50
Load, MW
40
30
20
10
Hour
13
Jan
12
UsingDSStoDetermineIncremental CapacityofDG
Needle Peaking System
1600 1400 1200 1000
800 600 400 200 4 0 10 Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec 13 7 1
MWh
5000
MWh EEN
Hour
16 19
22
Month
6000
160
170
180
MW Load
190
200
5000
4000
KW 3000
2000
How much more power can be served at the same risk of unserved energy?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 Hour 15 16 17 18 19 20 21 22 23 24
1000
Month
13
DGDispatch
5000 2500 4500 2000
1500
3000 Power, kW
500
2500
2000 kW 1500
-500
-1000
1000
-1500
500
-2000
0 1077 1346 1615 1884 2153 2422 2691 2960 3229 3498 3767 4036 4305 4574 4843 5112 5381 5650 5919 6188 6457 6726 6995 7264 7533 7802 8071 8340 8609 270 539 808 1
-2500
Hour
14
SolarPVSimulation 1hrData
5 Without PV Difference 4 4 With PV 5
-1 2 Weeks
-1
Difference, MW
MW
15
1secSolarData CloudTransients
1-Sec Solar PV Output Shape with Cloud Transients
1 0.9 Per Unit of Maximum 0.8 0.7 0.6 0.5 0.4 0.3 0.2 0.1 0 0 500 1000 1500 Time,s 2000 2500 3000
16
PowerDistributionEfficiency
350 300 250 Losses, kW 200 No-Load Losses 150 100 50 Load Losses 0 0 50 100 Hour (1 Week) 150 Total Losses
50
17
WindPlant1sSimulation
4000 3000 2000 1000
P3-(kW) (W)
1.03
0 -91 Q3-(kvar) (VAr) -191 -291 -391
-491
0.97
0 Electrotek Concepts 20000 40000 Time (s) 60000 80000 1.02 TOP, The Output Processor
Ta p -(p u )
(V )
-591
1.00 0.98 0.96 0 20000 40000 Time (s) 60000 80000 TOP, The Output Processor
Electrotek Concepts
18
0.02 |Y| 0.015 0.01 0.005 0 0 100000 200000 300000 400000 500000
19
Frequency, Hz
PowerFlowVisualization
20
GettingStarted
InstallationandBasicUsage
SourceForge.Net LinksforOpenDSS
OpenDSSDownloadFiles:
http://sourceforge.net/projects/electricdss/files/
MainPageinWiki
http://sourceforge.net/apps/mediawiki/electricdss/index.php?title=Main_Page
ToplevelofMainRepository
http://electricdss.svn.sourceforge.net/viewvc/electricdss/
SourceCode
http://electricdss.svn.sourceforge.net/viewvc/electricdss/Source/
Examples
http://electricdss.svn.sourceforge.net/viewvc/electricdss/Distrib/Examples/
IEEETestCases
http://electricdss.svn.sourceforge.net/viewvc/electricdss/IEEETestCases/
22
ReleaseFileDownloadPage
23
WikiHomePage
24
RepositoryonSourceForge.Net
25
ReleaseVersionsVs.SourceCode
ReleaseversionsarepostedirregularlyonSourceForge Youcankeepupwiththelatestchangesbyaccessing thesourcecodeandbuildingthelatestversion LatestbuildsarealsopostedonanEPRIFTPsite
RequestalinkfromEPRI(seeWikiNewsandNotes)
Compilers
Delphi2010 Thisiswhatweusefordevelopment
Delphi2007and2009alsoworkedlasttimewetried
FreePascal(withlimitations)www.freepascal.org
26
Changethecheckoutdirectoryifitpointssomewhereotherthanwhat youwant.
27
ProgramFiles
OpenDSS.EXE OpenDSSEngine.DLL KLUSolve.DLL DSSgraph.DLL StandaloneEXE InprocessCOMserver Sparsematrixsolver DSSgraphicsoutput
Copythesefilestothedirectory(folder)ofyourchoice
Typicallyc:\OpenDSS or c:\Program Files\OpenDSS
IfyouintendtodriveOpenDSSfromanotherprogram,youwill needtoregistertheCOMserver
Someprogramsrequirethis!!
28
OpenDSSFolders
29
OpenDSSStandaloneEXEUserInterface
30
ExecutingScriptsintheStandaloneEXE
DSS executes selected line or opens selected file name Any script window may be used at any time.
4th International Conference on Integration of Renewable and Distributed Energy Resources
31
DSSStructure
Scripts
COM Interface
Scripts, Results
UserWritten DLLs
32
DSSObjectStructure
DSS Executive Commands Options Circuit V Solution [Y] I
DSSClassStructure
Instances of Objects of this class Class Property Definitions Class Property Editor Collection Manager Object 1 Property Values Methods Yprim States
34
ScriptingBasics
Syntaxandorganizingyourscripts
Scripting
OpenDSSisascriptablesolutionengine Scripts
Seriesofcommands Fromtextfiles FromeditformsinOpenDSS.EXE FromanotherprogramthroughCOMinterface
e.g.,Thisishowyouwoulddolooping
36
CommandSyntax
Commandparm1,parm2parm3parm 4. Parametersmaybepositional ornamed (tagged). Ifnamed,an"="signisexpected.
Name=value (thisisthenamedform) Value (valuealoneinpositionalform)
Forexample,thefollowingtwocommandsare equivalent:
New Object="Line.First Line" Bus1=b1240 LineCode=336ACSR,
New Line.First Line, b1240 32
Bus2=32
336ACSR,
37
Delimiters
Arrayorstringdelimiterpairs: [],{},(), , Matrixrowdelimiter: | Valuedelimiters: , (comma) anywhitespace(taborspace) Class,Object,Bus,orNodedelimiter: . (period) Keyword/valueseparator: = Continuationofpreviousline: ~ (More) Commentline: // Inlinecomment: ! Queryaproperty: ?
38
ArrayandMatrixParameters
Array
kvs =[115,6.6,22] kvas=[200001600016000]
Matrix
(3x3matrix)
Xmatrix=[1.2.3.3 |.31.23|.3.3 1.2]
(3x3matrix lowertriangle)
Xmatrix=[1.2|.31.2|.3.3 1.2]
39
ArraysfromFiles
Mult=[1,2,3,4,5,..etc] Mult=[file=myfile.txt] Mult=[dblfile=myfile.dbl] Mult=[sngfile=mufile.sng] SeeURL:
http://sourceforge.net/apps/mediawiki/electricdss/index.php?title=TechNote_New_way s_to_import_loadshapes
40
ABasicScript(ClassExercise)
TR1 LINE1 1 Mile, 336 ACSR Sourcebus Sub_bus 12.47 kV LOAD1 1000 kW 0.95 PF
Source 115 kV
Loadbus
New Circuit.Simple
New Transformer.TR1 Buses=[SourceBus, Sub_Bus] Conns=[Delta Wye] kVs= [115 12.47] ~ kVAs=[20000 20000] XHL=10 New Linecode.336ACSR R1=0.058 X1=.1206 R0=.1784 X0=.4047 C1=3.4 C0=1.6 Units=kft New Line.LINE1 Bus1=Sub_Bus Bus2=LoadBus Linecode=336ACSR Length=1 Units=Mi New Load.LOAD1 Bus1=LoadBus kV=12.47 kW=1000 PF=.95 Solve Show Voltages Show Currents Show Powers kVA elements
4th International Conference on Integration of Renewable and Distributed Energy Resources
41
Circuit
NewCircuit.Simple !(Vsource.Source isactivecircuitelement) EditVsource.Source BasekV=115pu=1.05ISC3=3000ISC1=2500
SourceBus
Vsource.Source
Source
115
kV
Short Circuit Impedance (a matrix) that yields 3000A 3ph fault current and 2500A 1-ph fault current. One-Line Diagram (default is 3-phase wye-grd source)
42
Vsource ElementNote
Vsource isactuallyaTwo terminalDevice
2nd terminaldefaultsto connectedtoground(0V) Butyoucanconnectit betweenanytwobuses
Comesinhandysometimes
ConceptuallyaThevinen equivalent
Shortcircuitequivalent ConvertedtoaNorton equivalentinternally
43
20MVASubstationTransformer
TR1
SourceBus
Sub_Bus
New Transformer.TR1 Phases=3 Windings=2 ~ Buses=[SourceBus, Sub_Bus] ~ Conns=[Delta Wye] ~ kVs= [115 12.47] ~ kVAs=[20000 20000] ~ XHL=10
New Transformer.TR1 Phases=3 Windings=2 XHL=10 ~ wdg=1 bus=SourceBus Conn=Delta kV=115 kVA=20000 ~ wdg=2 bus= Sub_Bus Conn=wye kV=12.47 kVA=20000
2 Ways to Define
44
TheLine
Sub_Bus
LINE 1 1 Mile, 336
LoadBus
New Linecode.336ACSR R1=0.058 X1=.1206 R0=.1784 X0=.4047 C1=3.4 C0=1.6 Units=kft New Line.LINE1 Bus1=Sub_Bus Bus2=LoadBus Linecode=336ACSR Length=1 Units=Mi
45
TheLoad
Loadbus
LOAD 1 1000 kW 0. 95 PF
New Load.LOAD1 Bus1=LoadBus kV=12.47 kW=1000 PF=.95 For 3-phase loads, use L-L kV and total kW For 1-phase loads, typically use L-N kV and total kW unless Delta-connected; Then use L-L kV.
4th International Conference on Integration of Renewable and Distributed Energy Resources
46
ModelingBasics
CircuitElements,Buses,etc
DSSBusModel
2 3
Referring to Buses and Nodes Bus1=BusName.1.2.3.0 (This is the default for a 3-phase circuit element) Shorthand notation for taking the default Bus1=BusName Note: Sometimes this can bite you (e.g. Transformers, or capacitors with ungrounded neutrals)
48
DSSTerminalDefinition
49
PowerDeliveryElements (PDElements)
Terminal 1
Terminal 2
50
PowerConversionElements (PCElements)
ITerm(t) = F(VTerm, [State], t)
F V
Power Conversion Element
51
SpecifyingBusConnections Shorthand(implicit)
NewLoad.LOAD1Bus1=LOADBUS Assumesstandard3phaseconnectionbydefault
LOADBUS
6 5 4 3 2 1 0 LOAD
52
SpecifyingBusConnections Explicit
NewLoad.LOAD1Bus1=LOADBUS.1.2.3.0
LOADBUS
Explicitlydefineswhichnode
NewLoad.1PHASELOADPhases=1Bus1=LOADBUS.2.0
Connects1phaseloadtophase2andground
6 5 4 3 2 1 0 1-ph Load connected to phase 2 LOAD
53
SpecifyingBusConnections DefaultBustemplates
Nodeconnectionsassumedifnotexplicitlydeclared
ElementdeclaredPhases=1
LOADBUS.1.0.0.0.0.0.0.0.0.0.
ElementdeclaredPhases=2
LOADBUS.1.2.0.0.0.0.0.0.0.0.
ElementdeclaredPhases=3
LOADBUS.1.2.3.0.0.0.0.0.0.0.
54
6 5 4 3 2 1 0 LOAD
Neutral
4th International Conference on Integration of Renewable and Distributed Energy Resources
55
SpecifyingTwoUngroundedWye CapacitorsonSameBus
MyBus
Bus1=MyBus.1.2.3 Bus2=MyBus.5.5.5
6 5 4 3 2 1 0
Bus1=MyBus Bus2=MyBus.4.4.4
56
CircuitElementsareConnectedtogetherat theNodesofBuses
MyBus
Terminal 1 Power Delivery Element Terminal 2 Terminal 1 Power Delivery Element Terminal 2
3 2
Iterm = [Yprim] Vterm Iterm = [Yprim] Vterm
. . . Bus2 = MyBus.2.1.3.0 . . .
(Explicitly define connections)
. . . Bus1 = MyBus . . .
(take the default)
DSS Convention: A Terminal can be connected to only one Bus. You can have any number of Nodes at a bus.
4th International Conference on Integration of Renewable and Distributed Energy Resources
57
Example:Connectionsfor1Phase ResidentialTransformer
! Line-to-Neutral Connected 1-phase Center-tapped transformer New Transformer.Example_1-ph phases=1 Windings=3 ! Typical impedances for small transformer with interlaced secondaries ~ Xhl=2.04 Xht=2.04 Xlt=1.36 %noloadloss=.2 ! Winding Definitions ~ wdg=1 Bus=Bus1.1.0 kV=7.2 kVA=25 %R=0.6 Conn=wye ~ wdg=2 Bus=Bus2.1.0 kV=0.12 kVA=25 %R=1.2 Conn=wye ~ Wdg=3 Bus=Bus2.0.2 kV=0.12 kVA=25 %R=1.2 Conn=wye
Bus 1 1 Bus 2 1 Wdg 2 Wdg 1 0 Wdg 3 0 or 2 2
Note: You may use XfmrCode to define a library of transformer definitions that are used repeatedly (like LineCode for Line elements)
58
AllTerminalsofaCircuitElementHave SameNumberofConductors
3-Phase Transformer
1
2 2
3 3
(OPEN) * MUST HAVE THE SAME NUMBER OF CONDUCTORS FOR EACH TERMINAL
4th International Conference on Integration of Renewable and Distributed Energy Resources
59
QuestionsIGet.
HowDoYouGetCurrentsandPowerIfYou OnlySolveforNodeVoltages?
Howarethebranchcurrents(andpowers)determined whenonlytheNodevoltagesandCompensation currentsareknown?
Currentsandpowersaredeterminedbypostprocessingthe solution IftheYmatrixisproperlyformed,thecurrentswillobey Kirchoffs currentlawatthenodes Ifconvergenceisachieved,thepowerswillbecorrect
61
ComputingCurrentsinBranchTerminals (Giventhevoltages)
I1 I2 I3 I4 I5 I6
I1 I2 I3 I4 I5 I6
Yprim
(6 x 6)
V1 V2 V3 V4 V5 V6
62
PossibleSourceofError!
Ifthebranchisextremelyshort(impedanceisvery low),currentsmaybeincorrectlycomputed
Convergencetoleranceisgenerally0.0001pu Voltagesolutionwillbegoodenough
64bitmathisusedthroughoutgivingyouflexibility
However,ifvoltagesatbothendsofbrancharenearlythe same,youwillbetakingthedifferencebetweentwonearly equalnumbersandthemultiplyingitbyalargenumber (veryhighconductance)
Thiswillmagnifyanyerror
Donotuseimpracticallyshortbranches
4th International Conference on Integration of Renewable and Distributed Energy Resources
63
WhereDoesOpenDSSincludeMutual Coupling?
ItALWAYSIncludesit!
AllcircuitelementmodelsprovidetheDSSexecutivewithan AdmittanceMATRIX
Thatis,everymodelimplicitlyhascoupledphases
Unitsonadmittancematrixareactualsiemens
Perunitsandpercentareusedforsomeinputandsomereports,but notforinternalmodel Fewerlimitationsontheproblemthatcanberepresented
64
PrimitiveYMatrix ASimpleExample
I1 R V1 V2 I2
I 1 G I = G 2
G V 1 V G 2
G=R
4th International Conference on Integration of Renewable and Distributed Energy Resources
65
Alittlemorecomplicated
I1 Z11 V3 M12 I4 I3 V1 I2
Z
Z22 V2
V4
Z=
Z11 M12
M12 Z22
I 1 V 1 I 2 1 1 Z V 2 = Z I 3 Z 1 Z 1 V 3 I 4 V 4
4th International Conference on Integration of Renewable and Distributed Energy Resources
66
Yprim
YoucanobtainthePrimitiveYmatrixforeachelement anumberofways(afteraSolve) Dumpcommand
DumpDSSclass.name debug
Or,DumpDSSclass.*debug
Script
ShowYprim !Ofactiveelement ExportYprims !AllYprims
COMInterface
MyVariant =DSSCircuit.ActiveElement.Yprim
67
WhatKindofPowerFlowistheDSS?
TheDSSisnotatraditionalpowerflowaspower engineerstendtothinkofpowerflows
Aprogramwithasolutionmethodforfundamental frequencypowerflow
Itsheritageisharmonicsanalysisanddynamics analysis
Itisapowerflowinthesensethatyoucanmodelloads connectedtobusesandgetasolutionthatmatches traditionalpowerflowprogramsat50/60Hz
68
WhatKindofPowerFlowistheDSS?
TheNormal solutionmodeisafixedpointiterative solutionthatworksfinefor>90%ofdistribution systems
Issimpleandrelativelyfast,especiallyforannualsolutions
69
LoadandBuses
ThereisasubtledifferenceinthewaytheDSS treatsloadsthatisconfusingtotraditionally trainedpowerengineers: Insteadof
ABushasLoad
TheDSShas
ALoadhasaBus
Thelatterallowsconnectionofamultitudeof differentloadsandloadtypestothesamebus
4th International Conference on Integration of Renewable and Distributed Energy Resources
70
Canitsolvenetworksystemsaswellas radial?
TheuseofthewordDistribution inthenameofthe programconjuresupideasofradialcircuitsolversin NorthAmerica(butnotnecessarilyinEurope) TheDSScircuitsolveriscompletelygeneralandhasno ideawhetherthecircuitisradialornot.
Thisisarequirementforharmonicsanalysisofdistribution systems
71
WhereisthePVbustype?
BusesdonothavespecialtypesintheDSS
Busesaresimplyconnectionpointsforcircuitelements
AGeneratorcancontrol(orattemptto)powerand voltage
(Thismodelcanbecantankerous)
Thisquestionusuallyariseswithregardtomodeling DGondistributionsystems
Fortunately,oneseldomneedsthismodelunlesstheDGis quitelargewithrespecttosystemcapacity MostotherDGiscontrolledbyPowerandPowerFactor whileinterconnected
Simplertomodel
4th International Conference on Integration of Renewable and Distributed Energy Resources
72
Examples
StorageExample
Scriptfor75kWhSimulation
CompileC:\DSSdata\Wes\Colfax\Master.DSS RedirectAllocateLoadsandMeters.DSS BusCoords colfax21_EXP_BUSCOORDS.CSV BusCoords buscoordsCES.DSS !COORDINATESOFCESLOCATIONS Setmaxcontroliter=20 !******ADDSTORAGE*************************** redirectCES.DSS RedirectSet_For_75kWh.DSS !DEFINESTORAGECONTROLLER NewStorageController.CESmain element=line.568_4921721terminal=1 ~kWTarget=7500PFTarget=0.98 ~%ratecharge=30 ~eventlog=y ~modedischarge=follow !SPECIALMONITORS Newmonitor.Store Storage.jo02110001731mode=1ppolar=no Newmonitor.StoreVars Storage.jo02110001731mode=3 solve SetCasename=StorageOn75 redirectannualscript.dss !************************************************************************* showmon store showmon storevars fileedit C:\DSSdata\Wes\Colfax\StorageOn75\DI_yr_1\feeder.csv
Controller Definition
75
Load Shapes With and Without Storage 8000 kW Trigger, 75 kWh Storage, 20% charge @ 2AM
10000 9000 8000 7000 6000 5000 4000 3000 2000 1000 0 180 200 220 240 Hours
4th International Conference on Integration of Renewable and Distributed Energy Resources
kW
260
280
300
76
Load Shapes With and Without Storage Variable Trigger, 75 kWh Storage, 30% charge @ 2AM
10000 9000 8000 7000 6000 5000 4000 3000 2000 1000 0 0 100 200 Hours
4th International Conference on Integration of Renewable and Distributed Energy Resources
kW
Variable Triggering Simulation Assumes a Controller that can accurately predict daily load and know when to trigger.
300 400 500
77
OpenDSSScriptforVariableTriggering ExampleonPreviousSlide
!DOPARTOFAYEARINYEARLYMODE setmode=yearlystepsize=0.25h Setoverloadreport=true!TURNOVERLOADREPORTON setvoltexceptionreport =true setdemand=true setDIVerbose=true SetYear=1 solvenumber=760 StorageController.CESmain.kWtarget=8000 solvenumber=120 StorageController.CESmain.kWtarget=7500 solvenumber=96 StorageController.CESmain.kWtarget=7000 solvenumber=472 StorageController.CESmain.kWtarget=7500 solvenumber=200 StorageController.CESmain.kWtarget=7000 solvenumber=(2784200 472 96 120 760)!Balanceof2784 closeDI
4th International Conference on Integration of Renewable and Distributed Energy Resources
78
Location
80
MainPartofRunFile
Compile (C:\DSSdata\IEEETest\8500Node\Master-unbal.dss)
Set Maxiterations=20
Solve
81
TheMasterFile
Clear NewCircuit.IEEE8500u !Makethesourcestiffwithsmallimpedance ~pu=1.05r1=0x1=0.001r0=0x0=0.001 RedirectLineCodes2.dss RedirectTriplex_Linecodes.dss RedirectLines.dss RedirectTransformers.dss RedirectLoadXfmrs.dss !LoadTransformers RedirectTriplex_Lines.dss RedirectUnbalancedLoads.dss RedirectCapacitors.dss RedirectCapControls.dss RedirectRegulators.dss !LetDSSestimatethevoltagebases Setvoltagebases=[115,12.47,0.48,0.208] Calcvoltagebases !Thisalsoestablishesthebuslist !Loadinbuscoordinatesnowthatbuslistisestablished Buscoords Buscoords.dss
4th International Conference on Integration of Renewable and Distributed Energy Resources
82
SolutionSummary
Status=SOLVED SolutionMode=Snap Number=100 LoadMult =1.000 Devices=7281 Buses=4876 Nodes=8561 ControlMode=STATIC TotalIterations=62 ControlIterations=5 MaxSolIter =16 CircuitSummary Year=0 Hour=0 Maxpu.voltage=1.05 Minpu.voltage=0.91084 TotalActivePower:12.0452MW TotalReactivePower:1.44513Mvar TotalActiveLosses:1.27202MW,(10.56%) TotalReactiveLosses:2.8252Mvar Frequency=60Hz Mode=Snap ControlMode=STATIC LoadModel=PowerFlow
83
PowerFlowSolutionPlot
Plot Circuit Power Max=2000 dots=n labels=n subs=y C1=$00FF0000 1ph=3
84
SelectingaBranchfromthePlot(Zoomed)
85
RightclickandselectProperties
86
Exercisethe8500NodeTestFeeder
(ClassDemo)
DistributedWindApplicationExample
DistributedWindApplication
OpenDSSapplication
Timeseriesload/generationrepresentation Inductionmachinemodeling Windturbinegeneratorvar control
Mechanicallyswitchedcapacitors Constantpowerfactor Voltagecontrol
Regulatorinteraction
89
Oneline Diagram
115kV/12.47kV
600 kvar
12.47kV/480V
90
CircuitDefinition
91
WindTimeSeries
WTG Output
P (kW) 4000 3500 3000 2500 kW,kvar 2000 1500 1000 500 0 -500 -1000 0 6 12 Hour 18 24 Q (kvar)
92
WindPlantImplementation
93
WTGType1,2:CapacitorBankVar Control
Utility Grid
Gearbox
Shaft Speed
Blades
Converter
94
CapacitorControlResults
WTG Output
P (kW) 4000 3500 3000 2500 kW,kvar 2000 1500 1000 500 0 -500 -1000 0 6 12 Hour 18 24
Vpu, tap 1 1.02 1.04
Q (kvar)
WTG Voltage
Regulator Tap
0.98
0.96
WTG Capacitors
0 -200 -400 -600 -800
kvar
Cap (kvar)
0.94 0 6 12 Hour 18 24
15
20
95
P, Q (stator)
750 kW woundrotor induction generator
Gearbox
Shaft Speed
P (rotor/converter)
Blades
0.8
0.6
0.4
WTG1 WTG2
Switch Control
iabc(rotor)
Pgen ,Qgen
i*abc(rotor)
Rotor Current Computation Torque Computation
0.2
WTG3
T*
0
Lookup Table (T vs. )
-0.6
-0.4
-0.2
0.2
0.4
0.6
96
PowerFactorControl
WTG Output
P1 (kW) 4000 3000
1.05
Q1 (kvar)
2000 kW,kvar
1.04
1000 0
Vpu,tap
24
0.98 0.97 0.96 0 6 12
Hour
18
24
97
WTGType3,4:VoltageControl
1.03
1.01
0.99
0.97
0.95 0 6 12 18 24
98
AdvancedTopics
RegisteringtheCOMServer
InDOSwindow,changetothefolderwhere youinstalleditandtype:
Regsvr32OpenDSSEngine.DLL
GUID
100
RegisteringtheCOMServer,contd
If you look up the GUID
101
AccessingtheCOMServer
InMATLAB:
DSSobj = actxserver(OpenDSSEngine.DSS);
InVBA:
Public DSSobj As OpenDSSEngine.DSS Set DSSobj = New OpenDSSEngine.DSS
InPYTHON:
self.engine = win32com.client.Dispatch("OpenDSSEngine.DSS")
102
DGScreener Applet
UsingtheOpenDSSViatheCOM Server
DGScreener(Demo)
DevelopedforEPRIProgram174
Availabletofunders Funderscandownloadtheinstallationpackage
Nextversionplannedfor2011
Expectinguserstotryitoutandsuggestchanges EspeciallyCanadianusers
ConcernsaredifferentthanUSusers
104
AppletArchitecture
Main Interfaces Used
DSSGraph.DLL
IndMach012a.DLL
Plot
Scripts, Results
105
DrivingtheOpenDSSviatheCOM ServerfromanotherApplication
Activeobjectsconcept
ThereisoneregisteredInProcessCOM interface:
OpenDSSEngine.DSS
Thatis,theDSSinterfaceistheoneyouinstantiate TheDSSinterfacecreatesalltheothers.
Theinterfacesgenerallyemploytheideaofan ACTIVEobject
Activecircuit, Activecircuitelement, Activebus,etc. Theinterfacesgenerallypointtotheactiveobject
Toworkwithanotherobject,changetheactiveobject.
4th International Conference on Integration of Renewable and Distributed Energy Resources
107
DSSInterface
This interface is instantiated upon loading OpenDSSEngine.DSS and then instantiates all other interfaces
108
InstantiatetheDSSInterface andAttemptaStart
Public Sub StartDSS()
' Create a new instance of the DSS Set DSSobj = New OpenDSSengine.DSS ' Start the DSS If Not DSSobj.Start(0) Then MsgBox "DSS Failed to Start" Else MsgBox "DSS Started successfully ' Assign a variable to the Text interface for easier access Set DSSText = DSSobj.Text End If
End Sub
109
COMInterface
Interfaces as Exposed by VBA Object Browser in MS Excel
110
AssignaVariabletotheTextInterface
Public Sub StartDSS()
' Create a new instance of the DSS Set DSSobj = New OpenDSSengine.DSS ' Start the DSS If Not DSSobj.Start(0) Then MsgBox "DSS Failed to Start" Else MsgBox "DSS Started successfully ' Assign a variable to the Text interface for easier access Set DSSText = DSSobj.Text End If
End Sub
111
NowUsetheTextInterface
YoucanissueanyoftheDSSscriptcommands fromtheTextinterface
Always a good idea to clear the DSS when loading a new circuit DSSText.Command = "clear" ' Compile the script in the file listed under "fname" cell on the main form DSSText.Command = "compile " + fname Set regulator tap change limits for IEEE 123 bus test case With DSSText .Command = "RegControl.creg1a.maxtapchange=1 This one moves first" .Command = "RegControl.creg2a.maxtapchange=1 .Command = "RegControl.creg3a.maxtapchange=1 .Command = "RegControl.creg4a.maxtapchange=1 .Command = "RegControl.creg3c.maxtapchange=1 .Command = "RegControl.creg4b.maxtapchange=1 .Command = "RegControl.creg4c.maxtapchange=1 .Command = "Set MaxControlIter=30" End With Delay=15 Delay=30 Delay=30 Delay=30 Delay=30 Delay=30 Delay=30 !Allow only one tap change per solution. !Allow only one tap change per solution" !Allow only one tap change per solution" !Allow only one tap change per solution" !Allow only one tap change per solution" !Allow only one tap change per solution" !Allow only one tap change per solution"
112
ResultProperty
TheResultpropertyisaReadOnlypropertythat containsanyresultmessagesthemostrecent commandmayhaveissued.
Errormessages Requestedvalues
Example: Query line length DSSText.Command = ? Line.L1.Length S = DSSText.Result MsgBox S Get the answer
113
CircuitInterface
This interface is used to 1) Get many of the results for the most recent solution of the circuit 2) Select individual circuit elements in a variety of ways 3) Select the active bus 4) Enable/Disable circuit elements
114
CircuitInterface
Since the Circuit interface is used often, it is recommended that a special variable be assigned to it:
Public DSSCircuit As OpenDSSengine.Circuit DSSText.Command = Compile xxxx.dss Set DSSCircuit = DSSobj.ActiveCircuit DSSCircuit.Solution.Solve Retrieving array quantities into variants
V = DSSCircuit.AllBusVmagPu VL =DSSCircuit.AllElementLosses
115
SolutionInterface
The Solution Interface is used to 1) Execute a solution 2) Set the solution mode 3) Set solution parameters (iterations, control iterations, etc.) 4) Set the time and time step size
116
SolutionInterface
Assuming the existence of a DSSCircuit variable referencing the Circuit interface
Set DSSSolution = DSSCircuit.Solution With DSSSolution .LoadModel=dssAdmittance .dblHour = 750.75 .solve
End With
117
CktElement Interface
This interface provides specific values of the Active Circuit Element Some values are returned as variant arrays
V = DSSCircuit.ActiveElement.Powers V = DSSCircuit.ActiveElement.seqCurrents V = DSSCircuit.ActiveElement.Yprim
118
PropertiesInterface
This interface gives access to a String value of each public property of the active element Val is a read/write property
119
PropertiesInterface
With DSSCircuit.ActiveElement Get all the property names VS = .AllPropertyNames Get a property value by numeric index V = .Properties(2).Val Get same property value by name (VS is 0 based) V = .Properties(VS(1)).Val Set Property Value by Name DSSCircuit.SetActiveElement(Line.L1) .Properties(R1).Val = .068 End With
120
LinesInterface
This interface is provided to iterate through all the lines in the circuit and change the most common properties of Lines.
121
Example:SettingallLineCodes toaValue
Set DSSLines = DSSCircuit.Lines . . . sets active
122
VBAExample
OptionExplicit PublicDSSobj AsOpenDSSengine.DSS PublicDSSText AsOpenDSSengine.Text PublicDSSCircuit AsOpenDSSengine.Circuit PublicSubStartDSS() 'CreateanewinstanceoftheDSS SetDSSobj =NewOpenDSSengine.DSS 'AssignavariabletotheTextinterfacefor easieraccess SetDSSText =DSSobj.Text 'StarttheDSS IfNotDSSobj.Start(0)ThenMsgBox "DSS FailedtoStart" EndSub Define some public variables that are used throughout the project
This routine instantiates the DSS and starts it. It is also a good idea at this time to assign the text interface variable.
123
VBAExample
PublicSubLoadCircuit(fname AsString) 'AlwaysagoodideatocleartheDSSwhenloadinganew circuit DSSText.Command ="clear" 'Compilethescriptinthefilelistedunder"fname"cellon themainform DSSText.Command ="compile"+fname 'TheCompilecommandsetsthecurrentdirectorythe thatofthefile 'Thats wherealltheresultfileswillendup. 'AssignavariabletotheCircuitinterfaceforeasieraccess SetDSSCircuit =DSSobj.ActiveCircuit EndSub This subroutine loads the circuit from the base script files using the Compile command through the Text interface. fname is a string contains the name of the master file. There is an active circuit now, so assign the DSSCircuit variable.
124
VBAExample
PublicSubLoadSeqVoltages() 'ThisSubloadsthesequencevoltagesontoSheet1startinginRow2 DimDSSBus AsOpenDSSengine.Bus DimiRow AsLong,iCol AsLong,iAsLong,jAsLong DimVAsVariant DimWorkingSheet AsWorksheet SetWorkingSheet =Sheet1'settoSheet1(targetsheet) iRow =2 Fori=1ToDSSCircuit.NumBuses 'Cyclethroughallbuses SetDSSBus =DSSCircuit.Buses(i)'Setith busactive 'BusnamegoesintoColumn1 WorkingSheet.Cells(iRow,1).Value=DSSCircuit.ActiveBus.Name 'Loadsequencevoltagemagnitudesofactivebusintovariantarray V=DSSBus.SeqVoltages 'PutthevariantarrayvaluesintoCells 'UseLbound andUBound becauseyoudon'tknowtheactualrange iCol =2 Forj=LBound(V)ToUBound(V) WorkingSheet.Cells(iRow,iCol).Value =V(j) iCol =iCol +1 Nextj iRow =iRow +1 Nexti
4th EndSub International Conference on Integration of Renewable and Distributed Energy Resources
This Sub puts the sequence voltage onto a spreadsheet Define a variable for the Bus interface Define a variant to pick up the arrays Cycle through all the buses Get the bus name
Get the voltages into the variant array Put them on the spreadsheet
125
RunningOpenDSSFromMatlab
StartingtheDSS
%Start up the DSS [DSSStartOK, DSSObj, DSSText] = DSSStartup;
function [Start,Obj,Text] = DSSStartup % Function for starting up the DSS % %instantiate the DSS Object Obj = actxserver('OpenDSSEngine.DSS'); % %Start the DSS. %Matlab session Start = Obj.Start(0); Only needs to be executed the first time w/in a
126
127
ParamNum = 6;
for Case_Count = 1:Max_Cases %Create index in the OutputData matrix to keep the cases in order OutputData(Case_Count,1) = Case_Count; % Generate random new coordinates for each conductor [x1 y1 x2 y2 x3 y3 geomean] = RandomGeometry(8,0.75,30); (... etc. etc. ) %define a new line geometry with random spacing DSSText.Command = ['New LineGeometry.OHMOD nconds=3 nphases=3 cond=1 wire=acsr336 num2str(x1) ' ' num2str(y1) ' units=ft cond=2 wire=acsr336 x=' num2str(x2) ' num2str(y2) ' units=ft cond=3 wire=acsr336 x=' num2str(x3) ' ' num2str(y3) ' units=ft']; %Solve the circuit DSSText.Command = 'solve'; x=' '
(etc. etc.)
4th International Conference on Integration of Renewable and Distributed Energy Resources
128
PowerFlowSolutionBasics
SolvingthePowerFlow
Oncethecircuitmodelisconnectedproperlythenextstepisto solve thebasepowerflow PowerConversionelements(PCelements)areoftennonlinear LoadareconvertedtoaNortonequivalentbasedonnominal 100%ratedvoltage.
Currentsourceiscompensationcurrent
130
SolvingthePowerFlow,contd
Thissolutionmethodrequiresthatthefirstguessatthevoltages beclosetothefinalsolution
Notaproblemfordailyoryearlysimulations Firstsolutionisoftenmostdifficult
131
Load(aPCElement)
General Concept
Added into Injection Current Vector
Yprim
(One-Line Diagram)
Compensation Current
132
Load 3phaseYconnected
Phase 1
Yprim
1 2 3
Compensation Current
Yprim
Compensation Current
Phase 2
4 Conductors/Terminal 4
4th International Conference on Integration of Renewable and Distributed Energy Resources
Yprim
Compensation Current
Phase 3
133
Load 3phaseDeltaconnected
Phase 1
Yprim
2
Compensation Current
Yprim
3
Compensation Current
Phase 2
3 Conductors/Terminal
Yprim
Compensation Current
Phase 3
134
PuttingitAllTogether
ALL Elements Yprim 1 PC Elements Comp. Currents I1 I2 Yprim 2 Yprim 3 Yprim n
Iinj
Node Voltages
Im Iteration Loop
4th International Conference on Integration of Renewable and Distributed Energy Resources
135
PuttingitAllTogether
ALL Elements Yprim 1 PC Elements Comp. Currents I1 I2 Yprim 2 Yprim 3 Yprim n
Iinj
Node Voltages
Im Iteration Loop
4th International Conference on Integration of Renewable and Distributed Energy Resources
136
SolutionSpeed
Distributionsystemsgenerallyconvergeverywell
Manytransmissionsystems,also
137
References
OpenDSSTechNotes: http://sourceforge.net/apps/mediawiki/electricdss/index.php?title=List_of_DSS_tech _notes OpenDSSForum: http://sourceforge.net/projects/electricdss/forums/forum/861976 FrequentlyAskedQuestions: http://www.rogerdugan.com/OpenDSS/sourceforgelinks.html MainDocumentationArea: http://electricdss.svn.sourceforge.net/viewvc/electricdss/Doc/
138