function v = Na(i)
global r1 r2 i1 i2
% 
% Two resistors in series to generate the `S' IV-characteristics (for the
% Na-channel)
% Need |r2|>r1
%
v1=r1*i; % serial resistor 1
v2=(i>i1).*(i<=i2).*((-r1+r2).*(i-i1))+(i>i2).*((-r1+r2)*(i2-i1)); % serial resistor 2
v = v1 + v2;% equivalent resistor by Kirchhoff's Laws.