Debian Codegraph @

texmf-dist/doc/latex/circuit-macros/examples/OneLine.m4

raw
1 .PS
2 # OneLine.m4
3 # https://tex.stackexchange.com/questions/191598/electric-network-one-line-diagrams/325717#325717
4 cct_init
5 include(libSLD.m4)
6 First: [
7 xgap = 0.6
8 dim1 = 1; dim2 = 0.75 ; dim3=0.5
9 X: box fill_(0.9) wid 1 "Xingu" "\SI{500}{\kV}"
10 { "$R_0=\SI{1,682}{\ohm}$" at X.sw below ljust }
11 sl_transformer(right_ dim2,type=S); rlabel(,\SI{18}{\percent},)
12 {[Ysymbol;Ysymbol(at last []+(last [].wid,0))] with .s at last [].n+(0,2bp__)}
13 { B1: line thick 3*linethick up 0.4 with .c at Here
14 "$s$" wid 0.1 ht 0.1 above }
15 { arrow right 0.2 from last line.c+(0.1,-0.1) }
16 { "$I^s$" at last line.start below }
17 line right 3.0 "$l=\SI{2600}{\km}$" wid 0.1 ht 0.1 above
18 { B2: line thick 3*linethick up 0.4 with .c at Here; "$r$" above }
19 sl_transformer(right_ dim2,type=S); rlabel(,\SI{18}{\percent},)
20 {[Ysymbol;Ysymbol(at last []+(last [].wid,0))] with .s at last [].n+(0,2bp__)}
21 NI: box fill_(0.9) wid 1 "Nova Igua\c{c}u" "\SI{500}{\kV}"
22 "$Z_0=a+b$" at NI.sw below ljust
23 RELE: box wid dimen_/2 ht dimen_/2 with .w at B1+(0.6,0.3)
24 line left 0.15 from 1/4 between RELE.nw and RELE.sw; "$V^s$" rjust
25 line left 0.15 from 3/4 between RELE.nw and RELE.sw; "$I^s$" rjust
26 ]
27 Second: [
28 lstem = dimen_*3/4
29 asep = dimen_/3
30 sl_grid(U,lgth=dimen_;wdth=dimen_)
31 sl_transformer(down_ dimen_*7/4,type=S;name=Tr)
32 llabel(,"$\SI{400}{kVA}$" ljust "$\SI{4}{\percent}$" ljust,,,Tr)
33 Bus: sl_busbar(right_ dimen_*12, 5) with .P3 at Here
34 #
35 define(`loadstring',`[ L: line invis down_ dimen_*5
36 line from L.start down_ L.len/4; dot
37 { arrow <-> down_ last line.len at last line+(asep,0) "\sf $5 m" ljust }
38 { sl_load(left_ lstem); "\sf $1" at Head.w rjust }
39 { r_text(90,`\sf\scriptsize NAYY 4x150 mm$^2$', at Here+(-7bp__,0)) }
40 line down_ L.len/4; dot
41 { arrow <-> down_ last line.len at last line+(asep,0) "\sf $6 m" ljust }
42 { sl_load(left_ lstem); "\sf $2" at Head.w rjust }
43 { box wid dimen_/3 ht dimen_/3 at Here }
44 line down_ L.len/8-3bp__
45 { ACsymbol(at Here+(0,-3bp__),,,2:RA) }
46 line down_ L.len/8+3bp__ from last line.end chop 6bp__ chop 0; dot
47 ifelse(`$7',,,
48 `{ arrow <-> up_ L.len/4 from Here+(asep,0) "\sf $7 m" ljust }')
49 { sl_load(left_ lstem); "\sf $3" at Head.w rjust }
50 line down_ L.len/4; dot
51 { arrow <-> down_ last line.len at last line+(asep,0) "\sf $8 m" ljust }
52 { sl_load(left_ lstem); Q:"\sf $4" at Head.w rjust }
53 { box wid dimen_/3 ht dimen_/3 at Here } ]')
54 #
55 loadstring(1,2,27,28, 21,21,,21) with .L.start at Bus.P1
56 move left_ 13bp__ from last [].Q
57 loadstring(1,2,15,16, 29,29,,29) with .L.start at Bus.P2
58 loadstring(1,2, 8, 9, 40,40,,40) with .L.start at Bus.P3
59 loadstring(1,2, 3, 4, 64,64,64,64) with .L.start at Bus.P4
60 line down_ last [].L.len/2 from Bus.P5; dot
61 { r_text(90,`\sf\scriptsize NAYY 4x150 mm$^2$', at last line.c+(-7bp__,0)) }
62 { arrow <-> down_ last line.len at last line+(asep,0)
63 "\sf 102 m" wid 30.4 bp__ ljust at last arrow }
64 { sl_load(left_ lstem)}
65 ] with .nw at First.sw+(0,-dimen_/2)
66 #showbox_
67 .PE