Let’s see how we compute the impedance of the DUT (R4+L1, in the figure) by observing V1 and V2.
In this particular example, we observe from the waveforms that V2/V1=0.5367, and V2 is advanced in relative to V1 with 55.48deg. We arbitrarily draw V1 as (0.5, 0.0) and V2 accordingly to get the diagram. Note that V(R1)=V(R2), due to the same impedance and the same current, and V(R1)+V(R2)=V(R3)+V(DUT), because they are both equal to V3.
Now some calculations:
z0=50.0+0.0j # define system impedance cv1=1.0+0.0j # V1 as a complex number cv2=vratio*(cos(phase2advance)+sin(phase2advance)*1.0j) # V2 as a complex number cvr=2.0*cv1-cv2 # V(R3) cz=z0*(cv2/cvr) # the same current for both DUT and R3 gamma1=(cz-z0)/(cz+z0) # a well-known formula swr=(1+abs(gamma))/(1-abs(gamma)) # another well-known formula # another method cvfwd=cv1 cvrfl=cv2-cv1 gamma2=cvrfl/cvfwd # check yourself that gamma1 and gamma2 are the same