.PS # Loadflow.m4 # Adapted and redrawn from: # https://electrical-engineering-portal.com/what-is-a-load-flow-study cct_init sinclude(tst.dim) sinclude(examples.dim) s_init(Loadflow) include(libSLD.m4) command "{\scriptsize\sf" brlen = dimen_*3/4 tof = textoffset define(`RL',`eleminit_(`$1'); Cend: last line.end { line to rvec_(rp_len/2-dimen_*9/20,0) resistor(to rvec_(dimen_/2,0),2) inductor(from 4/5 along_(last line) by vec_(dimen_/2,0),L,2) line to Cend} line invis to Cend') define(`Cline', `[Start: Here; RL(down_ dimen_) {`$1' at last line+(5bp__,0) ljust} reversed(`lswitch',down_ dimen_*2/3,R,KD) sl_breaker(down_ brlen) {`$2' at last line+(5bp__,0)} {Deltasymbol(at Here+(-dimen_/3,dimen_/5))} TC: inductor(left_ dimen_*3/4 at Here,,6) BL: inductor(right_ dimen_/2 at TC.end+(0,-dimen_/4)) BR: inductor(right_ dimen_/2 at TC.start+(0,-dimen_/4)) Ysymbol(at BL.start+(-dimen_/6,dimen_/10)); line left_ dimen_/4 from last [].C corner; ground Ysymbol(at BR.end+(dimen_/6,dimen_/10)); line right_ dimen_/4 from last [].C corner; ground] ') define(`sp_gen',`pushdef(`sl_diskdia_',`dimen_/2') move to `$1'; sl_generator(`$2',type=`$3') popdef(`sl_diskdia_')') define(`Bline',`[Start: Here sl_breaker(down_ brlen) T1: Here sl_breaker(down_ brlen) T2: Here sl_breaker(down_ brlen)]') define(`RLB',``$1' RL(down_ dimen_); {`$2' at last line+(5bp__,0) ljust} sl_breaker(down_ brlen)') BusN: sl_busbar(right_ 4*dimen_,4) "Bus-N" ljust at BusN.Start+(0,12bp__) "138 kV" ljust L1C: ebox(up_ linewid*5/4 from BusN.P2) rlabel(,"Line1" ljust "Canna" ljust "7.89 mile" ljust) sl_grid(up_ dimen_/8) "1250 MVAsc" ljust at Head.e "Power Grid 1" ljust BL1: Bline with .Start at BusN.P3 line from BL1.T1 to (BusN.P2,BL1.T1) then to BusN.P2 BusS: sl_busbar(right_ 4*dimen_,4) with .P3 at BL1.s "Bus-S" ljust at BusS.P2+(-12bp__,12bp__) "138 kV" ljust BL2: Bline with .Start at BusN.P4 { line right_ BusN.P4.x-BusN.P3.x from BL2.T1 then up_ BusN.y-BL2.T1.y ebox(up_ L1C.len) rlabel(,"Line2" ljust "Canna" ljust "6 mile" ljust) sl_grid(up_ dimen_/8) "1600 MVAsc" ljust at Head.e "Power Grid 2" ljust } BL3: Bline with .Start at BusN.P1 line from (BusN.P4,BL1.T2) right_ BusN.P4.x-BusN.P3.x ; corner C3: Cline("\shortstack[l]{C3\\ 2405 ft\\ 6-1/C 500}", "3WTR:2" ljust "30/15/15 MVA" ljust "7.1/7.1/14 \%Z" ljust ) \ with .Start at Here line from BL3.T2 left_ (BusN.P4.x-BusN.P3.x)*5/4 ; corner C2: Cline("\shortstack[l]{C2\\ 2405 ft\\ 6-1/C 500}", "3WTR:1" ljust "30/15/15 MVA" ljust "7/7/14 \%Z" ljust ) \ with .Start at Here line from BL3.T1 left_ dimen_ C1T: Here-(dimen_,0) RL(right_ dimen_ from C1T) {"C1" ljust at Here+(-dimen_,20bp__) "1100 ft" ljust "3-1/C 3/0" ljust} sl_transformer(left_ dimen_*2 from C1T) {"GSU:1" ljust at last [].nw+(-8bp__,15bp__) "75 MVA" ljust "9 \%Z" ljust} corner; line to (Here,BL1.T2) N10: sl_busbar(right_ 3/2*dimen_,4) with .P1 at Here "N10" ljust at N10.P1+(0,12bp__) "13.8 kV" ljust sl_breaker(down_ brlen from N10.P1) sp_gen(Here,D,Y) "Main Gen" at Head.s +(0,-16bp__) "75 MW" "19 \%Xd" Ysymbol(at Head.nw+(-dimen_/5,dimen_/8)); line left_ dimen_/3 from last [].C corner; resistor(down_ dimen_); ground(,T) sl_transformer(down_ dimen_ from N10.P4) {"\shortstack[l]{UAT:1\\ 25 MVA\\ 4.8 \%Z}" at last [].e ljust} sp_gen(Here,D,Delta) "Aux" at Head.s at Head.s+(0,-10bp__) "load" line down_ dimen_ from C3.BR RLB(,"\shortstack[l]{C7\\ 850 ft\\ 6-1/C 1000}") BusB: sl_busbar(right_ 6*dimen_,13) with .P10 at Here {"Bus B" ljust at BusB.w+(0,10bp__) "13.8 kV" ljust} sp_gen((BusB.P13.x,C3.BR.y-dimen_),U,Y) {Ysymbol(at Head.e+(dimen_/6,dimen_/8)); line right_ dimen_/3 from last [].C corner; ground} {"GTG" ljust at Head.n+(-10bp__,14bp__) "10 MW" ljust "19 \%d" ljust} RLB(C8:,s_box(\shortstack[l]{C8\\ 1100 ft\\ 9-1/C 1000})) line from C2.BR down_ C2.BR.y-C8.start.y-dimen_/4 continue to (BusB.P6,Here) then down_ Here.y-C8.start.y RLB(,"\shortstack[l]{C6\\ 850 ft\\ 6-1/C 1000}") BusA: sl_busbar(right_ 5.5*dimen_,13) with .e at BusB.w+(-dimen_,0) {"Bus A" ljust at BusA.w+(-14bp__,10bp__) "13.8 kV" ljust} line from C3.BL to (C3.BL,C8.start) then to (BusA.P12,C8.start); corner RLB(,"\shortstack[l]{C5\\ 850 ft\\ 6-1/C 1000}") line from C2.BL down_ C2.BL.y-C8.start.y; continue to (BusA.P8,Here); corner RLB(,"\shortstack[l]{C4\\ 850 ft\\ 6-1/C 1000}") sl_breaker(up_ brlen from BusA.P2) sl_transformer(up_ dimen_) rlabel(,"TR:2" ljust "3 MVA" ljust "5.75 \%Z" ljust) sp_gen(Here,U,WT) "Wind Turbine" at Head.n+(0,15bp__) "1500 kW" "600 \%LRC" for_(1,11,2,`A`'m4x: sl_breaker(from BusA.P`'m4x down_ brlen)') for_(2,12,2,`B`'m4x: sl_breaker(from BusB.P`'m4x down_ brlen)') line from BusA.P13 down_ brlen/2; corner Ct: sl_breaker(to (BusB.P1,Here)); corner; line to BusB.P1 SS1: box wid dimen_*3/4 ht dimen_/2 at (Ct.x,A11.end.y-dimen_/4) hatchbox(wid SS1.wid*2/3 ht SS1.ht*2/3,4bp__) at SS1 {"Substation 1" at SS1.s below} line from SS1.w to (A11,SS1) then to A11.end line from SS1.e to (B2,SS1) then to B2.end OG: box wid dimen_/2 ht dimen_/2 at (Ct.x,A9.end.y-dimen_*5/4) hatchbox(wid OG.wid*2/3 ht OG.ht*2/3,4bp__) at OG {s_box(Oil \& Gas) at OG.s below} line from OG.w to (A9,OG) then to A9.end line from OG.e to (B4,OG) then to B4.end sl_transformer(from A1.end down_ dimen_/2); line down_ dimen_/6 {s_box(\shortstack[r]{TR:4\\ 1 MVA\\ 5.75 \%Z}) with .e at last [].w+(-tof,0)} SF: box wid dimen_/3 ht dimen_/2 with .n at Here shaded "lightgray" {rs_box(Solar Farm) with .n at SF.s+(0,-tof) } sl_load(from A3.end down_ dimen_*2/3) {rs_box(\shortstack[r]{Arc Furnace\\ Feeder}) with .n at Head.s +(0,-tof) } ebox(from A5.end down_ dimen_/2,dimen_/3,dimen_/8); line down_ dimen_/6 circle diam dimen_/2 with .n at Here inductor(up_ dimen_*3/8 at last circle.e+(dimen_/12,0),,3) {rs_box(\shortstack[r]{7500 HP\\ Compressor A}) \ with .n at last circle.s +(0,-tof) } line from A7.end down_ dimen_*2/3; circle diam dimen_/2 with .n at Here {rs_box(\shortstack[r]{3500 HP\\ Crusher}) \ with .n at last circle.s +(0,-tof) } ebox(from B6.end down_ dimen_/2,dimen_/3,dimen_/8); line down_ dimen_/6 circle diam dimen_/2 with .n at Here {rs_box(\shortstack[r]{4500 HP\\ Compressor B}) \ with .n at last circle.s +(0,-tof) } sp_gen(B8.end,down_ dimen_*2/3,Delta) {rs_box(\shortstack[r]{Distillation\\ Unit}) with .n at Head.s +(0,-tof) } sl_load(from B10.end down_ dimen_*2/3) {rs_box(\shortstack[r]{Sub Pump\\ Feeder}) with .n at Head.s +(0,-tof) } ebox(from B12.end down_ dimen_/2,dimen_/3,dimen_/8); line down_ dimen_/6 circle diam dimen_/2 with .n at Here {rs_box(\shortstack[r]{1800 kW\\ Injection Pump}) \ with .n at last circle.s +(0,-tof) } #howbox_ command "}%" .PE iflatex(\vspace{1pt})