function I = F(V)
global G1 G2 V1 V2
I1 = G1*V; % parallel resistor 1
I2 = (V>V1).*(V<=V2).*(G2*(V-V1))+(V>V2).*(G2*(V2-V1)); % parallel resistor 2
I = I1 + I2; % equivalent resistor by Kirchhoff's Laws.