function V = rr(i_2)
global R1 R2 I1 I2
% 
% Two resistors in series to generate the `S' IV-characteristics
%
V1=R1*i_2;
V2=(i_2>I1).*(i_2<=I2).*(R2.*(i_2-I1))+(i_2>I2).*(R2*(I2-I1));
V = V1+V2;