Академический Документы
Профессиональный Документы
Культура Документы
TOOLSFORLONGTERMPARAMETRICSIMULATIONS
TechnicalReport2011137(RPTEC)411MODSIM
REVIEWOFOPENSOURCECODEPOWERGRIDSIMULATION
TOOLSFORLONGTERMPARAMETRICSIMULATIONS
Preparedby:
MarcAndrMoffet
FrdricSirois,Ph.D.
colepolytechniquedeMontral
and
DavidBeauvais
CanmetENERGY,NaturalResourcesCanada
Date
th
July11 ,2011
TechnicalReport2011137(RPTEC)411MODSIM
CITATION
MarcAndr Moffet, Frdric Sirois and David Beauvais; Review of OpenSource Code Power Grid
Simulation ToolsforLongTermParameticSimulation,CanmetENERGY technicalreport2011137,July,
2011.
DISCLAMER
This report is distributed for informational purposes and does not necessarily reflect the views of the
GovernmentofCanadanorconstituteandendorsementofanycommercialproductorperson.Neither
Canadanoritsministers,officers,employeesoragentsmakesanywarrantyinrespecttothisreportor
assumesanyliabilityarisingoutofthisreport.
ACKNOWLEDGEMENT
Financial support for this project was provided by Natural Resources Canada through the Program on
EnergyResearchandDevelopment(PERD).
TechnicalReport2011137(RPTEC)411MODSIM
TABLEOFCONTENT
ListofTables ................................................................................................................................................ iii
ListofFigures ............................................................................................................................................... iii
1 Introduction............................................................................................................................................ 1
2 DescriptionofSimulationTools ............................................................................................................. 3
2.1
2.2
2.3
2.4
FirstCaseStudy:CalculationofDistributionLineLosseswithAdditionofDistributedGeneration.... 11
3.1
3.2
3.3
3.4
3.5
OpenDSS ......................................................................................................................................................4
2.1.1
DescriptionoftheSoftwareApplication .......................................................................................4
2.1.2
Typesofsimulations......................................................................................................................4
GridLABD ....................................................................................................................................................5
2.2.1
DescriptionoftheSoftware ..........................................................................................................5
2.2.2
TypesofSimulations......................................................................................................................7
APREM .........................................................................................................................................................7
2.3.1
SoftwareDescription.....................................................................................................................7
2.3.2
Typesofsimulations......................................................................................................................8
SoftwareComparison ..................................................................................................................................8
Methodology .............................................................................................................................................11
ParameterDescription...............................................................................................................................11
3.2.1
DistributedgenerationData........................................................................................................11
3.2.2
LoadData.....................................................................................................................................12
3.2.3
ElectricalDistributionLineModel ...............................................................................................13
SimulationImplementation .......................................................................................................................14
SimulationCaseAnalysis............................................................................................................................15
ComparativeSoftwareAnalysis .................................................................................................................16
3.5.1
Results .........................................................................................................................................16
3.5.2
Discussion ....................................................................................................................................17
ThirdCaseStudy:CalculationofAnnualEnergyConservationFollowingConservationVoltage
Control.................................................................................................................................................. 19
4.1
4.2
4.3
4.4
IntroductiontotheCaseStudy..................................................................................................................19
DescriptionoftheParameters...................................................................................................................19
Results........................................................................................................................................................21
Discussion ..................................................................................................................................................21
Conclusion................................................................................................................................................... 23
References .................................................................................................................................................. 25
Appendix1ExampleofCodeswithOpendss........................................................................................... 27
Appendix2ExampleofcodeswithGridlabD......................................................................................... 33
Appendix3ExampleofCodeswithAprem.............................................................................................. 39
TechnicalReport2011137(RPTEC)411MODSIM
ii
LISTOFTABLES
Table2.1:SummaryofSoftwareFeatures ....................................................................................................................9
Table3.1:Comparisonofresultsbasedonthedifferentmodels ...............................................................................16
Table3.2:Calculationtimebysoftwareapplication ...................................................................................................17
Table4.1:Calculationtimebysoftwareapplicationforanannualsimulationona30busesand63loadcircuit .....21
LISTOFFIGURES
Figure3.1:V66windturbinepowercurve ..................................................................................................................12
Figure3.2:Loadforadistributionlineforaweekinsummerandwinter ..................................................................13
Figure3.3:Simplifiedmodelofthedistributionline(4)withdecentralizedwindtypegeneration
attheendoftheline ...................................................................................................................................................14
Figure3.4:Weeklylinelosseswith(red)andwithout(blue)distributedgenerationcalculated
withtheline4model...................................................................................................................................................15
Figure4.1:DiagramofthedistributionnetworkasrepresentedbytheOpenDSSvisualizationtool.........................20
TechnicalReport2011137(RPTEC)411MODSIM
iii
INTRODUCTION
NewgridsimulationtoolsarerequiredfortheprogressivedevelopmentofaSmartGridabletomanage
distributed generation, charging of electric cars or of many special protection systems [1] [2] [3].
Properlymodellingandsimulatingthegridisamongsomeofthechallengesposedbytheprogressive
deploymentofalargenumberofdistributedresources,includinginfrastructurerelatedtoflexibleloads
andstorage.Whatisbasicallyneededisgreatergranularityofinformation,aswellasbetterperforming
analysistoolsthatarecapableofprocessingalargerquantityofinformationovertime.
Theadventofsmartgridshasledtonewgridfunctionsthatbringwiththemtheirownchallengesfor
the planner. Integrating the decentralized generation of renewable energy may reverse loadflow
directionandsendpowertothetransmissionnetwork.Ahighpenetrationofthisresourceonaweak
gridmayresultinvoltagesurgesattheendofthedistributionline,andtherebyrequireareviewofthe
voltageregulationandgridprotection.Withtheelectrificationoftransportation,chargingelectriccars
mayoverloadgridcomponentsupstreamfromelectricvehiclechargingstations.Finally,managingpeak
demandbringsaboutchangestotheloadprofile,therebyaffectinggridplanningcriteriaandpractices.
In the midterm, the smart grid aims to take greater advantage of these distributed resources. In the
eventofagridoutagethegoalisthat,withdistributedgenerationandadditionalsupportforstorage,
demandmanagementandautomatedreconfiguration,itwillbepossibletoislandtheload,inorderto
createanautonomousmicrogridandtherebymaintainacommunityspowersupply.
Inordertoaddressthesenumeroustechnicalchallenges,electricaldistributionnetworkengineerswill
need to add new techniques to their repertoire. They must be able to do annual type simulations
(time series simulation), as well as longterm transitory simulations (in minutes) to evaluate, for
example,theeffectofadropinsolargenerationduetoapassingcloudongridvoltage,ortooptimize
managementofdemandandpowerstorageresources.Itisinthisperspectivethatwewillpresentthree
recently developed electrical distribution network simulation tools: GridLABD, OpenDSS and APREM.
Thesesoftwareapplicationsarefirstandforemostaimedatgridplanners,notoperators.Theyareopen
sourcecodeandavailablefreeofcharge:online,inthecaseofOpenDSSandGridLABD,oronrequest,
inthecaseofAPREM.
A description of these software applications and their functions is provided in this report. Two case
studies are simulated with the software applications, and they serve as a basis for comparison
concerningtheirrespectiveperformances.
TechnicalReport2011137(RPTEC)411MODSIM
TechnicalReport2011137(RPTEC)411MODSIM
DESCRIPTIONOFSIMULATIONTOOLS
Notoolinthepowergridsimulationfieldcanrespondtoallneedssimultaneously.Thedifferenttools
developed to date can be reasonably divided into three major groups. First, we have transient state
simulationtools(timebasedsimulations,withoutlimitationastothedurationofthesimulations),such
asEMTPRV,EMTDC,SimPowerSystems,etc.Thesearealsosometimescalledofflinesimulations.This
typeoftoolmaybeused,amongotherthings,toevaluateimpactsonthepowergridofallthingsthat
cause a transient state: lightening, turning a circuit breaker on/off, shortcircuit, etc. Models are
generallyvalidoverlargefrequencyranges,fromdirectcurrenttoMHz.
Second, we have realtime software applications (timebased synchronized in real time with external
inputs/outputsand,ingeneral,externalphysicalequipment/systems)suchasRTDS,OpalRT,Hypersim,
etc. These simulators, also intended to study transient states, are used mainly to check how new
equipmenttobe connectedto thegrid,suchasprotectorrelays,behaves. Giventhedemandsofreal
time simulation, large calculators (multiprocessors) are required. Nevertheless, certain concessions
mustbemadewithrespecttotheaccuracyofthemodelsand/orsizeofthesimulations.
Third, certain grid analysis software applications in the frequencybased state allow for loadflow
calculations,suchasPSAF,ETAPorPSS/E.Thesesoftwareapplicationsareusedtofindthesteadystate
solution of a simple or complex electric circuit. The user enters the electrical parameters of the lines,
transformersandnominalvoltageofthenodes,generatorproductionandloadamountatagiventime.
Thesoftwarethendeterminesthevoltagesandanglesatallbusesand,asaresult,theamplitudeand
directionofthepowerexchangesbetweeneachbus,therebymakingitpossibletocheckforoverloaded
linesorgenerators,andverifythatthegridcandulysustaintheloadandgenerationconditions.Wealso
find, related to frequency, other calculation functions or software applications for calculating short
circuitcurrents,harmonics,protectionsystemadjustment,etc.
When planning electrical distribution networks, a common simulation practice is to consider only the
worstcase,i.e.,peakloadontheline.Wethereforeneedtodeterminetheactiveandreactivevoltages
andpowersoneachsteadystatenodeinordertobeabletodeterminewhetherthegridwilleventually
need to be upgraded. In order to conduct these studies, the following must be known: peak demand
forecast(summerorwinter,dependingontheclimateandclients),layoutoftheelectricaldistribution
network and the different electrical parameters of the network equipment (conductor gauges,
conductor length, electrical parameters of transformers, etc.). Software applications, such as Cymdist,
thatcantakethistypeofinformationandcalculateloadflowarecommonlyused[4].
Three tools were used in this report to do this type of simulation, namely: OpenDSS, GridLABD and
APREM.Thefirsttwoarenotonlyfreeandopensourcecode,buttheyarealsodevelopedbyresearch
centres in the electrical power field. OpenDSS is developed by the ElectricPower Research Institute
TechnicalReport2011137(RPTEC)411MODSIM
(EPRI)andGridLABDbythePacificNorthwestNationalLaboratory(PNNL)undertheUSDepartmentof
Energy(DOE).TheAPREMsoftwareisdevelopedbythecolePolytechniquedeMontral.
2.1
OpenDSS
2.1.1 DescriptionoftheSoftwareApplication
OpenDSS [56] (Distribution System Simulator) is an opensource code software application originally
developedbyElectrotekConceptsin1997.Oneofthereasonsbehindthedevelopmentofthistoolwas
the calculation of harmonics and interharmonics on the electrical distribution network. Different
moduleswherelateradded,suchasMonteCarloanalysisandannualsimulations.In2004,thesoftware
waspurchasedbyEPRIinordertohaveatooltosimulatetheadvancedautomationandmodernization
ofthepowergrids.ItwaswiththisinmindthatEPRIdecidedtomakethesourcecodeavailablefreeof
chargeonlineontheSourceForge.netsite.Awikiisalsoavailableonlinetoassistinunderstandingand
usingthesoftware.
OpenDSS works by command line with its own console. It is also designed to be used with Matlab or
Excel.Itcanbedownloadedforfreeonlineanddoesnotrequireinstallation.ItisprogrammedinDelphi
(objectoriented Pascal) language. Based on how it was designed, it can be integrated into different
software application through a COM interface. Companies can therefore use the calculation tool and
easily integrate it into their software. The software does frequencybased rather than timebased
analysis. It is therefore not a transient state analysis tool. OpenDSS is also not traditional loadflow
software in the sense that it does not use any nonlinear system resolution algorithm such as the
NewtonRaphson algorithm. In fact, the software solves the circuit by using an impedance matrix,
accordingtoEMTP,andwithaparticularcurrentinjectionmethod,whichenablesittofindthevoltage
and current at every circuit node with very few iterations. However, unlike traditional loadflow tools,
withOpenDSS,itistheloadthathasanode,andnotanodethathasaload.Anodecanthereforehave
severaltypesofloadsconnectedtoit.OpenDSSmakesitpossibletodefinethedifferentelementsofthe
electricaldistributionnetwork:lines,cable,capacitors,voltageregulators,transformersandloads.Itcan
solve imbalanced threephase circuits and do simulations taking into account the impedance of the
distribution transformers. Even if the software works by command line, an interface was developed
fromtheprogramforthegraphs.Moreover,ifgeographicaldataareintegrated,thesoftwarecandraw
theshapeoftheelectricaldistributionnetwork.
2.1.2 Typesofsimulations
OpenDSS is used to do several types of simulations that are difficult to do with more traditional
transientstudyorloadflowtools.Thefollowingareafewexamples:
Calculationoflossesinawindfarmcollectionsystem:Lossesinawindfarmcollectionsystemvary
accordingtothepowerdeliveredbywindturbines,whichfluctuatesovertime.Thiscalculationcan
TechnicalReport2011137(RPTEC)411MODSIM
bedonetraditionally,takingintoaccountaveragewindturbinepoweroutput.Inexchange,with
OpenDSS,andusingthepowerdeliveredbyeachwindturbineeachhouroftheyear,thecalculation
oftotallossesforall8,760hoursisdoneinafewcodelinesonly,unliketraditionaltoolsthatrequire
heavierprogramming,oftenconsistingofdataexchangeinterfacesthatperformpoorlyintermsof
executiontime.
Calculationoftheeffectofacloudpassingoverasolarpowerplant:Whencloudspassinanarea
withphotovoltaicpanels,electricitygenerationwillbedownforafewmoments(fromafew
secondstoafewminutes)andthenresumeaccordingtoaslopeofjustafewseconds.Ifthese
generationvariationdataareknown,OpenDSScaneasilyhelptodeterminevoltagedroponthebus
towhichthesolargenerationisconnected.Wecanthereforedeterminewhetherornottherewill
beilltimedoperationofthetransformerswithtapchangersorcapacitorbankstoregulatethis
voltagevariation.
Impactofthearrivalofelectriccarsontheelectricaldistributionnetwork:Theanalysiscapacitiesof
OpenDSSmakeitpossibletoevaluatetheimpactofconnectingelectricvehiclestothepowergrids.
EPRIusedOpenDSStoanalyzetheimpactontheHydroQubecgrid[7].
ShortcircuitanalysisusingtheMonteCarloapproach:OpenDSSmakesitpossibletocarryoutshort
circuitanalysisusingtheMonteCarloapproach.Thesoftwareautomaticallygeneratesshortcircuits
randomlyandfindsthecircuitsolutionundertheseconditions.
Reactivepowerandvoltagecontrol(VoltVarControl):Inordertoreduceconsumedenergyand
losses,electricpowercompaniesusecapacitorsandvoltageregulatorsatthestationorontheline
tokeepvoltagewithintherecommendedlimits.Thisnewapproachtovoltageregulationrequires
measuringvoltageattheendofthegrid.Numerousscenariosofloadflowovertheyearcanbe
studiedwiththisdynamictool.
2.2
GridLABD
2.2.1 DescriptionoftheSoftware
GridlabD [8] is anopensource software application developed by PNNL (Pacific NorthWest National
Laboratory),alaboratorywiththeUSDepartmentofEnergy.GridLABDisalsoanelectricaldistribution
networksimulationapplicationwhichexplainstheletterDinthename.UnlikeOpenDSS,GridLABD
wasfirstandforemostdevelopedasaresidentialloadsimulator[9].Othermoduleswerethenaddedfor
grid simulations. PNNL uses this tool to carry out analysis on the impact of the energy conservation,
renewable energy integration and new technology program on the entire US power grid. The PNNL
laboratoryusedoneofthefirstversionsofthissoftwarewhenshowinghowasmartwaterheaterreacts
toamarketpricesignalinrealtime(OlympicPeninsulaProject)[10].
GridLABDcanbeusedtomodelahomeselectricloads(dishwasher,refrigerator,freezer,dryer,etc.),
as well as thermostatcontrolled loads. The approach is different for household appliance and water
TechnicalReport2011137(RPTEC)411MODSIM
heater simulation, or air conditioning and heating demand. The profiles of the household appliance
loadsweredevelopedbasedonastudyontheuseofdifferentresidentialloadsbyAmericans(ELCAP
EndUseLoadandConsumerAssessmentProgram19831990).Thesoftwaretakesoverallloadcurves,
seenfromtheintegratednetwork,foreachofthedevicesanddistributesthemhousebyhouse,based
on a topdown allocation. This approach enables different analyses on the overall impact of demand
management,butdoesnotreflectthespecificdynamicofahouseanditsloadsovertime.Itisratheran
average load. As concerns the thermostatcontrolled loads (heating, air conditioning, water heater),
GridLABDincludesadynamicmodelthatusesadiscretesetofdataprovidedbytheuser.
Thesoftwareincludesawaterheatermodelandthermalparametersofahousetocalculateheating,air
conditioningandhotwaterneeds.Infact,thenumberofsquarefeet,wallandwindowinsulationcanbe
calculated. The type of heating/air conditioning (electrical, thermal) can then be defined, and the
softwarecalculatestheneed.Inordertoreflecttemperaturevariations,itusestypicalmeteorological
year(TMY)data.Forthetimebeing,onlyUSdataareavailable.
The method used to model heat exchanges is the ETP (Equivalent Thermal Parameter) method. This
method makes it possible to convert thermal parameters to electric parameters. It represents the
thermal dynamics of a house using resistances and capacitors. The temperature is represented by
voltage.Thecalculationmethodforheating/airconditioningneedsisnotasdevelopedasinthecaseof
buildingmechanicssoftware,suchasEnergyPlusorTrnsys,butitcanstillsimulateheatexchangesfora
time step of less than one minute. Also, as we will show below, simulation time is already quite
important,soanoverlycomplexmodelwouldslowtheprogramdownunnecessarily.
TheGridLABDapproachfordeterminingheating,airconditioningandwaterheaterneedsistherefore
tomodeltheneedofeachhouseandgobackupthenetwork,fromthebottomup.Thisisthereverseof
the method usedtoanalyzetheimpactofhouseholdappliances.Inthefirstversionsofthesoftware,
GridLABDusedtheGaussSeidelalgorithmtosolvetheloadflow.However,thisalgorithmdidnotoffer
good largescale network performance. That is why the current algorithm is the NewtonRaphson. At
this time, GridLABD does not offer any graphic interface. However, like the OpenDSS, there is an
integratedprogramthatallowsgraphicstobetracedinordertoproperlyviewtheresults.
Thedesignersofthissoftwarewouldlikeothercompaniestousetheirsourcecodeandintegrateitin
their software applications. The programming language used is in general C and C++. Text files which
describe the different network elements and loads and define the simulation parameters and type of
results desired must be written for the software to operate. To run these text files,the Windows
commandwindowmustbeused,andthenthenameofthefiletoberunmustbetyped.Aninterface
with Matlab was developed, but seems difficult to operate (see discussion group). This makes the
programheaviertousethanOpenDSS.Finally,PNNLoffersgroupsoftwaretraining.
TechnicalReport2011137(RPTEC)411MODSIM
2.2.2 TypesofSimulations
SeveraltypesofelectricalsimulationsmaybedonewithGridLABD,butwhatsetsitapartisitsabilityto
simulatedemandmanagement.Theusermayspecifythesimulationtimeparameters:thesmallesttime
stepvalueisonesecondandthebiggestisonehour.Simulationsoveratimeframeofseveralyearscan
alsobedoneusingthissoftware.
Several modules have been developed by the scientific community and are available on SourceForge.
The main GridLABD modules are a load control module (demand side management under
development),areliabilitymodulefor evaluating SAIDIandSAIFIindexesfollowinggridautomation,a
marketmoduletosimulateanelectricitymarket,amoduleforrealtimecalculation,i.e.,statechanging
loads in real time and a module including models for commercial, industrial and agricultural loads. A
moduletosimulateacommunicationsnetworkwasrecentlyadded.Thesoftwareisbeingdevelopedby
thecommunity,therefore,certainfunctionsarenotaccessibletoeveryone,arelackingdocumentation
orarenotfinal.
Thesoftwareisalsousedforloadflowcalculationsonthedistributionnetworks.GridLABDwasusedto
evaluateenergyconservationgainedfromvoltagecontrol(CVR)ontheAmericandistributionnetwork
[11]. Twentyfour types of distribution circuits with loads were modelled with GridLABD, in order to
modelthisconservation.Thesemodelsareavailablewiththesoftware.
As previously mentioned, this software was developed for largescale simulations. We can therefore
simulate grids with tens of thousands of homes, each with its respective residential load, as well as
largesize distribution networks. GridLABD also makes it possible to simulate these grids at the same
timeondifferentcomputers.
2.3
APREM
2.3.1 SoftwareDescription
APREM (Analyse Paramtrique des Rseaux lectriques [Parametric Analysis of Power Grids] with
Matlab)wasdevelopedatMontrealscolePolytechniqueinordertorespondtocertainspecificHydro
Qubec needs [12]. APREM functions with Matlab and uses this softwares objectoriented
programming, combined with MEX files (files written in C++ and precompiled to accelerated
calculations). APREM uses the increased node matrix method to solve the electrical circuit [13]. Like
OpenDSS,itmakesloopsimulationspossiblebyvaryingtheload,thegenerationandeventhetopology
of the grid. Of the three software applications proposed here, this one is the easiest to use.
Furthermore, since it works with Matlab, an intermediate Matlab user with a basic understanding of
loadflowcanlearntouseAPREMinunderanhour.Theusermustfirstofalldefinehisgrid(impedances,
transformers, loads, sources, switches, etc.), and can then change any circuit parameter at will and
recalculatethesolution.Itseaseofusemakesittheidealsoftwareforacademicuse.However,APREM
TechnicalReport2011137(RPTEC)411MODSIM
offersfewerfunctionsthanthetwoprevioussoftwareapplicationsgivenmorerestrictedbudgetsand
developmenttime.Forexamplegridautomations(capacitorbank,tapchange)canbeeasilyintegrated
inOpenDSS, which isnot yetthecase withAPREM.However,APREMisabletoassociateanarbitrary
number of functions (transformer tap change, capacitor bank control, grid reconfiguration, etc.) with
each piece of grid equipment, which makes it possible to model any conventional or other control
systemfoundonthegrid.Forexample,APREMenablestheusertoeasilyanddynamicallychangethe
gridtopology,whichisnotthecasewiththeothertwosoftwareapplications.
2.3.2 Typesofsimulations
APREM was initially developed for Monte Carlotype reliability simulations. It can therefore simulate
loops of thousands of iterations with topological (generator or working or nonworking line, open or
closed circuit breaker, etc.) or parametric (load or generation change) changes at each iteration. A
topologicalvalidationtoolisalsoincludedtopreventnonconvergenceoftheelectricalcalculationinthe
eventofaninvalidtopologyresulting,forexamplefromtheislandingofaPQloadfollowingthelostof
thesource,upstream.ThismeansthatAPREMisspecializedinsimulationswhereparametersmustbe
changed with each iteration. An optimized version for a fixed network topology is currently being
developed.
Furthermore, APREM can be coupled, through Java, with an artificial intelligence module (Drools) for
simulatingsmartautomationsonthegrid,suchasreconfigurationintheeventofanoutage.
2.4
SoftwareComparison
Table2.1setsoutaqualitativesummaryofthefeaturesofthethreesoftwareapplications.Thistable
provides an overview only. Since the three software applications are still under
development/improvement, the features presented are valid at the time this report was drafted, but
maybesignificantlydifferentin2to3years,andperhapsevennextyear.
TechnicalReport2011137(RPTEC)411MODSIM
Table2.1:SummaryofSoftwareFeatures
Availablemodelsof
gridelements
OpenDSS
Source,line,generator,
capacitor,transformers
withnphasesandm
windings,supportfor
imbalancedloads
Availablemodelsof
loads
7models,including:
constantPQ,constantZ,
constantPI
Typesofcalculation
Loadflow,harmonics,time
seriessimulations
Typesofstudy
Fluctuatinggeneration,loss
calculation,shortcircuit
currents,storage
management,voltandvar
management
VarVolts,tapchanger,
storage
Integratedcontrols
Calculationtime
Preprocessing
Postprocessing
Veryfast(throughMatlab),
evenfasterwithdirectuse
oftheexecutable
csvfiles,Matlab/Excel
Codeexamples
csvfiles,Matlab/Excel,
graphictools
Sourceforge,Wiki,PDF
Documentation[14]
Severalexamples
Internetforum
Initialsoftwaregoal
Active
Calculationofharmonics
Specificfeatures
Maybecoupledwithother
softwarethroughaCOM
DLLinterface
Developer
EPRI
Documentation
TechnicalReport2011137(RPTEC)411MODSIM
GridLABD
Line,transformer,
regulator,capacitor,fuse,
restart,generator
(includingsolarandwind),
supportforimbalanced
loads
ConstantZ,constantI,
constantP
Commercial,industrialand
residentialloads
(Heating/airconditioning,
severalhousehold
appliances)
Loadflow,timeseries
simulationstakingclimate
andutilisationintoaccount
Voltandvarmanagement,
fluctuatinggeneration,
loadcontrol,loss
calculation
APREM
Source(V,I),impedance(RLC),
transformer,switch,
generator,supportfor
imbalancedloads
PQ,Z,possibilityof
programmingP,Q=f(V,I)
Loadflow,timeseries
simulations
Reliability(MonteCarlo),loss
calculation,fluctuating
generation,reconfiguration
(withDrools)
VarVolts,tapchanger,
Tobeprogrammedbythe
loadcontrolsdepending
useronacasebycasebasis
onelectricitycost,peak
demandmanagement,
possibleuserprogramming
Fast
Medium
csvfiles,Matlablink
possible,butwithlimited
functionality(seeforum)
csvfiles,graphictools
Matlab,Excel
Sourceforge,Wiki[13]
PDFDocumentation(limited)
Afewexamplesand
trainingofferedbyPNNL
Active
Modellingofresidential
loads
Useofclimatefiles(TMY)
forsolarpanels,wind
turbinesandheating/air
conditioning,economic
modules
PNNL
Limited
Matlab
No
Reliability(MonteCarlo)
Topologicalvalidations,
dynamicaddition/withdrawal
ofcomponents
PolytechniqueMontral
TechnicalReport2011137(RPTEC)411MODSIM
10
FIRSTCASESTUDY:CALCULATIONOFDISTRIBUTIONLINELOSSES
WITHADDITIONOFDISTRIBUTEDGENERATION
Annualdistributionlinelossesareusuallycalculatedwiththedatafromthepeakloadusingalossfactor
based on the grid use factor. With the addition of distributed generation, analyzing losses becomes
morecomplexgiventhatgenerationvariationisaddedontoloadvariation.Whendistributedgeneration
isproducingpower,itreducesthecurrentcarriedfromthesubstationtotheload.Dependingonthe
distributedgenerationcapacityinstalledandtheminimumlineload,incertaininstances,thedirection
ofthecurrentmaybereversedandthelinemayprovidepowertothesubstationwhenthereisaload
dipand high generation.Sincelossesareproportionaltothesquareofthecurrent,the differentialof
thepowerproducedandconsumedonthelineisnotthesamedependingonwhetherasingleannual
value is used or a series of values are used over time. That is why using a software application for
calculatingtimeseriesloadflowsisrequiredinordertoimprovetheaccuracyoftheresult.
3.1
Methodology
In order to evaluate each tools performance, a typical case was tested using the three software
applications chosen for comparison. This case consists in evaluating the effect on a distribution lines
losses of adding distributed generation which is variable over time. Although this case looks at
distributed generation, it is also similar to calculating losses in a wind farms collector network. The
problem consists in calculating the annual losses of a distribution line, with or without distributed
generation connected at the end of the distribution line. Since distributed generation and load data
fluctuateovertime,thesoftwaremustbeabletocalculateloadflowateachunitoftimeforwhichwe
havedata.Inthiscase,therearedataforeachhourinayear.Thesoftwareapplicationsmusttherefore
perform8,760loadflowcalculations.Thedifferent parametersofthisstudyareasfollows:distributed
generation,loadandlinemodel.Theyaredescribedindetailbelow.
3.2
ParameterDescription
3.2.1 DistributedgenerationData
The type of distributed generation used is wind power. Solar could also have been used. Distributed
generation consists of generation from three Vestas V66 2 MW wind turbines, for a total nominal
capacity of 6 MW. The wind speed data come from the National Climate Archive [16] and where
measuredatCapChatinGaspsie.Theyweremeasuredataheightof5m,andsincetheaverageheight
oftheV66windturbineis78m,wecanusethefollowingequationtobringthemeasureddatatothe
rightheight[17]:
TechnicalReport2011137(RPTEC)411MODSIM
11
Thewinddataisthereforemultipliedby:(78/5)0.14=1.47.
Therearetherefore8,760itemsofwinddata(1itemforeachhourfromJune1,2004,toMay31,2005).
EachitemofwinddataisassociatedwiththeVestasV66windturbinepowercurve[18]:
2200
2000
1800
1600
1400
1200
1000
800
600
400
200
0
10
15
Wind speed (m/s)
20
25
Figure3.1:V66windturbinepowercurve
Usingtheseparameters,andknowingthattherearethree2MWwindturbines,weareabletoobtaina
distributedgenerationvalueforeachhourinayear.
3.2.2 LoadData
Thedistributionlineloaddataaretypicalofalinesupplyingpowertoelectricallyheatedhomes(mostly
resistiveload),thereforewithapowerfactorofnearly99%.Inordertofacilitatethestudy,weuseda
unit power factor, although simulation with variable reactive power over time does not pose any
problemtothethreesoftwareapplications.Thefactorforlineuseis:
TechnicalReport2011137(RPTEC)411MODSIM
12
Themaximumloadis13.37MWandtheminimumloadis3.03MW.Figure3.2presentstheloadprofile
foratypicalwinterweekwhenloadisatitsmaximum,andforatypicalsummerweek,whenloadisat
itsminimum.
14
12
Power (MW)
10
2
Summer load (typical week)
Winter load (typical week)
0
3
4
Time (days)
Figure3.2:Loadforadistributionlineforaweekinsummerandwinter
3.2.3 ElectricalDistributionLineModel
Inordertomodeladistributionline,thesubstationisfirstrepresentedbyaswingbusatoneendofthe
line(25kVlinevoltage).Thelineis10kmlong,witha477MCMaluminumconductor(directsequence
impedance0.116+j0.395/km).Thethreephasesaremodelledseparately,butthecouplingbetween
thelinesisneglected,becausetheloadisevenlydistributedoverthethreephases(therefore,thegrid
remains balanced). The coupled lines can, however, be modelled in all three software applications,
whichallowsforeasymodellingofimbalancedgrids.Decentralizedproductionplacedattheendofthe
TechnicalReport2011137(RPTEC)411MODSIM
13
lineisrepresentedbyaPQbus,withQ=0,althoughareactivepowercontrol,definedbytheuser,can
alsobeused.
Fortheload,fourmodelswereused.Thefirstthreemodelswillconsistofaloadseparatedinto5,10or
20equalpartsalongthe10kmline.Distributingaloadthiswayalongalineincreasesthecalculation
load.Intheliteraturereviewed,wefindasimplifiedmodelforevaluatinglossesandavoltagedropon
thistypeofline[19].Thismodel,whichwillbeourfourth,consistsinplacingtwothirdsoftheloadalong
aquarterofthelineandthelastthirdattheendoftheline 1 .Byhavingdifferentmodels,weareableto
observe the difference in software calculation time, based on the number of elements in play. The
followingarethefourlinemodelstested:
1. Loadevenlydistributedinfiveequalparts
2. Loadevenlydistributedin10equalparts
3. Loadevenlydistributedin20equalparts
4. Twothirdsoftheloadalongaquarterofthelineatonethirdoftheloadattheendoftheline
Figure3.3:Simplifiedmodelofthedistributionline(4)withdecentralizedwindtype
generationattheendoftheline
3.3
SimulationImplementation
Nowthatthemodelanditsparametershavebeendefined,wecanmovetothesimulationstage.The
twocalculationsusedareasfollows:
Calculationoflossesalongthedistributionlineateveryhouroftheyear,withoutdistributed
generation
Calculation of losses along the distribution line at every hour of the year, without addition of wind
generationattheendoftheline
These two calculations are done for each of the four models, and with each of the three software
applications.Thereaderishighlyadvisedtoreadatthistimethecodesusedwitheachofthesoftware
Thismodelshouldbevalidated,inviewoftherecentintroductionofdistributedgeneration.
TechnicalReport2011137(RPTEC)411MODSIM
14
applications,presentedintheappendices,inordertohaveanaccurateideaonhowtousethem.This
willmakeiteasiertounderstandandassessthecomparativeanalysispresentedinthefollowingsection.
3.4
SimulationCaseAnalysis
Thethreesoftwareapplicationsprovideidenticalresultsforeachofthescenariosreviewed.Theresults
ofeachofthefourlinemodelsare,however,different.Theelectricalresultswillfirstbepresentedand
analyzed.Thesoftwareresultsandperformanceswillthenbediscussed.Figure3.4presentstheresults
obtainedforlinemodelnumber4withAPREM,OpenDSSandGridLABD.Itisofnotethatthefourline
modelsprovidesimilargraphs.
15
10
10
15
20
25
30
Week
35
40
45
50
Figure3.4:Weeklylinelosseswith(red)andwithout(blue)distributedgeneration
calculatedwiththeline4model
Hourlylosseswereaddedandcombinedintoweeklylossesinordertobetterobservetheeffectofwind
generationonthelinelosses.Wenoticeinthegraphthatthereisaweekwherelosseswithdistributed
generationarehigherthanwithout.Thisisduetothefactthat,inthatweek,windgenerationishigher
thanthelineload.Thisthereforemeansthat,atthatmoment,thedistributionlineissendingpowerto
thedistributionsubstation.Table3.1summarizestheresultsforthefourloadmodels.
TechnicalReport2011137(RPTEC)411MODSIM
15
Table3.1:Comparisonofresultsbasedonthedifferentmodels
Model1
Model2
Model3
Model4
Totalannualpowerconsumedbythe
load
58,280MWh
Peaklinelosses
151.4kW
132.1kW
122.9kW
113.9kW
Offpeaklinelosses
7.58kW
6.6kW
6.2kW
5.7kW
Annualdistributedgeneration
14731MWh
6MWfarmcapacityfactor
28.0%
Annuallosseswith/withoutdistributed
generation
351/235MWh
307/210MWh
286/199MWh
265/188MWh
Annualenergyconservation
116MWh
96.8MWh
87.1MWh
77MWh
Annualsavings(10/kWh)
$11,600
$9,680
$8,710
$7,700
Table3.1showsthattheinstallationofdecentralizedwindtypegenerationattheendofadistribution
linemakesitpossibletoreducelinelossesbyabout80MWhperyear,whichrepresentsanapproximate
30% decrease in annual losses. This reduction in losses includes only average distribution line voltage
losses.Infact,lossreductionisstillmoreconsiderableifweconsiderthat,onanannualbasis,mostof
the losses incurred on the transmission network are avoided. However, as can be seen in figure 3.4,
medium voltage losses increased during periods of low load since, at that moment, distributed
generationishigherthantheloadandthelinesendspowertothegrid.Inordertomodelthisunusual
situationanditsimpactupstream,thesubstation,regionaltransmissionnetworkorotherdistribution
linesmustbemodelled.Ifneeded,thistypeofcalculationmayalsobedoneusingthethreesoftware
applicationspresented.
3.5
ComparativeSoftwareAnalysis
3.5.1 Results
Table3.2setsoutacomparisonofthecalculationtimeofthedifferentsoftwareapplicationsbasedon
the line model used. Model 4 is the one with the fewest elements, and model 3 is the one with the
most.
TechnicalReport2011137(RPTEC)411MODSIM
16
Table3.2:Calculationtimebysoftwareapplication
Linemodel
1
2
Numberofelements
15loads,15lines
30loads,30lines
60loads,60lines
6loads,6lines
OpenDSS
55seconds
1min50seconds
3min30seconds
(CoupledwithMatlab)
30seconds
(CoupledwithMatlab)
GridLABD
5minutes
8minutes
APREM
26minutes
53minutes
13minutes
115minutes
2minutes
10minutes
The calculation time for this case study increases linearly with the number of elements. Thus, by
doubling the number of loads, the calculation time was doubled. The previous table shows the
impressiveperformanceoftheOpenDSSsoftwareintermsofcalculationtime.Moreover,thesetimes
are even shorter if the executable is used directly instead of passing through Matlab. GridLABDs
performanceisslightlyslowerthanthatofOpenDSS(byafactorofabout4).Moreover,thecalculation
timeofOpenDSSincludestheanalysisoftheresults,whichisnotthecaseofGridLABD.AsforAPREM,
thecalculationtimeislongerbyafactorof5to20inrelationtotheothersoftwareapplications.
3.5.2 Discussion
The three software applications made it possible to simulate distributed generation, with calculation
times that differ from one case to another. As concerns the distribution line modelling, the three
softwareapplicationsarecomparable.However,thesyntaxandcalculationtimevaryfromonesoftware
applicationtoanother.Forthistypeofsimulation,OpenDSSiscertainlythemostappropriatebecauseit
waspartiallydesignedforthistypeofcalculation.GridLABDperformsreasonablywellgiventhatitwas
first and foremost designed for residential load and not strictly grid calculations. However, its use is
morecomplexthanthatofAPREMorOpenDSS.AsforAPREM,itsrelativeslownessindoingthistypeof
calculationiscompensatedbyitseaseofuse,asprogramwritingandresultsanalysisiseasierthanwith
the two other software applications. Of course, this is only valid if the user is already familiar with
Matlab.
It is important to note that the authors prior indepth understanding of Matlab influenced their
assessment.Notably,thefactthatOpenDSSandAPREMweretestedusingMatlabasaninterfacegave
themacomparativeedgeoverGridLABD.Table2.1alsoshowsthatOpenDSSandGridLABDhavegood
qualitydocumentationandenoughexamplestobeabletohelpthebeginneruserperformsimulations
easily.
TechnicalReport2011137(RPTEC)411MODSIM
17
TechnicalReport2011137(RPTEC)411MODSIM
18
THIRDCASESTUDY:CALCULATIONOFANNUALENERGY
CONSERVATIONFOLLOWINGCONSERVATIONVOLTAGECONTROL
4.1
IntroductiontotheCaseStudy
The second case study relates to voltage control or CVR (Conservation Voltage Reduction). This
application 2 aimsatoptimizingvoltageandreactivepowercompensationtosaveenergyandlinelosses.
This type of study requires specific capacities on the part of the power grid analysis software
applications.First,thesoftwaremustbeabletomodelthedifferenttypesofload.TheZIPmodelisthe
onemost commonly used.Thismodelmakesit possibletodefinethe differentloadbehaviourswhen
dealingwithavoltagevariation.TheletterZrepresentsconstantimpedanceloads(whenvoltagedrops,
the current drops), the letter I represents constantcurrent loads (when voltage drops, the current
remainsconstant),andtheletterPrepresentsconstantpowerloads(whenvoltagedrops,thecurrent
increases).
This model has a few limits, in particular when the time comes to model thermostatcontrolled loads
(waterheater,heating,airconditioning).Inthecaseoftheseloads,whenthevoltagedrops,thecurrent
drops. They therefore behave like constantimpedance loads. However, these devices must operate
longer in order to be able to provide the total required amount of power, which risks reducing the
diversityoftheloadandleadtopeakloadincrease.Impactanalysisthereforerequiresatoolfortime
series simulations. Since GridLABD is the only one of the three software applications to be able to
implicitly model this phenomenon, it is of great importance for this type of study. PNNL used this
softwaretoevaluatetheCVRpotentialintheUnitedStates[11].
Inordertobeabletocomparethethreesoftwareapplications,onlytheZIPmodelwillbeused.
4.2
DescriptionoftheParameters
This case study consists of a simplified 30buses distribution line with threephase and singlephase
branches, as well as singlephase loads. The loads 21 in total are represented by a ZIP model
upstream from the transformers. There is therefore a Z load, I load and P load at each load bus. It is
assumed that the voltage is to be kept at a minimum value of 114 V upstream from the transformer.
Thisthereforerepresentsaphasevoltageof13,680Vonthenetworksideassumingaturnsratioof14.4
kV/120240V.Thegoalisthereforetogetasclosetothisvoltageaspossiblewithoutbeinglower.We
assume that the nominal voltage at the substation is 25 kV and that we can decrease this voltage in
200Vincrements.Thegoalisthereforetoslavetheminimumvoltageatthesubstationinordertohave
avoltagevaluecloseto13,680Vonthebuswherethevoltageislowest.
2
TechnicalReport2011137(RPTEC)411MODSIM
19
Theadvantageofthethreesoftwareapplicationsistobeabletoperformtimeseriessimulations.We
arethereforegoingtovarytheloadsoverthedistributionnetworkbasedonthevaluesprovidedinthe
previouscasestudy.Accordingly,thetotalpowerdemandedbytheloadsischangedwitheachonehour
timestep.EachofthesepoweramountsisequallydistributedamongtheZ,IandPloads.Inorderfor
the study to be more authentic, this distribution must also be changed according to the times and
seasons over a year. These results will be the basis for estimating what amount of energy can be
conserved annually with this type of control and what is the impact on peak load. It is important to
specify that the goal of this study is merely to provide an overview of the software applications
possibilities.Itdoesnotonitsownprovideforavalidationofthetypeofcontrolreviewed,atleastnot
withoutfirstaccuratelymodellingtheenergyneedsoftheloadsatallperiodsoftheyear.
Figure4.1presentsthedistributionnetworkdiagramusedaswellastheresultprovidedbytheOpenDSS
circuitvisualizationtool.Thewidertheline,thebiggerthecurrentcirculatinginthispartofthenetwork.
Wenotethatthenetworkconsistsofamainthreephasebranchandsecondarysinglephasebranches,
towhichtheloadsareconnected.
Figure4.1:DiagramofthedistributionnetworkasrepresentedbytheOpenDSSvisualizationtool
TechnicalReport2011137(RPTEC)411MODSIM
20
4.3
Results
Table4.1providesanoverviewofthecalculationtimeforeachsoftwareapplication.Sincethecircuits
arebiggerandthecalculationismorecomplicated(therightvoltageneedstobefoundforeachtime
step),thecalculationtimesarelongerthanthosefoundinthepreviouscasestudy.Theperformanceof
each software application is fairly identical to those previously found. The table shows that it is the
OpenDSSthatperformsbest,evenifusedwithMatlabandnotsimplywiththeexecutable.
Table4.1:Calculationtimebysoftwareapplicationforanannualsimulationona30busesand63loadcircuit
OpenDSS
3minutes(coupledwith
Matlab)
GridLABD
APREM
12minutes
200minutes
4.4
Discussion
With these three software applications the impact of the conservation voltage control on the annual
energy conservation of a distribution line can be simulated. Given the complexity and length of this
calculation, we notice an even wider gap between APREMs calculation time performance and that of
theothersoftware.Voltageregulationcanbeeasilyprogrammedwiththethreesoftwareapplications.
WiththeGridLABD,thereisevenalreadyadevicethatdoesthisoperationdirectly.Moreover,ifwehad
wanted to integrate the thermostatcontrolled circuits, only the GridLABD would have this function
alreadybuiltin.Thisstudyhasnotintegratedvarcontrol(capacitorcontrol).However,sincecapacitor
modellingisalreadybuiltintothethreesoftwareapplications,theintegrationofthiscontrolcouldhave
beendonebythethreeapplications.Theproblemandcontrolwouldhavebecomemorecomplex,and
thecalculationtimelonger.
TechnicalReport2011137(RPTEC)411MODSIM
21
TechnicalReport2011137(RPTEC)411MODSIM
22
CONCLUSION
This report presents three recent power grid simulation tools for conducting time series studies. The
commonfeatureamongthesesoftwareapplicationsisthattheyareopensourcecodeandavailablefor
free online or on request. These tools make loop simulations relatively easy when compared to the
existing tools, including, among other things, longlasting time series simulations. Each of these three
softwareapplicationsoffersdifferentpossibilities.GridLABDismorespecializedforstudiesthatinclude
modelling residential loads, APREM is specialized in reliability studies, and OpenDSS is specialized in
annualtimeseriesstudies.
The conclusions of this report are based on two cases that can be simulated with the three software
applications. Each application performed differently and their use has been characterized. Albeit the
threeapplicationswereshowtobecapableofhandlingbothstudies,theircalculationtimeandeaseof
usevaryconsiderably.Forthetypeofstudiespresented,OpenDSShadthebestperformanceintermsof
calculationtime.However,foreaseofuse,APREMstandsoutfromtherest.InthecaseofGridLABD,
thetypeofstudypresenteddidnotdojusticetothissoftwarespossibilities.Infact,ifresidentialload
modelling had been mandatory, it is the only software that would have solved the problem in a
reasonable time frame for the user, without having to program new functions oneself. Since these
software applications are still being developed, it will be interesting in the future to follow their
respectivedevelopmentsandevaluatetheirimpactonthecommercialsoftwaremarket.
TechnicalReport2011137(RPTEC)411MODSIM
23
TechnicalReport2011137(RPTEC)411MODSIM
24
REFERENCES
[1]
F.Milano,L.Vanfretti,StateoftheArtandFutureofOSSforPowerSystems,2009IEEEPES
GeneralMeeting,Calgary,July2009.
[2]
R.C.Dugan,R.F.Arritt,T.E.McDermott,S.M.Brahma,K.Schneider,DistributionSystem
AnalysistoSupporttheSmartGrid,2010IEEEPESGeneralMeeting,Minneapolis,July2010.
[3]
C.Abbey,EvolutionofnetworksimulationtoolstofacilitateDERdeployment,PowerPoint
presentation,3rdInternationalConferenceonIntegrationofRenewableandDistributedEnergy
Resources,Nice,France,December2008;www.3rdintegrationconference.com/pres/38_Abbey.pdf,
accessedJuly11,2011.
[4]
C.Kwok,F.DeLon,A.Morched,CYMEInternationalSurveyofStudiesandAnlysisToolsUsed
forAssessmentofDistributedGenerationIntegrationinCanadianDistributionSystems,
CanmetENERGYreportnumber2006070,May2006
[5]
SourceForge.netOpenDSS,http://sourceforge.net/projects/electricdss/accessedJuly11,2011.
[6]
R.C.Dugan,OpenDistributionSimulationsSystemWorkshop:UsingOpenDSSforsmart
distributionsimulations,EPRIPQSmartDistribution2010ConferenceandExhibition,Qubec,
June1417,2010.
[7]
A.Maitra,K.S.Kook,J.Taylor,A.Giumento,GridImpactsofPluginElectricVehiclesonHydro
QuebecsDistributionSystem,2010IEEEPESTransmissionandDistributionConferenceand
Exposition,NewOrleans,April2010.
[8]
SourceForge.netGridLABD,http://sourceforge.net/projects/gridlabd/,accessedJuly11,2011.
[9]
R.T.Guttromson,D.P.Chassin,S.E.Widergren,ResidentialEnergyResourceModelsfor
DistributionFeederSimulation,PowerEngineeringSocietyGeneralMeeting,IEEE,2003.
[10]
D.J.Hammerstrom,R.Ambrosio,T.A.Carlon,J.G.DeSteese,G.R.Horst,R.Kajfasz,L.L.Kiesling,P.
Michie,R.G.Pratt,M.Yao,J.Brous,D.P.Chassin,R.T.Guttromson,O.M.Jarvegren,S.
Katipamula,N.T.Le,T.V.Oliver,andS.E.Thompson.PacificNorthwestGridWiseTestbed
DemonstrationProjects;PartI.OlympicPeninsulaProject.PNNL17167,PacificNorthwest
NationalLaboratory,Richland,WA,October2007.
[11]
K.P.Schneider,JCFuller,FKTuffner,andRSingh.2010.EvaluationofConservationVoltage
Reduction(CVR)onaNationalLevel.PNNL19596,PacificNorthwestNationalLaboratory,
Richland,WA,July2010.http://www.pnl.gov/main/publications/external/technical_reports/PNNL19596.pdf
accessedJuly11,2011
TechnicalReport2011137(RPTEC)411MODSIM
25
[12]
F.Sirois,APREMAnalyseparamtriquedesrseauxlectriquesavecMatlab,cole
polytechniquedeMontral,http://www.professeurs.polymtl.ca/f.sirois/These_F_Sirois.pdfaccessed
July11,2011
[13]
J.J.AllemongRJ.BennonP.W.Selent,MultiphasePowerFlowSolutionsUsingEMTPand
NewtonsMethod,IEEETransactionsonPowerSystems,Vol.8,No.4,November1993,pp.
14551462.
[14]
SourceForge.netOpenDSS,MainPage,
http://sourceforge.net/apps/mediawiki/electricdss/index.php?title=Main_PageAccessed,July
2011.
[15]
SourceForge.netGridLABD,MainPage,http://sourceforge.net/apps/mediawiki/gridlab
d/index.php?title=Main_Pageaccessed,July2011.
[16]
EnvironmentCanada,NationalClimateDataandInformationArchive
http://climate.weatheroffice.gc.ca/Welcome_e.htmlaccessed,July2011
[17]
NaturalResourcesCanada,RetscreenInternational,CleanEnergyProjectAnalysis,3rdEdition,
January2006,p.Eole16.
[18]
NaturalResourcesCanada,RETScreenInternationalProductData,
http://www.retscreen.net/ang/d_data_p.phpaccessed,July2011
[19]
W.H.Kersting,DistributionSystemModelingandanalysis,2ndedition,CRCPress,p.57.
[20]
Rgiedelnergie,Projetderductiondelaconsommationnergtiqueparunegestion
optimisedelatensiondurseaudedistributionProjetCATVAR,DemandeR37462010,
HydroQubecDistribution,October22,2010,http://internet.regie
energie.qc.ca/Depot/Projets/84/Documents/R37462010B0004DEMANDEPIECE
2010_10_27.pdfaccessed,July2011
TechnicalReport2011137(RPTEC)411MODSIM
26
APPENDIX1EXAMPLEOFCODESWITHOPENDSS
TechnicalReport2011137(RPTEC)411MODSIM
27
A.1OpenDSScodeusingtheexecutableforthefirstcasestudy
As previously mentioned, OpenDSS can be used in its own environment or with software applications
suchasMatlaborExcel.Inthisappendix,weprovideanexamplewithitsexecutableandanexample
withMatlab.Wemustfirstcreateourcircuitwiththeexecutable(herecalledreseau):
new circuit.network
Then,theloaddataareentered.ThesedatacomefromaCSVfile,i.e.,aseriesofnumbersseparatedby
commas.Thereisoneitemofdataforeachhouroftheyear,i.e.,8,760intotal.Thesedataareloaded
intoaloadshapeobject,whichisfirstgivenaname,inthiscaseessaiA.Ofnoteaswellisthatthe
valueschangeeveryhour:
new
new
new
new
new
Thesameisdoneforthewindgenerationvalues:
new loadshape.wind Npts=8760 Csvfile=testwind.csv hour=1
Then, the different grid elements need to be created. First, the sources are created, using an object,
vsource, which is named at random. In this case, a threephase imbalanced circuit is assumed;
therefore,threesourcesareusedandthePhases=1parametersarechosen.Thevsourceobjectsare
connectedtothegroundandtoabus.TheBusnamemustthereforebespecified.Thenominalvoltage
mustalsobeprovided,whichhereis14.43kV(25kVoflinevoltage):
new vsource.source Bus1=B2A Phases=1 basekv=14.43 pu=1
new vsource.sourceB Bus1=B2B Phases=1 basekv=14.43 pu=1
new vsource.sourceC Bus1=B2C Phases=1 basekv=14.43 pu=1
Second,thelinesarecreatedviatheLineobject.ALineobjectisconnectedbetweentwoBusesthat
theusermustspecify.Finally,theuserentersthelinesR1andX1electricalparameters:
new Line.L1A Bus1=B2A Bus2=B3A Phases=1 R1=0.29 X1=0.9875
new Line.L1B Bus1=B2B Bus2=B3B Phases=1 R1=0.29 X1=0.9875
new Line.L1C Bus1=B2C Bus2=B3C Phases=1 R1=0.29 X1=0.9875
new Line.L2A Bus1=B3A Bus2=B4A Phases=1 R1=0.87 X1=2.9625
new Line.L2B Bus1=B3B Bus2=B4B Phases=1 R1=0.87 X1=2.9625
new Line.L2C Bus1=B3C Bus2=B4C Phases=1 R1=0.87 X1=2.9625
TechnicalReport2011137(RPTEC)411MODSIM
28
The last objects to be created are the loads via the Load object. Like the sources, this object is
connected between the ground and a bus. The nominal voltage, nominal capacity, power factor and
load type (constant power, constant current, constant resistance, etc.) must be specified. In our case,
since we are looking for an annual simulation, we use the Yearly parameter to specify the annual
value.Inthiscase,theYearlyparameterisequaltoessaiA,whichisapreviouslyspecifiedLoadshape
typeobjectthatcontainstheannualloadvalues:
new Load.C1A Bus1=B3A Phases=1 Kv=14.43 Kw=10000 Pf=1 Model=6 Yearly=essaiA
new Load.C1B Bus1=B3B Phases=1 Kv=14.43 Kw=10000 Pf=1 Model=6 Yearly=essaiB
new Load.C1C Bus1=B3C Phases=1 Kv=14.43 Kw=10000 Pf=1 Model=6 Yearly=essaiC
new Load.C2A Bus1=B4A Phases=1 Kv=14.43 Kw=10000 Pf=1 Model=6 Yearly=essai2A
new Load.C2B Bus1=B4B Phases=1 Kv=14.43 Kw=10000 Pf=1 Model=6 Yearly=essai2B
new Load.C2C Bus1=B4C Phases=1 Kv=14.43 Kw=10000 Pf=1 Model=6 Yearly=essai2C
TheannualwindgenerationvaluescanbespecifiedthesamewaywiththeGeneratorobject:
new Generator.G1A Bus1=B4A Phases=1 Kv=14.43 Kw=10000 Pf=1 Model=1 Yearly=wind
new Generator.G1B Bus1=B4B Phases=1 Kv=14.43 Kw=10000 Pf=1 Model=1 Yearly=wind
new Generator.G1C Bus1=B4C Phases=1 Kv=14.43 Kw=10000 Pf=1 Model=1 Yearly=wind
Oncethemodelisbuilt,theparameterstoberecordedneedtobespecified.Theenergymeterobject
isused,forwhichwespecifytheobjectwhoseparameterswewishtomeasure:
new
new
new
new
new
energymeter.m3A
energymeter.m4A
energymeter.m3B
energymeter.m4B
energymeter.m3C
Line.L1A
Line.L2A
Line.L1B
Line.L2B
Line.L1C
LocalOnly=yes
LocalOnly=yes
LocalOnly=yes
LocalOnly=yes
LocalOnly=yes
Thesimulationparametersmustbespecified:
set
set
set
set
mode=yearly
casename= essainumero1
year=1
demandinterval=true
Set overloadreport=true
Tofinish,thesimulationneedstobelaunchedandtheresultssaved:
solve
edit energymeter.m3A
edit energymeter.m4A
edit energymeter.m3B
edit energymeter.m4B
action=save
action=save
action=save
action=save
TechnicalReport2011137(RPTEC)411MODSIM
29
The simulation results are recorded in an essainumero1.csv file, as specified in the simulation
parameters.ThecasepreviouslypresentediseasilysolvedwithOpenDSS.However,theproblemiswith
respecttothedatapreparation(preprocessing)andpostsimulationresultsanalysis(postprocessing).
ThesimulationsweredonewithMatlabinordertofacilitatethesetwosteps.
A.2OpenDSSCodeusingMatlab
First,runOpenDSSthroughMatlabusingthiscommand:
[DSSStartOK, DSSObj, DSSText] = DSSStartup;
TheDSSStartupfunctionisasfollows:
function [Start,Obj,Text] = DSSStartup
% Function for starting up the DSS
%instantiate the DSS Object
Obj = actxserver('OpenDSSEngine.DSS');
%Start the DSS.
Only needs to be executed the first time w/in a
%Matlab session
Start = Obj.Start(0);
% Define the text interface
Text = Obj.Text;
The circuit already defined in OpenDSS is then loaded. This file (cir1.dss) contains the sources, lines,
loads,butnottheloadshape:
DSSText.command='Compile (C:\Users\MA\Desktop\OpenDSS_7_0_1\Calcul\cir1.dss)';
Theinterfacevariablesmustthenbeprepared:
% Set up the interface variables
DSSCircuit=DSSObj.ActiveCircuit;
DSSSolution=DSSCircuit.Solution;
Then,thelossesateachhouroftheyeararesimplycalculatedwithafor.Itisassumedherethatthe
differentLoadvectorscontaintheloadvaluesforalltimesoftheyear:
for i = 1:8760
DSSText.command=['Edit
DSSText.command=['Edit
DSSText.command=['Edit
DSSText.command=['Edit
DSSText.command=['Edit
Load.C1A
Load.C1B
Load.C1C
Load.C2A
Load.C2B
Kw='
Kw='
Kw='
Kw='
Kw='
num2str(ChargeA1(i))];
num2str(ChargeB1(i))];
num2str(ChargeC1(i))];
num2str(ChargeA2(i))];
num2str(ChargeB2(i))];
TechnicalReport2011137(RPTEC)411MODSIM
30
DSSSolution.Solve;
A = DSSCircuit.LineLosses;
Pertes = [Pertes A(1)*1000];
end
TheLineLossesfunctionmakesitpossibletocalculatethelossesofallofthecircuitsLineobjects.The
Losses vector contains the line loss values for all hours of the year. These data can then be easily
analyzedandprocessed,andgraphseasilycreated,usingtheMatlabenvironment.
TechnicalReport2011137(RPTEC)411MODSIM
31
TechnicalReport2011137(RPTEC)411MODSIM
32
APPENDIX2EXAMPLEOFCODESWITHGRIDLABD
TechnicalReport2011137(RPTEC)411MODSIM
33
ForsimulationswithGridLABD,textfileswitha.glmextension(GridLABDmodel)mustfirstbecreated.
This file must then be run using a control window with the following text, making sure to be in the
GridLABDprogramdirectory:
gridlabd
nameoffile.glm
Thebaseforusingthissoftwareisthewritingoftextfiles.Awikiorexamplesavailableonlinecanbe
used to ensure correct syntax. One code example is provided below. To start, we need to load the
requiredmodules.Inthiscase,sincewearesimulatingpowerflow,thepowerflowmodulemustbe
loaded.Thetapemodulemustbeusedtosaveorloaddata.
module powerflow;
module tape;
Then,thetimeparametersforthesimulationneedtobeestablished.Inthiscase,thisbeinganannual
simulation,thestartandendtimesareayearapart:
clock {
timezone EST+5EDT;
starttime '2000-01-01 0:00:00';
stoptime '2001-01-01 0:00:00';
}
Thenextstepistodefinetheelectricalparameters.First,thetypesofconductorsarenoted:
object overhead_line_conductor {
name OH100;
geometric_mean_radius 0.0244;
resistance 0.306; //Ohm par mile
}
object overhead_line_conductor {
name OH101;
geometric_mean_radius 0.00814;
resistance 0.306;
}
Then,thedistancebetweenconductors:
object line_spacing {
name LS200;
distance_AB 5.0;
distance_BC 5.0;
distance_AC 5.0;
distance_AN 5.0;
distance_BN 5.0;
distance_CN 5.0;
TechnicalReport2011137(RPTEC)411MODSIM
34
Thelineconfigurationcanbespecifiedusingthepreviousparameters:
object line_configuration {
name LC300;
conductor_A OH100;
conductor_B OH100;
conductor_C OH100;
conductor_N OH101;
spacing LS200;
}
Thenodesarethendefined.Inourcase,therearethreenodes,includingabalancingnode:
object node {
name Node1;
bustype SWING;
phases ABC;
nominal_voltage 25000.0;
}
object node {
name Node2;
phases ABC;
nominal_voltage 25000.0;
}
object node {
name Node3;
phases ABC;
nominal_voltage 25000.0;
}
Theelectricallinesconnectingthenodesarethendefined:
object overhead_line {
name Link12;
phases A|B|C;
from Node1;
to Node2;
length 8200;
configuration LC300;
nominal_voltage 25000.0;
}
object overhead_line {
name Link23;
TechnicalReport2011137(RPTEC)411MODSIM
35
phases A|B|C;
from Node2;
to Node3;
length 24600;
configuration LC300;
nominal_voltage 25000.0;
}
Thenextstepistospecifytheloadsforeachhouroftheyear.Inordertodothis,theplayerobjectis
usedandthedatafromaCSVfileareloaded.TheseCSVfilesarepresentedintwocolumns,oneforthe
temporarydata,andtheotherfortheloadvaluesatthattime.
object load {
name Load1;
phases ABC;
parent Node2;
object player {
property constant_power_A;
file loadA1.csv;
};
object player {
property constant_power_B;
file loadB1.csv;
};
object player {
property constant_power_C;
file loadC1.csv;
};
nominal_voltage 25000.0;
}
object load {
name Load2;
parent Node3;
phases ABC;
object player {
property constant_power_A;
file loadA2.csv;
};
object player {
property constant_power_B;
file loadB2.csv;
};
object player {
TechnicalReport2011137(RPTEC)411MODSIM
36
property constant_power_C;
file loadC2.csv;
};
nominal_voltage 25000.0;
}
Thewindgenerationdatacanbeloadedthesameway,aslongasitismodelledbyanegativePQload.
object load {
name Load3;
parent Node3;
phases ABC;
object player {
property constant_power_A;
file WindA.csv;
};
object player {
property constant_power_B;
file WindA.csv;
};
object player {
property constant_power_C;
file WindA.csv;
};
nominal_voltage 25000.0;
}
Thelaststepistochoosethedatatobesavedusingarecorderobject.Inthiscase,wechoosetosave
thelinelosses,specifyinginwhichfiletheresultswillbesaved.
object recorder{
name MeterCorderXA;
parent Link12;
property power_losses, power_in, power_out;
file pertes2A.csv;
}
object recorder{
name MeterCorderXB;
parent Link23;
property power_losses;
file pertes2B.csv;
}
Thelaststepconsistsinrunningthisfileusingthecontrolwindow,aspreviouslyspecified.
TechnicalReport2011137(RPTEC)411MODSIM
37
TechnicalReport2011137(RPTEC)411MODSIM
38
APPENDIX3EXAMPLEOFCODESWITHAPREM
TechnicalReport2011137(RPTEC)411MODSIM
39
TheAPREMsoftwareworksintheMatlabenvironmentandusesMatlabsobjectorientedprogramming
functions.Adescriptionofthecodeusedtosolvethefirstcasestudyisprovidedbelow.Thisisthecode
tobeusedinanmfile.First,acircuitneedstobecreated(hereitiscalledreseau):
reseau = cCircuit();
Then,thecircuitsourceiscreated.ItisgiventhennameV1.ItisconnectedbetweentheB1node
andground(0).Ithasavoltageof25kVandanangleof0.Itwillbethebalancingbar.
reseau.addVsrc('V1', {'B1', '0'}, 25000, 0);
ThenextstepistocreateRLbranchesrepresentingthelines.ThebranchesarecalledL1andL2.They
are connected between nodes B1 and B2, and B2 and B3. The line impedances are 0.29 +
j0.9875and0.87+j2.9625,respectively(seesection2.2.3).
reseau.addImp('L1', {'B1', 'B2'}, 0.29 + 0.9875*1i);
reseau.addImp('L2', {'B2', 'B3'}, 0.87 + 2.9625*1i);
The PQ1 and PQ2 loads are then created. The load is a PQ type with Q = 0 and the power values
containedinvectorsCharge1andCharge2,previouslydefinedinMatlab.Thenominalvoltageis25kV.
reseau.addPQ('PQ1', {'B2', '0'}, Charge1(1), 0, 25000);
reseau.addPQ('PQ2', {'B3', '0'}, Charge2(1), 0, 25000);
Lossesarecalculatedusingthefollowingloop:
Pertes = [];
for i = 1:8760
reseau.set('PQ1', 'P', Charge1(i)); % Modification of the load
reseau.set('PQ2', 'P', Charge2(i));
reseau.solve(); % solve
P1 = real(reseau.get('L1', 'S')); % Losses of L1
P2 = real(reseau.get('L2', 'S')); % Losses of L2
Pertes = [Pertes P1+P2]; % Recording of the losses
end
Thesamecalculationmustthenbedone,thistimeaddingthedistributedgeneration.Thisgenerationis
connectedbetweennodeB3andground(0).Thepowerateveryhouroftheyearispresavedinthe
Puissancesvector.Aunitpowerfactorisassumedforthesource,andaselectricityissenttothegrid,
thepowerisnegative.Thevoltageis25kV.
reseau.addPQ('Peol', {'B3', '0'}, -Puissance(1), 0, 25000);
The calculation must then be redone for each hour of the year. However, this time, in addition to
varyingtheloads,thewindgenerationisalsovaried.
TechnicalReport2011137(RPTEC)411MODSIM
40
Pertesdistribuees = [];
for i = 1:8760
reseau.set('PQ1', 'P', Charge1(i));
reseau.set('PQ2', 'P', Charge2(i));
reseau.set('Peol', 'P', -Puissance(i));
reseau.solve();
P1 = real(reseau.get('L1', 'S'));
P2 = real(reseau.get('L2', 'S'));
Pertesdistribuees = [Pertesdistribuees P1+P2];
end
TheusercanthenanalyzetheresultsanddrawgraphsusingtheMatlabfunctions.
TechnicalReport2011137(RPTEC)411MODSIM
41