EAZAZAaZa

% Metadata for the PDF output
\hypersetup{
        pdftitle={A single-phase AC supply, with series-connected cable, and a simple load},
        pdfauthor={Peter Jan Randewijk (peter@randewijk.dk)},
        pdfsubject={Single-phase AC circuit theory},
        pdfkeywords={Single-phase AC systems; series-connected cable, simple load}
        }

.PS

include(pstricks.m4)

scale=1.0       # Scale set to inches

cct_init

# See Circuit Macros manual version 11.1.3, Section 13 "Writing macros", Example 4, Figure 82
define(`phsource',`source($1,
    #`Set angle to 0, draw sinusoid, restore angle'
    m4smp_ang = rp_ang; rp_ang = 0
    sinusoid(m4h/2,twopi_/(m4h),
    ifelse(`$2',,,`($2)/360*twopi_+')pi_/2,-m4h/2,m4h/2) with .Origin at Here
    rp_ang = m4smp_ang,
    $3,$4,$5)')

vsp=0.7
hsp=0.7
rsp=0.7

define(`termrad_',`sourcerad_/4')
define(`terminal',`circle rad termrad_')

VN: (0,0)
VA: Rect_(rsp,  90)
VB: Rect_(rsp, -30)
VC: Rect_(rsp,-150)

NN: (VB.x+rsp/4+hsp,VN.y)
NA: (VB.x+rsp/4+hsp,VA.y+rsp/4)
NB: (VB.x+rsp/4+hsp,VB.y-rsp/4)
NC: (VB.x+rsp/4+hsp,VC.y-3*rsp/4)

Nn: (NN.x+hsp,NN.y)
Na: (NA.x+hsp,NA.y)
Nb: (NB.x+hsp,NB.y)
Nc: (NC.x+hsp,NC.y)

Vb: (Nb.x+rsp/4,Nb.y+rsp/4)
Vn: (Vb+(Rect_(rsp,30)))
Va: (Vn+(Rect_(rsp, 90)))
Vc: (Vn+(Rect_(rsp,-30)))

line invis right hsp/4 from Vc
line invis left  hsp/4 from VC

phsource(from VN to VA, 0);dlabel(0,-0.25,,\mathbf{E}_{A},)
#phsource(from VN to VB, 240);dlabel(0,-0.25,,\mathbf{E}_{B},)
#phsource(from VN to VC, 120);dlabel(0,-0.25,,\mathbf{E}_{C},)

ground(at VN)

#line from VN to NN chop 0 chop termrad_

line from VA to (VA,NA) then to (VB,NA)
ebox(to NA chop 0 chop termrad_);dlabel(0,0.15,,\mathbf{Z}_{A},)
#line from VB to (VB,NB) 
#ebox(to NB chop 0 chop termrad_);dlabel(0,0.15,,\mathbf{Z}_{B},)
#line from VC to (VC,NC) then to (VB,NC)
#ebox(to NC chop 0 chop termrad_);dlabel(0,0.15,,\mathbf{Z}_{C},)

#terminal with .c at NN
terminal with .c at NA
#terminal with .c at NB
#terminal with .c at NC

#"$N$" at (NN.x,NN.y+termrad_) above
"$A$" at (NA.x,NA.y+termrad_) above
#"$B$" at (NB.x,NB.y+termrad_) above
#"$C$" at (NC.x,NC.y+termrad_) above

#line from NN to Nn chop termrad_ chop termrad_
ebox(from NA to Na chop termrad_ chop termrad_);dlabel(0,0.15,,\mathbf{Z}_{Aa},)
#ebox(from NB to Nb chop termrad_ chop termrad_);dlabel(0,0.15,,\mathbf{Z}_{Bb},)
#ebox(from NC to Nc chop termrad_ chop termrad_);dlabel(0,0.15,,\mathbf{Z}_{Cc},)

#terminal with .c at Nn
terminal with .c at Na
#terminal with .c at Nb
#terminal with .c at Nc

#"$n$" at (Nn.x,Nn.y+termrad_) above
"$a$" at (Na.x,Na.y+termrad_) above
#"$b$" at (Nb.x,Nb.y+termrad_) above
#"$c$" at (Nc.x,Nc.y+termrad_) above

#line from Nn to Vn chop termrad_ chop 0
line from Na to (Va,Na) chop termrad_ chop 0 then to Va
#line from Nb to (Vb,Nb) chop termrad_ chop 0 then to Vb
#line from Nc to (Vc,Nc) chop termrad_ chop 0 then to Vc

ebox(from Va to Vn);dlabel(0,-0.15,,\mathbf{Z}_{a},)
#ebox(from Vb to Vn);dlabel(0,-0.20,,\mathbf{Z}_{b},)
#ebox(from Vc to Vn);dlabel(0,-0.20,,\mathbf{Z}_{c},)

linethick_(0.75)
\psset{linecolor=darkgray}

line dashed from (NB.x-rsp/8,NA.y+rsp/4) to (NB.x-rsp/8,NC.y-rsp/4)
line dashed from ((1/2 between Nb and Vb).x,Na.y+rsp/4) to ((1/2 between Nb and Vb).x,Nc.y-rsp/4)

dimension_(from (VC.x,NA.y+rsp/4)       to (NB.x-rsp/8,NA.y+rsp/4),hsp/4,"\textbf{Supply}",50bp__,termrad_,<->)
dimension_(from (NB.x-rsp/8,NA.y+rsp/4) to (Nc.x+rsp/8,NA.y+rsp/4),hsp/4,"\textbf{Line}"  ,30bp__,termrad_,<->)
dimension_(from (Nc.x+rsp/8,NA.y+rsp/4) to (Vc.x,NA.y+rsp/4)      ,hsp/4,"\textbf{Load}"  ,35bp__,termrad_,<->)

\psset{linecolor=black}

ground(at Vn)

.PE