Nodal analysis 2

.PS
include(pstricks.m4)

scale=25.4 # Scale in mm per inch

cct_init

vsp=20  # Vertical spacing
hsp=25  # Horizontal spacing

O: (0,0)  # Define the origin point for the circuit

move to O

R1: resistor(up_ vsp); llabel(,R_1,)
line right hsp
{ # Push current location to the "stack"
  Va: 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"
line right hsp
{ dot(at Here)
  R2: resistor(down_ to (Here.x,O.y)); rlabel(,R_2,)
  dot(at Here)
} # Return to the previous location on the "stack"
{ line up vsp
  I2: source(right_ hsp,I,,R); rlabel(,i_2,)
  line down to (Here.x,R1.end.y)
  Vb: dot(at Here)
} # Return to the previous location on the "stack"
R4: resistor(right_ hsp); llabel(,R_4,)
R3: resistor(down_ to (Here.x,O.y)); rlabel(,R_3,)
V2: source(left_ to R2.end,V); rlabel(,v_2,)
line left to I1.end
ground(at Here)
V1: source(left_ to O,V); rlabel(,v_1,)

# Label the nodes with their voltages
"$v_a$" at Va.n above
"$v_b$" at Vb.e ljust

.PE