Solving Power Flow Problems With A Matlab Implementation of The Power System Applications Data Dictionary

You might also like

You are on page 1of 7

Solving Power Flow Problems with a Matlab Implementation of the Power System Applications Data Dictionary

Fernando L. Alvarado alvarado@engr.wisc.edu ECE Department, The University of Wisconsin, Madison, Wisconsin 5 !"5

Abstract
This paper implements a power flow application and variations using the IEEE Power System Application Data Dictionary within a Matlab environment. It describes a number of useful data and implementation techni ues for a variety of applications. The techni ues include the use of very compact and efficient code for the computation of Power Transfer Distribution !actors. Power Transfer Distribution !actors are an important element of present and proposed congestion management strategies for power systems" particularly when these systems must operate in a deregulated environment. #eywords$ databases" IEEE %ommon !ormat" data e&change.

. !he Data Dictionary


The '(ADD is an attempt #y &EEE to e-tend and renovate the old stand#y of the po$er ind+stry, the &EEE Common Format 738, $hich served the ind+stry $ell for many years. The Data Dictionary is meant primarily as a definition of terms +sed for analytical applications $ithin po$er system models. &t is or.ani,ed aro+nd the notion of o#%ects. Within this paper, $e consider o#%ects to #e str+ct+res $ithin the Matla# environment. Each o#%ect contains a n+m#er of attri#+tes or fields. As s+ch, each o#%ect constit+tes a relational data#ase. The follo$in. is a list of all data types defined in the dictionary. 9oldface indicates data types that are +sed in the present paper. (ome of the data types are defined #+t declared o#solescent Analog Data Area "us Data Capacitor Data0 o#solete, see sh+nt device data. Company Data Connectivity 6ode Data Data E-chan.e Data E4+ivalent AC (eries Device Data E4+ivalent &n%ection:(h+nt Device Data ;enerator Data0 o#solete, see machine data. &nterchan.e Control Data #ine Data #oad Data Machine $Synchronous% Data Miscellaneous Application Data <$nership Data 5atin. Data 5eactor Data0 o#solete, see sh+nt device data. (et Data Shunt $&onsynchronous% Device Data (tation Data (tat+s Data ($itchin. Device Data Tie($itch Data (ystem Terminal

1. Introduction
This paper provides a #rief overvie$ of the ma%or elements of the &EEE 'o$er (ystem Application Data Dictionary )'(ADD*. &t +tili,es '(ADD elements to$ard the creation of fle-i#le .eneral/p+rpose po$er flo$ environments that have .reat e-panda#ility and fle-i#ility. The '(ADD is intended primarily as a means for e-chan.in. application data amon. po$er system analytical applications of vario+s types. The paper then +ses an environment closely #ased on '(ADD concepts to$ard the creation of sample applications in Matla#. The t$o main applications considered are0 a simple 1vanilla2 po$er flo$ and a rapid and efficient comp+tation of 'o$er Transfer Distri#+tion Factors )'TDF*. The paper is intended as a means of doc+mentin. efforts cond+cted #y '(erc3 to$ard the creation of a +nified environment for po$er flo$ analysis, as a means for ill+stratin. and pop+lari,in. the Data Dictionary itself, and as a means for ill+stratin. Matla# vectori,ed comp+tation techni4+es and methods. The paper contains m+ch act+al code #eca+se it is intended for +se in its electronic form, $here +sers are e-pected to #e a#le to 1c+t and paste2 e-amples to a Matla# environment directly from the te-t of the paper.
3

The 'o$er (ystems En.ineerin. 5esearch Center, an 6(F and ind+stry sponsored +niversity consorti+m.

Transaction Data Transformer Data

Analo..Assi.nDev ice

Each field of each o#%ect type has a type0 inte.er, te-t, real or date. We only consider te-t or real types. &n some cases, t$o alternative types are permitted in the '(ADD for certain fields. We do not allo$ this. <nly a small s+#set of all availa#le '(ADD fields is +sed in this paper. Fields or data types mentioned #+t not +sed are indicated $ith an asteris=>. T denotes Te-t )strin.* data, 5 denotes real data, & denotes inte.er data. The Transformer and Load data types have s+#types not descri#ed here. The '(ADD inte.rates t$o vie$points0 a #+s/oriented vie$point common to analytical st+dies, and an e4+ipment/oriented vie$point common to meas+red val+es and system operation. The Miscellaneo+s Application Data descri#es this information. ?ere is a subset of the Miscellaneo+s Application Data ta#le0
6ame Misc.Title Misc.9aseM@A Misc.ModelConnect ivityType Misc.Contin.ency; enMW5esponse Misc.Device5efMet hod Description User defined case title M@A #ase 9M or 9+s.Model 9( or 9+s(ection> 9< or 9oth> 5F A Use response factors 'C A 'roportional to capacity '< A 'roportional to o+tp+t Method )i.e., 6+m#er or 6ame* +sed as for referencin. a device. T 5 T T T

