Mesh analysis 1

.PS
include(pstricks.m4)

scale=25.4  # scale factor for the diagram

cct_init

vsp=20  # vertical spacing
hsp=30  # horizontal spacing

O: (0,0)

move to O

V1: source(up_ vsp,V); llabel(,v_1,)
{ # Push current location to the "stack"
  dot(at Here)
  line up vsp
  V3: source(right_ hsp,V); llabel(,v_3,)
  R1: resistor(right_ hsp); llabel(,R_1,)
  line down to (Here.x,V1.end.y)
  dot(at Here
} # Return to the previous location on the "stack"
R3: resistor(right_ hsp); llabel(,R_3,)
{ # Push current location to the "stack"
  dot(at Here)
  I1: source(down_ to (Here.x,O.y),I); rlabel(,i_1,)
  dot(at Here
} # Return to the previous location on the "stack"
R2: resistor(right_ hsp); llabel(,R_2,)
V2: source(down_ to (Here.x,O.y),V,,R); llabel(,v_2,)
line left to I1.end
R4: resistor(left_ to O); rlabel(,R_4,)

# Draw mesh currents
Ia: arcd(1/2 between V1.end and R1.end,vsp/4,-135,-45) cw ->
Ib: arcd(1/2 between V1.start and R3.end,vsp/4,-135,-45) cw ->
Ic: arcd(1/2 between I1.end and R2.end,vsp/4,-135,-45) cw ->

# Label mesh currents
"$i_a$" at Ia.c
"$i_b$" at Ib.c
"$i_c$" at Ic.c

.PE