Analo..Device5ef Analo..@al+e

Device type associated $ith val+e )complete spellin. or a##reviation of one of the root entities*. (ome possi#ilities are0 9(A9+s L6ALine T5ACformer (WA($itch MAAMachine LDALoad (?A(h+nt Device assi.nment )9+s.6+m#er, Line.6+m#er* of val+e on device for device type. 6+meric val+e

& 5

The ne-t important cate.ory is the 9+s type0


6ame 9+s.6+m#er 9+s.6ame 9+s.9ase=@ 9+s.(tat+s 9+s.@ma. 9+s.@an.le 9+s.MWMismatch 9+s.MvarMismatc h 9+s.TypeCode Definition 9+s n+m#er 9+s name 9ase volta.e 5M( Ma.nit+de of #+s volta.e. (olved val+e. 'hase an.le of #+s volta.e. (olved val+e 6et M$ not assi.ned to .enerator, load or sh+nt 6et Mvar not assi.ned to .enerator, load or sh+nt >L or Load )no control* >C9 or ControlTo9and >CT or ControlToTar.et >( A ($in. )or reference* >& A &solated @olta.e ma.nit+de setpoint @olta.e control #and lo$er limit @olta.e control #and +pper limit TA transformer (A (ynchrono+s machine 6 Anonsynchrono+s sh+nt & T 5 & 5 5 5 5 T

Fo+r other ta#les of .eneric interest are those for Analo. Data, (tat+s Data, 5atin.s Data and (et Data. The (et Data is +sef+l for .ro+pin. information into Bones, Areas, Companies, Locations and almost any other +ser/desired .ro+pin.. &t is not +sed here. The 5atin.s Data specifies ratin. types. This paper ass+mes all flo$ ratin.s are in M@A, th+s no s+ch data is re4+ired. (tat+s Data is +sed to denote the stat+s of a device or component. We +se 3 to denote in service, active or closed, " other$ise. Th+s, $e do not need (tat+s Data as a separate data type. Analo. Data is +sed to specify 1metered2 information )as opposed to 1parameters2 of components*. 5ather than enterin. this information as part of each device type, it is entered as 1analo. data2 $ith a pointer to the device type $here it is +sed. ?ere is a s+#set of the definition of Analo. Data0
6ame Analo..6+m#er Analo..Type Description Uni4+e n+m#er @<LTAvolta.e ma.nit+de FL<WA'o$er or c+rrent MW A Active 'o$er M@A5 A 5eactive 'o$er TA' A Transformer Tap A6;L A @olta.e An.le & T

9+s.@oltTar.et 9+s.Lo$@oltLim 9+s.Up@oltLim 9+s.Control'riorit yCode

5 5 5 T

The nodal in%ections types +sed in this paper incl+de Machine, Load and (h+nt Element, defined ne-t0
6ame Machine.6+m#er Machine.9+s5ef Machine.&d Machine.(tat+s Machine.MW Machine.Mvar Machine.ControlMode Description Uni4+e 6+m#er 9+s.6+m#er to $hich machine is connected &dentifier MW o+tp+t, solved val+e M@A5 o+tp+t, solved val+e 'D A hold ' and D constant '@ A ad%+st D to hold @ 6L A ad%+st D, no limits (W A case s$in. Machine 9+s )9+s.6+m#er* $hose volta.e is controlled &dentification of ratin.s A vector of possi#le .enerator ma-im+m MW val+es A vector of possi#le .enerator & & T & 5 5 &

Machine.Controlled9+ s5ef Machine.5atin.&d Machine.5atin.@al+e Machine.5atin.Minim

& T 5 5

+m)E* Machine.MinD<+tp+t Machine.Ma-D<+tp+t Machine.Min<peratin .@olt Machine.Ma-<peratin .@olt Machine.'ostCont5es pFact

minim+m MW val+es Lo$er limit for reactive po$er Upper limit for reactive po$er Machine minim+m operatin. volta.e Machine ma-im+m operatin. volta.e 'ercent of Machine MW response to system MW im#alance. @al+es are normali,ed for each island

5 5 5 5 5

(h+nt.Ma-5e.@olta .e (h+nt.Min5e.@olta .e (h+nt.9loc=(+scept @al+e6o (h+nt.9loc=(+scept ance (h+nt.MW (h+nt.Mvar

)E* 6ot in the c+rrent version of the Data Dictionary.


6ame Load.6+m#er Load.9+s5ef Load.&d Load.(tat+s Load.ModelType> Description Uni4+e 6+m#er 9+s.6+m#er of #+s to $hich load is connected &dentifier & & T & T

@al+e at $hich sh+nt $ill chan.e o+t to lo$er volta.e @al+e at $hich sh+nt $ill chan.e o+t to raise volta.e 6+m#er of discrete val+es availa#le. Bero for contin+o+s ad%+stment (+sceptance of each #loc= A vector. Ma.nit+de of (h+nt o+tp+t MW. A solved val+e Ma.nit+de of (h+nt o+tp+t Mvar. A solved val+e

5 5 & 5 5 5

T$o series '(ADD elements are implemented here0


6ame Line.6+m#er Line.From9+s5ef Line.To9+s5ef Line.Circ+it Line.(tat+s Line.(ection5 Line.(ectionC Line.(h+ntCond+cta nce Line.(h+nt(+scepta nce Line.FromMW Line.FromMvar Line.ToMW Line.ToMvar Line.Type&d Line.Len.th> Line.LossAssi.n9+s 5ef Line.FromL+mpedC ond Line.FromL+mped( +scept Line.ToL+mpedCon d Line.ToL+mped(+c ept Line.5ate&d Line.5ate@al+e 6ame Cformer.6+m#er Cformer.'rimary9+ s5ef Cformer.(econdary 9+s5ef Definitions Uni4+e n+m#er 9+s.6+m#er of FfromF #+s 9+s.6+m#er of FtoF #+s Alphan+meric circ+it &D (eries resistance (eries reactance Total +niformly sh+nt cond+ctance of this section Total sh+nt s+sceptance of this section Line MW flo$ at From end. A solved val+e Line Mvar flo$ at From end. A solved val+e. Line MW flo$ at To end. A solved val+e Line Mvar flo$ at To end. A solved val+e Type of e4+ipment type )L&6E, CA'AC&T<5>* Len.th 9+s.6+m#er to $hich losses sho+ld #e assi.ned Cond+ctance of l+mped sh+nt element at FfromF #+s (+sceptance of l+mped sh+nt element at FfromF #+s Cond+ctance of l+mped sh+nt element at FtoF #+s (+sceptance of l+mped sh+nt element at FtoF #+s &D of line ratin. val+e. A vector of te-t strin.s 5atin. val+e )a vector* Definition Uni4+e 6+m#er 9+s.6+m#er to $hich $indin. a$indin. A is connected 9+s.6+m#er to $hich $indin. 9 is connected & & & T & 5 5 5 5 5 5 5 5 T 5 & 5 5 5 5 T 5

Load.ModelMin@o lta.e> Load.ModelMa-@ olta.e> Load.MinMW> Load.Ma-MW> Load.5eferenceM W> Load.MinMvar> Load.Ma-Mvar> Load.5eferenceMv ar> Load.Mvar Load.M$

C<6(T A constant MW and M@A5 @FU6C A volta.e depend &6DM<TAind+ction motor Minim+m model volta.e for this models Ma-im+m volta.e for this load model Minim+m real po$er Ma-im+m real po$er 5eference real po$er at one per +nit )for scalin.* Minim+m reactive po$er cons+med Ma-im+m reactive po$er 5eference reactive po$er at one per +nit )for scalin.* Ma.nit+de of Load Mvar. (olved val+e Ma.nit+de of Load MW. (olved val+e Description Uni4+e 6+m#er 9+s.6+m#er to $hich sh+nt is connected &dentifier M@A of this device 9ase volta.e of this device &dentifier of this device )Capacitor, 5eactor* 6<6E A fi-ed sh+nt val+e @<LT A hold volta.e #et$een limits M@A5Ahold M@A5 flo$> 9+s.6+m#er at $hich volta.e is to #e controlled

5 5 5 5 5 5 5 5 5 5

6ame (h+nt.6+m#er (h+nt.9+s5ef (h+nt.&d (h+nt.(tat+s (h+nt.9aseM@A> (h+nt.9ase=@> (h+nt.Type (h+nt.ControlMode

& & & & 5 5 T &

& & &

(h+nt.Control9+s5e f

&

Cformer.Circ+it Cformer.Type

Cformer.Tap5atio Cformer.TapAn.le Cformer.Tap5atioM in Cformer.Tap5atioM aCformer.Tap5atio(t ep Cformer.TapAn.le Min Cformer.TapAn.le MaCformer.TapAn.le( tep Cformer.(tat+s Cformer.9aseM@A Cformer.FromM$ Cformer.FromMvar Cformer.ToM$ Cformer.ToMvar Cformer.LossAssi.n 9+s5ef Cformer.'ri/(ec5 Cformer.'ri/(ecC Cformer.'ri/ (ecBero5> Cformer.'ri/ (ecBeroC>

&dentifier F&CED Fi- ratio and an.le @<LT Fi- an.le var ratio M@A5 Fi- an.le var ratio MW G Fi- ratio var an.le Tap ratio val+e Tap an.le val+e Minim+m Tap ratio val+e of the transformer Ma-im+m Tap ratio val+e of the transformer Tap ratio step si,e val+e of the transformer Minim+m Tap an.le val+e of the transformer Ma-im+m Tap an.le val+e of the transformer Tap an.le step si,e val+e of the transformer > M$ flo$ From #+s. (olved val+e Mvar flo$ From #+s. (olved val+e M$ flo$ To #+s. (olved val+e Mvar flo$ To #+s. (olved val+e 9+s.6+m#er to $hich losses sho+ld #e assi.ned s.c. resistance $indin. A to 9 s.c. reactance $indin. A to 9 s.c. ,ero se4+ence resistance $indin. A to 9 s.c. ,ero se4+ence reactance $indin. A to 9

T T

Misc.ContingencyGenMWResponse= C; Misc.!eviceRe"Metho#=$%m&e';

5 5 5 5 5 5 5 5 & 5 5 5 5 5 & 5 5 5 5

Most other data types incl+de vector or even sets of vectors as their data elements. The 4+estion arises immediately in Matla# $hether it is #etter to represent these types as a sin.le str+ct+re $ith vector str+ct+re entries, or to represent each data type entry as a str+ct+re and to represent the entire data type as a vector of str+ct+res. Either ans$er is correct and $ill $or=, #+t #eca+se of the vectori,ed nat+re of Matla# comp+tations, o+r e-periments indicate that it is 4+ite efficient to represent data types as str+ct+res of vectors. F+rthermore, for the sa=e all consistence almost all vectors $ill #e col+mn vectors. When it is necessary to represent sets )act+ally vectors* of varia#le/len.th vectors, this is done #y +sin. the notion of cells, $hich are vectors of ar#itrary entry types. This is the convention adopted in the data dictionary. (tart $ith a definition of all #+ses alon. $ith, loads, machines and sh+nts connected to them.
( )nitiali*ation o" B%s !ata Type B%s.$%m&e'=+,; B%s.$ame=; B%s.Base-V=+,; B%s..tat%s=+,; B%s.Vmag=+,; B%s.Vangle=+,; B%s.M/Mismatch=+,; B%s.Mva'Mismatch=+,; B%s.TypeCo#e=; B%s.VoltTa'get=+,; B%s.0o/Volt0im=+,; B%s.1pVolt0im=+,; ( )nitiali*ation o" Machine !ata Type Machine.$%m&e'=+,; Machine.B%sRe"=+,; Machine.)#=; Machine..tat%s=+,; Machine.M/=+,; Machine.Mva'=+,; Machine.Cont'olMo#e=; Machine.Cont'olle#B%sRe"=+,; Machine.Min23%tp%t=+,; Machine.Ma423%tp%t=+,; Machine.Min3pe'atingVolt=+,; Machine.Ma43pe'atingVolt=+,; Machine. ostContResp5act=+,; ( )nitiali*ation o" 0oa# !ata Type 0oa#.$%m&e'=+,; 0oa#.)#=; 0oa#.B%sRe"=+,; 0oa#..tat%s=+,; 0oa#.Mva'=+,; 0oa#.M/=+,; ( )nitiali*ation o" .h%nt !ata Type .h%nt.$%m&e'=+,; .h%nt.B%sRe"=+,; .h%nt.)#=; .h%nt..tat%s=+,; .h%nt.Type=; .h%nt.Cont'olMo#e=+,; .h%nt.Cont'olB%sRe"=; .h%nt.Ma4RegVoltage=+,; .h%nt.MinRegVoltage=+,; .h%nt.Bloc-.%sceptVal%e$o=+,; .h%nt.Bloc-.%sceptance=+,; .h%nt.M/=+,; .h%nt.Mva'=+,;

'. (endition in Matlab


The implementation of the Data Dictionary in Matla# is done #y means of sparse arrays, str+ct+res and cells of types real and character. For the sa=e of clarity, all concepts $ill #e ill+strated #y means of an e-ample. The e-ample in 4+estion corresponds to the H/#+s system from Wood and Wollen#er.. The Common Format File )CFF* descri#in. this data is ill+strated in the appendi-. The CFF is not s+fficient to descri#e all the necessary information. Th+s, additional ass+mptions $ill #e made as needed. To implement the data dictionary, one needs to first esta#lish the necessary str+ct+res for all the #ase data types and the correspondin. fields )or attri#+tes* of each data type. (ome data types )s+ch as Misc* contain only scalar or simple te-t attri#+tes. The complete definition for the Misc data type s+#set is0
Misc.Title=This is a sample case; Misc.BaseMVA=100; Misc.ConnectivityType=BM;

Li=e$ise, all str+ct+res for lines can #e initiali,ed0


0ine.$%m&e'=+,; 0ine.5'omB%sRe"=+,; 0ine.ToB%sRe"=+,; 0ine.Ci'c%it=; 0ine..tat%s=+,; 0ine..ectionR=+,; 0ine..ection6=+,; 0ine..h%ntCon#%ctance=+,;

0ine..h%nt.%sceptance=+,; 0ine.5'omM/=+,; 0ine.5'omMva'=+,; 0ine.ToM/=+,; 0ine.ToMva'=+,; 0ine.Type)#=; 0ine.0ossAssignB%sRe"=+,; 0ine.5'om0%mpe#Con#=+,; 0ine.5'om0%mpe#.%scept=+,; 0ine.To0%mpe#Con#=+,;0ine.To0%mpe#.%scept=+,; 0ine.Rate)#=; 0ine.RateVal%e=+,;

Machine.Min3pe'atingVolt=0.@?Aones8ng;1:; Machine.Ma43pe'atingVolt=1.<Aones8ng;1:; Machine. ostContResp5act=+1;1;1,; ( 0oa# #ata speci"ication nl==; 0oa#.$%m&e'=819=:; 0oa#.B%sRe"=+>;?;7,; 0oa#.)#=st'vcat81;1;1:; 0oa#..tat%s=+1;1;1,; ( .h%nt #ata speci"ication nsh=1; .h%nt.$%m&e'=+1,; .h%nt.B%sRe"=?; .h%nt.)#=1; .h%nt..tat%s=1; .h%nt.Type=Capacito'; .h%nt.Cont'olMo#e=$3$D; .h%nt.Cont'olB%sRe"=?; .h%nt.Ma4RegVoltage=1.<?Aones8nsh;1:; .h%nt.MinRegVoltage=0.@?Aones8nsh;1:; .h%nt.Bloc-.%sceptVal%e$o=E<F; ( CD00 ARRAG .h%nt.Bloc-.%sceptVal%e=E+0.1;0.1,F; ( H ( 0ine #ata speci"ication n0=11; 0ine.$%m&e'=819n0:; 0ine.5'omB%sRe"=+1;1;1;<;<;<;<;=;=;>;?,; 0ine.ToB%sRe"=+<;>;?;=;>;?;7;?;7;?;<,; 0ine.Ci'c%it=st'vcat81;1;1;1;... 1;1;1;1;1;1;1:; 0ine..ectionR=+.1;.0?;.00@;.0?;.0?; ... .1;.0B;.1<;.0<;.0<;.1,; 0ine..ection6=+.<;.<;.=;.<?;.1;.=; ... .<;.<7;.1;.>;.=,; 0ine..h%ntCon#%ctance=*e'os8n0;1:; 0ine..h%nt.%sceptance=+.0<;.0<;.0=; ... .0<;.01;.0<;.0<?;.0<?;.01;.0>;.0=,; 0ine.Type)#=cha'8ones8n0;1:A#o%&le80ine::; 0ine.0ossAssignB%sRe"=0ine.5'omB%sRe"; 0ine.5'om0%mpe#Con#=*e'os8n0;1:; 0ine.5'om0%mpe#.%scept=*e'os8n0;1:; 0ine.To0%mpe#Con#=*e'os8n0;1:; 0ine.To0%mpe#.%scept=*e'os8n0;1:; 'ati#=st'vcat8$3RMA0;DMDRG:; 'atval=+1.?;<,; "o' -=19n0; 0ine.Rate)#E-;1F='ati#; 0ine.RateVal%eE-;1F='atval; en#

(ince no transformers are +sed in the e-ample, details of transformers are not ill+strated. At this point, the ta#le val+es can #e loaded for the e-ample at hand more or less directly from the Data Dictionary. (ome ass+mptions are made0 All machine minim+m po$ers are 3"I of the machine ma-im+m po$ers. All machine ma-im+m po$ers are J"" MW )or Jp+*. We prefer to $or= in per/+nit every$here, even $hen the Data Dictionary calls for M$ or Mvar. Minim+m volta.es any$here are specified at ".K5 p+, ma-im+m volta.es at 3.J p+. All sh+nt s+sceptances are ass+med to #e ad%+sta#le in e-actly t$o e4+al/si,ed steps. (ince there are no s+sceptances in this e-ample, a capacitive s+sceptance $ith a val+e of "."J p+ is ass+med at #+s 5. 6ormally, data types $o+ld #e constr+cted +sin. a f+nction that reads ra$ data from a data#ase, from a common format data file, or some other availa#le so+rce. ?ere, data is constr+cted directly for the e-ample at hand, $itho+t resortin. to a readin. and translation f+nction.
( B%s #ata speci"ication n=7; B%s.$%m&e'=819n:; B%s.$ame=st'vcat8B1.1;B1.<;... B1.=;B1.>;B1.?;B1.7:; B%s.Base-V=1=@Aones8n;1:; B%s..tat%s=ones8n;1:; B%s.Vmag=+1.0?;1.0?;1.0B;1;1;1,; B%s.Vangle=*e'os8n;1:; B%s.TypeCo#e=... st'vcat8.;CT;CT;0;0;0:; B%s.VoltTa'get=B%s.Vmag; B%s.0o/Volt0im=0.@?Aones8n;1:; B%s.1pVolt0im=1.<Aones8n;1:; ( Machine #ata speci"ication ng==; Machine.$%m&e'=819ng:; Machine.)#=st'vcat8Machine.)#;1;1;1:; Machine..tat%s=ones8ng;1:; Machine.Cont'olMo#e=st'vcat8.W; V; V:; Machine.B%sRe"=+1;<;=,; Machine.Cont'olle#B%sRe"=+1;<;=,; Machine.Rating)#=... st'vcat8$3RMA0;$3RMA0;$3RMA0:; Machine.RatingVal%e=+1.?;1.?;1.?,; Machine.RatingMinim%m=+0.1?;0.1?;0.1?,; Machine.Min23%tp%t=+C0.<?;C0.<?;C0.<?,; Machine.Ma423%tp%t=+0.B?;0.B?;0.B?,;

The specification of metered parameters for all data types is done #y means of the Analog data type. We consider first the specification of data val+es for all loads, follo$ed #y the specification of all machines, all sh+nts, all lines and all transformers )this e-ample has no transformers*. <rdinarily this $o+ld also #e accomplished #y an inp+t ro+tine that $o+ld translate appropriate data#ase entries, common format file information and:or other s+ch availa#le data into the Data Dictionary str+ct+res. ?ere, the data is specified directly for the e-ample of interest, startin. $ith an initiali,ation of all Analo. data types0
()nitiali*ation o" all Analog #ata Analog.$%m&e'=+,; Analog.Type=; Analog.Assign!evice=; Analog.!eviceRe"=+,; Analog.Val%e=+,; ( .peci"ication o" all 0oa# ope'ating Analog #ata "o' -=19nl;

na=length8Analog.$%m&e':; Analog.$%m&e'=+Analog.$%m&e';naI1;naI<,; Analog.Type=st'vcat8Analog.Type;MW;MVAR:; Analog.Assign!evice=... st'vcat8Analog.Assign!evice;0oa#;0oa#:; Analog.!eviceRe"=+Analog.!eviceRe";-;-,; en# Analog.Val%e=+Analog.Val%e;0.B;0.B;... 0.B;0.B;0.B;0.B,; ( .peci"ication o" all Machine ope'ating Analog #ata "o' -=19ng; na=length8Analog.$%m&e':; Analog.$%m&e'=+Analog.$%m&e';naI1,; Analog.Type=st'vcat8Analog.Type;MW:; Analog.Assign!evice = ... st'vcat8Analog.Assign!evice;Machine:; en# Analog.!eviceRe"=+Analog.!eviceRe";1;<;=,; Analog.Val%e=+Analog.Val%e;0;0.?;0.7,;

0ine.L=0ine..ectionRIJA0ine..ection6; 0ine..h%ntG<=80ine..h%ntCon#%ctanceIJA0ine..h %nt.%sceptance:M<; 0ine.G)=0ine.5'om0%mpe#Con#IJA0ine.5'om0%mpe# .%scept; 0ine.GN=0ine.To0%mpe#Con#IJA0ine.To0%mpe#.%sc ept; ( .h%nt #evices at &%s not consi#e'e# he'e 2list=st'match80;B%s.TypeCo#e:; Vlist=st'match8CT;B%s.TypeCo#e:; .lac-0ist=st'match8.;B%s.TypeCo#e:; Gen0ist=%nion8.lac-0ist; Vlist:; $on.lac-=%nion8 2list; Vlist:;

6e-t $e constr+ct the L/#+s matri-0


n=length8B%s.$%m&e':; G&%s=spa'se8+,;+,;+,;n;n:; G&%s=G&%sIspa'se80ine.5'omB%sRe";0ine.5'omB%s Re";1.M0ine.LI0ine..h%ntG<;n;n:; G&%s=G&%sIspa'se80ine.5'omB%sRe";0ine.ToB%sRe ";C1.M0ine.L;n;n:; G&%s=G&%sIspa'se80ine.ToB%sRe";0ine.5'omB%sRe ";C1.M0ine.L;n;n:; G&%s=G&%sIspa'se80ine.ToB%sRe";0ine.ToB%sRe"; 1.M0ine.LI0ine..h%ntG<;n;n:; G&%s=G&%sIspa'se80ine.5'omB%sRe";0ine.5'omB%s Re";0ine.G);n;n:; G&%s=G&%sIspa'se80ine.ToB%sRe";0ine.ToB%sRe"; 0ine.GN;n;n:;

). A *+anilla, &ewton Power Flow


The a#ove str+ct+res can #e +sed directly in the implementation of a #asic 6e$ton po$er flo$. Convenient comp+tation in Matla# re4+ires a fe$ additional ideas0 Most data types +sed for comp+tation sho+ld #e comple-. Th+s, a fe$ data types are added to the definition of the 9+s data type )and other data types as needed*. An &nternal data type is defined and +sed to contain all important intermediate matrivaria#les. An overall encaps+lation of all data types into a sin.le master data types is done to #e a#le to refer to all the varia#les and data for a sin.le st+dy #y means of a sin.le varia#le. This is a str+ct+re of str+ct+res. The first step is to convert pertinent Data Dictionary str+ct+res into Matla# str+ct+res s+ita#le for comp+tation. Also, it is e-tremely +sef+l to associate any analo. meas+rement data from the Analo. data types and associate it $ith the pertinent data type in a manner s+ita#le for comp+tation. The follo$in. code performs these tas=s and f+rther encaps+lates all information0
J=sK't8C1:; - 0=inte'sect8st'match80oa#;Analog.Assign!e vice:;st'match8MW;Analog.Type::; -20=inte'sect8st'match80oa#;Analog.Assign!e vice:;st'match8MVAR;Analog.Type::; - M=inte'sect8st'match8Machine;Analog.Assig n!evice:;st'match8MW;Analog.Type::; B%s..0=*e'os8n;1:; B%s. M=*e'os8n;1:; i 0=0oa#.B%sRe"8Analog.!eviceRe"8- 0::; i20=0oa#.B%sRe"8Analog.!eviceRe"8-20::; i M=Machine.B%sRe"8Analog.!eviceRe"8- M::; B%s..08i 0:=B%s..08i 0:IAnalog.Val%e8- 0:; B%s..08i20:=B%s..08i20:IJAAnalog.Val%e8-20:; B%s. M8i M:=B%s. M8i M:IAnalog.Val%e8- M:;

We then ill+strate the code to constr+ct the complete po$er flo$ Maco#ian for any system )6ote0 this hi.hly vectori,ed version of the code is d+e to Christopher DeMarco of the University of Wisconsin*0
"%nction +#.##;#.#v,=p"lo/Jac8G&;V&: )&=G&AV&; #.##=JA#iag8conJ8)&:.AV&:C JA#iag8V&:AconJ8G&:A#iag8conJ8V&::; #.#v=#iag8conJ8)&:.A8V&.Ma&s8V&::: I#iag8V&:AconJ8G&:A#iag8conJ8V&:.Ma&s8V&::;

Finally, the complete master vanilla 6e$ton solver is0


Vmag=B%s.Vmag; Vang=B%s.VangleApiM1@0; "o' ite'=1910; V=Vmag.Ae4p8JAVang:; +#.##;#.#v,=p"lo/Jac8G&%s;V:; misvect=V.AconJ8G&%sAV:IB%s..0CB%s. M; 'miss=+'eal8misvect8$on.lac-::; ... imag8misvect8 2list::,; mismatch=ma48a&s8'miss::; i" mismatchO0.0001; &'ea-; en# 'Jac=+'eal8#.##8$on.lac-;$on.lac-:: ... 'eal8#.#v8$on.lac-; 2list::; ... imag8#.##8 2list;$on.lac-:: ... imag8#.#v8 2list; 2list::,; #4='JacP'miss; #4Ang=#4819length8$on.lac-::; #4Mag=#48length8$on.lac-:I19length8#4::; Vang8$on.lac-:=Vang8$on.lac-:C#4Ang; Vmag8 2list:=Vmag8 2list:C#4Mag; en# B%s.Vmag=Vmag; B%s.Vangle=VangA1@0Mpi;

To r+n the e-ample in this paper, 1c+t and paste2 every Matla# code se.ment to a Matla# environment. (tore f+nction code se.ments in m/files.

E-trapolation of these techni4+es to considera#ly more comple- cases and pro#lems is immediate. We ill+strate only one s+ch e-tension.

::,; e=*e'os8n;1:; e8?:=1; e'=+'eal8e8$on.lac-::;imag8e8 2list::,; #5 ?='N"A8'NPe':

-. Power !ransfer Distribution Factors


As an e-ample of the +sef+lness of this approach to practical po$er system comp+tations, $e ill+strate the code to comp+te 'o$er Transfer Distri#+tion Factors for an increase in active po$er demand at any location in the net$or=, relative to the po$er #ein. s+pplied at the slac= .enerator. 9y havin. the 'TDFs for any t$o )or more* locations in the .rid, the 'TDF for any #ilateral )or m+ltilateral* transaction not involvin. the slac= .enerator can also #e readily fo+nd, altho+.h this is not done here. For the e-ample a#ove, the 'TDF code re4+ires the determination of a Maco#ian matri- that relates the flo$s at either end of a line to chan.es in volta.e ma.nit+des and an.les. The vectori,ed code to constr+ct s+ch matri- for the flo$ at the 1from2 end of every line in the system is .iven ne-t. ?ere V& is the vector of comple- nodal volta.es and Vs refers to the sendin. end volta.es of the lines of interest. G" is either G"lo/) or G"lo/N; the from or to end 1flo$2 admittance matrices.
"%nction +G"lo/);G"lo/N,=&l#y"lo/8B%s;0ine: n=length8B%s.$%m&e':; n&=length80ine.5'omB%sRe":; n&e=819n&:Q; G"lo/)=spa'se8n&e;0ine.5'omB%sRe";1.M0ine.LIi A0ine..h%ntG<I0ine.G);n&;n:; G"lo/)=G"lo/)Ispa'se8n&e;0ine.ToB%sRe";C 1.M0ine.L;n&;n:; G"lo/N=spa'se8n&e;0ine.5'omB%sRe";C 1.M0ine.L;n&;n:; G"lo/N=G"lo/NIspa'se8n&e;0ine.ToB%sRe";1.M0in e.LIiA0ine..h%ntG<I0ine.GN;n&;n:; "%nction +#5##;#5#v,="lo/Jac8G";0ine;V&;Vs: n&=length80ine.5'omB%sRe":; n=length8V&:; )"=G"lo/AV&; #5##=JAspa'se8819n&:Q;0ine.5'omB%sRe"; 8conJ8)":.AVs:;n&;n:C JA#iag8Vs:AconJ8G":A#iag8conJ8V&::; #5#v=spa'se8819n&:Q;0ine.5'omB%sRe"; 8conJ8)":.A8Vs.Ma&s8Vs:::;n&;n: I#iag8Vs:AconJ8G":A#iag8conJ8V&:.Ma&s8V&::;

At this point, the Matla# environment contains already a $ealth of +sef+l information for ans$erin. a lar.e n+m#er of 4+estions a#o+t the system.

.. /onclusions
'o$er (ystem Application Data Dictionary data types have #een +sed as the #asis for a direct implementation of a simple po$er flo$ in Matla#. The implementation is remar=a#ly efficient and easy to e-tend to any desired additional p+rpose0 ne$ methods can #e tested $ith ease, ne$ f+nctions and o#%ectives implemented, all $hile maintainin. the a#ility to comm+nicate #et$een and amon. diverse applications in a standardi,ed manner.

Ac0nowledgements
'rofessor Christopher DeMarco made availa#le the =ey Maco#ian ro+tine to this a+thor. Moann (taron has #een for years instr+mental in developin. the '(ADD. Than=s are also d+e to (cott ;reene and Taiyo+ Lon..

(eferences
738 &EEE Committee 5eport, 1Common format for e-chan.e of solved load flo$ data,2 &EEE Transactions on 'o$er Apparat+s and (ystems, @ol+me 'A(/NJ, 6+m#er H, pa.es 3N3H/3NJ5, 6ovem#er:Decem#er, 3N! .

This code can #e +sed to determine the sensitivity of flo$s on any line to any in%ections at a .iven operatin. point. (ample code to do this calc+lation for o+r e-ample for an in%ection at #+s 5 $o+ld #e0
+G"lo/);G"lo/N,=&l#y"lo/8B%s;0ine:; +#5##;#5#v,="lo/Jac8G"lo/);0ine;V;V80ine.5'om B%sRe"::; +#.##;#.#v,=p"lo/Jac8G&%s;V:; 'N=+'eal8#.##8$on.lac-;$on.lac-::;'eal8#.#v8$ on.lac-; 2list::;imag8#.##8 2list;$on.lac-::; imag8#.#v8 2list; 2list::,; 'N"=+'eal8#5##89;$on.lac-::;'eal8#5#v89; 2lis t::;imag8#5##89;$on.lac-::;imag8#5#v89; 2list

You might also like